/* My Account slide-in (#tab-account) — Airbnb-inspired layout, site colors */

/* Consistent slide-in insets (override .tab-window .tab margin + width) */
.tab-window .tab#tab-account,
.tab-window:has(.tab#tab-account.active) {
    /* Match main nav avatar row (~34px avatar + padding); balances close btn vs visible avatar */
    --account-header-h: 50px;
    --account-header-side: 46px;
}

.tab-window .tab#tab-account {
    --account-inset-x: 2.5rem;
    /* Content starts just below slide-in header bar + divider */
    --account-inset-top: calc(var(--account-header-h) + 1px);
    --account-inset-bottom: 2.5rem;
    --account-sticky-header-z: 10;

    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: var(--account-inset-top) var(--account-inset-x) var(--account-inset-bottom);
    box-sizing: border-box;
    align-self: stretch;
    flex: 1 1 auto;
}

/* Tabbed account: fixed header zone + scrollable body (close btn / hr stay on .tab-window) */
.tab-window:has(.tab#tab-account.active) {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.tab-window .tab#tab-account.active:has(.account-sticky-header) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
}

/* Centered close btn: equal side insets mirror nav avatar width on desktop */
.tab-window:has(.tab#tab-account.active) .close-btn {
    left: var(--account-header-side);
    right: var(--account-header-side);
    top: 0;
    width: auto;
    height: var(--account-header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    text-align: center;
    z-index: 20;
}

.tab-window:has(.tab#tab-account.active) hr {
    top: var(--account-header-h);
    z-index: 19;
}

.tab#tab-account #errors:not(:empty) {
    margin-bottom: 1.25rem;
}

.tab#tab-account #errors .notification,
.tab#tab-account #errorsOther .notification {
    border-radius: 12px;
    font-size: 0.9rem;
}

/* Panel shell — full width of padded slide-in column */
.tab#tab-account .account-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
}

.tab#tab-account .account-panel:has(.account-sticky-header) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Sticky header: inner tab pills sit below centered close row + divider */
.tab#tab-account .account-sticky-header {
    flex: 0 0 auto;
    position: relative;
    z-index: var(--account-sticky-header-z);
    background: #fff;
    margin-top: var(--account-inset-top);
    padding: 0 var(--account-inset-x) 0;
    box-shadow: 0 1px 0 #f5f5f5;
}

/* Scrollable tab content below sticky header */
.tab#tab-account .account-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem var(--account-inset-x) var(--account-inset-bottom);
}

.tab#tab-account:has(.account-sticky-header) #errors:not(:empty) {
    flex: 0 0 auto;
    margin: var(--account-inset-top) 0 0;
    padding: 0.75rem var(--account-inset-x) 0;
}

.tab#tab-account:has(.account-sticky-header) #errors:not(:empty) + .account-panel .account-sticky-header {
    margin-top: 0;
}

/* ── Pill segment tab bar (Airbnb-style) ── */
.tab#tab-account .account-inner-tabs {
    margin: 0 0 1rem;
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    z-index: 1;
    display: block;
    background: #fff;
    padding: 0 0 0.75rem;
}

.tab#tab-account .account-inner-tabs > ul {
    display: flex;
    gap: 0.25rem;
    border: none;
    background: #f5f5f5;
    border-radius: 999px;
    padding: 4px;
    margin: 0;
}

.tab#tab-account .account-inner-tabs li {
    flex: 1 1 0;
    margin: 0;
}

.tab#tab-account .account-inner-tabs li a {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 999px;
    padding: 0.6rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    background: transparent;
    color: #484848;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab#tab-account .account-inner-tabs li a:hover {
    color: #111;
}

.tab#tab-account .account-inner-tabs li.is-active a {
    background: #000;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Tab panes — no extra horizontal inset (shell padding handles edges) */
.tab#tab-account .account-tab {
    display: none;
    margin: 0;
    padding: 0;
    animation: accountTabIn 0.2s ease;
}

.tab#tab-account .account-tab.active {
    display: block;
}

@keyframes accountTabIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Greeting — friendly headline */
.tab#tab-account .account-greeting {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    color: #111;
    line-height: 1.3;
}

.tab#tab-account .account-tab-intro {
    margin-bottom: 0.5rem;
}

/* ── Cards — soft shadow, generous padding ── */
.tab#tab-account .account-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tab#tab-account .account-card:last-of-type {
    margin-bottom: 1rem;
}

.tab#tab-account .account-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f0f0f0;
}

.tab#tab-account .account-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    color: #111;
    letter-spacing: -0.01em;
}

.tab#tab-account .account-section-title--lg {
    font-size: 1rem;
}

.tab#tab-account .account-section-subtitle {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #717171;
    margin: 0.35rem 0 0;
    line-height: 1.45;
}

.tab#tab-account .account-note {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #717171;
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid #f5f5f5;
}

/* ── Key-value rows (subscription details) ── */
.tab#tab-account .account-details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
}

.tab#tab-account .account-details-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.tab#tab-account .account-details-table tr:last-child {
    border-bottom: none;
}

.tab#tab-account .account-details-table td {
    padding: 0.85rem 0;
    vertical-align: middle;
    font-size: 0.875rem;
    border: none;
    line-height: 1.4;
}

.tab#tab-account .account-details-table td:first-child {
    width: 46%;
    color: #717171;
    font-weight: 400;
    padding-right: 1rem;
}

.tab#tab-account .account-details-table td:last-child,
.tab#tab-account .account-details-table #table_value {
    padding-left: 0;
    text-align: right;
    font-weight: 500;
    color: #111;
}

.tab#tab-account .account-details-table a.button {
    margin-left: auto;
}

/* ── Subscription details — heading + stat card grid (no section box) ── */
.tab#tab-account .account-subscription-section {
    margin-bottom: 1.25rem;
}

.tab#tab-account .account-subscription-section > .account-section-title {
    margin-bottom: 1rem;
}

.tab#tab-account .account-subscription-section > .account-note {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}

/* ── Dashboard stat cards (subscription details) ── */
.tab#tab-account .account-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.tab#tab-account .account-stat-card {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 5.5rem;
}

.tab#tab-account .account-stat-card--wide {
    grid-column: 1 / -1;
}

.tab#tab-account .account-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #717171;
    line-height: 1.3;
}

.tab#tab-account .account-stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.tab#tab-account .account-stat-value--status {
    color: #008a05;
}

.tab#tab-account .account-stat-value .button {
    margin: 0;
}

/* ── Branding section ── */
.tab#tab-account .account-card--branding {
    margin-bottom: 1.25rem;
}

.tab#tab-account .account-branding-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tab#tab-account .account-branding-item {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tab#tab-account .account-branding-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #717171;
}

.tab#tab-account .account-branding-preview {
    border: 1px dashed #ddd;
    border-radius: 12px;
    background: #fafafa;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab#tab-account .account-branding-preview--bg {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.tab#tab-account .account-branding-preview--bg video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tab#tab-account .account-branding-preview--bg.has-image {
    border-style: solid;
    border-color: #ebebeb;
}

.tab#tab-account .account-branding-preview--logo {
    height: 88px;
    padding: 0.75rem;
}

.tab#tab-account .account-branding-preview--logo img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.tab#tab-account .account-branding-placeholder {
    font-size: 0.8125rem;
    color: #999;
    text-align: center;
    padding: 0 0.75rem;
}

.tab#tab-account .account-branding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab#tab-account .account-branding-actions label.button {
    cursor: pointer;
    margin: 0;
}

.tab#tab-account .account-branding-hint {
    font-size: 0.75rem;
    color: #999;
    margin: 0;
    line-height: 1.4;
}

.tab#tab-account #errorsBranding:not(:empty) {
    margin-bottom: 1rem;
}

/* ── Profile form — clean stacked rows ── */
.tab#tab-account .account-card .field {
    margin-bottom: 1.15rem;
}

.tab#tab-account .account-card .field:last-child {
    margin-bottom: 0;
}

.tab#tab-account .account-card .label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #717171;
    margin-bottom: 0.45rem;
}

.tab#tab-account .account-card .input,
.tab#tab-account .account-card select.input,
.tab#tab-account .account-auth .input {
    border-radius: 10px;
    border-color: #ddd;
    box-shadow: none;
    font-size: 0.9375rem;
    min-height: 2.75em;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tab#tab-account .account-card .input:focus,
.tab#tab-account .account-card select.input:focus,
.tab#tab-account .account-auth .input:focus {
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.tab#tab-account .account-card .button.is-info,
.tab#tab-account .account-auth .button.is-info {
    border-radius: 999px;
    font-weight: 600;
    margin-top: 0.5rem;
    min-height: 2.75em;
}

/* ── Action buttons (admin, create sub) ── */
.tab#tab-account .account-action {
    margin-bottom: 1.25rem;
}

.tab#tab-account .account-action .button {
    border-radius: 999px;
    font-weight: 600;
    min-height: 2.75em;
    height: auto;
    font-size: 0.9375rem;
}

.tab#tab-account .account-action--admin {
    margin-bottom: 1.5rem;
}

.tab#tab-account .account-action--admin .button {
    border: 1px solid #ebebeb;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tab#tab-account .account-action--admin .button:hover {
    background: #fafafa;
    border-color: #ddd;
}

/* ── Footer zone — logout, legal, language ── */
.tab#tab-account .account-footer {
    margin-top: 1.75rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid #ebebeb;
    width: 100%;
}

.tab#tab-account .account-section {
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-top: 0;
    border-top: none;
}

.tab#tab-account .account-section--language .account-section-title {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    text-transform: none;
    letter-spacing: normal;
}

.tab#tab-account .account-section--language .control.has-icons-left .icon {
    color: #717171;
}

.tab#tab-account .account-section--language .select.is-rounded select {
    border-radius: 999px;
    border-color: #ddd;
    min-height: 2.5em;
}

.tab#tab-account .account-legal-links {
    margin: 0 0 1.25rem;
    padding: 0;
    border-top: none;
    font-size: 0.8125rem;
    gap: 0.15rem 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.tab#tab-account .account-legal-links .legal-sep {
    color: #ccc;
    user-select: none;
}

.tab#tab-account .account-legal-links a {
    opacity: 0.75;
    font-weight: 500;
    color: #484848;
    text-decoration: none;
}

.tab#tab-account .account-legal-links a:hover,
.tab#tab-account .account-legal-links a:focus {
    opacity: 1;
    color: #111;
    text-decoration: underline;
}

.tab#tab-account .account-action--logout {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    border-top: none;
}

.tab#tab-account .account-action--logout .button {
    color: #484848;
    border: 1px solid #ddd;
    background: #fff;
}

.tab#tab-account .account-action--logout .button:hover {
    background: #f5f5f5;
    color: #111;
    border-color: #ccc;
}

/* ── Login / forgot / reset ── */
.tab#tab-account .account-auth {
    margin-top: 0;
    width: 100%;
    max-width: none;
}

.tab#tab-account .account-auth h1 {
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.25;
    color: #111;
}

.tab#tab-account .account-auth .openForm {
    display: inline-block;
    float: right;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111;
    text-decoration: underline;
    margin-top: -0.25rem;
    margin-bottom: 1.25rem;
}

.tab#tab-account .account-auth .openForm:hover {
    color: #484848;
}

.tab#tab-account #loginDiv,
.tab#tab-account #forgotDiv {
    margin-top: 0;
}

.tab#tab-account #forgotDiv {
    min-height: 200px;
}

/* ── Uploads tab — same design language, separate pane ── */
.tab#tab-account .account-tab#uploads .uploads-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tab#tab-account .account-tab#uploads .uploads-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.tab#tab-account .account-tab#uploads .uploads-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: #111;
    line-height: 1.3;
}

.tab#tab-account .account-tab#uploads .uploads-panel-desc {
    font-size: 0.8125rem;
    color: #717171;
    margin: 0.35rem 0 0;
    line-height: 1.45;
}

.tab#tab-account .account-tab#uploads .account-storage-tag {
    flex-shrink: 0;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    background: #f5f5f5;
    color: #484848;
    border: 1px solid #ebebeb;
}

.tab#tab-account .account-tab#uploads .account-storage-tag.is-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.tab#tab-account .account-tab#uploads .account-uploads-card,
.tab#tab-account .account-tab#users .account-users-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tab#tab-account .account-tab#uploads .table,
.tab#tab-account .account-tab#users .table {
    font-size: 0.8125rem;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    margin: 0;
}

.tab#tab-account .account-tab#uploads .table thead th,
.tab#tab-account .account-tab#users .table thead th {
    background: #fafafa;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #717171;
    border-bottom: 1px solid #ebebeb;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.tab#tab-account .account-tab#uploads .table tbody td,
.tab#tab-account .account-tab#users .table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f5;
    color: #484848;
}

.tab#tab-account .account-tab#uploads .table tbody tr:last-child td,
.tab#tab-account .account-tab#users .table tbody tr:last-child td {
    border-bottom: none;
}

.tab#tab-account .account-tab#uploads .table tbody tr:hover td,
.tab#tab-account .account-tab#users .table tbody tr:hover td {
    background: #fafafa;
}

.tab#tab-account .account-tab#uploads .table a,
.tab#tab-account .account-tab#users .table a {
    color: #111;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tab#tab-account .account-tab#uploads .table a:hover,
.tab#tab-account .account-tab#users .table a:hover {
    color: #484848;
}

.tab#tab-account .account-tab#uploads .uploads-actions {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tab#tab-account .account-tab#uploads .uploads-actions-sep {
    color: #ccc;
    user-select: none;
}

/* Empty states */
.tab#tab-account .account-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #717171;
    font-size: 0.9375rem;
    line-height: 1.55;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 16px;
}

.tab#tab-account .account-empty-state .button {
    margin-top: 1rem;
}

/* ── Sub Users tab ── */
.tab#tab-account .account-tab#users .users-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tab#tab-account .account-tab#users .users-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: #111;
}

.tab#tab-account .account-tab#users .button.is-info.is-rounded {
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 0;
}

.tab#tab-account .account-tab#users #add-sub-user-block {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tab#tab-account .account-tab#users #add-sub-user-block .label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #717171;
}

.tab#tab-account .account-tab#users #add-sub-user-block .input {
    border-radius: 10px;
    border-color: #ddd;
    min-height: 2.75em;
}

.tab#tab-account .account-tab#users #add-sub-user-block .button {
    border-radius: 999px;
    font-weight: 600;
}

/* Legacy float overrides */
.tab#tab-account #submitDetailsChange,
.tab#tab-account #submitNewSub,
.tab#tab-account #submitLogin,
.tab#tab-account #submitForgot,
.tab#tab-account #submitReset {
    float: none;
}

/* Mobile */
@media (max-width: 768px) {
    .tab-window .tab#tab-account,
    .tab-window:has(.tab#tab-account.active) {
        --account-header-h: 44px;
        --account-header-side: 0;
        --account-inset-x: 1.25rem;
        --account-inset-bottom: 1.5rem;
    }

    .tab-window:has(.tab#tab-account.active) {
        min-height: 0;
    }

    .tab-window .tab#tab-account:has(.account-sticky-header) {
        max-height: calc(100vh - 50px);
        max-height: calc(100dvh - 50px);
    }

    /* Avatar sits in mobile navbar above slide-in — close btn spans full header width */
    .tab-window:has(.tab#tab-account.active) .close-btn {
        left: 0;
        right: 0;
    }

    .tab#tab-account .account-inner-tabs {
        display: block;
    }

    .tab#tab-account .account-inner-tabs li a {
        font-size: 0.75rem;
        padding: 0.55rem 0.4rem;
    }

    .tab#tab-account .account-greeting {
        font-size: 1.2rem;
    }

    .tab#tab-account .account-details-table td:first-child {
        width: 50%;
        font-size: 0.8125rem;
    }

    .tab#tab-account .account-details-table td:last-child,
    .tab#tab-account .account-details-table #table_value {
        font-size: 0.8125rem;
    }

    .tab#tab-account .account-card {
        padding: 1.15rem 1.2rem;
        border-radius: 14px;
    }

    .tab#tab-account .account-tab#uploads .uploads-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tab#tab-account .account-tab#uploads .account-storage-tag {
        align-self: flex-start;
    }

    .tab#tab-account .account-tab#uploads .account-uploads-card,
    .tab#tab-account .account-tab#users .account-users-card {
        border-radius: 14px;
    }

    .tab#tab-account .account-tab#uploads .table,
    .tab#tab-account .account-tab#users .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab#tab-account .account-auth h1 {
        font-size: 1.375rem;
    }

    .tab#tab-account .account-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tab#tab-account .account-branding-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tab#tab-account .account-stat-grid {
        grid-template-columns: 1fr;
    }
}
