:root {
    --bg-main: #f3f5f9;
    --bg-main-alt: #edf1f7;
    --bg-canvas: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.94);
    --bg-panel-strong: rgba(255, 255, 255, 0.98);
    --bg-sidebar: linear-gradient(180deg, #ffffff 0%, #fbfcfe 56%, #f5f7fb 100%);
    --bg-soft: #f5f7fb;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-soft: #475569;

    --accent: #2563eb;
    --accent-2: #1d4ed8;
    --accent-hover: #1e40af;
    --accent-glow: rgba(37, 99, 235, 0.12);
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-border: rgba(37, 99, 235, 0.16);

    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --neutral: #64748b;

    --border: rgba(15, 23, 42, 0.08);
    --border-soft: rgba(15, 23, 42, 0.05);
    --border-strong: rgba(37, 99, 235, 0.12);

    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.03), 0 12px 28px rgba(15, 23, 42, 0.05);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-main);
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.05), transparent 22%),
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fafc 0%, #f3f5f9 42%, #eef2f7 100%);
    color: var(--text-main);
    line-height: 1.45;
}

a {
    text-decoration: none;
}

h1, h2, h3 {
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 268px;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    padding: 22px 16px;
    box-shadow:
        inset -1px 0 0 rgba(255,255,255,0.7),
        12px 0 30px rgba(15, 23, 42, 0.04);
    position: relative;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.04), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.35), transparent 18%);
    pointer-events: none;
}

.brand {
    position: relative;
    z-index: 1;
}

.brand h1 {
    margin: 0;
    font-size: 26px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1;
}

.brand p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.2;
}

.nav {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.nav a {
    color: #334155;
    padding: 11px 12px;
    border-radius: 12px;
    transition: 0.18s ease;
    background: transparent;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
}

.nav a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.08);
    transform: translateX(1px);
}

.nav a.active {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
    color: #0f172a;
    font-weight: 700;
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 18px rgba(15, 23, 42, 0.04);
}

.logout-link {
    margin-top: 12px;
    color: #dc2626 !important;
}

.main-content {
    flex: 1;
    padding: 22px 24px 28px;
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.04), transparent 18%),
        radial-gradient(circle at 58% 12%, rgba(148, 163, 184, 0.07), transparent 22%),
        linear-gradient(180deg, #f8fafc 0%, #f3f5f9 50%, #eef2f7 100%);
}

.topbar {
    margin-bottom: 18px;
}

.topbar h2 {
    margin: 0;
    font-size: 28px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.08;
}

.subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.page-content {
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 252, 255, 0.98) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.metric-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.metric-card h3 {
    margin: 0;
    font-size: 26px;
    color: #0f172a;
    line-height: 1.1;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 252, 255, 0.98) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 15px;
}

.clean-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.clean-list li {
    margin-bottom: 8px;
}

.action-grid {
    display: grid;
    gap: 10px;
}

.action-btn {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2b7fff 0%, #2563eb 100%);
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    border: 1px solid rgba(37, 99, 235, 0.16);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16), inset 0 1px 0 rgba(255,255,255,0.16);
    transition: 0.18s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255,255,255,0.18);
    filter: brightness(1.02);
}

.login-page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top center, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(148, 163, 184, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
}

.login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.login-brand h1 {
    margin: 0;
    color: #0f172a;
    font-size: 30px;
    font-weight: 800;
}

.login-brand p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    font-size: 14px;
    transition: 0.16s ease;
}

.form-group input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.btn-primary {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #2b7fff 0%, #2563eb 100%);
    color: white;
    cursor: pointer;
    transition: 0.18s ease;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.14), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.login-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.flash-wrap {
    margin-bottom: 14px;
}

.standalone-flash {
    width: 100%;
    max-width: 500px;
    margin-bottom: 14px;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.flash-error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.flash-success {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.14);
    color: #166534;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--text-main);
    font-size: 13px;
}

.data-table th {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(248, 250, 252, 0.7);
}

.checklist-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.checklist-score-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checklist-progress-box {
    min-width: 140px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.checklist-store-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
}

.checklist-store-btn {
    display: flex;
    align-items: end;
}

.checklist-items {
    display: grid;
    gap: 12px;
}

.checklist-item-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.checklist-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #0f172a;
    cursor: pointer;
}

.checklist-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.task-meta {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.accordion-section {
    padding: 0;
    overflow: hidden;
    margin-bottom: 16px;
}

.accordion-summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.accordion-summary::-webkit-details-marker {
    display: none;
}

.accordion-summary::after {
    content: "▾";
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 8px;
}

.accordion-section[open] .accordion-summary::after {
    content: "▴";
}

.accordion-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.accordion-title {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.accordion-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.accordion-count,
.accordion-percent {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.integrity-pill {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: none;
}

.accordion-body {
    padding: 0 18px 18px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.accordion-body .checklist-items {
    margin-top: 14px;
}

.summary-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-pill {
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

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

    .main-content {
        padding: 18px 16px 22px;
    }

    .accordion-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .accordion-meta {
        margin-left: 0;
    }

    .checklist-score-grid {
        width: 100%;
    }

    .checklist-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .checklist-store-row {
        grid-template-columns: 1fr;
    }

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

.readonly-badge {
    display: inline-block;
    margin-top: 8px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.16);
    color: #92400e;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-main);
}

.history-item:hover {
    border-color: rgba(37, 99, 235, 0.16);
}

.history-date {
    font-weight: 700;
    color: #0f172a;
    font-size: 13px;
}

.history-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.history-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    font-size: 12px;
    color: var(--text-soft);
}

.autosave-status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.area-subtitle {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.table-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 56px;
    text-align: center;
}

.badge-success {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.14);
    color: #166534;
}

.badge-warning {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.14);
    color: #92400e;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-completed {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.14);
    color: #166534;
}

.status-progress {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.14);
    color: #92400e;
}

.status-not-started {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
}

.success-pill {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.14);
    color: #166534;
}

.warning-pill {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.14);
    color: #92400e;
}

.neutral-pill {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
}

.inline-metric {
    font-weight: 700;
    color: var(--text-main);
}

.success-text {
    color: #15803d;
}

.danger-text {
    color: #b91c1c;
}

.admin-task-list {
    display: grid;
    gap: 12px;
}

.admin-task-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 12px;
    transition: border 0.18s ease, transform 0.14s ease;
}

.admin-task-card:hover {
    border-color: rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.admin-task-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-task-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-check-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.command-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248, 250, 252, 0.98) 50%, rgba(244, 247, 251, 0.98) 100%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    padding: 18px 20px;
}

.command-bar-left {
    max-width: 760px;
}

.command-eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #2563eb;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.command-title {
    margin: 0 0 6px 0;
    font-size: 26px;
    line-height: 1.05;
    color: #0f172a;
    font-weight: 800;
}

.command-subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.command-bar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.command-chip {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #334155;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.dashboard-grid-premium {
    margin-bottom: 18px;
}

.premium-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    border: 1px solid rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(10px);
}

.premium-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: rgba(148, 163, 184, 0.36);
}

.premium-card-blue::before {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.14);
}

.premium-card-alert::before {
    background: var(--danger);
}

.metric-footnote {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.premium-panel {
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    backdrop-filter: blur(10px);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.summary-pills-large {
    gap: 10px;
}

.area-panel {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.area-header-premium {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.area-header-right {
    display: flex;
    align-items: center;
}

.premium-table-wrap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

.premium-table thead th {
    background: rgba(248, 250, 252, 0.96);
}

.store-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-main {
    font-weight: 700;
    color: #0f172a;
}

.store-sub {
    font-size: 11px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .command-bar {
        flex-direction: column;
    }

    .command-bar-right {
        justify-content: flex-start;
    }

    .command-title {
        font-size: 24px;
    }
}

.exceptions-grid {
    grid-template-columns: repeat(3, 1fr);
}

.exception-panel {
    min-height: 150px;
}

.exception-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exception-chip {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .exceptions-grid {
        grid-template-columns: 1fr;
    }
}

.heatmap-panel {
    overflow: hidden;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
}

.heatmap-tile {
    border-radius: 16px;
    padding: 12px;
    min-height: 98px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 18px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(8px);
}

.tile-green {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(220, 252, 231, 0.96));
}

.tile-yellow {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.96));
}

.tile-red {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(254, 226, 226, 0.96));
}

.tile-gray {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
}

.heatmap-store {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.heatmap-area {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.heatmap-metrics {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #334155;
}

.heatmap-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.legend-chip {
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.legend-green {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.14);
    color: #166534;
}

.legend-yellow {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.14);
    color: #92400e;
}

.legend-red {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.legend-gray {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
}

textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    font-size: 14px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.full-span {
    grid-column: 1 / -1;
}

.svr-value-list {
    display: grid;
    gap: 12px;
}

.svr-value-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 12px;
}

.svr-value-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.svr-value-text {
    color: var(--text-main);
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 13px;
}

.svr-export-block {
    display: grid;
    gap: 10px;
}

.svr-export-row {
    color: var(--text-main);
    font-size: 13px;
}

.svr-divider {
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    margin: 4px 0;
}

.svr-export-section {
    display: grid;
    gap: 5px;
}

.svr-export-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.svr-export-text {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 11px;
    white-space: pre-wrap;
    line-height: 1.45;
    color: var(--text-main);
    font-size: 13px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-danger:hover {
    background: #b91c1c;
}

.compact-grid {
    gap: 8px;
    margin-bottom: 6px;
}

.compact-group {
    gap: 3px;
    margin-bottom: 6px;
}

.compact-actions {
    gap: 10px;
}

.admin-task-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.form-group {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 10px 11px;
}

/* ------------------------------
   Mobile nav / sidebar polish
------------------------------ */

.topbar-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mobile-nav-toggle,
.mobile-nav-close {
    display: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.mobile-nav-toggle:hover,
.mobile-nav-close:hover {
    background: rgba(37, 99, 235, 0.05);
}

.mobile-sidebar-overlay {
    display: none;
}

.brand-mobile-row {
    display: block;
}

@media (max-width: 800px) {
    .mobile-nav-toggle {
        display: inline-flex;
    }

    .mobile-nav-close {
        display: inline-flex;
    }

    .brand-mobile-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .layout {
        position: relative;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(82vw, 320px);
        z-index: 60;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        overflow-y: auto;
        padding: 20px 16px 24px 16px;
    }

    .mobile-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.26);
        backdrop-filter: blur(4px);
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-nav-open .mobile-sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        width: 100%;
        min-width: 0;
    }

    .nav {
        margin-top: 22px;
    }

    .nav a {
        padding: 13px 12px;
        font-size: 14px;
    }

    .topbar-left {
        width: 100%;
        align-items: flex-start;
    }

    .topbar h2 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 12px;
    }
}

/* ------------------------------
   Dashboard store click-through
------------------------------ */

.heatmap-link {
    display: block;
    color: inherit;
}

.heatmap-link:hover .heatmap-tile {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.04);
    border-color: rgba(37, 99, 235, 0.12);
}

.heatmap-link .heatmap-tile {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
}

.clickable-row {
    cursor: pointer;
    transition: background 0.16s ease;
}

.clickable-row:hover {
    background: rgba(37, 99, 235, 0.04);
}

.clickable-row td {
    position: relative;
}

/* ------------------------------
   Maintenance dashboard cleanup
------------------------------ */

.maintenance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maintenance-content-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

@media (max-width: 1100px) {
    .maintenance-metric-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar nav regroup fix */
.nav {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.nav-section + .nav-section {
    margin-top: 18px;
}

.nav-section-label {
    display: block;
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 4px;
    margin-bottom: 2px;
}

.nav-section a {
    display: block;
    width: 100%;
}

.nav-section-bottom {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* ------------------------------
   Admin Page Layout Fix
------------------------------ */

.admin-page {
    display: grid;
    gap: 18px;
}

.admin-page .content-grid {
    grid-template-columns: 1fr !important;
}

.admin-page .panel {
    padding: 18px;
}

.admin-task-grid {
    gap: 14px;
    margin-bottom: 10px;
}

.form-group input,
.form-group select,
textarea {
    padding: 11px 12px;
}

.compact-actions {
    display: flex;
    justify-content: flex-end;
}

.panel-head {
    margin-bottom: 14px;
}

/* =========================================================
   Manager Checklist Mobile Cleanup
========================================================= */

.mobile-checklist-page {
    display: grid;
    gap: 0;
}

.mobile-checklist-hero {
    padding: 18px;
}

.mobile-checklist-layout {
    align-items: start;
}

.checklist-panel-head-mobile {
    margin-bottom: 12px;
}

.mobile-checklist-load-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mobile-full-btn {
    width: 100%;
}

.checklist-section-card {
    border-radius: 18px;
    overflow: hidden;
}

.checklist-section-summary {
    padding: 16px 18px;
}

.checklist-section-title {
    font-size: 18px;
}

.mobile-checklist-items {
    gap: 12px;
}

.mobile-checklist-card {
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-checklist-item-main {
    display: grid;
    gap: 7px;
}

.mobile-checklist-checkbox-row {
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.35;
}

.mobile-checklist-checkbox-row input[type="checkbox"] {
    width: 21px;
    height: 21px;
    margin-top: 2px;
    flex-shrink: 0;
}

.checklist-task-text {
    display: block;
    flex: 1;
    word-break: break-word;
}

.mobile-note-group input {
    min-height: 44px;
}

.mobile-history-panel {
    position: sticky;
    top: 18px;
}

.mobile-history-list {
    gap: 8px;
}

.mobile-history-item {
    border-radius: 14px;
    padding: 12px 14px;
}

.autosave-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.96);
    font-weight: 700;
    font-size: 12px;
}

.autosave-ready {
    color: #64748b;
}

.autosave-saving {
    color: #1d4ed8;
}

.autosave-saved {
    color: #15803d;
}

.autosave-failed {
    color: #b91c1c;
}

.mobile-sticky-save {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    margin-top: 16px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

@media (max-width: 1100px) {
    .mobile-history-panel {
        position: static;
    }
}

@media (max-width: 800px) {
    .mobile-checklist-hero {
        padding: 16px;
    }

    .checklist-topbar-mobile {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .checklist-score-grid-mobile {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .mobile-score-box {
        min-width: 0;
        width: 100%;
        text-align: left;
        padding: 12px 14px;
    }

    .mobile-checklist-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mobile-checklist-load-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mobile-checklist-info-panel,
    .mobile-checklist-load-panel {
        padding: 16px;
    }

    .mobile-accordion-section {
        margin-bottom: 16px;
    }

    .mobile-accordion-summary {
        padding: 14px 16px;
        align-items: flex-start;
        gap: 10px;
    }

    .checklist-section-title-wrap {
        width: 100%;
    }

    .checklist-section-meta {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .mobile-accordion-body {
        padding: 0 14px 14px 14px;
    }

    .mobile-checklist-card {
        padding: 13px;
    }

    .mobile-checklist-checkbox-row {
        font-size: 15px;
    }

    .mobile-note-group label {
        font-size: 12px;
    }

    .mobile-history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-metrics {
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
    }

    .mobile-sticky-save {
        bottom: 8px;
        padding: 8px;
    }

    .checklist-save-btn {
        min-height: 46px;
        font-size: 15px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.24);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.34);
}
/* =========================================================
   LIGHT THEME PATCH FIXES
   Fix pages that still inherited dark-theme text logic
========================================================= */

body,
.page-content,
.panel,
.premium-panel,
.metric-card,
.checklist-item-card,
.admin-task-card,
.history-item,
.svr-value-card,
.svr-export-text,
.mobile-checklist-card,
.accordion-summary,
.accordion-body,
.command-bar,
.premium-table-wrap,
.heatmap-tile {
    color: var(--text-main);
}

/* General text cleanup */
p,
label,
small,
strong,
em,
li,
td,
th,
div,
span {
    color: inherit;
}

/* Form controls */
input,
select,
textarea {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

/* Checkboxes / radios */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #2563eb;
}

/* Settings / admin table text that went ghosted */
.data-table td,
.data-table th,
.data-table td *,
.data-table th *,
.table-wrap,
.premium-table,
.premium-table * {
    color: var(--text-main) !important;
}

.data-table th {
    color: var(--text-muted) !important;
}

/* Panel subtitles and helper text */
.subtitle,
.area-subtitle,
.command-subtitle,
.metric-footnote,
.history-sub,
.task-meta,
.login-note,
.svr-value-label,
.svr-export-label,
.nav-section-label,
.brand p {
    color: var(--text-muted) !important;
}

/* Pills / chips */
.summary-pill,
.command-chip,
.accordion-count,
.accordion-percent,
.table-badge,
.status-badge,
.exception-chip,
.legend-chip {
    color: var(--text-soft) !important;
}

/* Preserve status colors */
.badge-success,
.status-completed,
.success-pill,
.legend-green {
    color: #166534 !important;
}

.badge-warning,
.status-progress,
.warning-pill,
.legend-yellow {
    color: #92400e !important;
}

.badge-danger,
.legend-red {
    color: #991b1b !important;
}

.badge-neutral,
.status-not-started,
.neutral-pill,
.legend-gray {
    color: #475569 !important;
}

/* SVR template rows */
.admin-task-card,
.checklist-item-card,
.svr-value-card {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Nightly settings page visibility fix */
.panel table,
.panel table *,
.premium-panel table,
.premium-panel table * {
    color: var(--text-main) !important;
}

/* Toggle / collapsed headers */
.panel-head h3,
.command-title,
.topbar h2,
h1, h2, h3, h4 {
    color: #0f172a !important;
}

/* Sidebar cleanup */
.sidebar,
.sidebar * {
    color: inherit;
}

.brand h1 {
    color: #0f172a !important;
}

.nav a {
    color: #334155 !important;
}

.nav a.active {
    color: #0f172a !important;
}

/* White-on-white prevention for weird inherited classes */
.text-white,
.text-light,
.text-muted-light {
    color: var(--text-main) !important;
}
/* =========================================================
   TRUEOPS GLOBAL TIGHTEN PATCH
   Paste at the very bottom of your REAL main CSS file
========================================================= */

.panel {
    padding: 14px 16px;
    border-radius: 14px;
}

.command-title {
    font-size: 20px;
    margin-bottom: 2px;
}

.command-subtitle {
    font-size: 12.5px;
    color: #64748b;
}

.command-chip {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 999px;
}

.panel-head h3 {
    font-size: 14px;
    margin: 0;
}

.area-subtitle {
    font-size: 11px;
}

.content-grid {
    gap: 14px;
}

.btn-primary,
.btn-danger {
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 8px;
}

input,
select,
textarea {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.form-group label {
    font-size: 11px;
    margin-bottom: 4px;
}

.summary-pill {
    font-size: 11px;
    padding: 4px 8px;
}

.admin-task-grid {
    gap: 10px;
}

.users-inline-row {
    min-height: 48px;
}

.users-inline-cell {
    padding: 6px 8px;
}

.users-inline-input,
.users-inline-select {
    min-height: 32px;
    font-size: 12.5px;
}

.users-inline-name {
    font-size: 13px;
}

.users-inline-sub {
    font-size: 11px;
}

.store-airtable-cell,
.nightly-airtable-cell,
.svr-row,
.checklist-task-card {
    padding-top: 6px;
    padding-bottom: 6px;
}

.store-inline-input,
.nightly-inline-input,
.field-key-input,
.field-label-input,
.field-sort-input,
.task-text-input,
.task-expected-input,
.task-sort-input {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12.5px;
}

.store-airtable-head-cell,
.nightly-airtable-head-cell,
.users-inline-head-cell {
    padding: 9px 10px;
    font-size: 11px;
}

.checklist-admin-toolbar {
    padding: 8px 10px;
}

.checklist-admin-stat,
.checklist-admin-chip {
    font-size: 11px;
    padding: 5px 9px;
}

.company-card-summary {
    padding: 14px;
}

.company-card-body {
    padding: 14px;
}

.company-name-main {
    font-size: 14px;
}

.company-name-sub {
    font-size: 11px;
}

.command-bar {
    padding: 16px 18px;
}

.metric-card,
.premium-card,
.panel,
.premium-panel {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.heatmap-tile {
    min-height: 88px;
    padding: 10px;
}

.heatmap-store {
    font-size: 16px;
}

.heatmap-metrics {
    font-size: 10.5px;
}

.data-table th,
.data-table td {
    padding: 9px 10px;
}

@media (max-width: 900px) {
    .command-title {
        font-size: 18px;
    }

    .panel {
        padding: 12px 13px;
    }

    .company-card-summary,
    .company-card-body,
    .command-bar {
        padding: 12px;
    }
}

/* =========================================================
   TRUEOPS MOBILE PREMIUM PASS
   Final mobile-only overrides for tighter, app-like feel
========================================================= */

@media (max-width: 800px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

    body {
        background:
            radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.045), transparent 24%),
            linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    }

    .layout {
        display: block;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .main-content {
        padding: 12px 10px 88px !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .page-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .topbar {
        margin: -2px 0 12px !important;
        padding: 10px 10px 11px;
        border: 1px solid rgba(15, 23, 42, 0.06);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.86);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
        position: sticky;
        top: 8px;
        z-index: 35;
    }

    .topbar-left {
        gap: 10px;
        align-items: flex-start;
        min-width: 0;
    }

    .mobile-nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        background: #ffffff;
        border-color: rgba(15, 23, 42, 0.08);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
        transform: translateY(1px);
    }

    .topbar h2 {
        font-size: 21px !important;
        line-height: 1.04;
        letter-spacing: -0.045em;
        max-width: calc(100vw - 86px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .subtitle {
        margin-top: 5px;
        font-size: 11.5px !important;
        line-height: 1.25;
        gap: 6px !important;
    }

    .subtitle form,
    .subtitle select {
        width: 100%;
        max-width: 100%;
    }

    .subtitle select {
        min-width: 0 !important;
        height: 34px;
        font-size: 12px;
        padding: 6px 9px !important;
    }

    .sidebar {
        width: min(86vw, 330px) !important;
        padding: 14px 12px 18px !important;
        border-right: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 22px 0 60px rgba(15, 23, 42, 0.18);
        transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
    }

    .brand-mobile-row {
        padding: 8px 6px 10px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
        margin-bottom: 8px;
    }

    .brand-mobile-row img {
        width: 34px !important;
        height: 34px !important;
        border-radius: 10px !important;
    }

    .brand h1 {
        font-size: 17px !important;
    }

    .brand p {
        font-size: 11px !important;
        margin-top: 2px !important;
    }

    .mobile-nav-close {
        width: 36px;
        height: 36px;
        border-radius: 13px;
    }

    .mobile-sidebar-overlay {
        background: rgba(15, 23, 42, 0.34);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .nav {
        margin-top: 8px !important;
        gap: 2px;
    }

    .nav-section {
        margin-bottom: 10px;
    }

    .nav-section-label {
        font-size: 10px !important;
        letter-spacing: .12em;
        padding: 8px 8px 4px;
    }

    .nav a {
        min-height: 42px;
        display: flex;
        align-items: center;
        padding: 10px 11px !important;
        border-radius: 14px !important;
        font-size: 13.5px !important;
        margin-bottom: 2px;
    }

    .nav a.active {
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.86),
            0 8px 18px rgba(37,99,235,.08) !important;
    }

    .dashboard-grid,
    .dashboard-grid-premium,
    .content-grid,
    .admin-task-grid,
    .maintenance-content-grid,
    .mobile-checklist-layout {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    .panel,
    .premium-panel,
    .metric-card,
    .premium-card,
    .command-bar,
    .area-panel,
    .heatmap-panel,
    .exception-panel,
    .checklist-item-card,
    .admin-task-card,
    .svr-value-card {
        border-radius: 17px !important;
        padding: 12px !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05) !important;
        border-color: rgba(15, 23, 42, 0.07) !important;
    }

    .panel + .panel,
    .premium-panel + .premium-panel {
        margin-top: 10px;
    }

    .panel-head {
        gap: 8px !important;
        margin-bottom: 10px !important;
        align-items: flex-start !important;
        flex-wrap: wrap;
    }

    .panel-head h3,
    .command-title {
        font-size: 15px !important;
        line-height: 1.12;
    }

    .area-subtitle,
    .command-subtitle,
    .metric-footnote {
        font-size: 11.5px !important;
        line-height: 1.28;
    }

    .metric-card h3 {
        font-size: 24px !important;
    }

    .metric-label {
        font-size: 10px !important;
        margin-bottom: 5px !important;
    }

    .summary-pill,
    .table-badge,
    .status-badge,
    .command-chip,
    .exception-chip {
        font-size: 10.5px !important;
        padding: 4px 8px !important;
        border-radius: 999px !important;
        line-height: 1.1;
    }

    .action-btn,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    button[type="submit"] {
        min-height: 40px;
        border-radius: 13px !important;
        font-size: 13px !important;
        font-weight: 750;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .action-grid .action-btn,
    .panel > .btn-primary,
    form > .btn-primary {
        width: 100%;
    }

    .form-group {
        gap: 5px !important;
        margin-bottom: 10px !important;
    }

    .form-group label {
        font-size: 11px !important;
        font-weight: 750;
        color: #475569 !important;
    }

    input,
    select,
    textarea {
        width: 100%;
        min-height: 42px;
        border-radius: 13px !important;
        font-size: 14px !important;
        padding: 9px 11px !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
    }

    textarea {
        min-height: 94px;
        line-height: 1.35;
    }

    input[type="file"] {
        min-height: 40px;
        padding: 8px !important;
        font-size: 12px !important;
    }

    .data-table,
    .premium-table {
        min-width: 720px;
    }

    .table-wrap,
    .premium-table-wrap,
    .panel:has(table),
    .premium-panel:has(table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td,
    .premium-table th,
    .premium-table td {
        padding: 8px 9px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .svr-value-list {
        display: grid;
        gap: 9px;
    }

    .svr-value-card {
        padding: 11px !important;
    }

    .svr-value-label {
        font-size: 10.5px !important;
        letter-spacing: .08em;
        text-transform: uppercase;
        margin-bottom: 5px;
    }

    .svr-value-text {
        font-size: 13px !important;
        line-height: 1.36;
    }

    .svr-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .svr-photo-grid img {
        height: 96px !important;
        border-radius: 13px !important;
    }

    .flash-wrap {
        margin-bottom: 10px;
    }

    .flash {
        border-radius: 14px;
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 520px) {
    .main-content {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .topbar {
        top: 6px;
        padding: 9px 9px 10px;
        border-radius: 16px;
    }

    .topbar h2 {
        font-size: 19px !important;
    }

    .subtitle {
        font-size: 10.75px !important;
    }

    .panel,
    .premium-panel,
    .metric-card,
    .premium-card,
    .command-bar,
    .svr-value-card {
        padding: 11px !important;
        border-radius: 16px !important;
    }

    .dashboard-grid {
        gap: 8px !important;
    }

    .metric-card {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 10px;
    }

    .metric-card h3 {
        font-size: 22px !important;
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .metric-footnote {
        margin-top: 2px;
    }

    .content-grid {
        gap: 8px !important;
    }

    .svr-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .heatmap-tile {
        min-height: 76px !important;
    }

    .heatmap-store {
        font-size: 15px !important;
    }
}


/* =========================================================
   TRUEOPS MOBILE BOTTOM NAV
========================================================= */

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 800px) {
    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 7px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow:
            0 18px 45px rgba(15, 23, 42, 0.16),
            inset 0 1px 0 rgba(255,255,255,.9);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        min-width: 0;
        height: 48px;
        border: 0;
        border-radius: 17px;
        background: transparent;
        color: #64748b;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-family: inherit;
        cursor: pointer;
        text-decoration: none;
        touch-action: manipulation;
    }

    .mobile-bottom-nav span {
        font-size: 17px;
        line-height: 1;
    }

    .mobile-bottom-nav small {
        font-size: 10px;
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1;
    }

    .mobile-bottom-nav a.active {
        background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
        color: #1d4ed8;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.86);
    }

    .mobile-bottom-nav button:active,
    .mobile-bottom-nav a:active {
        transform: scale(.97);
    }
}

@media (max-width: 390px) {
    .mobile-bottom-nav {
        left: 6px;
        right: 6px;
        bottom: 7px;
        padding: 6px;
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        height: 45px;
        border-radius: 15px;
    }

    .mobile-bottom-nav small {
        font-size: 9.5px;
    }
}



/* =========================================================
   TRUEOPS SVR MOBILE CARDS
========================================================= */

.svr-mobile-report-list {
    display: none;
}

.svr-photo-pill {
    background: rgba(37, 99, 235, 0.1) !important;
    border: 1px solid rgba(37, 99, 235, 0.18) !important;
    color: #1d4ed8 !important;
}

@media (max-width: 800px) {
    .svr-desktop-report-table-wrap {
        display: none;
    }

    .svr-mobile-report-list {
        display: grid;
        gap: 10px;
        margin-top: 10px;
    }

    .svr-mobile-report-card {
        background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
        border: 1px solid rgba(15, 23, 42, 0.07);
        border-radius: 17px;
        padding: 12px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .svr-mobile-report-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }

    .svr-mobile-store {
        font-size: 16px;
        font-weight: 850;
        color: #0f172a;
        letter-spacing: -0.035em;
        line-height: 1.05;
    }

    .svr-mobile-date {
        margin-top: 3px;
        font-size: 11.5px;
        font-weight: 700;
        color: #64748b;
    }

    .svr-mobile-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 11px;
    }

    .svr-mobile-meta div {
        background: rgba(241, 245, 249, 0.74);
        border: 1px solid rgba(15, 23, 42, 0.055);
        border-radius: 13px;
        padding: 8px 9px;
        min-width: 0;
    }

    .svr-mobile-meta span {
        display: block;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: #64748b;
        margin-bottom: 3px;
    }

    .svr-mobile-meta strong {
        display: block;
        font-size: 12.5px;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .svr-mobile-actions {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        align-items: stretch;
    }

    .svr-mobile-actions .action-btn {
        width: 100%;
        min-height: 40px;
    }

    .svr-mobile-actions form {
        margin: 0;
    }

    .svr-mobile-actions .btn-danger {
        min-width: 86px;
        height: 40px;
        background: rgba(127, 29, 29, 0.92);
        color: #fee2e2;
        border: 0;
    }
}

@media (max-width: 420px) {
    .svr-mobile-meta {
        grid-template-columns: 1fr;
    }

    .svr-mobile-actions {
        grid-template-columns: 1fr;
    }

    .svr-mobile-actions .btn-danger {
        width: 100%;
    }
}


/* =========================================================
   TrueOps UI Polish — BPI Ops-style tighter shell
   Safe override layer only
   ========================================================= */

:root {
    --bg-main: #f4f6f8;
    --bg-main-alt: #eef2f6;
    --bg-panel: rgba(255, 255, 255, 0.98);
    --bg-panel-strong: #ffffff;
    --bg-sidebar: #ffffff;

    --text-main: #101827;
    --text-muted: #64748b;
    --text-soft: #475569;

    --accent: #2563eb;
    --accent-2: #1d4ed8;

    --border: rgba(15, 23, 42, 0.09);
    --border-soft: rgba(15, 23, 42, 0.075);
    --border-strong: rgba(15, 23, 42, 0.14);

    --shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
    --shadow-soft: 0 7px 18px rgba(15, 23, 42, 0.055);

    --radius: 15px;
    --radius-sm: 10px;
}

body {
    background: #f4f6f8;
    color: var(--text-main);
}

.layout {
    background: #f4f6f8;
}

/* Sidebar — cleaner, flatter, more like BPI Ops */
.sidebar {
    width: 258px;
    padding: 18px 13px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 22px rgba(15, 23, 42, 0.035);
}

.sidebar::before {
    display: none;
}

.brand {
    padding: 8px 8px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.065);
}

.brand img {
    height: 34px !important;
    width: 34px !important;
    border-radius: 9px !important;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.brand h1 {
    font-size: 19px !important;
    font-weight: 850;
    letter-spacing: -0.045em;
}

.brand p {
    margin-top: 2px !important;
    font-size: 11px !important;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: #64748b;
}

.nav {
    margin-top: 14px;
    gap: 12px;
}

.nav-section {
    display: grid;
    gap: 3px;
}

.nav-section-label {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.105em;
    text-transform: uppercase;
    color: #94a3b8;
}

.nav a {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
}

.nav a:hover {
    transform: none;
    background: #f6f8fb;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.07);
}

.nav a.active {
    background: #eef4ff;
    color: #123b88;
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: none;
}

.logout-link {
    color: #b91c1c !important;
    background: #fff5f5 !important;
    border-color: rgba(220, 38, 38, 0.12) !important;
}

/* Main area */
.main-content {
    padding: 16px 18px 24px;
    background: #f4f6f8;
}

.topbar {
    margin-bottom: 14px;
    padding: 10px 2px 4px;
}

.topbar h2 {
    font-size: 25px;
    font-weight: 875;
    letter-spacing: -0.055em;
}

.subtitle {
    margin-top: 5px;
    font-size: 12.5px;
    color: #64748b;
}

.page-content {
    max-width: 1500px;
    margin: 0 auto;
}

/* Command bar */
.command-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 17px !important;
    margin-bottom: 16px !important;
}

.command-eyebrow {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.command-title {
    margin: 0;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.command-subtitle {
    margin: 5px 0 0;
    max-width: 760px;
    color: #64748b;
    font-size: 13px;
}

.command-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.command-chip,
.summary-pill,
.exception-chip,
.legend-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: -0.01em;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
    color: #334155;
}

/* Panels/cards — tighter and sharper */
.panel,
.metric-card,
.premium-panel {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
}

.panel {
    padding: 15px;
}

.panel:hover,
.metric-card:hover,
.premium-panel:hover {
    border-color: var(--border-strong);
}

.panel-head {
    margin-bottom: 10px;
}

.panel-head h3,
.panel h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 875;
    letter-spacing: -0.025em;
}

.area-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.dashboard-grid {
    gap: 11px;
    margin-bottom: 14px;
}

.content-grid {
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    padding: 13px 14px;
    min-height: 86px;
}

.metric-label {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.105em;
}

.metric-card h3 {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

/* Heat map — tighter screenshot-friendly tiles */
.heatmap-panel {
    padding: 15px !important;
}

.heatmap-grid {
    gap: 8px !important;
}

.heatmap-tile {
    min-height: 76px;
    padding: 10px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.heatmap-store {
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: -0.04em;
}

.heatmap-area {
    font-size: 10px !important;
    font-weight: 800;
    opacity: 0.78;
}

.heatmap-metrics {
    margin-top: 6px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.heatmap-metrics span {
    font-size: 10px !important;
    font-weight: 850;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.62);
}

/* Status colors */
.success-pill,
.badge-success {
    background: #ecfdf5 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.warning-pill,
.badge-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

.danger-pill,
.badge-danger {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.neutral-pill {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

/* Forms/buttons/tables */
button,
.btn,
.action-btn,
input[type="submit"] {
    border-radius: 10px;
    font-weight: 850;
}

.action-btn {
    padding: 10px 12px;
    border-radius: 11px;
    background: #111827;
    border-color: #111827;
    box-shadow: none;
}

.action-btn:hover {
    transform: none;
    background: #1f2937;
    box-shadow: none;
}

input,
select,
textarea {
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.13);
    box-shadow: none;
}

table {
    font-size: 12.5px;
}

th {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: #f8fafc;
}

th,
td {
    padding: 8px 10px;
}

/* Flash messages */
.flash-wrap {
    margin-bottom: 12px;
}

.flash {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 750;
}

/* Mobile polish */
.mobile-nav-toggle,
.mobile-nav-close {
    border-radius: 10px;
}

.mobile-bottom-nav {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

@media (max-width: 980px) {
    .main-content {
        padding: 13px 13px 78px;
    }

    .command-bar {
        flex-direction: column;
    }

    .command-bar-right {
        justify-content: flex-start;
    }

    .dashboard-grid,
    .content-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar h2 {
        font-size: 22px;
    }
}

@media (min-width: 981px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 15;
        background: rgba(244, 246, 248, 0.92);
        backdrop-filter: blur(12px);
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}


/* =========================================================
   TrueOps UI Polish — BPI Ops-style tighter shell
   Safe override layer only
   ========================================================= */

:root {
    --bg-main: #f4f6f8;
    --bg-main-alt: #eef2f6;
    --bg-panel: rgba(255, 255, 255, 0.98);
    --bg-panel-strong: #ffffff;
    --bg-sidebar: #ffffff;

    --text-main: #101827;
    --text-muted: #64748b;
    --text-soft: #475569;

    --accent: #2563eb;
    --accent-2: #1d4ed8;

    --border: rgba(15, 23, 42, 0.09);
    --border-soft: rgba(15, 23, 42, 0.075);
    --border-strong: rgba(15, 23, 42, 0.14);

    --shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
    --shadow-soft: 0 7px 18px rgba(15, 23, 42, 0.055);

    --radius: 15px;
    --radius-sm: 10px;
}

body {
    background: #f4f6f8;
    color: var(--text-main);
}

.layout {
    background: #f4f6f8;
}

/* Sidebar — cleaner, flatter, more like BPI Ops */
.sidebar {
    width: 258px;
    padding: 18px 13px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 22px rgba(15, 23, 42, 0.035);
}

.sidebar::before {
    display: none;
}

.brand {
    padding: 8px 8px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.065);
}

.brand img {
    height: 34px !important;
    width: 34px !important;
    border-radius: 9px !important;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.brand h1 {
    font-size: 19px !important;
    font-weight: 850;
    letter-spacing: -0.045em;
}

.brand p {
    margin-top: 2px !important;
    font-size: 11px !important;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: #64748b;
}

.nav {
    margin-top: 14px;
    gap: 12px;
}

.nav-section {
    display: grid;
    gap: 3px;
}

.nav-section-label {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.105em;
    text-transform: uppercase;
    color: #94a3b8;
}

.nav a {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
}

.nav a:hover {
    transform: none;
    background: #f6f8fb;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.07);
}

.nav a.active {
    background: #eef4ff;
    color: #123b88;
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: none;
}

.logout-link {
    color: #b91c1c !important;
    background: #fff5f5 !important;
    border-color: rgba(220, 38, 38, 0.12) !important;
}

/* Main area */
.main-content {
    padding: 16px 18px 24px;
    background: #f4f6f8;
}

.topbar {
    margin-bottom: 14px;
    padding: 10px 2px 4px;
}

.topbar h2 {
    font-size: 25px;
    font-weight: 875;
    letter-spacing: -0.055em;
}

.subtitle {
    margin-top: 5px;
    font-size: 12.5px;
    color: #64748b;
}

.page-content {
    max-width: 1500px;
    margin: 0 auto;
}

/* Command bar */
.command-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 17px !important;
    margin-bottom: 16px !important;
}

.command-eyebrow {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.command-title {
    margin: 0;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.command-subtitle {
    margin: 5px 0 0;
    max-width: 760px;
    color: #64748b;
    font-size: 13px;
}

.command-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.command-chip,
.summary-pill,
.exception-chip,
.legend-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: -0.01em;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
    color: #334155;
}

/* Panels/cards — tighter and sharper */
.panel,
.metric-card,
.premium-panel {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
}

.panel {
    padding: 15px;
}

.panel:hover,
.metric-card:hover,
.premium-panel:hover {
    border-color: var(--border-strong);
}

.panel-head {
    margin-bottom: 10px;
}

.panel-head h3,
.panel h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 875;
    letter-spacing: -0.025em;
}

.area-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.dashboard-grid {
    gap: 11px;
    margin-bottom: 14px;
}

.content-grid {
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    padding: 13px 14px;
    min-height: 86px;
}

.metric-label {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.105em;
}

.metric-card h3 {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

/* Heat map — tighter screenshot-friendly tiles */
.heatmap-panel {
    padding: 15px !important;
}

.heatmap-grid {
    gap: 8px !important;
}

.heatmap-tile {
    min-height: 76px;
    padding: 10px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.heatmap-store {
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: -0.04em;
}

.heatmap-area {
    font-size: 10px !important;
    font-weight: 800;
    opacity: 0.78;
}

.heatmap-metrics {
    margin-top: 6px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.heatmap-metrics span {
    font-size: 10px !important;
    font-weight: 850;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.62);
}

/* Status colors */
.success-pill,
.badge-success {
    background: #ecfdf5 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.warning-pill,
.badge-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

.danger-pill,
.badge-danger {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.neutral-pill {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

/* Forms/buttons/tables */
button,
.btn,
.action-btn,
input[type="submit"] {
    border-radius: 10px;
    font-weight: 850;
}

.action-btn {
    padding: 10px 12px;
    border-radius: 11px;
    background: #111827;
    border-color: #111827;
    box-shadow: none;
}

.action-btn:hover {
    transform: none;
    background: #1f2937;
    box-shadow: none;
}

input,
select,
textarea {
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.13);
    box-shadow: none;
}

table {
    font-size: 12.5px;
}

th {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: #f8fafc;
}

th,
td {
    padding: 8px 10px;
}

/* Flash messages */
.flash-wrap {
    margin-bottom: 12px;
}

.flash {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 750;
}

/* Mobile polish */
.mobile-nav-toggle,
.mobile-nav-close {
    border-radius: 10px;
}

.mobile-bottom-nav {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

@media (max-width: 980px) {
    .main-content {
        padding: 13px 13px 78px;
    }

    .command-bar {
        flex-direction: column;
    }

    .command-bar-right {
        justify-content: flex-start;
    }

    .dashboard-grid,
    .content-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar h2 {
        font-size: 22px;
    }
}

@media (min-width: 981px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 15;
        background: rgba(244, 246, 248, 0.92);
        backdrop-filter: blur(12px);
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}


/* =========================================================
   Independent sidebar + content scrolling
   ========================================================= */

html,
body {
    height: 100%;
    overflow: hidden;
}

.layout {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.sidebar {
    flex: 0 0 258px;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.main-content {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Keeps the topbar visible while scrolling the main content */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(244, 246, 248, 0.94);
    backdrop-filter: blur(12px);
}

/* Cleaner sidebar scrollbar */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.24);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.38);
    border: 3px solid transparent;
    background-clip: padding-box;
}

/* Mobile should scroll normally */
@media (max-width: 980px) {
    html,
    body {
        height: auto;
        overflow: auto;
    }

    .layout {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar {
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }

    .main-content {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .topbar {
        position: relative;
        top: auto;
    }
}


/* =========================================================
   Sidebar cleanup — tighter BPI Ops style
   ========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Brand block */
.brand {
    margin: 0 0 8px;
    padding: 7px 7px 13px;
}

.brand-mobile-row {
    min-height: 52px;
}

.brand h1 {
    font-size: 18px !important;
}

.brand p {
    font-size: 10.5px !important;
    text-transform: uppercase;
    letter-spacing: 0.065em;
}

/* Navigation structure */
.nav {
    flex: 1;
    margin-top: 8px;
    gap: 14px;
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-section-label {
    padding: 7px 9px 3px;
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.13em;
    color: #94a3b8;
}

/* Cleaner nav links */
.nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 33px;
    padding: 7px 10px 7px 12px;
    border-radius: 9px;
    font-size: 12.75px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #475569;
    background: transparent;
    border: 1px solid transparent;
    line-height: 1.15;
}

/* Small left rail marker */
.nav a::before {
    content: "";
    width: 3px;
    height: 16px;
    border-radius: 999px;
    background: transparent;
    margin-right: 8px;
    flex: 0 0 auto;
}

.nav a:hover {
    background: #f7f9fc;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.06);
}

.nav a:hover::before {
    background: #cbd5e1;
}

.nav a.active {
    background: #eef4ff;
    color: #153e90;
    border-color: rgba(37, 99, 235, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

.nav a.active::before {
    background: #2563eb;
}

/* Separate admin area a little more cleanly */
.nav-section + .nav-section {
    padding-top: 4px;
    border-top: 1px solid rgba(15, 23, 42, 0.055);
}

/* Keep logout at bottom when sidebar has room */
.nav-section-bottom {
    margin-top: auto;
    padding-top: 10px !important;
    border-top: 1px solid rgba(15, 23, 42, 0.075) !important;
}

.logout-link {
    justify-content: center;
    color: #b91c1c !important;
    background: #fff7f7 !important;
    border-color: rgba(220, 38, 38, 0.12) !important;
}

.logout-link::before {
    display: none;
}

.logout-link:hover {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* Sidebar scroll position feels cleaner */
.sidebar {
    scrollbar-gutter: stable;
}

/* Make mobile close button less ugly */
.mobile-nav-close {
    min-height: 30px;
    width: 30px;
    padding: 0 !important;
    display: none;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #475569;
    box-shadow: none;
}

/* Mobile sidebar */
@media (max-width: 980px) {
    .sidebar {
        width: min(286px, 86vw);
        flex-basis: auto;
        padding: 14px 11px;
    }

    .mobile-nav-close {
        display: inline-flex;
    }

    .brand {
        padding-bottom: 12px;
    }

    .nav a {
        min-height: 38px;
        font-size: 13.5px;
    }

    .nav-section-label {
        font-size: 10px;
    }
}


/* =========================================================
   Admin gear menu — BPI Ops-style
   ========================================================= */

.topbar-left {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.topbar-title-block {
    min-width: 0;
}

.company-pill {
    background: #eef4ff !important;
    border-color: rgba(37, 99, 235, 0.16) !important;
    color: #1e3a8a !important;
}

.company-switcher-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.company-switcher-select {
    min-width: 180px;
    max-width: 240px;
    height: 32px;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 750;
    background: #ffffff;
}

.admin-gear-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.admin-gear-menu summary {
    list-style: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.055);
    transition: 0.16s ease;
}

.admin-gear-menu summary::-webkit-details-marker {
    display: none;
}

.admin-gear-menu summary:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, 0.20);
}

.admin-gear-icon {
    font-size: 18px;
    line-height: 1;
}

.admin-gear-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    z-index: 60;
    width: 245px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.admin-gear-label {
    padding: 8px 9px 7px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-gear-dropdown a {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.015em;
    border: 1px solid transparent;
}

.admin-gear-dropdown a:hover {
    background: #f7f9fc;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.06);
}

.admin-gear-dropdown a.active {
    background: #eef4ff;
    color: #153e90;
    border-color: rgba(37, 99, 235, 0.16);
}

@media (max-width: 980px) {
    .topbar-left {
        align-items: flex-start;
    }

    .admin-gear-menu {
        margin-top: 2px;
    }

    .admin-gear-dropdown {
        right: 0;
        width: min(260px, 84vw);
    }

    .company-switcher-select {
        max-width: 190px;
    }
}


/* =========================================================
   Account / logout menu in top-right gear
   ========================================================= */

.account-menu .admin-gear-dropdown {
    width: 255px;
}

.admin-gear-user {
    padding: 9px 10px 10px;
    margin-bottom: 5px;
    border-radius: 11px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.admin-gear-user strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.admin-gear-user span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.admin-gear-divider {
    height: 1px;
    margin: 7px 2px;
    background: rgba(15, 23, 42, 0.08);
}

.admin-gear-dropdown .gear-logout-link {
    color: #b91c1c;
    background: #fff7f7;
    border-color: rgba(220, 38, 38, 0.12);
}

.admin-gear-dropdown .gear-logout-link:hover {
    color: #991b1b;
    background: #fee2e2;
    border-color: rgba(220, 38, 38, 0.18);
}

/* Since logout moved out of sidebar */
.nav-section-bottom {
    display: none !important;
}

/* Mobile top-right menu stays usable */
@media (max-width: 980px) {
    .account-menu {
        margin-left: auto;
    }

    .account-menu .admin-gear-dropdown {
        right: 0;
        width: min(270px, 86vw);
        max-height: calc(100vh - 88px);
        overflow-y: auto;
    }

    .admin-gear-menu summary {
        width: 40px;
        height: 40px;
    }
}


/* =========================================================
   Separate logout button next to admin gear
   ========================================================= */

.topbar-logout-btn {
    flex: 0 0 auto;
    height: 38px;
    min-width: 78px;
    padding: 0 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7f7;
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.15);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.045);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.topbar-logout-btn:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.24);
}

/* Hide old dropdown logout styling if it exists from prior pass */
.gear-logout-link,
.admin-gear-divider {
    display: none !important;
}

@media (max-width: 980px) {
    .topbar-logout-btn {
        height: 40px;
        min-width: auto;
        padding: 0 11px;
        font-size: 12.5px;
    }

    .topbar-left {
        gap: 8px;
    }
}


/* =========================================================
   Quick Actions cleanup — make them match the new UI
   ========================================================= */

.action-grid {
    display: grid;
    gap: 8px;
}

/* Turn old chunky buttons into clean action rows */
.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 11px 9px 13px;
    border-radius: 12px;
    background: #f8fafc;
    color: #172033;
    border: 1px solid rgba(15, 23, 42, 0.075);
    box-shadow: none;
    text-align: left;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: -0.015em;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

/* Little arrow on the right */
.action-btn::after {
    content: "›";
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    background: #ffffff;
    color: #64748b;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.action-btn:hover {
    background: #eef4ff;
    color: #123b88;
    border-color: rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
    box-shadow: none;
    filter: none;
}

.action-btn:hover::after {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.18);
}

/* If quick actions sit inside a panel, make spacing cleaner */
.panel .action-grid {
    margin-top: 6px;
}

/* Optional: make panels with only quick actions feel less bulky */
.panel:has(.action-grid) {
    padding: 14px;
}

/* Mobile: keep them thumb-friendly but not huge */
@media (max-width: 980px) {
    .action-btn {
        min-height: 44px;
        font-size: 13.25px;
    }
}
