:root {
    --tg-navbar-h: 56px;
    --tg-sidebar-w: 260px;
    --tg-sidebar-collapsed-w: 72px;
    --tg-sidebar-peek-w: 12px;
    --tg-navbar-bg: #0b1220;
    --tg-sidebar-bg: #0f172a;
    --tg-sidebar-fg: #f1f5f9;
    --tg-sidebar-fg-active: #ffffff;
    --tg-sidebar-icon: #bfdbfe;
    --tg-sidebar-hover-bg: rgba(255,255,255,0.14);
    --tg-sidebar-active-bg: rgba(37, 99, 235, 0.46);
    --tg-content-bg: #f4f6fb;
}

html, body { height: 100%; }

.tg-body {
    background: var(--tg-content-bg);
    padding-top: var(--tg-navbar-h);
}

/* ===== Navbar ===== */
.tg-navbar {
    height: var(--tg-navbar-h);
    background: var(--tg-navbar-bg);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
    z-index: 1040;
}

.tg-navbar .navbar-brand {
    color: #fff;
}

.tg-sidebar-toggle {
    padding: 0.25rem 0.5rem;
}
.tg-sidebar-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ===== Sidebar (desktop ≥ lg) ===== */
@media (min-width: 992px) {
    .tg-sidebar {
        position: fixed;
        top: var(--tg-navbar-h);
        left: 0;
        bottom: 0;
        width: var(--tg-sidebar-w);
        background-color: var(--tg-sidebar-bg) !important;
        color: var(--tg-sidebar-fg) !important;
        z-index: 1030;
        transition: width 0.2s ease;
        overflow-y: auto;
        border-right: 1px solid rgba(255,255,255,0.04);
    }
    .tg-main {
        margin-left: var(--tg-sidebar-w);
        transition: margin-left 0.2s ease;
    }
    /* Collapsed state on desktop keeps a usable icon rail. */
    .tg-sidebar-collapsed .tg-sidebar {
        width: var(--tg-sidebar-collapsed-w);
    }
    .tg-sidebar-collapsed .tg-main {
        margin-left: var(--tg-sidebar-collapsed-w);
    }
    .tg-sidebar-collapsed .tg-nav .nav-link,
    .tg-sidebar-collapsed .tg-nav .tg-nav-group {
        justify-content: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .tg-sidebar-collapsed .tg-nav .nav-link span,
    .tg-sidebar-collapsed .tg-nav .tg-nav-group span,
    .tg-sidebar-collapsed .tg-nav .tg-nav-chev,
    .tg-sidebar-collapsed .tg-nav-sub,
    .tg-sidebar-collapsed .tg-sidebar-footer {
        display: none !important;
    }
    /* No peek tab on desktop — toggle button is the affordance */
    .tg-sidebar-peek { display: none !important; }
}

/* ===== Sidebar (mobile < lg) — Bootstrap offcanvas handles open/close ===== */
@media (max-width: 991.98px) {
    .tg-sidebar {
        background-color: var(--tg-sidebar-bg) !important;
        color: var(--tg-sidebar-fg) !important;
        width: min(85vw, 320px);
    }
    .tg-sidebar .offcanvas-header {
        background: var(--tg-navbar-bg);
        color: #fff;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .tg-sidebar .offcanvas-header .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }
}

/* ===== The "peek" tab on mobile — visible at the left edge as an affordance ===== */
.tg-sidebar-peek {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: var(--tg-sidebar-peek-w);
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: var(--tg-sidebar-bg);
    color: var(--tg-sidebar-fg);
    z-index: 1035;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    font-size: 0.7rem;
}
.tg-sidebar-peek:hover,
.tg-sidebar-peek:focus-visible {
    background: var(--tg-sidebar-active-bg);
    color: var(--tg-sidebar-fg-active);
    outline: none;
}
.tg-sidebar-peek::after {
    content: "";
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent, rgba(13,110,253,0.6), transparent);
}

/* Keep the sidebar surface explicit because Bootstrap offcanvas supplies its own
   light background variables on some breakpoints. */
.tg-sidebar,
.tg-sidebar.offcanvas-lg,
.tg-sidebar .offcanvas-body {
    --bs-offcanvas-bg: var(--tg-sidebar-bg);
    --bs-offcanvas-color: var(--tg-sidebar-fg);
    background-color: var(--tg-sidebar-bg) !important;
    background-image: none !important;
    color: var(--tg-sidebar-fg) !important;
}

/* ===== Sidebar nav links ===== */
.tg-nav .nav-link,
.tg-nav .tg-nav-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--tg-sidebar-fg) !important;
    text-decoration: none;
    border-left: 3px solid transparent;
    background: transparent;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 1 !important;
}
.tg-nav .nav-link i,
.tg-nav .tg-nav-group i {
    width: 1.1rem;
    text-align: center;
    flex: 0 0 1.1rem;
    color: var(--tg-sidebar-icon);
    opacity: 1;
}
.tg-nav .nav-link:hover,
.tg-nav .tg-nav-group:hover {
    color: var(--tg-sidebar-fg-active) !important;
    background: var(--tg-sidebar-hover-bg);
}
.tg-nav .nav-link:hover i,
.tg-nav .tg-nav-group:hover i,
.tg-nav .nav-link.active i,
.tg-nav .tg-nav-group.active i {
    color: var(--tg-sidebar-fg-active);
}
.tg-nav .nav-link.active,
.tg-nav .tg-nav-group.active {
    color: var(--tg-sidebar-fg-active) !important;
    background: var(--tg-sidebar-active-bg);
    border-left-color: #0d6efd;
}
.tg-nav .tg-nav-sub .nav-link {
    padding-left: 2.75rem;
    font-size: 0.9rem;
}
.tg-nav .tg-nav-group[aria-expanded="true"] .tg-nav-chev {
    transform: rotate(180deg);
}
.tg-nav .tg-nav-chev {
    transition: transform 0.15s ease;
    font-size: 0.75rem;
    opacity: 0.85;
}

.tg-sidebar .offcanvas-body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.tg-sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
}

.tg-status-box {
    background: #172231;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    padding: 0.75rem;
}

.tg-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.55rem;
}

.tg-status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.tg-status-dot.ok { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14); }
.tg-status-dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14); }
.tg-status-dot.bad { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14); }

.tg-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.78rem;
    margin-top: 0.35rem;
}

.tg-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #e8eef7;
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 750;
}

.tg-status-pill.ok { background: #dcfce7; color: #166534; }
.tg-status-pill.info { background: #dbeafe; color: #1d4ed8; }
.tg-status-pill.warn { background: #fef3c7; color: #92400e; }
.tg-status-pill.bad { background: #fee2e2; color: #991b1b; }
.tg-status-pill.muted { background: #e2e8f0; color: #475569; }

/* ===== Main content surface ===== */
.tg-main {
    min-height: calc(100vh - var(--tg-navbar-h));
}

.tg-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 24, 48, 0.04);
}

.tg-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.tg-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
}
.tg-stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.1;
}
.tg-stat-value.tg-up { color: #198754; }
.tg-stat-value.tg-down { color: #dc3545; }

.tg-page-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.tg-page-title h1 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
}

.tg-datatable {
    display: grid;
    gap: 0;
}

.tg-datatable-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.85rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #dbe3ec;
    background: #f8fafc;
}

.tg-datatable-toolbar-primary,
.tg-datatable-toolbar-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.tg-datatable-toolbar-primary {
    flex: 1 1 320px;
}

.tg-datatable-toolbar-secondary {
    justify-content: flex-end;
    flex: 0 1 auto;
}

.tg-datatable-filter {
    width: clamp(220px, 32vw, 380px);
    min-width: 0;
}

.tg-datatable-filter .input-group-text {
    border-color: #d8e0ea;
    background: #fff;
    color: #64748b;
}

.tg-datatable-filter .form-control,
.tg-datatable-page-size .form-select,
.tg-datatable-page-size .input-group-text {
    border-color: #d8e0ea;
    font-size: 0.82rem;
}

.tg-datatable-page-size {
    width: auto;
    flex-wrap: nowrap;
    margin: 0;
}

.tg-datatable-page-size select {
    min-width: 4.4rem;
}

.tg-datatable-status {
    min-height: 1.8rem;
    align-items: center;
    padding-inline: 0.75rem;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
}

.tg-datatable-pager .btn,
.tg-datatable-pager [data-tg-page-label] {
    min-height: 2rem;
    border-color: #cfd8e3;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 750;
}

.tg-datatable-pager .btn:not([data-tg-page-label]) {
    width: 2.15rem;
}

.tg-datatable-pager [data-tg-page-label] {
    min-width: 6.7rem;
    background: #fff;
    opacity: 1;
}

.tg-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: inherit;
    gap: 0.35rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: inherit;
}

.tg-sort-button:hover,
.tg-sort-button:focus-visible,
.tg-sort-button.active {
    color: #0d6efd;
    outline: 0;
}

.tg-sort-button i {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-left: auto;
}

.tg-sort-button.active i {
    color: #0d6efd;
}

.tg-panel-head-auto {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.tg-panel-head-auto h1,
.tg-panel-head-auto h2,
.tg-panel-head-auto h3,
.tg-panel-head-auto h4,
.tg-panel-head-auto h5,
.tg-panel-head-auto h6 {
    margin-bottom: 0;
}

.tg-panel-auto-tools {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

.tg-panel-summary {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding-inline: 0.75rem;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
}

.blitz-panel-head .tg-panel-summary,
.insights-panel-head .tg-panel-summary,
.tg-panel-head-auto .tg-panel-summary {
    display: inline-flex;
    margin-top: 0;
}

.blitz-live-page {
    display: grid;
    gap: 1rem;
}

.blitz-live-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.blitz-live-title {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.blitz-live-title > i {
    margin-top: 0.2rem;
    font-size: 1.35rem;
}

.blitz-live-title h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
}

.blitz-live-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.82rem;
}

.blitz-live-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.blitz-runtime-notices {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
}

.blitz-runtime-notices-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 750;
}

.blitz-runtime-notices ul {
    margin: 0;
    padding-left: 1.05rem;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.35;
}

.blitz-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.blitz-kpi-grid .tg-card {
    min-height: 86px;
}

.blitz-kpi-grid small {
    color: #64748b;
    font-size: 0.78rem;
}

.blitz-manual-refresh {
    opacity: 0.82;
}

.blitz-live-status-row,
.blitz-panel-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.blitz-live-status-row .badge,
.blitz-panel-metrics .badge {
    min-height: 24px;
    align-items: center;
}

.blitz-panel-metrics .badge {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.32rem 0.68rem;
    font-size: 0.78rem;
    font-weight: 750;
}

.blitz-panel-metrics [data-blitz-count] {
    color: inherit;
    font-weight: 850;
}

.blitz-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.blitz-panel {
    border-radius: 8px;
    overflow: hidden;
}

.blitz-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #dbe3ec;
}

.blitz-panel-title {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.blitz-panel-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.blitz-panel-toggle {
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #fff;
}

.blitz-panel-toggle i {
    display: inline-block;
    margin: 0;
    transition: transform 0.15s ease;
}

.blitz-panel-toggle[aria-expanded="false"] i {
    transform: rotate(180deg);
}

.blitz-panel-head h2 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 750;
}

.blitz-panel-subtitle,
.blitz-panel-head > div:not(.blitz-panel-tools) > span:not(.badge) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.8rem;
}

.blitz-table {
    --bs-table-bg: transparent;
    font-size: 0.86rem;
}

.blitz-table thead th {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    border-bottom-color: #dbe3ec;
}

.blitz-table tbody td {
    vertical-align: middle;
    border-bottom-color: #edf1f6;
}

.blitz-row-qualified {
    background: #f7fbff;
}

.blitz-rank {
    font-weight: 800;
    color: #0f172a;
}

.blitz-rank-delta {
    display: inline-block;
    min-width: 1.6rem;
    margin-left: 0.25rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.blitz-rank-delta.up {
    color: #15803d;
}

.blitz-rank-delta.down {
    color: #b91c1c;
}

.blitz-symbol-sub {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 0.76rem;
}

.tg-otp-input {
    letter-spacing: 0.5em;
    font-size: 1.5rem;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tg-login-shell {
    min-height: calc(100vh - var(--tg-navbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.tg-login-card {
    width: 100%;
    max-width: 420px;
}

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

.news-header h1 {
    font-size: 1.45rem;
    line-height: 1.2;
    font-weight: 650;
    margin: 0;
}

.news-meta-row,
.news-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #5f6b7a;
    font-size: 0.82rem;
    margin-top: 0.4rem;
}

.news-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.news-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: #e8eef7;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 750;
}

.news-chip.ok { background: #dcfce7; color: #166534; }
.news-chip.warn { background: #fef3c7; color: #92400e; }
.news-chip.active { background: #e7f0ff; color: #145ba6; }
.news-chip.muted { background: #eef2f7; color: #64748b; }

.news-card {
    background: #fff;
    border: 1px solid #d5dde7;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 24, 48, 0.04);
}

.news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #d8e0ea;
}

.news-tab {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    font-weight: 650;
    padding: 0.55rem 0.85rem;
}

.news-tab.active {
    background: #eef5ff;
    color: #0b5cad;
    box-shadow: inset 0 0 0 1px #d2e4ff;
}

.news-tab:disabled {
    opacity: 0.75;
}

.news-tab-count {
    margin-left: 0.35rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #dbe8f6;
    font-size: 0.72rem;
}

.news-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #d8e0ea;
}

.news-section-head h2 {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}

.news-empty {
    display: grid;
    gap: 0.25rem;
    color: #64748b;
    text-align: center;
    padding: 3rem 1rem;
}

.news-empty strong {
    color: #1e293b;
}

.news-feed {
    padding: 1rem;
}

.news-feed-row {
    display: grid;
    grid-template-columns: 3rem 11rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #d8e0ea;
    border-bottom: 0;
}

.news-feed-row:first-child {
    border-radius: 10px 10px 0 0;
}

.news-feed-row:last-child {
    border-bottom: 1px solid #d8e0ea;
    border-radius: 0 0 10px 10px;
}

.news-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: #edf5ff;
    color: #145ba6;
    font-weight: 800;
    font-size: 0.84rem;
}

.news-symbol {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.news-symbol strong {
    color: #0f172a;
}

.news-symbol span,
.news-row-meta {
    color: #5f6b7a;
    font-size: 0.78rem;
}

.news-body {
    min-width: 0;
}

.news-body p {
    margin: 0;
    color: #0f172a;
}

@media (max-width: 767.98px) {
    .tg-datatable-toolbar {
        align-items: stretch;
    }

    .tg-datatable-toolbar-primary,
    .tg-datatable-toolbar-secondary,
    .tg-datatable-filter {
        width: 100%;
    }

    .tg-datatable-page-size,
    .tg-datatable-pager,
    .tg-panel-auto-tools,
    .blitz-panel-tools {
        justify-content: flex-start;
    }

    .tg-panel-head-auto {
        flex-direction: column;
        align-items: stretch;
    }

    .blitz-live-header {
        flex-direction: column;
    }

    .blitz-live-actions {
        justify-content: flex-start;
    }

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

    .blitz-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .blitz-symbol-sub {
        max-width: 11rem;
    }

    .news-header {
        flex-direction: column;
    }

    .news-actions {
        justify-content: flex-start;
    }

    .news-feed-row {
        grid-template-columns: 2.4rem minmax(0, 1fr);
    }

    .news-symbol {
        grid-column: 2;
    }

    .news-body {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .blitz-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

.blitz-settings-page {
    max-width: 1320px;
    margin: 0 auto;
}

.blitz-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -0.25rem -0.25rem 1rem;
    padding: 0.25rem 0.25rem 1rem;
    border-bottom: 1px solid #d8e0ea;
}

.blitz-settings-header h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 650;
    color: #1d2838;
}

.blitz-settings-header p {
    margin: 0.35rem 0 0;
    color: #667085;
    font-size: 0.9rem;
}

.blitz-settings-shell {
    display: grid;
    grid-template-columns: 208px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.blitz-settings-nav,
.blitz-settings-section {
    background: #fff;
    border: 1px solid #d5dde7;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 24, 48, 0.04);
}

.blitz-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem;
}

.blitz-settings-nav span {
    padding: 0.35rem 0.45rem 0.5rem;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.blitz-settings-nav button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1d2838;
    font-weight: 650;
    text-align: left;
    padding: 0.75rem 0.75rem;
}

.blitz-settings-nav button:hover,
.blitz-settings-nav button:focus-visible {
    background: #eef5ff;
    color: #0b5cad;
    outline: 0;
}

.blitz-settings-nav button.active {
    background: #e7f0ff;
    color: #145ba6;
}

.blitz-settings-section {
    min-height: 390px;
    padding: 1rem;
}

.blitz-settings-section[hidden] {
    display: none;
}

.blitz-settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #d8e0ea;
    padding: 0 0 0.75rem;
    margin-bottom: 0.85rem;
}

.blitz-settings-section-head strong {
    color: #111827;
    font-size: 1rem;
}

.blitz-settings-section-head span {
    color: #5f6b7a;
    font-size: 0.86rem;
    text-align: right;
}

.blitz-settings-subhead {
    margin: 1rem 0 0.75rem;
    padding-top: 0.9rem;
    border-top: 1px solid #edf1f5;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.blitz-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 0.9rem;
}

.blitz-setting-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.blitz-setting-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    color: #5f6b7a;
    font-size: 0.74rem;
    font-weight: 750;
    text-transform: uppercase;
}

.blitz-setting-field input:not([type="checkbox"]),
.blitz-setting-field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d2dce8;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    padding: 0.45rem 0.7rem;
    font-size: 0.92rem;
}

.blitz-setting-field input:focus,
.blitz-setting-field select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: 0;
}

.blitz-toggle-field {
    min-height: 61px;
    justify-content: center;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid #d2dce8;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
}

.blitz-toggle-field input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.blitz-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border: 1px solid #c6d3e1;
    border-radius: 999px;
    background: #fff;
    color: #6b7787;
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;
    padding: 0;
}

.blitz-setting-field small {
    color: #667085;
    font-size: 0.8rem;
}

.blitz-settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border: 1px solid #d5dde7;
    border-radius: 8px;
}

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

@media (max-width: 767.98px) {
    .blitz-settings-header {
        flex-direction: column;
    }

    .blitz-settings-shell {
        grid-template-columns: 1fr;
    }

    .blitz-settings-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .blitz-settings-nav span {
        display: none;
    }

    .blitz-settings-nav button {
        white-space: nowrap;
    }

    .blitz-settings-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .blitz-settings-section-head span {
        text-align: left;
    }

    .blitz-settings-grid {
        grid-template-columns: 1fr;
    }

    .blitz-settings-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Touch-friendly tap targets on mobile */
@media (max-width: 991.98px) {
    .tg-nav .nav-link,
    .tg-nav .tg-nav-group {
        padding: 0.85rem 1rem;
    }
}

/* ===== Blitz Insights ===== */
.insights-page {
    display: grid;
    gap: 1rem;
}

.insights-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.insights-title {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.insights-title > i {
    margin-top: 0.2rem;
    font-size: 1.35rem;
}

.insights-title h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
}

.insights-title p {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
    max-width: 760px;
}

.insights-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.insights-export-panel {
    display: grid;
    gap: 0;
}

.insights-export-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(140px, 0.55fr) minmax(180px, 0.65fr) auto;
    align-items: end;
    gap: 0.85rem;
}

.insights-export-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.insights-export-field span,
.insights-export-check span {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 750;
}

.insights-export-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    margin: 0;
}

.insights-export-submit {
    min-height: 38px;
    white-space: nowrap;
}

.insights-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.insights-status-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 8px;
}

.insights-status-kicker {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.insights-status-card strong {
    color: #1e293b;
    font-size: 1rem;
}

.insights-status-card p {
    min-height: 3.6rem;
    margin: 0;
    color: #475569;
    font-size: 0.86rem;
}

.insights-panel {
    padding: 1rem;
    border-radius: 8px;
}

.insights-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.insights-panel-head h2 {
    margin: 0;
    color: #1e293b;
    font-size: 0.98rem;
    font-weight: 750;
}

.insights-panel-head span {
    display: block;
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.8rem;
}

.insights-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.insights-flow-step {
    display: grid;
    gap: 0.35rem;
    min-height: 150px;
    padding: 0.85rem;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #f8fafc;
}

.insights-flow-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
}

.insights-flow-step strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.insights-flow-step p {
    margin: 0;
    color: #475569;
    font-size: 0.82rem;
}

.insights-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

.insights-table th {
    color: #64748b;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.insights-table td {
    color: #334155;
}

.insights-checklist {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.insights-checklist li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.insights-checklist li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.insights-checklist .badge {
    flex: 0 0 auto;
}

.insights-checklist strong {
    color: #1e293b;
    font-size: 0.9rem;
}

.insights-checklist p {
    margin: 0.2rem 0 0;
    color: #475569;
    font-size: 0.82rem;
}

.insights-guardrails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.insights-guardrails span {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-height: 58px;
    padding: 0.75rem;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 0.84rem;
}

.insights-guardrails i {
    margin-top: 0.1rem;
    flex: 0 0 auto;
}

@media (max-width: 1199.98px) {
    .insights-export-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights-summary-grid,
    .insights-flow,
    .insights-guardrails {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .insights-header {
        flex-direction: column;
    }

    .insights-header-actions {
        justify-content: flex-start;
    }

    .insights-summary-grid,
    .insights-export-form,
    .insights-flow,
    .insights-guardrails {
        grid-template-columns: 1fr;
    }

    .insights-status-card p,
    .insights-flow-step {
        min-height: auto;
    }
}
