/* ==========================================================================
   ALMODEER visual identity — loaded after app.css.
   One brand colour drives the theme. The defaults below are the ALMODEER
   identity; Settings → Appearance overrides the same variables.
   Desktop-first: large targets, clear type, icon tiles.
   ========================================================================== */
:root {
    --brand: #00C896;
    --brand-light: #00E5A0;
    --brand-strong: #008160;
    --brand-hover: #006B50;
    --brand-deep: #093E31;
    --brand-deeper: #062820;
    --on-brand: #062820;
    --brand-rgb: 0, 200, 150;
    --brand-strong-rgb: 0, 129, 96;
    --brand-tint: #EFF9F5;
    --brand-tint-2: #DFF2EA;
    --sidebar-text: #D9EFE6;
    --sidebar-muted: #8FC7B3;

    --ink: #10231C;
    --ink-soft: #55665F;
    --line: #DDE7E2;
    --surface: #FFFFFF;
    --canvas: #F3F6F5;

    --primary-color: var(--brand-strong);
    --success-color: #12A150;
    --light-color: var(--canvas);
    --sidebar-width: 292px;
    --navbar-height: 76px;
    --radius: 16px;

    --bs-primary: var(--brand-strong);
    --bs-primary-rgb: var(--brand-strong-rgb);
    --bs-link-color: var(--brand-strong);
    --bs-link-color-rgb: var(--brand-strong-rgb);
    --bs-link-hover-color: var(--brand-deep);
    --bs-body-color: var(--ink);
    --bs-body-font-size: 1.0625rem;
    --bs-border-radius: 10px;
    --bs-border-color: var(--line);
}

html { font-size: 16px; }
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
[dir="ltr"] body { font-family: 'Inter', -apple-system, 'Segoe UI', Tahoma, sans-serif; }

.table td, .table th, .stat-value, .line-total, input[type="number"], .num {
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--brand-deeper) 0%, var(--brand-deep) 100%);
    color: var(--sidebar-text);
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-brand { padding: 18px 18px; gap: 12px; flex: 0 0 auto; }
.sidebar-brand strong { font-size: 1.25rem; }
.sidebar-brand small { color: var(--sidebar-muted); font-size: .78rem; }
.brand-logo { width: 52px; height: 52px; border-radius: 15px; padding: 6px; }

.sidebar-nav { padding: 12px 12px 16px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 8px; }
.nav-group { margin-bottom: 4px; }
.nav-link {
    gap: 13px; padding: 9px 12px; border-radius: 14px;
    color: var(--sidebar-text); font-size: 1.05rem; font-weight: 600; min-height: 54px;
}
/* icon tiles: every section icon sits in its own rounded square */
.nav-link > i {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: #fff;
    background: linear-gradient(160deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .25);
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active { background: var(--brand); color: var(--on-brand); }
.nav-link.active > i {
    background: #fff; color: var(--brand-strong);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.nav-link.child {
    font-size: .98rem; font-weight: 400; padding: 8px 14px; min-height: 42px;
    color: var(--sidebar-text); opacity: .86; border-radius: 10px;
}
.nav-link.child:hover { opacity: 1; }
.nav-link.child.current { background: rgba(255, 255, 255, .12); opacity: 1; font-weight: 600; }
.nav-children { padding: 4px 51px 8px 0; }
[dir="ltr"] .nav-children { padding: 4px 0 8px 51px; }

/* fixed foot: current branch + assistant, always visible however long the menu is */
.sidebar-foot {
    flex: 0 0 auto; padding: 12px; display: grid; gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .16);
}
.branch-button, .faheem-button {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: start;
    padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07); color: #fff; min-height: 58px; cursor: pointer;
}
.branch-button:hover, .faheem-button:hover { background: rgba(255, 255, 255, .13); }
.branch-button:focus-visible, .faheem-button:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.branch-icon {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: inline-flex;
    align-items: center; justify-content: center; background: var(--brand); color: var(--on-brand);
}
.branch-label, .faheem-text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.branch-label small, .faheem-text small { display: block; color: var(--sidebar-muted); font-size: .78rem; }
.branch-label strong, .faheem-text strong {
    display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.branch-caret { font-size: .8rem; opacity: .7; }
.branch-menu { width: calc(var(--sidebar-width) - 24px); padding: 8px; box-shadow: 0 18px 40px rgba(6, 40, 32, .28); }
.branch-menu .dropdown-item { border-radius: 10px; padding: .6rem .8rem; }
.faheem-face { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; }
.faheem-face.small { width: 36px; height: 36px; flex-basis: 36px; }
.faheem-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }

/* ------------------------------------------------------------------ topbar */
.topbar { border-bottom: 1px solid var(--line); padding: 0 26px; gap: 14px; }
.page-title { font-size: 1.45rem; color: var(--brand-deep); }
.branch-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
    background: var(--brand-tint-2); color: var(--brand-deep); font-weight: 600; font-size: .98rem;
    white-space: nowrap;
}
.licence-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
    font-weight: 600; font-size: .92rem; white-space: nowrap; text-decoration: none; margin-inline-start: 8px;
}
.licence-chip.is-owned { background: #e2f5ea; color: #0b7a3e; }                 /* active copy: green */
.licence-chip.is-trial, .licence-chip.is-ended { background: #fde8e8; color: #b42318; } /* trial: red */
.licence-chip .chip-state { font-weight: 700; }
.licence-chip .chip-branch + .chip-state::before { content: "·"; margin-inline-end: 6px; opacity: .6; }
.licence-chip:hover { filter: brightness(.97); }
.user-name { font-size: 1rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.user-name i { font-size: 1.3rem; color: var(--brand-strong); }
.content { padding: 26px; }
.app-footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .88rem; }

/* ---------------------------------------------------------------- controls */
.btn {
    font-weight: 600; border-radius: 12px; padding: .6rem 1.15rem; font-size: 1rem;
    min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
}
.btn-sm { min-height: 38px; padding: .4rem .85rem; font-size: .95rem; border-radius: 10px; }
.btn-lg { min-height: 56px; font-size: 1.1rem; border-radius: 14px; }
.btn i { font-size: 1.1em; }
.btn-primary {
    --bs-btn-bg: var(--brand-strong); --bs-btn-border-color: var(--brand-strong);
    --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
    --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand-deep);
    --bs-btn-disabled-bg: var(--brand-strong); --bs-btn-disabled-border-color: var(--brand-strong);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-strong); --bs-btn-border-color: var(--brand-strong);
    --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong);
    --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand-deep);
    --bs-btn-disabled-color: var(--brand-strong); --bs-btn-disabled-border-color: var(--brand-strong);
}
.btn-outline-secondary {
    --bs-btn-color: var(--brand-deep); --bs-btn-border-color: #B9C7C1;
    --bs-btn-hover-bg: var(--brand-deep); --bs-btn-hover-border-color: var(--brand-deep);
    --bs-btn-active-bg: var(--brand-deeper); --bs-btn-active-border-color: var(--brand-deeper);
}
.btn-outline-success {
    --bs-btn-color: var(--brand-strong); --bs-btn-border-color: var(--brand-strong);
    --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong);
}
.btn:disabled, .btn.disabled { opacity: .5; }
.btn-icon { min-width: 46px; padding: .5rem; }

.form-control, .form-select {
    min-height: 46px; font-size: 1rem; border-radius: 10px; border-color: #C9D5D0;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .22);
}
.form-check-input:checked { background-color: var(--brand-strong); border-color: var(--brand-strong); }
.form-switch .form-check-input { width: 2.6em; height: 1.35em; }
.form-label { font-weight: 600; color: var(--brand-deep); margin-bottom: .35rem; }
.input-group-text { min-height: 46px; background: var(--brand-tint); border-color: #C9D5D0; }

.nav-pills .nav-link {
    color: var(--brand-deep); background: #fff; border: 1px solid var(--line);
    margin-inline-end: 8px; margin-bottom: 8px; min-height: 46px; font-size: 1rem; padding: 8px 16px;
}
.nav-pills .nav-link.active { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }

/* ------------------------------------------------------------------- cards */
.card, .panel, .stat-card {
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 35, 28, .05);
}
.card-header {
    background: #fff; border-bottom: 1px solid var(--line);
    font-weight: 700; font-size: 1.08rem; color: var(--brand-deep); padding: 14px 18px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-footer { background: #FAFCFB; border-top: 1px solid var(--line); padding: 14px 18px;
    border-radius: 0 0 var(--radius) var(--radius) !important; }
.stat-card { padding: 20px; }
.stat-card .stat-label { color: var(--ink-soft); font-size: .98rem; }
.stat-card .stat-value { font-size: 1.85rem; color: var(--brand-deep); }
.stat-card .stat-icon { width: 58px; height: 58px; border-radius: 17px; font-size: 1.6rem; }
.bg-primary-soft { background: rgba(var(--brand-rgb), .14); color: var(--brand-strong); }
.panel-title { font-size: 1.12rem; color: var(--brand-deep); }

/* launcher tiles (report hubs, settings hub) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile {
    display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none;
    min-height: 84px;
}
.tile:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(16, 35, 28, .08); color: var(--ink); }
.tile-icon {
    width: 52px; height: 52px; flex: 0 0 52px; border-radius: 15px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 1.4rem; color: #fff;
    background: linear-gradient(160deg, var(--brand-light), var(--brand-strong));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(var(--brand-strong-rgb), .3);
}
.tile strong { display: block; font-size: 1.05rem; color: var(--brand-deep); }
.tile small { color: var(--ink-soft); font-size: .9rem; line-height: 1.4; display: block; }

/* ------------------------------------------------------------------ tables */
.table { font-size: 1rem; }
.table thead th { background: var(--brand-tint-2); font-size: .95rem; color: var(--brand-deep); padding: 12px 12px; }
.table td { font-size: 1rem; padding: 11px 12px; }
.table-hover tbody tr:hover { background: var(--brand-tint); }
.table tfoot td { font-weight: 700; background: #FAFCFB; }
.empty-state i { font-size: 3rem; color: var(--sidebar-muted); }

.badge { font-size: .88rem; font-weight: 600; padding: .45em .8em; border-radius: 999px; }
.badge-status { font-size: .88rem; }
.status-posted, .status-reported, .status-sent { background: rgba(var(--brand-rgb), .16); color: var(--brand-strong); }
.status-accepted, .status-converted { background: rgba(28, 200, 138, .15); color: #0f8a5c; }
.status-expired { background: #eef1f7; color: #5b6478; }
.alert { border-radius: 12px; font-size: 1rem; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); font-size: 1rem; }
.dropdown-item { padding: .55rem 1rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-strong); color: #fff; }
.page-link { color: var(--brand-strong); min-width: 44px; min-height: 44px; text-align: center; }
.active > .page-link { background: var(--brand-strong); border-color: var(--brand-strong); }
a { color: var(--brand-strong); }
::selection { background: var(--brand); color: var(--on-brand); }

/* ------------------------------------------------------------- filter bars */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px;
}
.filter-bar .filter { min-width: 170px; flex: 1 1 170px; }
.filter-bar .filter.narrow { flex: 0 1 150px; min-width: 130px; }
.filter-bar .form-label { font-size: .9rem; margin-bottom: .2rem; }
.multi-select { position: relative; }
.multi-select > summary {
    list-style: none; cursor: pointer; min-height: 46px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; padding: 0 12px; border: 1px solid #C9D5D0;
    border-radius: 10px; background: #fff;
}
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-select > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .75rem; color: var(--ink-soft); }
.multi-select[open] > summary { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .22); }
.multi-select .options {
    position: absolute; z-index: 30; inset-inline-start: 0; top: calc(100% + 4px); min-width: 100%;
    max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 8px; box-shadow: 0 16px 36px rgba(16, 35, 28, .16);
}
.multi-select .options label { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.multi-select .options label:hover { background: var(--brand-tint); }

/* -------------------------------------------------------------- item picker */
.item-picker { position: relative; }
.item-picker .picker-code { font-size: .85rem; color: var(--ink-soft); margin-top: 3px; min-height: 1.2em; direction: ltr; text-align: start; }
.picker-list {
    position: absolute; z-index: 40; inset-inline-start: 0; top: calc(100% - 18px); width: max(100%, 420px);
    max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 6px; box-shadow: 0 16px 36px rgba(16, 35, 28, .18);
}
.picker-option { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.picker-option.active, .picker-option:hover { background: var(--brand-tint-2); }
.picker-option .po-code { font-size: .88rem; color: var(--brand-strong); font-weight: 700; direction: ltr; min-width: 76px; }
.picker-option .po-name { flex: 1 1 auto; }
.picker-option .po-meta { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; }
.picker-empty { padding: 12px; color: var(--ink-soft); text-align: center; }

/* ------------------------------------------------------------- appearance */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.swatch {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
    border: 2px solid var(--line); cursor: pointer; background: #fff;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch.selected { border-color: var(--ink); }
.swatch-dot { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6), 0 1px 3px rgba(0, 0, 0, .25); }
.swatch-name { font-weight: 600; }
.preview-strip { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.preview-side { background: var(--brand-deep); color: #fff; padding: 10px 16px; border-radius: 12px; display: inline-flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- assistant */
.faheem-panel {
    position: fixed; z-index: 1080; width: 380px; max-width: calc(100vw - 24px); height: 520px;
    max-height: calc(100vh - 24px); inset-inline-start: 24px; bottom: 24px;
    display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
    border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(6, 40, 32, .32);
}
.faheem-panel[hidden] { display: none; }
.faheem-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: move; user-select: none;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-strong)); color: #fff;
}
.faheem-title { flex: 1 1 auto; line-height: 1.2; }
.faheem-title strong { display: block; font-size: 1.1rem; }
.faheem-title small { opacity: .8; font-size: .82rem; }
.faheem-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .16); color: #fff; }
.faheem-close:hover { background: rgba(255, 255, 255, .28); }
.faheem-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--canvas); }
.fh-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: .98rem; line-height: 1.6; white-space: pre-line; }
.fh-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-start-start-radius: 6px; }
.fh-msg.me { align-self: flex-end; background: var(--brand-strong); color: #fff; border-end-end-radius: 6px; }
.fh-msg a.fh-link { display: inline-flex; margin-top: 8px; font-weight: 700; }
.fh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fh-chip { border: 1px solid var(--brand-strong); color: var(--brand-strong); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .9rem; cursor: pointer; }
.fh-chip:hover { background: var(--brand-tint-2); }
.faheem-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.faheem-form .btn { min-width: 46px; padding: 0 12px; }

/* -------------------------------------------------------------------- login */
.auth-logo { width: 240px; max-width: 80%; height: auto; margin-bottom: 10px; }
.auth-card { border-radius: 24px; max-width: 460px; padding: 36px 32px; }
.auth-brand h1 { color: var(--brand-deep); font-size: 1.9rem; }
.auth-brand p { color: var(--ink-soft); font-size: 1.02rem; }
.is-anonymous .sidebar, .is-anonymous .topbar, .is-anonymous .app-footer { display: none; }
.is-anonymous .app-shell { min-height: 0; width: 100%; justify-content: center; }
.is-anonymous .main-column, [dir="ltr"] .is-anonymous .main-column { margin: 0; flex: 0 1 auto; width: 100%; }
.is-anonymous .content { padding: 0; display: flex; justify-content: center; }
.auth-wrap { width: 100%; display: flex; justify-content: center; }
.auth-lang { text-align: center; margin-top: 18px; font-size: 1rem; }
.auth-lang a { color: var(--brand-strong); font-weight: 600; text-decoration: none; padding: 6px 10px; }
.auth-lang a.current { text-decoration: underline; }
.auth-lang a:hover { text-decoration: underline; }

/* ------------------------------------------------------- printed documents */
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--brand-strong); padding-bottom: 12px; margin-bottom: 14px; }
.doc-head .doc-logo { max-height: 84px; max-width: 190px; object-fit: contain; }
.doc-head .doc-org strong { font-size: 1.25rem; color: var(--brand-deep); display: block; }
.doc-head .doc-org span { display: block; font-size: .92rem; color: var(--ink-soft); }
.doc-title { font-size: 1.3rem; font-weight: 700; color: var(--brand-deep); text-align: center; }
.report-head { text-align: center; margin-bottom: 12px; }
.report-head h2 { font-size: 1.25rem; margin: 0; color: var(--brand-deep); }
.report-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: .95rem; }
.print-only { display: none; }

@media print {
    .sidebar, .topbar, .app-footer, .no-print, .btn, .filter-bar, .faheem-panel, .nav-pills { display: none !important; }
    .main-column, [dir="ltr"] .main-column { margin: 0 !important; }
    .content { padding: 0; }
    .print-only { display: block; }
    body { background: #fff; font-size: 11pt; }
    .card, .panel { border: 0; box-shadow: none; }
    .table thead th { background: #eef2f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; text-decoration: none; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 280px; }
    .content { padding: 16px; }
    .branch-chip { display: none; }
    .branch-chip.licence-chip { display: inline-flex; font-size: .8rem; padding: 4px 10px; }   /* the status always shows */
}
@media (prefers-reduced-motion: no-preference) {
    .nav-link, .btn, .tile { transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
}


/* ------------------------------------------------------------ report level */
.level-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 10px 14px; margin-bottom: 14px; }
.level-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.level-form .form-select { width: auto; min-width: 190px; }
.level-form .multi-select { min-width: 220px; }
.level-hint { color: var(--ink-soft); font-size: .9rem; }
.level-fixed { font-weight: 700; color: var(--brand-deep); }
.level-title { font-size: 1.15rem; font-weight: 800; color: var(--brand-deep); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-tint-2); }
/* A branch section repeats the report without its own filters and export buttons. */
.level-section form, .level-section .btn-group, .level-section .filter-bar { display: none !important; }
.level-section { break-inside: avoid-page; }
@media print { .level-title { margin-top: 10px; } }

/* ------------------------------------------------------- backup and restore */
.recovery-code { font-family: Consolas, "Courier New", monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: .06em; word-break: break-word; background: var(--brand-tint); border: 1px dashed var(--brand-strong); border-radius: 12px; padding: 14px 16px; text-align: center; }
.restore-page { max-width: 860px; }
.lead-text { font-size: 1.05rem; color: var(--ink-soft); }
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-strong); color: #fff; font-weight: 700; margin-inline-end: 8px; }
@media print {
    .recovery-card { border: 2px solid #000 !important; }
    .recovery-card .card-header { font-size: 14pt; font-weight: 700; }
    .recovery-code { font-size: 18pt; border: 1px solid #000; background: #fff; }
}

/* ------------------------------------------------- subscription («التفعيل» on the web) */
.sub-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.sub-current { border-top: 4px solid var(--brand); position: sticky; top: calc(var(--navbar-height, 64px) + 16px); }
.sub-current.is-trial { border-top-color: #f59e0b; }
.sub-current.is-ended { border-top-color: #dc2626; }
.sub-kicker { font-size: .85rem; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
.sub-plan-name { font-size: 1.7rem; font-weight: 800; color: var(--brand-deep); margin: 4px 0 6px; }
.sub-state { font-weight: 700; display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.sub-days { margin: 10px 0 6px; color: var(--ink-soft); }
.sub-days .num { font-size: 2.2rem; font-weight: 800; color: var(--brand-strong); font-variant-numeric: tabular-nums; margin-inline-end: 4px; }
.sub-links { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: .92rem; }
.sub-links a { text-decoration: none; color: var(--brand-strong); display: inline-flex; gap: 8px; align-items: center; }
.sub-paypal { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: 999px; background: #eef4ff; color: #003087; font-weight: 700; font-size: .85rem; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.sub-card {
    position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 18px;
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(9, 62, 49, .05), 0 8px 24px rgba(9, 62, 49, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sub-card:hover { transform: translateY(-3px); border-color: rgba(var(--brand-rgb), .55); box-shadow: 0 14px 34px rgba(9, 62, 49, .12); }
.sub-card.is-current { border: 2px solid var(--brand); background: linear-gradient(180deg, rgba(var(--brand-rgb), .07), #fff 55%); }
.sub-badge { position: absolute; top: -11px; inset-inline-start: 16px; background: var(--brand); color: #04221a; font-weight: 800; font-size: .78rem; padding: 3px 12px; border-radius: 999px; }
.sub-card-name { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--brand-deep); }
.sub-price .num { font-size: 1.9rem; font-weight: 800; color: var(--ink, #10231c); font-variant-numeric: tabular-nums; }
.sub-price .cur { color: var(--ink-soft); font-weight: 600; }
.sub-period { color: var(--ink-soft); font-size: .9rem; margin-top: -6px; }
.sub-features { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; flex: 1; }
.sub-features i { color: var(--brand-strong); width: 18px; text-align: center; margin-inline-end: 6px; }
@media (max-width: 991.98px) {
    .sub-layout { grid-template-columns: 1fr; }
    .sub-current { position: static; }
}
