/* ==========================================================================
   ADMIN PANEL — SIDEBAR LAYOUT
   Full-screen dashboard separate from the main site layout.
   Loaded only on /admin — overrides style.css where needed.
   ========================================================================== */

/* Remove body texture & standard page flow */
body.admin-body {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
    overflow: hidden;
}

body.admin-body::before {
    display: none;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--forest-deep);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 200;
    transition: width 0.3s var(--ease-out), min-width 0.3s var(--ease-out);
    scrollbar-width: none;
}

.admin-sidebar::-webkit-scrollbar {
    display: none;
}

/* Collapsed: icon-only mode on desktop */
.admin-sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.admin-sidebar.collapsed .sidebar-brand-name,
.admin-sidebar.collapsed .sidebar-brand-sub {
    display: none;
}

/* Collapse hides text inside sidebar links */
.admin-sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem;
}

.admin-sidebar.collapsed .sidebar-link > span:not(.sidebar-icon) {
    display: none;
}

.admin-sidebar.collapsed .sidebar-footer .sidebar-link > span:not(:first-child) {
    display: none;
}

/* ----- Brand Area ----- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(250, 247, 242, 0.1);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    color: var(--wheat);
    line-height: 1;
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cream);
    line-height: 1.3;
    white-space: nowrap;
}

.sidebar-brand-sub {
    font-size: 0.68rem;
    color: var(--wheat-light);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.75;
    white-space: nowrap;
}

/* ----- Nav Links ----- */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    color: rgba(250, 247, 242, 0.65);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(250, 247, 242, 0.07);
    color: var(--cream);
    border-left-color: rgba(212, 168, 75, 0.4);
}

.sidebar-link.active {
    background: rgba(212, 168, 75, 0.12);
    color: var(--wheat-light);
    border-left-color: var(--wheat);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    line-height: 1;
}

/* ----- Sidebar Footer ----- */
.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(250, 247, 242, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--cream-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(27, 58, 47, 0.05);
    flex-shrink: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--stone);
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--cream);
    color: var(--forest);
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--forest);
    margin: 0;
    flex: 1;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: var(--stone);
    flex-shrink: 0;
}

.admin-badge {
    background: var(--wheat);
    color: var(--forest-deep);
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

/* ==========================================================================
   ADMIN SECTIONS (show/hide) — overrides style.css .admin-section card style
   ========================================================================== */
.admin-section {
    display: none;
    padding: 1.5rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    max-width: none;
    flex: 1;
}

.admin-section.active {
    display: block;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header-row h2 {
    font-size: 1.4rem;
    color: var(--forest);
    margin: 0;
}

/* ==========================================================================
   STATS GRID
   ========================================================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.astat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--forest);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.astat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.astat-card.astat-green {
    border-left-color: var(--meadow);
}

.astat-card.astat-gold {
    border-left-color: var(--wheat);
}

.astat-icon {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    line-height: 1;
}

.astat-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1;
}

.astat-label {
    font-size: 0.75rem;
    color: var(--stone-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ==========================================================================
   OVERVIEW GRID
   ========================================================================== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.overview-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.overview-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--cream-dark);
    color: var(--forest);
}

/* Recent Quotes rows */
.recent-quote-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--cream-dark);
    gap: 0.75rem;
}

.recent-quote-row:last-child {
    border-bottom: none;
}

.rq-address {
    display: block;
    font-size: 0.78rem;
    color: var(--stone-light);
    margin-top: 0.15rem;
}

/* Quick Links */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ql-btn {
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--forest);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.ql-btn:hover {
    background: var(--forest);
    color: white;
    border-color: var(--forest);
    transform: translateX(3px);
}

/* ==========================================================================
   RESPONSIVE — Tablet (sidebar collapses off-screen)
   ========================================================================== */
@media (max-width: 900px) {
    /* Sidebar slides off-screen when collapsed on mobile */
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 300;
        box-shadow: var(--shadow-lg);
        /* Start visible */
    }

    .admin-sidebar.collapsed {
        transform: translateX(-100%);
        width: 240px;
        min-width: 240px;
    }

    .admin-main {
        width: 100%;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-topbar {
        padding: 0.75rem 1rem;
    }

    .topbar-user span:not(.admin-badge) {
        display: none;
    }

    .admin-section {
        padding: 1rem;
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .astat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 400px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}




/* Scrollable full-height modal */


/* Payment info block inside modal */
.modal-payment-block {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-md, 12px);
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.modal-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--cream-dark);
    font-size: 0.92rem;
}

.modal-payment-row:last-child {
    border-bottom: none;
}

.modal-payment-row span:first-child {
    color: var(--stone-light);
}

.modal-payment-row span:last-child {
    font-weight: 600;
    color: var(--charcoal);
}

.modal-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--stone-light);
    margin: 1.25rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--cream-dark);
}

.form-row-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* ── Settings ── */
.settings-tabs {
    display: flex;
    border-bottom: 2px solid var(--cream-dark);
    margin: 1.25rem 0 1.5rem;
}

.settings-tab {
    background: none;
    border: none;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--stone-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.settings-tab:hover { color: var(--forest); }
.settings-tab.active { color: var(--forest); border-bottom-color: var(--forest); }

.settings-group {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.settings-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--forest);
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    align-items: center;
}

.settings-note {
    font-size: 0.85rem;
    color: var(--stone-light);
    margin: 0 0 1rem;
}

.settings-note code, .settings-note strong {
    background: var(--cream);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.82rem;
}

.settings-note strong {
    background: none;
    font-size: inherit;
    color: var(--charcoal);
}

/* Integration key rows */
.integration-key-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--cream-dark);
}

.integration-key-row:last-of-type { border-bottom: none; }

.integration-key-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--stone-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.key-field-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.key-field-wrap input {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    color: var(--charcoal);
    min-width: 0;
}

.key-btn {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--forest);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.key-btn:hover {
    background: var(--forest);
    color: white;
    border-color: var(--forest);
}

.integration-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--stone-light);
}

/* Config rows (Security tab) */
.config-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--cream-dark);
}

.config-row:last-child { border-bottom: none; }
.config-label { font-size: 0.9rem; color: var(--charcoal); }
.config-value { font-weight: 700; font-size: 0.9rem; color: var(--forest); }
.config-env {
    font-size: 0.72rem;
    color: var(--stone-light);
    background: var(--cream);
    padding: 0.15em 0.5em;
    border-radius: 4px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .integration-key-row {
        grid-template-columns: 1fr;
    }
    .settings-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
    }
}

/* ── Settings visual redesign ── */
.settings-header {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}

.settings-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--forest), var(--meadow));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.settings-header-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--forest);
    margin: 0 0 0.2rem;
    line-height: 1.1;
}

.settings-header-sub {
    font-size: 0.9rem;
    color: var(--stone-light);
    margin: 0;
}

.settings-tab-panel { }

/* Group header (icon bubble + title + desc) */
.settings-group-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cream-dark);
}

.settings-group-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.settings-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--forest);
    margin: 0 0 0.2rem;
}

.settings-group-desc {
    font-size: 0.84rem;
    color: var(--stone-light);
    margin: 0;
}

/* Fields grid */
.settings-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--stone-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-input {
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--cream);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-input:focus {
    outline: none;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(27,58,47,0.1);
    background: white;
}

.settings-group-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cream-dark);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Rate cards row */
.settings-rate-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rate-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem 1rem;
    text-align: center;
    border-top: 3px solid var(--forest);
}

.rate-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.rate-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--forest);
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.rate-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--stone-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Integration cards */
.settings-banner-note {
    background: rgba(27,58,47,0.06);
    border: 1px solid rgba(27,58,47,0.15);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: var(--forest);
    margin-bottom: 1.25rem;
}

.settings-banner-note code {
    background: rgba(27,58,47,0.1);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.8rem;
}

.integration-card-full {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.integration-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
}

.stripe-header {
    background: linear-gradient(135deg, #635bff 0%, #7c74ff 100%);
}

.fr-header {
    background: linear-gradient(135deg, var(--forest) 0%, var(--meadow) 100%);
}

.smtp-header {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
}

.mta-header {
    background: linear-gradient(135deg, #6a1b9a 0%, #ab47bc 100%);
}

.openai-header {
    background: linear-gradient(135deg, #10a37f 0%, #1a7f64 100%);
}

.everify-header {
    background: linear-gradient(135deg, #00695c 0%, #26a69a 100%);
}

.integration-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.integration-brand-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.integration-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.integration-brand-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}

.integration-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3em 0.85em;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    white-space: nowrap;
}

.integration-badge.badge-ok {
    background: rgba(255,255,255,0.3);
}

.integration-badge.badge-err {
    background: rgba(220,53,69,0.3);
}

.integration-keys {
    padding: 0.5rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.key-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--cream-dark);
}

.key-row:last-of-type { border-bottom: none; }

.key-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--stone-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.key-input {
    flex: 1;
    font-family: monospace;
    font-size: 0.82rem;
    background: #1a1a2e;
    color: #7fffb0;
    border: 1px solid #2d2d44;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    min-width: 0;
    outline: none;
}

.key-input::placeholder { color: #555; }

.key-btn-reveal,
.key-btn-copy {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--forest);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.key-btn-reveal:hover,
.key-btn-copy:hover {
    background: var(--forest);
    color: white;
    border-color: var(--forest);
}

.key-env-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px dashed var(--cream-dark);
    margin-top: 0.25rem;
}

.key-env-row code {
    font-size: 0.75rem;
    background: var(--cream);
    color: var(--stone-light);
    padding: 0.15em 0.5em;
    border-radius: 4px;
    border: 1px solid var(--cream-dark);
}

/* Security tab */
.settings-security-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Token display widget */
.token-display {
    background: linear-gradient(135deg, var(--forest), var(--meadow));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin: 0.25rem 0 1rem;
}

.token-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.token-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 700px) {
    .settings-rate-cards {
        grid-template-columns: 1fr 1fr;
    }
    .settings-field-row {
        grid-template-columns: 1fr;
    }
    .key-row {
        grid-template-columns: 1fr;
    }
    .settings-security-row {
        flex-direction: column;
    }
}

/* ── Employee section tabs ── */
.emp-tabs {
    display: flex;
    border-bottom: 2px solid var(--cream-dark);
    margin-bottom: 1.5rem;
}

.emp-tab {
    background: none;
    border: none;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--stone-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.emp-tab:hover { color: var(--forest); }
.emp-tab.active { color: var(--forest); border-bottom-color: var(--forest); }

/* ── Edit customer modal ── */
#editCustomerModal {
    align-items: flex-start;
    padding: 1rem;
    /* overlay scrolls if content taller than viewport */
    overflow-y: auto;
}

#editCustomerModal .modal-content {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    /* fill viewport minus overlay padding so body has room to scroll */
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    /* cancel the bounce animation that can cause overflow flicker */
    animation: none;
}

#editCustomerModal .modal-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* ── Quote Review Modal ── */
.qr-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.qr-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 680px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18); display: flex; flex-direction: column;
    max-height: 90vh; overflow: hidden;
}
.qr-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 28px; border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, var(--forest), var(--meadow));
}
.qr-title { margin: 0; color: #fff; font-size: 18px; font-weight: 700; }
.qr-close {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 50%; font-size: 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qr-close:hover { background: rgba(255,255,255,0.35); }
.qr-body { padding: 24px 28px; overflow-y: auto; flex: 1; }
.qr-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
}
.qr-full { grid-column: 1 / -1; }
.qr-info-item { display: flex; flex-direction: column; gap: 2px; }
.qr-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #999; }
.qr-value { font-size: 15px; color: #222; font-weight: 500; }
.qr-divider { border: none; border-top: 1px solid #eee; margin: 4px 0 20px; }
.qr-section-title { font-size: 13px; font-weight: 700; color: var(--forest); margin: 0 0 14px; text-transform: uppercase; letter-spacing: .05em; }
.qr-hint { font-weight: 400; color: #aaa; text-transform: none; letter-spacing: 0; }
.qr-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qr-field { display: flex; flex-direction: column; gap: 6px; }
.qr-approved-notice {
    margin-top: 18px; padding: 12px 16px; border-radius: 8px;
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
    font-size: 14px;
}
.qr-footer {
    padding: 16px 28px; border-top: 1px solid #eee;
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Crew Management ── */

/* New full-width 3-column card */
.crew-card2 {
    background: #fff;
    border: 1px solid #e4e8e0;
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.crew-card2:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

.crew-card2--inactive {
    opacity: 0.55;
}

.crew-card2-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1b3a2f 0%, #2d5a40 100%);
    color: #fff;
}

.crew-card2-title-block {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.crew-card2-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.crew-card2-id {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-family: monospace;
}

.crew-month-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 1px 9px;
    white-space: nowrap;
}

.crew-card2-header .status-badge {
    font-size: 11px;
}

.crew-card2-header .btn-outline {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    font-size: 12px;
}

.crew-card2-header .btn-outline:hover {
    background: rgba(255,255,255,0.22);
}

.crew-card2-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.crew-col2 {
    padding: 14px 18px;
    border-right: 1px solid #f0f0f0;
}

.crew-col2:last-child {
    border-right: none;
}

.crew-col2-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 10px;
}

.crew-col2-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.cc-row-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-row-sub {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
}

.cc-empty {
    font-size: 13px;
    color: #bbb;
    font-style: italic;
}

.cc-date-badge {
    font-size: 12px;
    font-weight: 700;
    color: #1b3a2f;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.crew-chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--forest);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.crew-chip--more {
    background: #e2e8f0;
    color: #555;
}

.crew-chip--sm {
    width: 24px;
    height: 24px;
    font-size: 9px;
    flex-shrink: 0;
}

.crew-chip--cust {
    background: #2563eb;
}

.crew-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.crew-member-row:last-child {
    border-bottom: none;
}

.btn-icon-danger {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}

.btn-icon-danger:hover {
    background: #fee2e2;
}

.btn-icon-sm {
    background: none;
    border: 1px solid #d1d5db;
    color: #555;
    cursor: pointer;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
    display: block;
}
.btn-icon-sm:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.btn-icon-sm:disabled {
    opacity: 0.3;
    cursor: default;
}

.cal-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.cal-dot-row {
    display: flex;
    align-items: center;
    margin-top: 3px;
    min-height: 10px;
}

/* ── Edit Customer Modal extras ── */
.ec-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ec-info-row { display: flex; flex-direction: column; gap: 3px; }
.admin-table-clickable tbody tr:hover { background: var(--cream-dark); }

/* ── Database Schema Tab ── */
.db-table-card {
    background: #fff; border: 1px solid #e4e8e0; border-radius: 12px;
    margin-bottom: 20px; overflow: hidden;
}
.db-table-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; background: var(--forest); color: #fff;
}
.db-table-name { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.db-row-count {
    font-size: 12px; background: rgba(255,255,255,0.18);
    padding: 2px 10px; border-radius: 20px;
}
.db-schema-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-schema-table thead th {
    background: #f4f6f1; padding: 7px 12px; text-align: left;
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: #666; font-weight: 600; border-bottom: 1px solid #e4e8e0;
}
.db-schema-table tbody tr { border-bottom: 1px solid #f0f2ee; }
.db-schema-table tbody tr:last-child { border-bottom: none; }
.db-schema-table tbody tr:hover { background: #f9fbf7; }
.db-schema-table td { padding: 6px 12px; vertical-align: middle; }
.db-col-pk { background: #fffbeb; }
.db-col-cid { color: #aaa; width: 30px; }
.db-col-name { font-weight: 600; color: #1a2e1a; }
.db-col-type { font-family: monospace; color: #6366f1; font-size: 12px; }
.db-col-flag { color: var(--forest); font-size: 13px; text-align: center; width: 60px; }
.db-col-default { font-family: monospace; font-size: 12px; color: #555; }
.db-null { color: #bbb; font-style: italic; }
.db-indexes {
    padding: 8px 14px; background: #f9fbf7;
    border-top: 1px solid #e8ece4; font-size: 12px; color: #666;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.db-index-badge {
    background: #e8ece4; color: #444; padding: 2px 8px;
    border-radius: 4px; font-family: monospace; font-size: 11px;
}
.db-index-unique { background: #dbeafe; color: #1d4ed8; }

.paychex-header {
    background: linear-gradient(135deg, #c62828 0%, #ef5350 100%);
}

/* ── Weekly Schedule Modal ── */
.ws-day-block {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.ws-day-header {
    background: #1b3a2f;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
}

.ws-map-container {
    height: 300px;
    margin: 0;
    border-top: 1px solid #e5e7eb;
    position: relative;
}


/* ── Print styles ── */
@media print {
    body > *:not(#weeklyScheduleModal) { display: none !important; }
    #weeklyScheduleModal {
        position: static !important;
        display: block !important;
        background: none !important;
    }
    #weeklyScheduleModal .qr-box {
        box-shadow: none !important;
        max-height: none !important;
        border: none !important;
        width: 100% !important;
    }
    #wsFooter { display: none !important; }
    .qr-close { display: none !important; }
    .ws-day-block { break-inside: avoid; margin-bottom: 32px; }
    .ws-map-container { height: 260px; }
    .leaflet-control-zoom { display: none !important; }
}
