﻿/*  Account Page Layout  */

.account-layout {
    display: flex;
    height: calc(100dvh - 80px);
    overflow: hidden;
}

/*  Sidebar  */

.account-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    background: var(--color-card);
}

/*  Overview Card  */

.overview-card {
    padding: 1.75rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.overview-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-yellow, #f9d88c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-amber, #a06000);
    user-select: none;
    letter-spacing: 0.02em;
}

.avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--color-card, #fff);
    background: var(--color-background, #f5f5f5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.avatar-edit-btn:hover { background: #e0e0e0; }

.avatar-edit-btn svg {
    width: 11px;
    height: 11px;
    fill: var(--color-text, #111);
}

.overview-info { text-align: center; }

.overview-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text, #111);
    line-height: 1.3;
}

.overview-email {
    font-size: 0.8rem;
    color: var(--color-muted, #666);
    margin-top: 0.15rem;
}

.overview-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.icon-action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.icon-action-btn:hover { background: #cccccc; }

.icon-action-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--color-text, #111);
}

.icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--color-accent, #1956f5);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}

.logout-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
    flex-shrink: 0;
}

.logout-action-btn:hover { background: #fff0f0; }

.logout-action-btn svg {
    width: 18px;
    height: 18px;
    fill: #e53935;
    flex-shrink: 0;
}

/*  Account Nav  */

.account-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 2px;
    flex: 1;

}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text, #111);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    fill: var(--color-muted, #666);
    flex-shrink: 0;
    transition: fill 0.15s;
}

.nav-item:hover { background: var(--color-background, #f5f5f5); }

.nav-item.active {
    background: #eff3ff;
    color: var(--color-accent, #1956f5);
}

.nav-item.active svg { fill: var(--color-accent, #1956f5); }

/*  Right Content Panel  */

.account-content {
    flex: 1;
    overflow-y: auto;
    background: var(--color-background, #f5f5f5);
}

/*  Tab Panels  */

.tab-panel {
    display: none;
    padding: 2rem;
}

.tab-panel.active { display: block; }

/*  Content Sections  */

.content-section {
    background: var(--color-card, #fff);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-base, 0 2px 8px rgba(0,0,0,0.05));
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text, #111);
    margin: 0 0 1.5rem 0;
}

.content-loading {
    padding: 2rem;
    text-align: center;
    color: var(--color-muted, #666);
    font-size: 0.9rem;
}

/*  Profile Form Layout  */

.profile-form-wrap {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.profile-avatar-col {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.5rem;
    position: relative;
}

.profile-avatar-display {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--color-yellow, #f9d88c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-amber, #a06000);
    user-select: none;
}

.avatar-edit-inline {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--color-muted, #666);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.avatar-edit-inline:hover { background: var(--color-background, #f5f5f5); }

.avatar-edit-inline svg {
    width: 13px;
    height: 13px;
    fill: var(--color-muted, #666);
}

.profile-divider {
    width: 1px;
    background: #e0e0e0;
    align-self: stretch;
    margin: 0 1.5rem;
}

.profile-form-col {
    flex: 1;
    min-width: 0;
}

/*  Profile Table  */

.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.profile-table th {
    width: 160px;
    text-align: left;
    font-weight: 500;
    color: var(--color-muted, #666);
    padding: 0.55rem 1rem 0.55rem 0;
    vertical-align: middle;
    white-space: nowrap;
}

.profile-table td {
    padding: 0.35rem 0;
    vertical-align: middle;
}

.profile-table input[type="text"],
.profile-table input[type="tel"],
.profile-table input[type="email"] {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: var(--color-text, #111);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.profile-table input:focus {
    outline: none;
    border-color: var(--color-accent, #1956f5);
}

.profile-table input:disabled {
    background: var(--color-background, #f5f5f5);
    color: var(--color-muted, #666);
    cursor: not-allowed;
}

.field-readonly {
    color: var(--color-muted, #666);
    font-size: 0.9rem;
}

.required { color: #e53935; }

.instagram-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.instagram-input-wrap:focus-within {
    border-color: var(--color-accent, #1956f5);
}

.instagram-at {
    padding: 0.45rem 0.5rem 0.45rem 0.65rem;
    color: var(--color-muted, #666);
    background: var(--color-background, #f5f5f5);
    font-size: 0.9rem;
    user-select: none;
}

.instagram-input-wrap input {
    flex: 1;
    padding: 0.45rem 0.65rem 0.45rem 0.25rem;
    border: none;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: var(--color-text, #111);
}

/*  Contact Preferences  */

.preferences-subsection {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e0e0e0;
}

.subsection-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

.pref-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pref-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.pref-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-accent, #1956f5);
}

.pref-check input:disabled { cursor: not-allowed; opacity: 0.6; }

/*  Save Button  */

.form-save-row {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-save-profile {
    padding: 0.55rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: #e0e0e0;
    color: #999;
    transition: background 0.2s, color 0.2s;
}

.btn-save-profile:not(:disabled) {
    background: var(--color-accent, #1956f5);
    color: #fff;
    cursor: pointer;
}

.btn-save-profile:not(:disabled):hover { background: #1348d4; }

.btn-save-profile:disabled { cursor: not-allowed; }

/*  Avatar Editor Popup  */

.avatar-editor-popup {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--color-card, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    width: 220px;
}

.avatar-editor-inner {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 0.25rem;
    user-select: none;
}

.editor-label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-muted, #666);
}

.editor-label input[type="color"] {
    width: 100%;
    height: 32px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
}

.editor-label input[type="text"] {
    padding: 0.4rem 0.6rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    text-transform: uppercase;
}

.editor-label input[type="text"]:focus {
    outline: none;
    border-color: var(--color-accent, #1956f5);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.btn-editor-cancel,
.btn-editor-save {
    flex: 1;
    padding: 0.45rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid #e0e0e0;
}

.btn-editor-cancel {
    background: transparent;
    color: var(--color-muted, #666);
}

.btn-editor-cancel:hover { background: var(--color-background, #f5f5f5); }

.btn-editor-save {
    background: var(--color-accent, #1956f5);
    color: #fff;
    border-color: var(--color-accent, #1956f5);
}

.btn-editor-save:hover { background: #1348d4; }

/*  Security Section  */

.security-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: var(--color-muted, #666);
}

.btn-logout-all {
    padding: 0.4rem 0.9rem;
    border: 1.5px solid #e53935;
    background: transparent;
    color: #e53935;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-logout-all:hover { background: #fff0f0; }

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: var(--color-background, #f5f5f5);
    gap: 1rem;
}

.session-item.current {
    border-color: var(--color-accent, #1956f5);
    background: #eff3ff;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.session-device {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text, #111);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.session-current-badge {
    font-size: 0.7rem;
    background: var(--color-accent, #1956f5);
    color: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.session-meta {
    font-size: 0.78rem;
    color: var(--color-muted, #666);
}

.session-revoke-btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 5px;
    font-size: 0.78rem;
    color: var(--color-muted, #666);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}

.session-revoke-btn:hover { border-color: #e53935; color: #e53935; }

/*  The Pond Placeholder  */

.pond-placeholder {
    text-align: center;
    padding: 4rem 2rem;
}

.placeholder-icon svg {
    width: 64px;
    height: 64px;
    fill: #e0e0e0;
    margin-bottom: 1rem;
}

.pond-placeholder h2 {
    font-size: 1.25rem;
    color: var(--color-text, #111);
    margin: 0 0 0.5rem;
}

.pond-placeholder p {
    color: var(--color-muted, #666);
    font-size: 0.9rem;
    max-width: 360px;
    margin: 0 auto;
}

/*  Duckwork Orders  */

#orders-list {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.orders-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.orders-table td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.orders-table tr:last-child td { border-bottom: none; }
.orders-table tr:hover td { background: #fafafa; }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending   { background: #fff3cd; color: #856404; }
.status-badge.reviewing { background: #d1ecf1; color: #0c5460; }
.status-badge.approved  { background: #d4edda; color: #155724; }
.status-badge.rejected  { background: #f8d7da; color: #721c24; }
.status-badge.completed { background: #e2e3e5; color: #383d41; }
.status-badge.quoted    { background: #e0d4f7; color: #4b2d8a; }

.btn-order-view {
    padding: 0.3rem 0.75rem;
    border: 1.5px solid var(--color-accent, #1956f5);
    background: transparent;
    color: var(--color-accent, #1956f5);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-order-view:hover { background: #eff3ff; }

.empty-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-muted, #666);
    font-size: 0.9rem;
}

/*  Order Detail  */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    color: var(--color-text, #111);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: background 0.15s;
}

.btn-back:hover { background: var(--color-background, #f5f5f5); }

.order-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.order-detail-id {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.order-detail-date { font-size: 0.85rem; color: var(--color-muted, #666); }

.order-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.order-detail-table th,
.order-detail-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: top;
}

.order-detail-table th {
    width: 180px;
    font-weight: 500;
    color: var(--color-muted, #666);
    white-space: nowrap;
}

.order-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-files-list li a {
    color: var(--color-accent, #1956f5);
    font-size: 0.85rem;
    text-decoration: none;
}

.order-files-list li a:hover { text-decoration: underline; }

/*  Responsive  */

@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .account-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        overflow-y: visible;
    }

    .account-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        justify-content: center;
    }

    .profile-form-col {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* Hide inactive tab labels with animation; show active label */
    .nav-label {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
        transition: max-width 0.25s ease, opacity 0.2s ease;
    }
    .nav-item.active .nav-label {
        max-width: 120px;
        opacity: 1;
    }

    .nav-item { flex-shrink: 0; }

    .account-content { overflow-y: visible; }

    .tab-panel { padding: 1rem; }

    .profile-form-wrap { flex-direction: column; }

    .profile-avatar-col {
        width: 100%;
        margin-bottom: 1.25rem;
    }

    .profile-divider { display: none; }

    .profile-table th { width: 120px; }
}
