/* TechWeb SLA – minimal theme on top of Bootstrap 5.3 */

:root {
    --sla-bg: #f5f6f8;
    --sla-surface: #ffffff;
    --sla-border: #e6e8ec;
    --sla-text: #1f2328;
    --sla-muted: #6b7280;
    --sla-primary: #2457d6;
    --sla-primary-soft: #eaf0ff;
    --sla-sidebar-width: 248px;

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--sla-text);
    --bs-primary: var(--sla-primary);
    --bs-primary-rgb: 36, 87, 214;
    --bs-link-color: var(--sla-primary);
    --bs-link-color-rgb: 36, 87, 214;
    --bs-border-color: var(--sla-border);
    --bs-border-radius: .5rem;

    /* Charts (validated palette: blue / orange, blue / red) */
    --viz-1: #2a78d6;
    --viz-2: #eb6834;
    --viz-new: #2a78d6;
    --viz-churn: #e34948;
    --viz-ink: #1f2328;
    --viz-muted: #6b7280;
    --viz-grid: #e6e8ec;
    --viz-surface: #ffffff;
}

.btn-primary {
    --bs-btn-bg: var(--sla-primary);
    --bs-btn-border-color: var(--sla-primary);
    --bs-btn-hover-bg: #1c47b3;
    --bs-btn-hover-border-color: #1c47b3;
    --bs-btn-active-bg: #183d9a;
    --bs-btn-active-border-color: #183d9a;
}

.btn-outline-primary {
    --bs-btn-color: var(--sla-primary);
    --bs-btn-border-color: var(--sla-primary);
    --bs-btn-hover-bg: var(--sla-primary);
    --bs-btn-hover-border-color: var(--sla-primary);
    --bs-btn-active-bg: var(--sla-primary);
}

.icon { flex-shrink: 0; vertical-align: -.2em; }

body { background-color: var(--sla-bg); }

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover { text-decoration: none; }

/* ---------- Shell ---------- */

.app-sidebar {
    width: var(--sla-sidebar-width);
    background: var(--sla-surface);
    border-right: 1px solid var(--sla-border);
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        overflow-y: auto;
    }

    .app-main { margin-left: var(--sla-sidebar-width); }
}

.app-brand img { height: 28px; }

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    border-radius: .5rem;
    color: var(--sla-text);
    font-weight: 500;
}

.app-nav .nav-link:hover { background: var(--sla-bg); }

.app-nav .nav-link.active {
    background: var(--sla-primary-soft);
    color: var(--sla-primary);
}

.app-nav-heading {
    margin: 1.25rem .75rem .35rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sla-muted);
}

.app-main { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(245, 246, 248, .92);
    backdrop-filter: blur(6px);
}

.app-content { flex: 1; width: 100%; max-width: 1280px; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sla-primary-soft);
    color: var(--sla-primary);
    font-weight: 600;
    font-size: .8rem;
}

.impersonation-bar {
    background: #fff4d6;
    border-bottom: 1px solid #f3dc9a;
}

/* ---------- Components ---------- */

.card {
    --bs-card-border-color: var(--sla-border);
    --bs-card-cap-bg: transparent;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--sla-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.badge-soft { font-weight: 500; }
.badge-soft.text-bg-success { background: #e3f5ea !important; color: #166534 !important; }
.badge-soft.text-bg-danger { background: #fde8e8 !important; color: #9b1c1c !important; }
.badge-soft.text-bg-warning { background: #fff4d6 !important; color: #8a5a00 !important; }
.badge-soft.text-bg-secondary { background: #eef0f3 !important; color: #4b5563 !important; }
.badge-soft.text-bg-info { background: #e5f2ff !important; color: #1e4f8a !important; }

.plan-card { transition: border-color .15s; }
.plan-card:hover { border-color: var(--sla-primary); }
.plan-price { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.plan-quantity { width: 72px; flex-shrink: 0; }

.hero-card {
    background: linear-gradient(135deg, #1d4ed8, #2457d6 60%, #3b82f6);
    color: #fff;
    border: 0;
}

.form-label { font-weight: 500; font-size: .875rem; }
.form-label.small { font-size: .8rem; }

/* ---------- Guest pages ---------- */

.guest-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.guest-card { width: 100%; max-width: 420px; }
.guest-card .brand img { height: 32px; }

.border-dashed { border-style: dashed !important; }

/* ---------- Statistics ---------- */

.stat-label { font-size: .8rem; font-weight: 500; color: var(--sla-muted); }
.stat-hero { font-size: 3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: .25rem 0 .5rem; }
.stat-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; margin: .15rem 0; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.share-track { height: 6px; border-radius: 3px; background: #edf1fb; }
.share-bar { height: 6px; border-radius: 3px; background: var(--viz-1); }
.chart-box { position: relative; }
details > summary { cursor: pointer; }

/* ---------- Help ---------- */

.help-btn {
    border: 0;
    background: none;
    padding: 0 .15rem;
    color: var(--sla-muted);
    line-height: 1;
    vertical-align: -3px;
}
.help-btn:hover, .help-btn:focus-visible { color: var(--sla-primary); }
.help-section { scroll-margin-top: 1rem; }
.help-section + .help-section { border-top: 1px solid var(--bs-border-color); padding-top: 1.25rem; margin-top: 1.25rem; }
.help-section.is-highlighted h3 { color: var(--sla-primary); }
.help-section dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.help-section dt { font-weight: 500; }
.help-section dd { margin: 0; color: var(--bs-secondary-color); }
@media (max-width: 575.98px) {
    .help-section dl { grid-template-columns: 1fr; gap: .15rem; }
    .help-section dd { margin-bottom: .5rem; }
}
.doc-line + .doc-line { margin-top: .35rem; }

/* ---------- E-mail log ---------- */

.email-meta { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; }
.email-meta dt { font-weight: 500; color: var(--sla-muted); font-size: .875rem; }
.email-meta dd { margin: 0; overflow-wrap: anywhere; }
.email-frame { display: block; width: 100%; height: 75vh; min-height: 480px; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: #fff; }
.email-text { white-space: pre-wrap; font-size: .85rem; max-height: 75vh; overflow: auto; background: #f8f9fb; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: 1rem; margin: 0; }
