/* ===== Whale VIP Dashboard ===== */

/* Presets page uses a wider main container than the single-column tools
   so the clients table + activity feed split-view has room to breathe. */
body.page-presets .main-container {
    max-width: min(100%, 78rem);
}

.dash-gate-banner {
    padding: 1.5rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 0.5rem;
    background: rgba(206, 186, 76, 0.08);
    text-align: center;
}
.dash-gate-banner h3 { margin: 0 0 0.5rem; color: #CEBA4C; }
.dash-gate-banner p { margin: 0; color: #f2f2f2; line-height: 1.6; }
.dash-gate-banner a { color: #CEBA4C; }
body.theme-gold .dash-gate-banner {
    border-color: rgba(13, 40, 73, 0.4);
    background: rgba(13, 40, 73, 0.05);
}
body.theme-gold .dash-gate-banner h3,
body.theme-gold .dash-gate-banner p,
body.theme-gold .dash-gate-banner a { color: #0D2849; }

/* Stat strip */
.dash-stats {
    display: flex;
    gap: 1rem;
    margin: 1.25rem 0;
    flex-wrap: wrap;
}
.dash-stat {
    flex: 1 1 10rem;
    min-width: 9rem;
    padding: 1rem 1.25rem;
    background: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.25);
    border-radius: 0.5rem;
    text-align: center;
}
.dash-stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #CEBA4C;
    line-height: 1.1;
}
.dash-stat-label {
    font-size: 0.78rem;
    color: rgba(242, 242, 242, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
body.theme-gold .dash-stat {
    background: rgba(206, 186, 76, 0.15);
    border-color: rgba(13, 40, 73, 0.3);
}
body.theme-gold .dash-stat-num { color: #0D2849; }
body.theme-gold .dash-stat-label { color: rgba(13, 40, 73, 0.7); }

/* Two-column layout */
.dash-main {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1rem;
}
.dash-clients {
    flex: 2 1 0;
    min-width: 0;
}
.dash-activity {
    flex: 1 1 0;
    min-width: 0;
}

.dash-clients-header,
.dash-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.dash-clients-header h3,
.dash-activity-header h3 {
    margin: 0;
    color: #CEBA4C;
    font-size: 1.15rem;
}
body.theme-gold .dash-clients-header h3,
body.theme-gold .dash-activity-header h3 { color: #0D2849; }

.dash-clients-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.dash-sort {
    padding: 0.35rem 0.6rem;
    background: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 0.25rem;
    color: #F2F2F2;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}
body.theme-gold .dash-sort {
    background: rgba(206, 186, 76, 0.15);
    border-color: rgba(13, 40, 73, 0.3);
    color: #0D2849;
}

/* Buttons */
.dash-btn-primary,
.dash-btn-subtle,
.dash-btn-danger {
    padding: 0.45rem 0.9rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.dash-btn-primary {
    background: rgba(206, 186, 76, 0.15);
    border: 1px solid #CEBA4C;
    color: #CEBA4C;
    font-weight: 600;
}
.dash-btn-primary:hover { background: rgba(206, 186, 76, 0.3); }
.dash-btn-subtle {
    background: transparent;
    border: 1px solid rgba(206, 186, 76, 0.35);
    color: rgba(242, 242, 242, 0.8);
}
.dash-btn-subtle:hover {
    background: rgba(206, 186, 76, 0.1);
    border-color: #CEBA4C;
}
.dash-btn-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #E74C3C;
}
.dash-btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

body.theme-gold .dash-btn-primary {
    background: rgba(13, 40, 73, 0.12);
    border-color: #0D2849;
    color: #0D2849;
}
body.theme-gold .dash-btn-primary:hover { background: rgba(13, 40, 73, 0.2); }
body.theme-gold .dash-btn-subtle {
    border-color: rgba(13, 40, 73, 0.3);
    color: rgba(13, 40, 73, 0.8);
}

/* Clients table */
.dash-table-wrap {
    background: rgba(13, 40, 73, 0.35);
    border: 1px solid rgba(206, 186, 76, 0.25);
    border-radius: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
body.theme-gold .dash-table-wrap {
    background: rgba(206, 186, 76, 0.08);
    border-color: rgba(13, 40, 73, 0.2);
}
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.dash-table thead {
    background: rgba(206, 186, 76, 0.08);
}
body.theme-gold .dash-table thead {
    background: rgba(13, 40, 73, 0.08);
}
.dash-table th {
    text-align: left;
    padding: 0.5rem 0.7rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(206, 186, 76, 0.75);
    font-weight: 600;
    border-bottom: 1px solid rgba(206, 186, 76, 0.2);
    white-space: nowrap;
}
body.theme-gold .dash-table th {
    color: rgba(13, 40, 73, 0.75);
    border-color: rgba(13, 40, 73, 0.2);
}
.dash-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(206, 186, 76, 0.08);
    vertical-align: middle;
    color: rgba(242, 242, 242, 0.88);
}
body.theme-gold .dash-table td {
    color: rgba(13, 40, 73, 0.9);
    border-color: rgba(13, 40, 73, 0.08);
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: rgba(206, 186, 76, 0.06); }
body.theme-gold .dash-table tbody tr:hover { background: rgba(13, 40, 73, 0.05); }
.dash-cell-name {
    color: #CEBA4C;
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
body.theme-gold .dash-cell-name { color: #0D2849; }
.dash-col-actions { text-align: right; white-space: nowrap; }
.dash-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 0.25rem;
    background: transparent;
    color: #CEBA4C;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    margin-left: 0.25rem;
    transition: background 0.15s ease;
}
.dash-act-btn:first-child { margin-left: 0; }
.dash-act-btn:hover { background: rgba(206, 186, 76, 0.15); }
body.theme-gold .dash-act-btn {
    border-color: rgba(13, 40, 73, 0.3);
    color: #0D2849;
}
.dash-act-btn.dash-card-delete {
    color: #e0857f;
    border-color: rgba(224, 133, 127, 0.4);
}
.dash-act-btn.dash-card-delete:hover { background: rgba(224, 133, 127, 0.15); }
body.theme-gold .dash-act-btn.dash-card-delete {
    color: #a0352f;
    border-color: rgba(160, 53, 47, 0.4);
}

/* Collapse to stacked cards on narrow viewports — only for the
   tax-tool clients table (.dash-table). The /movers launches table
   (.mv-table) keeps its tabular layout and uses horizontal scroll
   inside the wrapper instead (see rule below this block). */
@media (max-width: 900px) {
    .dash-table-wrap:not(:has(.mv-table)) {
        background: transparent;
        border: none;
        overflow: visible;
    }
    /* Wrapper that contains the launches table: keep horizontal scroll
       so all 12 columns stay reachable on phones. */
    .dash-table-wrap:has(.mv-table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .dash-table-wrap:has(.mv-table) .mv-table {
        min-width: max-content;
    }
    .dash-table thead { display: none; }
    .dash-table,
    .dash-table tbody,
    .dash-table tr,
    .dash-table td {
        display: block;
        width: 100%;
    }
    .dash-table tr {
        border: 1px solid rgba(206, 186, 76, 0.25);
        border-radius: 0.4rem;
        padding: 0.65rem 0.8rem;
        margin-bottom: 0.6rem;
        background: rgba(13, 40, 73, 0.5);
    }
    body.theme-gold .dash-table tr {
        background: rgba(206, 186, 76, 0.1);
        border-color: rgba(13, 40, 73, 0.2);
    }
    .dash-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.28rem 0;
        border: none;
    }
    .dash-table td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: rgba(206, 186, 76, 0.7);
        font-weight: 600;
        flex-shrink: 0;
    }
    body.theme-gold .dash-table td::before {
        color: rgba(13, 40, 73, 0.7);
    }
    .dash-table td.dash-col-actions {
        justify-content: flex-end;
        gap: 0.4rem;
        padding-top: 0.5rem;
    }
    .dash-table td.dash-col-actions::before { display: none; }
    .dash-cell-name { max-width: 60vw; }
}

/* Status badges */
.dash-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dash-badge-new          { background: rgba(160, 160, 160, 0.2); color: #BDBDBD; }
.dash-badge-in_progress  { background: rgba(206, 186, 76, 0.2); color: #CEBA4C; }
.dash-badge-awaiting_review { background: rgba(52, 152, 219, 0.2); color: #5DADE2; }
.dash-badge-filed        { background: rgba(46, 204, 113, 0.2); color: #58D68D; }
.dash-badge-complete     { background: rgba(39, 174, 96, 0.25); color: #2ECC71; }
.dash-badge-on_hold      { background: rgba(231, 76, 60, 0.2); color: #E74C3C; }

/* Deadline indicator */
.dash-deadline {
    font-size: 0.75rem;
    padding: 0.12rem 0.4rem;
    border-radius: 0.2rem;
}
.dash-deadline-upcoming { color: rgba(242, 242, 242, 0.8); }
.dash-deadline-soon     { color: #E67E22; font-weight: 600; }
.dash-deadline-overdue  { color: #E74C3C; font-weight: 600; }

/* Activity feed */
.dash-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 30rem;
    overflow-y: auto;
}
.dash-activity-row {
    padding: 0.6rem 0.75rem;
    background: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 0.3rem;
    cursor: pointer;
    font-size: 0.82rem;
}
.dash-activity-row:hover { border-color: rgba(206, 186, 76, 0.5); }
body.theme-gold .dash-activity-row {
    background: rgba(206, 186, 76, 0.1);
    border-color: rgba(13, 40, 73, 0.2);
}
.dash-activity-row .aq-tool { font-weight: 600; color: #CEBA4C; }
body.theme-gold .dash-activity-row .aq-tool { color: #0D2849; }
.dash-activity-row .aq-sep { opacity: 0.5; padding: 0 0.25rem; }
.dash-activity-row .aq-client { color: #F2F2F2; }
body.theme-gold .dash-activity-row .aq-client { color: #0D2849; }
.dash-activity-row .aq-status-success { color: #2ECC71; }
.dash-activity-row .aq-status-failed  { color: #E74C3C; }
.dash-activity-row .aq-status-cancelled { color: #E67E22; }
.dash-activity-row .aq-time { float: right; opacity: 0.6; font-size: 0.75rem; }

/* Empty states */
.dash-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: rgba(242, 242, 242, 0.7);
    font-size: 0.9rem;
}
body.theme-gold .dash-empty { color: rgba(13, 40, 73, 0.7); }

/* Modal */
.dash-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.dash-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.dash-modal-body {
    position: relative;
    z-index: 1;
    background: rgba(13, 40, 73, 0.98);
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 0.5rem;
    max-width: 40rem;
    width: 100%;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
}
body.theme-gold .dash-modal-body {
    background: rgba(212, 175, 55, 0.98);
    border-color: rgba(13, 40, 73, 0.4);
}
.dash-modal-body h3 {
    margin: 0 0 1rem;
    color: #CEBA4C;
}
body.theme-gold .dash-modal-body h3 { color: #0D2849; }
.dash-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #CEBA4C;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
body.theme-gold .dash-modal-close { color: #0D2849; }
.dash-form { display: flex; flex-direction: column; gap: 0.75rem; }
.dash-form label {
    display: block;
    color: #CEBA4C;
    font-size: 0.85rem;
    font-weight: 500;
}
body.theme-gold .dash-form label { color: #0D2849; }
.dash-form input, .dash-form select, .dash-form textarea {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.7rem;
    background: rgba(13, 40, 73, 0.5);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 0.25rem;
    color: #F2F2F2;
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
}
body.theme-gold .dash-form input,
body.theme-gold .dash-form select,
body.theme-gold .dash-form textarea {
    background: rgba(206, 186, 76, 0.15);
    border-color: rgba(13, 40, 73, 0.3);
    color: #0D2849;
}
.dash-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.dash-form-hint {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: rgba(242, 242, 242, 0.65);
}
body.theme-gold .dash-form-hint { color: rgba(13, 40, 73, 0.7); }
.dash-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.dash-modal-actions .dash-btn-danger { margin-right: auto; }

.dash-fieldset {
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 6px;
    padding: 0.6rem 0.75rem 0.75rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
body.theme-gold .dash-fieldset { border-color: rgba(13, 40, 73, 0.3); }
.dash-fieldset legend {
    padding: 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #CEBA4C;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
body.theme-gold .dash-fieldset legend { color: #0D2849; }
.dash-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
    margin: 0 !important;
}
.dash-checkbox input[type="checkbox"] {
    width: auto !important;
    accent-color: #CEBA4C;
    flex-shrink: 0;
    margin: 0;
}
.dash-rule-row { align-items: end; gap: 0.75rem; }
.dash-rule-row input[type="number"] { max-width: 9rem; }

.dash-rule-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.dash-rule-row-editor {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.dash-rule-row-editor .vr-keyword {
    flex: 2 1 10rem;
    min-width: 0;
}
.dash-rule-row-editor .vr-category {
    flex: 1 1 8rem;
    min-width: 0;
}
.dash-rule-remove {
    border: none;
    background: transparent;
    color: #e0857f;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.35rem;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.dash-rule-remove:hover { background: rgba(224, 133, 127, 0.15); }
body.theme-gold .dash-rule-remove { color: #a0352f; }
.dash-rule-add {
    align-self: flex-start;
    margin-top: 0.35rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

/* Whale-only nav link: hidden by default, common-bundle JS adds
   body.is-whale when tier check passes to reveal it. */
.whale-only { display: none; }
body.is-whale .whale-only { display: inline-flex; }

/* Mobile */
@media (max-width: 900px) {
    .dash-main { flex-direction: column; }
    .dash-form-row { grid-template-columns: 1fr; }
}
