﻿.nav-messages-link {
    position: relative;
}

.nav-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-danger);
    color: var(--color-text-inverse);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9px;
    margin-left: 4px;
    line-height: 1;
    animation: badge-pop 0.3s cubic-bezier(0.2, 0.8, 0.4, 1.2);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

/* ============================================================
   My Account — Modern Tabbed Layout
   ============================================================ */

.acct-auth-notice {
    text-align: center;
    padding: 4rem 2rem;
}

/* ── Two-column layout ── */
.acct-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    min-height: 60vh;
}

/* ── Sidebar ── */
.acct-sidebar {
    position: sticky;
    top: calc(var(--nav-height, 60px) + 1rem);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.acct-sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.acct-sidebar-name {
    margin: 0.75rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.acct-sidebar-email {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

/* ── Sidebar Nav ── */
.acct-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 0.5rem;
    overflow: hidden;
}

.acct-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    width: 100%;
}

    .acct-nav-item:hover {
        background: rgba(0, 0, 0, 0.03);
        color: var(--color-text);
    }

.acct-nav-active {
    background: var(--color-primary) !important;
    color: var(--color-text-inverse) !important;
    font-weight: 600;
}

.acct-nav-icon {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Sidebar Quick Links ── */
.acct-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.25rem;
}

.acct-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}

    .acct-sidebar-link:hover {
        background: rgba(0, 0, 0, 0.03);
    }

.acct-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-danger);
    color: var(--color-text-inverse);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9px;
    margin-left: auto;
}

/* ── Main Content Area ── */
.acct-main {
    min-width: 0;
}

.acct-section {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 2rem;
}

.acct-section-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.acct-section-desc {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.acct-subsection-title {
    margin: 1.75rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── Forms ── */
.acct-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.acct-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

    .acct-form-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--color-text);
    }

.acct-input {
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

    .acct-input:focus {
        outline: none;
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.12);
    }

.acct-textarea {
    resize: vertical;
    min-height: 80px;
}

.acct-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.acct-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── Avatar Upload ── */
.acct-avatar-upload {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.acct-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.acct-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: var(--color-bg);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.acct-avatar-upload-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.acct-uploading {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-top: 0.35rem;
}

/* ── Privacy Toggles ── */
.acct-privacy-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.acct-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--color-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

    .acct-toggle-row:hover {
        background: rgba(0, 0, 0, 0.03);
    }

    .acct-toggle-row input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        accent-color: var(--color-primary);
        flex-shrink: 0;
    }

.acct-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.acct-toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.acct-toggle-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* ── Security Section ── */
.acct-security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.acct-security-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acct-security-value {
    display: block;
    font-size: 0.95rem;
    color: var(--color-text);
    margin-top: 0.15rem;
}

.acct-change-form {
    padding: 1.25rem;
    background: var(--color-bg);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.acct-security-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Toast Notifications ── */
.acct-toast {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: acct-toast-in 0.25s ease;
}

@keyframes acct-toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.acct-toast-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.acct-toast-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.acct-toast-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .acct-layout {
        grid-template-columns: 1fr;
    }

    .acct-sidebar {
        position: static;
    }

    .acct-sidebar-profile {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
    }

    .acct-sidebar-name {
        margin-top: 0;
    }

    .acct-sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.35rem;
        gap: 0;
    }

    .acct-nav-item {
        white-space: nowrap;
        padding: 0.5rem 0.85rem;
        font-size: 0.82rem;
    }

    .acct-nav-icon {
        display: none;
    }

    .acct-sidebar-links {
        flex-direction: row;
        gap: 0.75rem;
    }
}

@media (max-width: 600px) {
    .acct-form-row {
        grid-template-columns: 1fr;
    }

    .acct-section {
        padding: 1.25rem;
    }

    .acct-avatar-upload {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ════════════════════════════════════════════════════════
   Loyalty tab
   The hero shows the headline balance and dollar-equivalent; the history
   is a three-column list (date │ description+source │ signed amount).
   Theme tokens only — picks up tenant colors automatically.
   ════════════════════════════════════════════════════════ */

.acct-section-subtitle {
    margin: 2rem 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

.acct-loyalty-hero {
    background: var(--color-surface-2, var(--color-card-bg, #f7f5ef));
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.acct-loyalty-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
}

.acct-loyalty-balance-num {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary, var(--color-text));
    font-variant-numeric: tabular-nums;
}

.acct-loyalty-balance-lbl {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted, #666);
    letter-spacing: 0.02em;
}

.acct-loyalty-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted, #666);
    margin-bottom: 0.75rem;
}

.acct-loyalty-hint-sub {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    opacity: 0.85;
}

.acct-loyalty-soon {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    color: var(--color-text-muted, #666);
    background: var(--color-surface, #fff);
    border: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
}

.acct-loyalty-history {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
}

.acct-loyalty-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
    background: var(--color-surface, #fff);
}

    .acct-loyalty-row:last-child {
        border-bottom: none;
    }

.acct-loyalty-row-when {
    font-size: 0.78rem;
    color: var(--color-text-muted, #888);
    white-space: nowrap;
}

.acct-loyalty-row-desc {
    font-size: 0.92rem;
    color: var(--color-text);
    line-height: 1.3;
}

.acct-loyalty-row-source {
    font-size: 0.7rem;
    color: var(--color-text-muted, #999);
    margin-top: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acct-loyalty-row-amount {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.acct-loyalty-amount-pos {
    color: #16a34a; /* green-600 — earned */
}

.acct-loyalty-amount-neg {
    color: #dc2626; /* red-600 — redeemed/clawback */
}

@media (max-width: 600px) {
    .acct-loyalty-hero {
        padding: 1.25rem 1rem;
    }

    .acct-loyalty-balance-num {
        font-size: 2.4rem;
    }

    .acct-loyalty-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "what amount"
            "when when";
        gap: 0.4rem 0.75rem;
        padding: 0.7rem 0.85rem;
    }

    .acct-loyalty-row-when {
        grid-area: when;
    }

    .acct-loyalty-row-what {
        grid-area: what;
    }

    .acct-loyalty-row-amount {
        grid-area: amount;
    }
}
