/* ==========================================================================
   أرحب V4 — Storefront & Product UI
   Ultra-Compact 0px Sharp Enterprise Design System
   Swiss Precision, High Information Density, Zero Border-Radius Everywhere
   ========================================================================== */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;

    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #cbd5e1;
    --line-strong: #94a3b8;
    --line-subtle: #e2e8f0;

    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-accent: #0d9488;
    --brand-soft: #f0fdfa;
    --brand-border: #99f6e4;

    --critical: #991b1b;
    --critical-soft: #fef2f2;
    --critical-border: #fecaca;

    --high: #c2410c;
    --high-soft: #fff7ed;
    --high-border: #fed7aa;

    --medium: #b45309;
    --medium-soft: #fffbeb;
    --medium-border: #fde68a;

    --monitor: #1d4ed8;
    --monitor-soft: #eff6ff;
    --monitor-border: #bfdbfe;

    --good: #047857;
    --good-soft: #ecfdf5;
    --good-border: #a7f3d0;

    --radius: 0px !important;
    --radius-sm: 0px !important;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --container: 1280px;
}

/* ZERO BORDER-RADIUS GLOBALLY WITHOUT EXCEPTION */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-radius: 0 !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

p {
    margin: 0;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 18px;
}

/* ---------- Header / Footer ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 25;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 19px;
    color: var(--ink);
}

.brand:hover {
    text-decoration: none;
}

.brand__mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--brand-dark);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.brand__sub {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    border-inline-start: 1px solid var(--line);
    padding-inline-start: 10px;
    margin-inline-start: 2px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14.5px;
}

.site-nav a {
    color: var(--ink-2);
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    text-decoration: none;
    color: var(--ink);
}

.site-nav a.is-active {
    color: var(--brand-dark);
    border-bottom-color: var(--brand-dark);
}

.site-footer {
    margin-top: 48px;
    border-top: 2px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13.5px;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding-block: 18px;
}

/* ---------- Generic Layout Blocks ---------- */
main {
    padding-block: 24px;
}

.stack > * + * {
    margin-top: 12px;
}

.section + .section {
    margin-top: 32px;
}

.section__head {
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section__title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--brand-dark);
}

.section__note {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 2px;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    padding: 2px 8px;
}

.hero {
    padding-block: 16px 8px;
}

.hero__title {
    font-size: clamp(24px, 3.5vw, 32px);
    margin-top: 8px;
    font-weight: 800;
}

.hero__lead {
    color: var(--ink-2);
    font-size: 16px;
    margin-top: 8px;
    max-width: 62ch;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

/* ---------- Buttons (Sharp Precision) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    padding: 8px 16px;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    min-height: 38px;
}

.btn:hover {
    text-decoration: none;
}

.btn--primary {
    background: var(--brand-dark);
    color: #ffffff;
    border-color: var(--brand-dark);
}

.btn--primary:hover {
    background: #0d4d48;
    border-color: #0d4d48;
}

.btn--ghost {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn--ghost:hover {
    background: var(--surface-2);
    border-color: var(--ink);
}

.btn--compact {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 34px;
}

.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- Cards (Compact Sharp) ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 16px;
}

.card--accent-top {
    border-top: 3px solid var(--brand-dark);
}

.card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.card__note {
    color: var(--muted);
    font-size: 13px;
}

/* ---------- Grids ---------- */
.grid {
    display: grid;
    gap: 12px;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.nowrap {
    white-space: nowrap;
}

.num {
    font-variant-numeric: tabular-nums;
}

/* ---------- Badges & Chips (Sharp) ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--ink-2);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.badge--critical {
    background: var(--critical-soft);
    color: var(--critical);
    border-color: var(--critical-border);
}

.badge--high {
    background: var(--high-soft);
    color: var(--high);
    border-color: var(--high-border);
}

.badge--medium {
    background: var(--medium-soft);
    color: var(--medium);
    border-color: var(--medium-border);
}

.badge--monitor {
    background: var(--monitor-soft);
    color: var(--monitor);
    border-color: var(--monitor-border);
}

.badge--good {
    background: var(--good-soft);
    color: var(--good);
    border-color: var(--good-border);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 2px 7px;
}

/* ---------- Metrics ---------- */
.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 12px 14px;
}

.metric__label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.metric__value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.metric__foot {
    font-size: 12.5px;
    margin-top: 4px;
}

.delta {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.delta--up {
    color: var(--good);
}

.delta--down {
    color: var(--critical);
}

.delta--flat {
    color: var(--muted);
}

/* ---------- Bars (Sharp) ---------- */
.bars {
    display: grid;
    gap: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 50px;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.bar-track {
    background: var(--surface-2);
    border: 1px solid var(--line);
    height: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--brand-dark);
}

.bar-fill--admin {
    background: #94a3b8;
}

.bar-fill--kingdom {
    background: #cbd5e1;
}

.bar-value {
    text-align: end;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ink);
}

/* ---------- Tables (Dense Financial Precision) ---------- */
.grid > *,
.stack > *,
.subject > *,
.card > * {
    min-width: 0;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--surface);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 600px;
}

table.data th,
table.data td {
    padding: 8px 12px;
    text-align: start;
    border-bottom: 1px solid var(--line);
    border-inline-end: 1px solid var(--line-subtle);
}

table.data th:last-child,
table.data td:last-child {
    border-inline-end: 0;
}

table.data thead th {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 2px solid var(--line-strong);
}

table.data tbody tr:hover {
    background: #f8fafc;
}

table.data tbody tr:last-child td {
    border-bottom: 0;
}

table.data td.num,
table.data th.num {
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* ---------- Subject Panel ---------- */
.subject {
    display: grid;
    gap: 14px;
}

.subject__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.subject__name {
    font-size: 18px;
    font-weight: 800;
}

.levels {
    display: grid;
    gap: 6px;
}

.level-row {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.level-fill {
    height: 8px;
}

.level-fill--high {
    background: var(--good);
}

.level-fill--medium {
    background: #0891b2;
}

.level-fill--low {
    background: #f59e0b;
}

.level-fill--very_low {
    background: var(--critical);
}

/* ---------- Plan / Weeks ---------- */
.weeks {
    display: grid;
    gap: 8px;
}

.week {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 12px 14px;
}

.week__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.week__num {
    font-weight: 800;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    padding: 1px 8px;
    font-size: 13px;
}

.week__items {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    color: var(--ink-2);
}

.week__items li {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

/* ---------- Form & Alerts ---------- */
.form {
    display: grid;
    gap: 14px;
}

.file-field {
    border: 2px dashed var(--line-strong);
    background: var(--surface-2);
    padding: 22px;
    text-align: center;
}

.file-field input[type="file"] {
    display: block;
    margin: 12px auto 0;
    font: inherit;
    max-width: 100%;
}

.alert {
    border: 1px solid var(--line);
    padding: 10px 14px;
    font-size: 13.5px;
    border-inline-start-width: 4px;
}

.alert--error {
    background: var(--critical-soft);
    color: var(--critical);
    border-color: #fecaca;
    border-inline-start-color: var(--critical);
}

.alert--info {
    background: var(--monitor-soft);
    color: var(--monitor);
    border-color: #bae6fd;
    border-inline-start-color: var(--monitor);
}

.alert--warn {
    background: var(--medium-soft);
    color: var(--medium);
    border-color: #fde68a;
    border-inline-start-color: var(--medium);
}

.alert--success {
    background: var(--good-soft);
    color: var(--good);
    border-color: #bbf7d0;
    border-inline-start-color: var(--good);
}

.notice-list {
    margin: 6px 0 0;
    padding-inline-start: 16px;
}

/* ---------- Meta Strip ---------- */
.meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-strip__item {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 4px 10px;
    font-size: 13px;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-strip__item strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   NAFS Dashboard — Ultra-Compact Enterprise Workstation Styles
   ========================================================================== */

/* ---------- Executive Header (Sharp & Compact) ---------- */
.dash-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--ink);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.dash-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.dash-header__title {
    font-size: 21px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.25;
}

.dash-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dash-header__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-hero {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-inline-start: 3px solid var(--brand-dark);
}

.stat-hero--change {
    border-inline-start-color: var(--ink);
}

.stat-hero--students {
    border-inline-start-color: var(--monitor);
}

.stat-hero--status {
    border-inline-start-color: var(--good);
}

.stat-hero__label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.stat-hero__value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
    color: var(--ink);
}

.stat-hero__meta {
    font-size: 12px;
    margin-top: 3px;
    font-weight: 700;
}

/* ---------- Navigation Bar (Sharp Tabs) ---------- */
.dash-nav {
    position: sticky;
    top: 56px;
    z-index: 20;
    background: var(--surface);
    border-bottom: 2px solid var(--line-strong);
    padding-block: 0;
    margin-bottom: 20px;
}

.dash-nav__scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.dash-nav__scroll::-webkit-scrollbar {
    display: none;
}

.dash-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-bottom: none;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.1s ease;
    min-height: 42px;
    text-decoration: none;
    user-select: none;
}

.dash-tab:first-child {
    border-inline-start: 1px solid var(--line);
}

.dash-tab:hover {
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
}

.dash-tab.is-active {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
    position: relative;
}

.dash-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
}

.dash-tab.is-active .dash-tab__badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.dash-nav__actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline: 8px;
}

/* ---------- Tab Panels ---------- */
.dash-panel {
    display: none;
}

.dash-panel.is-active {
    display: block;
}

/* Mode: Full View (When exporting or previewing all sections together) */
.dash-mode-full .dash-panel {
    display: block !important;
    margin-bottom: 36px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 28px;
}

.dash-mode-full .dash-panel:last-of-type {
    border-bottom: none;
}

/* ---------- 10-Second Overview Grid (Sharp & Tight) ---------- */
.glance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.glance-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 12px 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 128px;
}

.glance-card--urgent {
    border-inline-start: 4px solid var(--critical);
}

.glance-card--good {
    border-inline-start: 4px solid var(--good);
}

.glance-card--target {
    border-inline-start: 4px solid var(--brand);
}

.glance-card--status {
    border-inline-start: 4px solid var(--monitor);
}

.glance-card__tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.glance-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 4px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.glance-card__value {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: auto;
}

.glance-card__footer {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

/* ---------- Sub-Navigation Pills (Zero Radius) ---------- */
.subnav-pill {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 2px;
    gap: 2px;
}

.subnav-pill__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    white-space: nowrap;
}

.subnav-pill__btn:hover {
    color: var(--ink);
    background: var(--surface);
}

.subnav-pill__btn.is-active {
    background: var(--brand-dark);
    color: #ffffff;
}

.subnav-pill__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10.5px;
    font-weight: 800;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
}

.subnav-pill__btn.is-active .subnav-pill__badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.analysis-subpane {
    display: none;
}

.analysis-subpane.is-active {
    display: block;
}

.dash-mode-full .analysis-subpane {
    display: block !important;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
}

/* ---------- Subject Tabs & Switcher ---------- */
.subject-nav {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.subject-nav::-webkit-scrollbar {
    display: none;
}

.subject-nav-btn {
    border: none;
    border-inline-end: 1px solid var(--line);
    background: transparent;
    padding: 7px 16px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
    min-height: 36px;
}

.subject-nav-btn:last-child {
    border-inline-end: 0;
}

.subject-nav-btn:hover {
    background: var(--surface);
    color: var(--ink);
}

.subject-nav-btn.is-active {
    background: var(--brand-dark);
    color: #ffffff;
}

.subject-pane {
    display: none;
}

.subject-pane.is-active {
    display: block;
}

.dash-mode-full .subject-pane {
    display: block !important;
    margin-bottom: 24px;
}

/* ---------- Domain Cards for Mobile ---------- */
.domain-card-list {
    display: grid;
    gap: 8px;
}

.domain-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--brand-dark);
    padding: 12px;
    display: grid;
    gap: 8px;
}

.domain-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.domain-card__name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
}

.domain-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-subtle);
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
}

.domain-card__stat-item strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    margin-top: 1px;
}

.domain-card__target-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    padding-top: 3px;
    border-top: 1px dashed var(--line);
}

.desktop-table-wrap {
    display: block;
}

.mobile-card-wrap {
    display: none;
}

/* ---------- Week Accordion Component (Compact Sharp) ---------- */
.accordion-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.week-accordion {
    display: grid;
    gap: 6px;
}

.week-item {
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--ink-700, #334155);
    background: var(--surface);
    transition: border-color 0.1s ease;
}

.week-item.is-open {
    border-inline-start-color: var(--brand-dark);
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
    min-height: 44px;
    gap: 10px;
}

.week-header:hover {
    background: var(--surface-2);
}

.week-header__info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.week-header__title {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}

.week-header__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.15s ease;
}

.week-item.is-open .week-header__icon {
    transform: rotate(180deg);
    color: var(--brand-dark);
}

.week-content {
    display: none;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: #fafbfd;
}

.week-item.is-open .week-content {
    display: block;
}

.dash-mode-full .week-content {
    display: block !important;
}

/* ---------- Checkpoint Cards (Progress) ---------- */
.checkpoint-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--monitor);
    padding: 12px;
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.checkpoint-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.checkpoint-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-subtle);
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
}

.checkpoint-card__input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
}

.input-number {
    font: inherit;
    width: 86px;
    height: 36px;
    padding: 4px 8px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.input-number:focus {
    outline: 2px solid var(--brand-dark);
    outline-offset: 0;
    border-color: var(--brand-dark);
}

.status--on_track { background: var(--good-soft); color: var(--good); border: 1px solid var(--good-border); }
.status--needs_adjustment { background: var(--medium-soft); color: var(--medium); border: 1px solid var(--medium-border); }
.status--off_track { background: var(--critical-soft); color: var(--critical); border: 1px solid var(--critical-border); }
.status--not_measured { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status--met { background: var(--good-soft); color: var(--good); border: 1px solid var(--good-border); }
.status--not_met { background: var(--critical-soft); color: var(--critical); border: 1px solid var(--critical-border); }

/* ---------- Technical Drawer (Zero Radius) ---------- */
.tech-drawer {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 10px 14px;
    margin-top: 24px;
    font-size: 13px;
}

.tech-drawer summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
    user-select: none;
}

.tech-drawer summary:hover {
    color: var(--ink);
}

.tech-drawer__content {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

/* ---------- Report Sections (Compact Typography) ---------- */
.report {
    display: grid;
    gap: 16px;
}

.report__section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.report__section p {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 6px;
}

.report__section p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Responsive Adaptations (390px, 768px, 1280px)
   ========================================================================== */
@media (max-width: 900px) {
    .dash-header__stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .dash-header {
        padding: 14px;
    }

    .dash-header__top {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-nav {
        top: 56px;
        margin-inline: -18px;
        padding-inline: 18px;
    }

    .dash-tab {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 40px;
    }

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

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .desktop-table-wrap {
        display: none;
    }

    .mobile-card-wrap {
        display: block;
    }

    .subject-nav {
        width: 100%;
    }

    .subject-nav-btn {
        flex: 1;
        text-align: center;
        padding: 7px 8px;
        font-size: 13px;
    }

    .input-number {
        width: 100px;
        height: 40px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .dash-header__stats {
        grid-template-columns: 1fr;
    }

    .stat-hero__value {
        font-size: 24px;
    }

    .site-nav {
        gap: 8px;
        font-size: 13px;
    }

    .brand__sub {
        display: none;
    }
}

/* ==========================================================================
   Print & PDF Export Optimization (High Resolution, Clean Document Output)
   ========================================================================== */
@page {
    size: A4 portrait;
    margin: 12mm 10mm;
}

@media print {
    /* Hide interactive & navigation elements */
    .site-header,
    .site-footer,
    .dash-nav,
    .accordion-toolbar,
    .btn,
    .hero__actions,
    .tech-drawer,
    form.progress-form button,
    .input-number {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    main {
        padding: 0 !important;
    }

    /* Force ALL panels to show in sequential printable order */
    .dash-panel {
        display: block !important;
        margin-bottom: 24pt !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .subject-pane {
        display: block !important;
        margin-bottom: 18pt !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .week-content {
        display: block !important;
    }

    .desktop-table-wrap {
        display: block !important;
    }

    .mobile-card-wrap {
        display: none !important;
    }

    .card,
    .metric,
    .stat-hero,
    .glance-card,
    .week-item,
    table.data {
        box-shadow: none !important;
        border: 1px solid #999999 !important;
        break-inside: avoid;
        page-break-inside: avoid;
        background: #ffffff !important;
    }

    table.data th {
        background: #f1f1f1 !important;
        color: #000000 !important;
        border-bottom: 2px solid #000000 !important;
    }

    .dash-header {
        border: 2px solid #000000 !important;
        margin-bottom: 16pt !important;
        break-inside: avoid;
    }

    .glance-grid,
    .dash-header__stats {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8pt !important;
    }

    .section__title {
        color: #000000 !important;
        font-size: 14pt !important;
        border-bottom: 1.5pt solid #000000 !important;
        padding-bottom: 4pt !important;
        break-after: avoid;
    }

    .stat-hero__value,
    .glance-card__value {
        color: #000000 !important;
    }
}

/* ---------- Forms ---------- */

.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }
.field-input {
    font: inherit;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
}
.field-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field-input--code { text-align: center; letter-spacing: 10px; font-size: 22px; font-weight: 700; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
select.field-input { appearance: none; background-image: none; }
textarea.field-input { min-height: 120px; resize: vertical; line-height: 1.8; }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field-check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); }

/* ---------- Unlock / pricing ---------- */

.unlock { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); align-items: center; }
.unlock__cta { text-align: center; border-inline-start: 1px solid var(--line); padding-inline-start: 24px; }
.price { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.price__amount { font-size: 44px; font-weight: 700; line-height: 1; }
.price__currency { font-size: 16px; color: var(--muted); }
.price__compare { font-size: 14px; color: var(--muted); text-decoration: line-through; margin: 6px 0 16px; }

.summary { display: grid; gap: 10px; margin-top: 14px; }
.summary__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }

/* ---------- Admin Enterprise UI (Sharp 0px, Fully Responsive) ---------- */

.admin {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--bg);
    max-width: 100%;
    overflow-x: hidden;
}

.admin__nav {
    background: #0f172a;
    color: #e2e8f0;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    max-width: 100%;
}

.admin__nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin__brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.admin__brand:hover {
    text-decoration: none;
    color: #fff;
}

.admin__env-badge {
    font-size: 11px;
    padding: 2px 7px;
    background: rgba(15, 118, 110, 0.35);
    border: 1px solid rgba(20, 184, 166, 0.4);
    color: #5eead4;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin__nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 7px 10px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}

.admin__nav-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.admin__links {
    display: grid;
    gap: 4px;
}

.admin__links a {
    color: #94a3b8;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-inline-start: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin__links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    text-decoration: none;
}

.admin__links a.is-active {
    background: rgba(15, 118, 110, 0.25);
    color: #fff;
    border-inline-start: 3px solid #14b8a6;
    font-weight: 600;
}

.admin__user-bar {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin__user-meta {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin__main {
    padding: 28px 32px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.admin__head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-subtle);
}

.admin__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.02em;
}

.admin__foot {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--line-subtle);
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Badges and Status Pills */
.pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    line-height: 1.3;
    white-space: nowrap;
}

.pill--active {
    background: var(--good-soft);
    color: var(--good);
    border-color: var(--good-border);
}

.pill--off {
    background: var(--critical-soft);
    color: var(--critical);
    border-color: var(--critical-border);
}

.pill--draft {
    background: var(--medium-soft);
    color: var(--medium);
    border-color: var(--medium-border);
}

.pill--refunded {
    background: var(--monitor-soft);
    color: var(--monitor);
    border-color: var(--monitor-border);
}

.pill--cancelled,
.pill--consumed {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--line);
}

/* ID Tag with Quick Copy */
.id-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-subtle);
    padding: 2px 7px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--ink-2);
}

.id-tag code {
    font-family: inherit;
    font-size: inherit;
    background: transparent;
    padding: 0;
    border: 0;
}

.id-copy-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    transition: color 0.15s ease;
}

.id-copy-btn:hover {
    color: var(--brand);
}

.id-copy-btn.is-copied {
    color: var(--good);
}

/* Pagination Bar (Sharp, Accessible, Arabic-first) */
.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.pagination-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
}

.pagination-summary strong {
    color: var(--ink);
    font-weight: 700;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pagination-btn,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
    color: var(--ink-2);
    border: 1px solid var(--line);
    min-height: 32px;
    text-decoration: none;
    transition: background 0.1s ease, border-color 0.1s ease;
}

.pagination-btn:hover:not(.is-disabled),
.pagination-page:hover:not(.is-current) {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--ink);
    text-decoration: none;
}

.pagination-page.is-current {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    cursor: default;
}

.pagination-btn.is-disabled {
    color: var(--line-strong);
    background: var(--surface-2);
    border-color: var(--line-subtle);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-ellipsis {
    padding: 6px 8px;
    color: var(--muted);
    font-size: 13px;
}

/* Admin Toolbar (Search, Filter, Export, Reset) */
.admin-toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.admin-toolbar__search {
    min-width: 220px;
    flex-grow: 1;
    max-width: 380px;
}

.admin-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-toolbar__count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

/* Executive Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    inline-start: 0;
    inline-end: 0;
    height: 3px;
    background: var(--line);
}

.metric-card--brand::before { background: var(--brand); }
.metric-card--good::before { background: var(--good); }
.metric-card--critical::before { background: var(--critical); }
.metric-card--medium::before { background: var(--medium); }
.metric-card--monitor::before { background: var(--monitor); }

.metric-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.metric-card__label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.metric-card__badge {
    font-size: 11px;
    padding: 1px 6px;
    font-weight: 600;
}

.metric-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.metric-card__foot {
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Visual Audit Diff Table */
.audit-diff {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: var(--surface);
    margin: 8px 0;
}

.audit-diff td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line-subtle);
}

.audit-diff__key {
    font-weight: 600;
    color: var(--ink-2);
    width: 110px;
    background: var(--surface-2);
}

.audit-diff__before {
    color: var(--critical);
    text-decoration: line-through;
    background: var(--critical-soft);
    max-width: 240px;
    word-break: break-all;
}

.audit-diff__after {
    color: var(--good);
    font-weight: 600;
    background: var(--good-soft);
    max-width: 240px;
    word-break: break-all;
}

.raw-json-details {
    margin-top: 6px;
}

.raw-json-details summary {
    font-size: 11.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.raw-json-details pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 8px;
    font-size: 11px;
    font-family: monospace;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Contextual Confirmation Modal */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.admin-modal.is-open {
    display: flex;
}

.admin-modal__card {
    background: var(--surface);
    border: 2px solid var(--critical);
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.admin-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--critical);
    margin-bottom: 12px;
}

.admin-modal__body {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.6;
    margin-bottom: 20px;
}

.admin-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Mobile Responsiveness & Breakpoints */
@media (max-width: 860px) {
    .admin {
        grid-template-columns: 1fr;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .admin__nav {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .admin__nav-header {
        margin-bottom: 0;
    }

    .admin__nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .admin__nav-body {
        display: none;
        padding-top: 16px;
        margin-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .admin__nav.is-open .admin__nav-body {
        display: flex;
    }

    .admin__links {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .admin__links a {
        padding: 12px 14px;
        font-size: 15px;
    }

    .admin__main {
        padding: 18px 16px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .admin__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

    .pagination-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .pagination-controls {
        justify-content: center;
    }

    .admin-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar__search {
        max-width: 100%;
    }
}

