/* Pietro - Main Stylesheet */
/* Friendly and informal design for community lending */

@font-face {
    font-family: 'Apfel Grotezk Mittel';
    src: url('ApfelGrotezk-Mittel.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'GapSans Bold';
    src: url('GapSansBold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    /* ---- Design system: color palette (semantic names) ---- */
    --color-blue: #0D21A4;
    --color-light-blue: #B9C7F8;
    --color-green: #D1D066;
    --color-pink: #FB44BB;
    --color-orange: #FFA93A;
    --color-grey: #ECECEC;
    --color-white: #FFFFFF;

    /* Derived shades, used only for hover/active states of the colors above */
    --color-blue-dark: #081672;
    --color-pink-dark: #d61ea0;
    --color-pink-tint: #ffe3f0;
    --color-green-tint: #e6f7d9;
    --color-orange-tint: #fff1de;

    /* ---- Design system: typography ---- */
    --font-heading: 'GapSans Bold', 'Apfel Grotezk Mittel', sans-serif;
    --font-body: 'Apfel Grotezk Mittel', sans-serif;
    --font-primary: var(--font-body);
    --font-secondary: var(--font-body);

    /* ---- Legacy aliases kept so existing components stay in sync with the palette above ---- */
    --primary-color: var(--color-blue);
    --secondary-color: var(--color-pink);
    --background-color: var(--color-grey);
    --card-background: var(--color-white);
    --text-color: #333333;
    --text-light: #666666;
    --success-color: var(--color-green);
    --error-color: var(--color-pink);
    --warning-color: var(--color-orange);
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    text-transform: lowercase;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-grey);
    color: var(--text-color);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 90px;
    overflow-x: hidden;
}

.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--color-grey);
}

.landing-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--color-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 50px 45px;
    text-align: center;
}

.landing-card h1 {
    font-size: 4rem;
    color: var(--color-blue);
    margin-bottom: 10px;
}

.landing-card p {
    color: #333333;
    font-family: var(--font-secondary);
    letter-spacing: normal;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 auto 30px auto;
    max-width: 700px;
    line-height: 1.7;
}

.landing-card .btn-secondary {
    background: none;
    border: none;
    padding: 6px 4px;
    color: var(--color-pink);
    font-weight: 700;
    font-family: var(--font-secondary);
    text-decoration: underline;
}

.landing-card .btn-secondary:hover {
    background: none;
    color: var(--color-pink-dark);
    transform: none;
}

.landing-info {
    background-color: #ffe8b0;
    border-radius: 20px;
    padding: 16px 18px;
    max-width: 720px;
    margin: 0 auto;
    color: #6b4c00;
    text-align: left;
    border: none;
    font-family: var(--font-secondary);
}

.landing-info p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #6b4c00;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 40px;
    background-color: var(--color-grey);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--color-white);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 36px 32px;
}

.login-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.login-top h1 {
    font-size: 2rem;
    margin: 0;
    color: var(--color-blue);
}

.login-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: var(--color-pink);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.login-avatar span {
    font-size: 1.3rem;
}

.login-card .form-group {
    margin-bottom: 22px;
}

.login-card label {
    display: block;
    margin-bottom: 12px;
    text-transform: none;
    font-weight: 700;
    color: var(--color-blue);
    font-size: 0.9rem;
}

.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"],
.login-card .password-wrapper input {
    width: 100%;
    padding: 18px 24px;
    border-radius: 50px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background-color: var(--color-white);
    color: var(--color-blue);
    font-size: 1rem;
    font-family: var(--font-secondary);
    outline: none;
    box-sizing: border-box;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="email"]:focus,
.login-card .password-wrapper input:focus {
    border-color: var(--color-blue);
    background-color: #f2f6ff;
}

.login-card input::placeholder {
    color: rgba(0, 0, 0, 0.35);
    font-style: italic;
}

.password-wrapper {
    position: relative;
}

.toggle-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.login-card .btn-primary {
    width: 100%;
    margin-top: 10px;
}

.login-card .register-link {
    margin-top: 24px;
    font-size: 0.95rem;
    color: #333333;
}

.login-card .register-link a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 700;
}

.login-card .register-link a:hover {
    text-decoration: underline;
}

.hero-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background-color: white;
    color: var(--color-blue);
    border: 3px solid var(--color-blue);
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-secondary:hover {
    background-color: var(--color-blue);
    color: white;
    transform: translateY(-2px);
}

.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
}

body.no-scroll-page {
    height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
}

.container.profile-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 1.25rem 0;
}

.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 90px;
}

.tab-panels {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Main Content */
main {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    padding-top:10px;
    box-shadow: var(--shadow);
    margin-top:10px;
    /*margin-bottom: 10px;*/
}

.chat-page main {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-secondary);
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 14px 30px;
    background-color: var(--color-blue);
    color: var(--color-white);
    border: none;
    border-radius: 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background-color: var(--color-blue-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background-color: var(--color-grey);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-accept {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.btn-decline {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
}

.btn-chat {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 20px;
    text-decoration: none;
}

.btn-borrow {
    width: 100%;
    text-align: center;
}

/* Cards */
.item-list,
.request-list {
    display: grid;
    gap: 20px;
}

.item-card,
.request-card {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.item-card h3,
.request-card h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.owner-info,
.location-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.available {
    background-color: var(--color-green-tint);
    color: #2f6b1f;
}

.status-badge.unavailable {
    background-color: var(--color-pink-tint);
    color: var(--color-pink-dark);
}

.status-badge.pending {
    background-color: var(--color-orange-tint);
    color: #a15c00;
}

.status-badge.accepted {
    background-color: var(--color-green-tint);
    color: #2f6b1f;
}

.status-badge.declined {
    background-color: var(--color-pink-tint);
    color: var(--color-pink-dark);
}

.status-badge.requested {
    background-color: var(--color-light-blue);
    color: var(--color-blue);
}

.status-badge.suspended {
    background-color: var(--color-pink-tint);
    color: var(--color-pink-dark);
}

/* Links */
.register-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    background-color: var(--color-pink-tint);
    color: var(--color-pink-dark);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--error-color);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.empty-state a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Search */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
}

.search-results-info {
    margin-bottom: 20px;
    color: var(--text-light);
}

.no-results {
    text-align: center;
    padding: 30px;
}

.no-results a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Chat */
.chat-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.chat-header h1 {
    font-size: 2rem;
    text-align: left;
    color: var(--color-blue);
    margin: 0;
}

.chat-back {
    color: var(--color-blue);
    text-decoration: none;
    margin-top: 10px;
}
.chat-back .icon {
    width: 1.6rem;
    height: 1.6rem;
    background-size: 100%;
}

.chat-summary-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-blue);
    margin-bottom: 6px;
}

.chat-summary-text {
    margin: 0;
    color: var(--color-blue);
    font-size: 1.1rem;
    line-height: 1.4;
}

.chat-card-summary {
    flex: 1;
    background: var(--color-pink);
    border-radius: 28px;
    padding: 20px 24px;
    box-shadow: 0 10px 22px rgba(251, 68, 187, 0.28);
    text-align: left;
}

.chat-messages {
    min-height: 260px;
    margin-bottom: 20px;
    padding-bottom: 100px;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px 30px 30px;
}

.chat-form input {
    flex: 1;
    padding: 16px 22px;
    border: none;
    border-radius: 999px;
    background: white;
    color: var(--color-blue);
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.chat-form input::placeholder {
    color: rgba(13, 33, 164, 0.4);
}

.chat-send-btn {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-orange);
    border: 2px solid var(--color-orange);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    padding: 0;
}

.chat-send-icon {
    width: 22px;
    height: 22px;
    stroke: var(--color-blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.chat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(0,0,0,0.12);
}

.chat-avatar::before {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid white;
    border-radius: 50%;
}
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(0,0,0,0.12);
}

.chat-avatar::before {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid white;
    border-radius: 50%;
}

.profile-header {
    margin-bottom: 24px;
}

.profile-header h1 {
    font-size: 2rem;
    text-align: left;
    color: var(--color-blue);
    margin: 0;
}

.profile-logout-btn {
    display: inline-block;
    margin-top: 10px;
    color: var(--color-pink);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: underline;
    white-space: nowrap;
}

.profile-logout-btn:hover {
    color: var(--color-pink-dark);
}

.pending-delete-request-btn {
    display: inline-block;
    margin-top: 10px;
    background: none;
    border: none;
    padding: 0;
    color: var(--color-pink);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}

.pending-delete-request-btn:hover {
    color: var(--color-pink-dark);
}

.profile-user-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.profile-user-info {
    flex: 1;
}

.profile-user-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-user-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-blue);
}

.profile-edit-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--color-white);
    color: var(--color-blue);
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-location {
    margin: 8px 0 0;
    color: #222;
    font-family: var(--font-secondary);
    letter-spacing: normal;
}

.profile-content {
    background: var(--color-light-blue);
    border-radius: 24px 24px 0 0;
    padding: 24px 18px 0;
    box-shadow: 0 -6px 28px rgba(0,0,0,0.1);
}

.profile-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--color-blue);
    font-family: var(--font-secondary);
    letter-spacing: normal;
}

.tab {
    flex: 1;
    border: none;
    background: white;
    color: rgba(13, 33, 164, 0.55);
    font-weight: 700;
    padding: 14px 18px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease, color 0.2s ease;
}

.tab.active {
    background: var(--color-light-blue);
    color: var(--color-blue);
    font-weight: 800;
}

.tab-panel {
    display: none;
    min-height: 0;
}

.tab-panel.active {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    padding-bottom: 90px;
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 33, 164, 0.65) transparent;
}

.items-grid::-webkit-scrollbar {
    width: 6px;
}

.items-grid::-webkit-scrollbar-track {
    background: transparent;
}

.items-grid::-webkit-scrollbar-thumb {
    background: rgba(13, 33, 164, 0.65);
    border-radius: 999px;
}

.item-card {
    border: none;
    background: transparent;
    line-height: 1.05;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.item-card:active {
    transform: scale(0.96);
}

/* Slightly increased line-height for borrowed item names to improve readability */
.item-card.borrowed .item-name {
    line-height: 1.15;
}

.item-card.borrowed .item-image {
    box-shadow: 0 6px 14px rgba(251, 68, 187, 0.3);
    transition: box-shadow 0.3s ease;
}

.item-card.borrowed.pending_confirmation .item-image {
    box-shadow: 0 6px 14px rgba(255, 169, 58, 0.35);
}

.item-card.borrowed.returned .item-image {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.item-card.borrowed.pending_confirmation,
.item-card.borrowed.returned {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.item-status-overlay {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    padding: 3px 4px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    font-family: var(--font-body);
    letter-spacing: normal;
    font-size: 0.6rem;
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
}

.item-status-overlay.pending_confirmation {
    color: var(--color-orange);
}

.item-status-overlay.returned {
    color: var(--color-green);
}

.item-status-overlay.lent {
    color: var(--color-orange);
}

.item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 10px;
    background: white;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-image-placeholder {
    width: 45%;
    aspect-ratio: 426 / 306;
    background-image: url("icon-no-image.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.35;
}

.item-name {
    width: 100%;
    font-family: var(--font-secondary);
    letter-spacing: normal;
    color: var(--color-blue);
    overflow-wrap: break-word;
}

.item-owner {
    width: 100%;
    font-size: 0.82rem;
    font-family: var(--font-secondary);
    letter-spacing: normal;
    color: var(--color-blue);
    overflow-wrap: break-word;
}

.empty-state {
    color: var(--text-light);
    text-align: center;
    margin: 40px 0;
    grid-column: 1 / -1;
}

.chat-section {
    max-width: 100%;
}

.chat-list-section {
    max-width: 100%;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px;
    background: white;
    border-radius: 24px;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(13, 33, 164, 0.12);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.chat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(0,0,0,0.1);
}

.chat-card.unread {
    background: var(--color-light-blue);
    border-color: transparent;
}

.chat-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.chat-card-left .avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background-color: var(--color-light-blue);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-card.unread .chat-card-left .avatar {
    background-color: var(--color-white);
}

.chat-card-text {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-name {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
}

.chat-snippet {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-card.unread .chat-snippet {
    color: var(--color-blue);
    font-weight: 700;
}

.chat-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-pink);
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 800;
}

.chat-card-time {
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
}

.chat-info {
    color: var(--text-light);
    margin-bottom: 20px;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 20px 4px;
}

.message {
    position: relative;
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: 20px;
    max-width: 75%;
}

.message.own {
    background-color: var(--color-light-blue);
    color: var(--color-blue);
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message.own::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 0 10px;
    border-color: var(--color-light-blue) transparent transparent transparent;
}

.message.other {
    background-color: #ffc2e0;
    color: var(--color-blue);
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

.message.other::after {
    content: '';
    position: absolute;
    left: 12px;
    bottom: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 10px 0 0;
    border-color: #ffc2e0 transparent transparent transparent;
}

.message-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

.message-content {
    flex: 1 1 auto;
    min-width: 55%;
    margin: 0;
    line-height: 1.4;
    white-space: pre-line;
}

.message .timestamp {
    font-size: 0.72rem;
    opacity: 0.65;
    white-space: nowrap;
}

.no-messages {
    text-align: center;
    color: var(--text-light);
}

.message.system-message {
    background-color: #eef0f5;
    color: #444444;
    margin: 0 auto 24px;
    max-width: 90%;
    border-radius: 16px;
}

.message.system-message::after {
    display: none;
}

.message.system-message .message-body {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.message.system-message .message-content {
    min-width: 0;
    text-align: center;
}

.message.system-return_confirmed {
    background-color: #e6f7d9;
    color: #2f6b1f;
}

.message.system-return_denied {
    background-color: #ffe3f0;
    color: #99044f;
}

.message.system-borrow_accepted {
    background-color: #e6f7d9;
    color: #2f6b1f;
}

.message.system-borrow_declined {
    background-color: #ffe3f0;
    color: #99044f;
}

.return-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.chat-respond-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.chat-respond-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    color: white;
}

.chat-respond-btn.accept {
    background: var(--color-pink);
}

.chat-respond-btn.decline {
    background: #8a8fa3;
}

.chat-respond-btn.yes {
    background: var(--color-green);
}

.chat-respond-btn.no {
    background: var(--color-pink);
}

.chat-status-note {
    text-align: center;
    color: var(--text-light);
    font-family: var(--font-secondary);
    letter-spacing: normal;
    padding: 14px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 10px;
    }
    
    nav {
        flex-direction: row;
        align-items: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .item-card,
    .request-card {
        padding: 15px;
    }
}

/* Shared icons */
.icon {
    display: inline-flex;
    width: 1.4rem;
    height: 1.4rem;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}
.login-avatar.icon,
.requester-avatar.icon {
    background-size: 60%;
}
.icon-search {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='currentColor' fill='none'><circle cx='11' cy='11' r='7' stroke-width='2'/><line x1='16.5' y1='16.5' x2='21' y2='21' stroke-width='2' stroke-linecap='round'/></svg>");
}
.icon-user {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 45' fill='none'><path d='M58.3848 41.27L2.06785 41.6907' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M17.6719 27.1709L1.40533 43.4374' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M41.8301 25.8457L15.3215 27.3524' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M26.5874 20.2124L19.6289 15.9048' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M21.0953 17.3984L17.7256 9.94043' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M18.1848 11.0631L22.2783 3.97656' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M20.6232 4.65922L28.6758 3.19922' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M27.2509 2.5754L34.5479 6.28076' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M33.4606 4.63886L35.7158 12.5059' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M35.5345 11.2661L31.2451 18.2358' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M32.398 17.3822L24.5996 19.8643' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M58.3984 42.4136L39.1798 25.1831' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/></svg>");
}
.icon-home {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M3 10.5L12 3l9 7.5V21a1 1 0 01-1 1h-5v-6H9v6H4a1 1 0 01-1-1V10.5z' stroke-width='2' stroke-linejoin='round'/></svg>");
}
.icon-request {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M4 7h16M4 12h12M4 17h8' stroke-width='2' stroke-linecap='round'/></svg>");
}
.icon-chat {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z' stroke-width='2' stroke-linejoin='round'/></svg>");
}
.icon-request {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M4 7h16M4 12h12M4 17h8' stroke-width='2' stroke-linecap='round'/></svg>");
}
.icon-chat {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z' stroke-width='2' stroke-linejoin='round'/></svg>");
}
.icon-list {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><line x1='8' y1='6' x2='21' y2='6' stroke-width='2'/><line x1='8' y1='12' x2='21' y2='12' stroke-width='2'/><line x1='8' y1='18' x2='21' y2='18' stroke-width='2'/><circle cx='3' cy='6' r='1.5' fill='currentColor'/><circle cx='3' cy='12' r='1.5' fill='currentColor'/><circle cx='3' cy='18' r='1.5' fill='currentColor'/></svg>");
}
.icon-package {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z' stroke-width='2' stroke-linejoin='round'/><path d='M16 6.5l-8 4.5'/><path d='M12 22V12'/></svg>");
}
.icon-eye {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z' stroke-width='2' stroke-linejoin='round'/><circle cx='12' cy='12' r='3' stroke-width='2'/></svg>");
}
.icon-eye-off {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M17.94 17.94A10.94 10.94 0 0112 19c-7 0-11-7-11-7a20.3 20.3 0 015.06-5.94M9.9 4.24A10.4 10.4 0 0112 4c7 0 11 7 11 7a20.3 20.3 0 01-2.7 3.9M14.12 14.12a3 3 0 11-4.24-4.24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/><line x1='1' y1='1' x2='23' y2='23' stroke-width='2' stroke-linecap='round'/></svg>");
}
.icon-heart {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 21s-7.5-4.6-10-9.1C0.4 8.6 2 5 5.6 5c2 0 3.5 1.1 4.4 2.7C10.9 6.1 12.4 5 14.4 5 18 5 19.6 8.6 18 11.9 15.5 16.4 12 21 12 21z'/></svg>");
}
.icon-bell {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M18 8a6 6 0 10-12 0c0 7-3 9-3 9h18s-3-2-3-9' stroke-width='2' stroke-linejoin='round'/><path d='M13.73 21a2 2 0 01-3.46 0' stroke-width='2' stroke-linecap='round'/></svg>");
}
.icon-pencil {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 81' fill='none'><line x1='65.2621' y1='4.11998' x2='9.66431' y2='52.3582' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/><line x1='85.2084' y1='34.47' x2='57.6218' y2='3.63697' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/><line x1='39.2553' y1='75.1917' x2='11.6686' y2='44.3587' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/><line x1='87.6844' y1='25.2225' x2='28.1271' y2='74.459' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/><line x1='14.1055' y1='44.3785' x2='6.47608' y2='76.4771' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/><line x1='37.5526' y1='71.4866' x2='0.481597' y2='74.7639' stroke='currentColor' stroke-opacity='0.6' stroke-width='10.9091'/></svg>");
}
.icon-nav-home {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 39 44' fill='none'><line x1='18.5966' y1='1.71274' x2='37.3022' y2='21.519' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.26872'/><line x1='20.7729' y1='1.50922' x2='1.50908' y2='20.773' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.26872'/><line x1='3.96639' y1='16.5205' x2='3.96639' y2='43.7636' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.26872'/><line x1='33.9127' y1='16.5205' x2='33.9127' y2='43.7636' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.26872'/><path d='M35.7354 41.3115L0.578201 41.5742' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.26872'/></svg>");
}
.icon-nav-profile {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 45' fill='none'><path d='M58.3848 41.27L2.06785 41.6907' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M17.6719 27.1709L1.40533 43.4374' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M41.8301 25.8457L15.3215 27.3524' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M26.5874 20.2124L19.6289 15.9048' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M21.0953 17.3984L17.7256 9.94043' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M18.1848 11.0631L22.2783 3.97656' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M20.6232 4.65922L28.6758 3.19922' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M27.2509 2.5754L34.5479 6.28076' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M33.4606 4.63886L35.7158 12.5059' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M35.5345 11.2661L31.2451 18.2358' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M32.398 17.3822L24.5996 19.8643' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/><path d='M58.3984 42.4136L39.1798 25.1831' stroke='currentColor' stroke-opacity='0.6' stroke-width='3.97626'/></svg>");
}
.icon-nav-search {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 55' fill='none'><path d='M41.4111 45.9269L26.7098 28.0364' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M27.8301 28.8718L16.1544 31.5425' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M19.0723 31.6115L8.11097 26.7841' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M9.40625 28.36L6.49813 16.7412' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M5.89648 17.8L11.683 7.31331' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M9.87109 8.80242L21.5838 6.2991' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M19.8076 5.80389L30.0295 12.0462' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M29.2871 10.5925L32.7226 22.0664' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M32.625 20.0754L26.6126 30.4342' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/></svg>");
}
.icon-nav-chat {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 39' fill='none'><path d='M6.99902 37.9067L3.46921 2.29472' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M0.0576172 6.1167L49.5122 4.735' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M13.9668 27.9165L51.0577 27.9165' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M47.9668 0.0986328L46.4213 32.5532' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/><path d='M18.6035 26.3711L6.23988 37.1893' stroke='currentColor' stroke-opacity='0.6' stroke-width='4.15557'/></svg>");
}
.icon-back {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 186 131' fill='none'><line x1='60.8571' y1='5.87383' x2='9.30083' y2='87.5063' stroke='currentColor' stroke-opacity='0.6' stroke-width='22'/><line x1='84.5588' y1='122.238' x2='10.9885' y2='64.0466' stroke='currentColor' stroke-opacity='0.6' stroke-width='22'/><line x1='185.496' y1='64.2437' x2='25.9198' y2='64.2437' stroke='currentColor' stroke-opacity='0.6' stroke-width='22'/></svg>");
}

/* Dashboard mobile specific styles (mocked from provided layout) */
.dashboard-header {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 10px;
}
.dashboard-header .welcome {
    font-size: 2rem;
    text-align: left;
    line-height: 1.2;
    color: var(--color-blue);
}
.dashboard-header .avatar,
.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dashboard-header .avatar {
    position: absolute;
    right: 20px;
    top: 0;
    color: var(--color-blue);
}

.profile-avatar {
    width: 84px;
    height: 84px;
    min-width: 84px;
    background-color: var(--color-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-blue);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='36'/><circle cx='84' cy='50' r='12'/><circle cx='80.63' cy='64.75' r='12'/><circle cx='71.2' cy='76.58' r='12'/><circle cx='57.57' cy='83.15' r='12'/><circle cx='42.43' cy='83.15' r='12'/><circle cx='28.8' cy='76.58' r='12'/><circle cx='19.37' cy='64.75' r='12'/><circle cx='16' cy='50' r='12'/><circle cx='19.37' cy='35.25' r='12'/><circle cx='28.8' cy='23.42' r='12'/><circle cx='42.43' cy='16.85' r='12'/><circle cx='57.57' cy='16.85' r='12'/><circle cx='71.2' cy='23.42' r='12'/><circle cx='80.63' cy='35.25' r='12'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='36'/><circle cx='84' cy='50' r='12'/><circle cx='80.63' cy='64.75' r='12'/><circle cx='71.2' cy='76.58' r='12'/><circle cx='57.57' cy='83.15' r='12'/><circle cx='42.43' cy='83.15' r='12'/><circle cx='28.8' cy='76.58' r='12'/><circle cx='19.37' cy='64.75' r='12'/><circle cx='16' cy='50' r='12'/><circle cx='19.37' cy='35.25' r='12'/><circle cx='28.8' cy='23.42' r='12'/><circle cx='42.43' cy='16.85' r='12'/><circle cx='57.57' cy='16.85' r='12'/><circle cx='71.2' cy='23.42' r='12'/><circle cx='80.63' cy='35.25' r='12'/></svg>");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.profile-avatar.icon {
    background-size: 50%;
}
.search-form-mobile {
    display: flex;
    gap: 8px;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
}
.search-form-mobile .search-bar-wrapper {
    position: relative;
    width: 100%;
    display: block;
}
.search-form-mobile input,
.search-form-mobile .search-bar-fake {
    width: 100%;
    padding: 14px 18px 14px 18px;
    padding-right: 56px;
    border-radius: 999px;
    font-size: 1rem;
    background: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: none;
    outline: none;
    box-sizing: border-box;
}
.search-form-mobile .search-bar-fake {
    color: #767676;
}
.search-form-mobile .search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #767676;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 0;
}
.search-form-mobile .search-btn .icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}
.search-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 20;
}
.search-suggestions.show {
    display: block;
}
.search-suggestion-item {
    padding: 12px 20px;
    font-family: var(--font-secondary);
    letter-spacing: normal;
    color: var(--color-blue);
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.search-suggestion-item:last-child {
    border-bottom: none;
}
.search-suggestion-item:hover {
    background: #f7f7f7;
}
.category-tag {
    display: inline-block;
    background: rgba(13, 33, 164, 0.08);
    color: var(--color-blue);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    padding: 16px;
    text-decoration: none;
    box-shadow: none;
    border: none;
    transition: transform 0.15s ease;
}
.category-card:active {
    transform: scale(0.96);
}
.category-card.color-green {
    background: #cfe562;
}
.category-card.color-blue {
    background: #afd8f8;
}
.category-card.color-pink {
    background: var(--color-pink);
}
.category-card.color-orange {
    background: var(--color-orange);
}
.category-icon {
    font-size: 2.4rem;
    line-height: 1;
}
.category-name {
    font-weight: 700;
    color: var(--color-blue);
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    line-height: 1.2;
}
.categories-section .section-title,
.pending-section .section-title {
    font-size: 1.1rem;
    color: var(--color-blue);
    margin: 8px 0 12px 0;
}
.pending-cards-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 9%;
    padding: 4px 9% 18px;
    margin: 0 -50px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pending-cards-scroll::-webkit-scrollbar {
    display: none;
}
.pending-card {
    flex: 0 0 90%;
    scroll-snap-align: center;
    border-radius: 24px;
    padding: 10px;
    box-shadow: none;
    border: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.pending-card.color-green {
    background: #cfe562;
}
.pending-card.color-blue {
    background: #afd8f8;
}
.pending-card.color-pink {
    background: var(--color-pink);
}
.pending-card.color-orange {
    background: var(--color-orange);
}
.pending-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.requester-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: var(--color-pink);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.dashboard-mobile main {
    background-color: transparent;
    box-shadow: none;
}
.requester-name {
    font-weight: 700;
    color: var(--color-blue);
}
.request-desc {
    color: var(--color-blue);
    font-family: var(--font-secondary);
    letter-spacing: normal;
    margin-bottom: 16px;
}
.request-image-card {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 10px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.request-image {
    max-width: 65%;
    max-height: 300px;
    width: auto;
    height: auto;
}
.request-image.no-image-icon {
    max-width: 35%;
    opacity: 0.35;
}

/* Dashboard home: stretch the pending cards down to 40px above the bottom nav */
.dashboard-home {
    height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
}
.dashboard-home .dashboard-mobile {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-bottom: 114px;
}
.dashboard-home main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dashboard-home .pending-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dashboard-home .pending-cards-scroll {
    flex: 1;
    min-height: 0;
}
.dashboard-home .pending-card {
    display: flex;
    flex-direction: column;
}
.dashboard-home .request-image-card {
    flex: 1;
    min-height: 0;
}
.big-action-button {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-block;
    padding: 12px 26px;
    background: var(--color-pink);
    color: white;
    border-radius: 24px;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(251, 68, 187, 0.28);
}
.big-action-button.disabled {
    background: #d9d9d9;
    color: #c6c6c6;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}
.request-action-stack {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.request-action-stack .big-action-button {
    position: static;
}
.request-action-stack .pending-delete-request-btn {
    margin-top: 0;
}
.item-detail-backdrop {
    filter: blur(3px);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}
.item-detail-back {
    color: inherit;
    text-decoration: none;
    margin-right: 6px;
    display: inline-flex;
    vertical-align: middle;
}
.item-detail-back .icon {
    width: 1.4rem;
    height: 1.4rem;
    background-size: 100%;
}
.item-detail-modal {
    position: relative;
    margin-top: -20px;
    background: white;
    border: 2px solid transparent;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.item-detail-modal.unreturned {
    background: #fff0f7;
    border-color: var(--color-pink);
    box-shadow: 0 20px 50px rgba(251, 68, 187, 0.25);
}
.item-detail-modal.returned-ok {
    background: white;
    border-color: var(--color-green);
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.item-detail-modal.pending-return {
    background: var(--color-orange-tint);
    border-color: var(--color-orange);
    box-shadow: 0 20px 50px rgba(255, 169, 58, 0.3);
}
.item-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--color-blue);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.item-detail-close:hover {
    background: rgba(13, 33, 164, 0.08);
}
.item-detail-name {
    font-size: 2rem;
    color: var(--color-blue);
    margin-bottom: 16px;
}
.item-detail-photo {
    background: var(--color-grey);
    border-radius: 16px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}
.item-detail-photo img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: contain;
}
.item-detail-description {
    color: #333333;
    font-family: var(--font-secondary);
    letter-spacing: normal;
    margin-bottom: 20px;
}
.item-detail-footer-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.item-detail-owner {
    color: var(--color-blue);
    font-weight: 700;
    font-family: var(--font-secondary);
}
.item-detail-request-btn {
    flex-shrink: 0;
    padding: 12px 26px;
    background: var(--color-pink);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(251, 68, 187, 0.28);
}
.item-detail-unavailable {
    color: #999999;
    font-weight: 700;
    font-family: var(--font-secondary);
}
.item-detail-unavailable.item-detail-lent {
    color: var(--color-orange);
}
.return-status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.return-status-text {
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-secondary);
    color: var(--color-pink);
    transition: color 0.3s ease;
    text-align: right;
}
.item-detail-modal.returned-ok .return-status-text {
    color: var(--color-green);
}
.item-detail-modal.pending-return .return-status-text {
    color: var(--color-orange);
}
.return-pending-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-orange-tint);
    color: var(--color-orange);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-secondary);
}
.btn-borrow-again {
    padding: 10px 20px;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    font-family: var(--font-secondary);
    cursor: pointer;
}
.item-edit-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px 20px;
    background: #e9e9ee;
    border: none;
    color: var(--color-blue);
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: background 0.2s ease;
}
.item-edit-btn:hover {
    background: #dcdce3;
}
.item-delete-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--color-pink);
    text-decoration: underline;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    text-align: center;
}
.item-delete-btn:hover {
    color: var(--color-pink);
    opacity: 0.8;
}
.account-danger-zone {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-grey);
}
.btn-delete-account {
    width: 100%;
    padding: 14px;
    background: none;
    border: 2px solid var(--color-pink);
    color: var(--color-pink);
    border-radius: 28px;
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.btn-delete-account:hover {
    background: var(--color-pink);
    color: white;
}
.return-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.return-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.return-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d9d9d9;
    border-radius: 999px;
    transition: background-color 0.3s ease;
}
.return-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.return-toggle input:checked + .return-toggle-slider {
    background-color: var(--color-green);
}
.return-toggle input:checked + .return-toggle-slider::before {
    transform: translateX(20px);
}
.borrowed-item-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.borrowed-item-popup.show {
    display: flex;
}
.borrowed-item-popup .item-detail-modal {
    margin-top: 0;
    max-height: 90vh;
    overflow-y: auto;
    max-width: 420px;
    width: 100%;
}
.bottom-nav {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    z-index: 100;
    max-width: 420px;
    margin: 0 auto;
}
.bottom-nav .nav-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--color-blue);
    background: white;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
    padding: 0;
}

.nav-dot {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-pink);
    border: 2px solid var(--color-white);
}
.bottom-nav .nav-item .icon {
    width: 1.5rem;
    height: 1.5rem;
    background-size: contain;
}
.bottom-nav .nav-item:hover {
    transform: translateY(-2px);
}
.bottom-nav .nav-item.active {
    background: var(--color-orange);
    color: var(--color-blue);
}
.bottom-nav .nav-item.center-action {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: white;
    color: var(--color-blue);
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
}
.bottom-nav .nav-item.center-action:hover {
    transform: translateY(-2px);
}
.bottom-nav .nav-item.center-action .plus-icon {
    width: 30px;
    height: 30px;
    stroke: var(--color-blue);
    stroke-opacity: 0.6;
    stroke-width: 8.5;
    stroke-linecap: butt;
    fill: none;
}
.bottom-nav .nav-item.center-action.active {
    background: var(--color-orange);
}

.footer-add-item-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.32);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.footer-add-item-modal.show {
    display: flex;
}
.footer-modal-content {
    background: white;
    border-radius: 32px;
    padding: 28px 24px 20px;
    max-width: 520px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.footer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}
.footer-modal-content h2 {
    font-size: 2rem;
    color: var(--color-blue);
    margin: 0;
}
.footer-modal-close {
    border: none;
    background: transparent;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-blue);
    width: 34px;
    height: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}
.footer-modal-close:hover {
    background: rgba(13, 33, 164, 0.08);
    color: var(--color-blue);
}
.footer-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.footer-category-chip {
    border: none;
    border-radius: 999px;
    background: var(--color-white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 14px;
    color: var(--color-blue);
}
.footer-category-chip:hover,
.footer-category-chip:focus-visible {
    background: #ffe3f0;
    outline: none;
}
.footer-category-chip.selected {
    background: var(--color-pink);
    color: white;
    box-shadow: none;
}
.footer-category-chip span {
    display: inline-block;
    width: 100%;
}

.photo-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.photo-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--color-white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    color: var(--color-blue);
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.photo-upload-btn:hover {
    background: var(--color-pink-tint);
}
.photo-upload-input:focus-visible + .photo-upload-btn {
    outline: 2px solid var(--color-pink);
    outline-offset: 2px;
}
.photo-upload-filename {
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.footer-modal-content .form-group label {
    display: block;
    font-weight: 700;
    color: var(--color-blue);
    margin-bottom: 8px;
    font-size: 0.92rem;
    text-transform: none;
}
.footer-modal-content .form-group input[type="text"],
.footer-modal-content .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e7eaf8;
    border-radius: 16px;
    background: #f7f8ff;
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    color: var(--color-blue);
}
.footer-modal-content .form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.footer-modal-content .btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: 28px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
}
.footer-modal-content .btn-submit:hover {
    background: var(--color-blue);
}

@media (max-width: 420px) {
    .big-action-button { padding: 14px 32px; }
    .bottom-nav {
        left: 12px;
        right: 12px;
        bottom: 14px;
        gap: 8px;
    }
    .bottom-nav .nav-item {
        height: 48px;
    }
    .bottom-nav .nav-item.center-action {
        width: 70px;
        height: 70px;
    }
}

/* Loading screen */
.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.loading-screen.show {
    display: flex;
}

.loading-screen.fullscreen {
    background-color: var(--color-light-blue);
}

.loading-screen.overlay {
    background-color: rgba(185, 199, 248, 0.5);
}

.loading-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-body);
    letter-spacing: normal;
    color: var(--color-blue);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

