/* =====================================================================
   Falcon Management System · Prototype 1 · "Modern Teal Enterprise"
   ===================================================================== */
:root {
  /* brand (mandatory) */
  --primary: #087E8B;          /* teal blue · white text 4.9:1 */
  --primary-600: #076F7A;
  --primary-700: #065E67;      /* hover / pressed */
  --primary-50: #EAF5F6;
  --primary-100: #D3ECEE;
  --primary-200: #A9D8DC;
  --secondary: #0F9D92;        /* teal green · decorative / large only on white */
  --secondary-700: #0A766E;    /* teal green for small text on white · 5.4:1 */
  --secondary-50: #E6F6F4;
  --navy: #17324D;             /* headings */
  --bg: #FFFFFF;
  --bg-2: #F4FAFA;             /* canvas */
  --bg-3: #EAF3F3;
  --border: #DCE9E9;
  --border-strong: #C4D8D9;
  --text: #243746;
  --muted: #566B79;            /* 5.5:1 on white */
  --subtle: #6E808C;           /* 4.6:1 on white */
  /* status (AA for text on tinted bg) */
  --success: #17804F; --success-bg: #E5F5EC;
  --warning: #965A00; --warning-bg: #FFF3DC;
  --danger: #B42318;  --danger-bg: #FDECEA;
  --info: #1F5FA3;    --info-bg: #E7F0FB;
  --neutral: #4D6070; --neutral-bg: #EEF3F4;
  --accent-amber: #E3A33B;
  /* shape */
  --r-sm: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px;
  --sh-1: 0 1px 2px rgba(23, 50, 77, .06);
  --sh-2: 0 1px 2px rgba(23, 50, 77, .06), 0 4px 16px rgba(23, 50, 77, .06);
  --sh-3: 0 8px 32px rgba(23, 50, 77, .14), 0 2px 6px rgba(23, 50, 77, .06);
  --ring: 0 0 0 3px rgba(8, 126, 139, .28);
  --sidebar-w: 260px; --rail-w: 76px; --header-h: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Kufi Arabic", "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: 170ms; --dur-in: 200ms; --dur-out: 140ms;
  /* type scale 12 / 13 / 14 / 16 / 20 / 24 / 30 */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 30px;
  /* spacing 4 / 8 / 12 / 16 / 20 / 24 / 32 / 40 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --sh-hover: 0 1px 2px rgba(23, 50, 77, .05), 0 10px 28px -8px rgba(8, 94, 103, .22);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--fs-base); font-feature-settings: "cv11"; -webkit-tap-highlight-color: rgba(8, 126, 139, .12); touch-action: manipulation; line-height: 1.5; color: var(--text); background: var(--bg-2); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[lang="ar"] body { font-family: var(--font-ar), var(--font); }
h1, h2, h3, h4 { color: var(--navy); margin: 0; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 600; color: var(--navy); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.pad { padding: 16px; }
.right { text-align: end; }
.ic { flex: none; vertical-align: middle; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur) var(--ease); }
.app.collapsed { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--bg); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; z-index: 30; min-width: 0; }
.brand { height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 10px rgba(8, 126, 139, .25); }
.brand-text { min-width: 0; line-height: 1.2; }
.brand-name { font-weight: 700; color: var(--navy); font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 12px 12px 16px; scrollbar-width: thin; }
.nav-sec { margin-top: 14px; }
.nav-sec:first-child { margin-top: 2px; }
.nav-sec-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); padding: 6px 12px; }
html[lang="ar"] .nav-sec-label { letter-spacing: 0; }
.nav-item, .nav-group-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text); font-weight: 520; border: 0; background: none; cursor: pointer; text-align: start; position: relative; transition: background var(--dur), color var(--dur); text-decoration: none; min-height: 40px; }
.nav-item:hover, .nav-group-btn:hover { background: var(--bg-2); color: var(--navy); text-decoration: none; }
.nav-item .ic, .nav-group-btn .ic { color: var(--muted); transition: color var(--dur); }
.nav-item.active { background: var(--primary-50); color: var(--primary-700); font-weight: 620; }
.nav-item.active .ic { color: var(--primary); }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
html[dir="rtl"] .nav-item.active::before { border-radius: 4px 0 0 4px; }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-btn .chev { margin-inline-start: auto; transition: transform var(--dur) var(--ease); }
.nav-group.open > .nav-group-btn .chev { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-btn { color: var(--navy); font-weight: 620; }
.nav-group.has-active > .nav-group-btn > .ic:first-child { color: var(--primary); }
.nav-sub { display: none; padding: 2px 0 4px; margin-inline-start: 21px; border-inline-start: 1px solid var(--border); padding-inline-start: 8px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding: 7px 10px; min-height: 34px; font-size: 13.5px; font-weight: 500; }
.nav-sub .nav-item.active::before { inset-inline-start: -10px; top: 6px; bottom: 6px; width: 3px; }
.nav-badge { font-size: 11px; font-weight: 650; background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.app.collapsed .brand { padding: 0; justify-content: center; }
.app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .nav-sec-label, .app.collapsed .chev, .app.collapsed .nav-badge { display: none; }
.app.collapsed .nav { padding: 10px; }
.app.collapsed .nav-sec { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.app.collapsed .nav-sec:first-child { border-top: 0; padding-top: 0; }
.app.collapsed .nav-item, .app.collapsed .nav-group-btn { justify-content: center; padding: 10px; }
.app.collapsed .nav-group-btn { display: none; }
.app.collapsed .nav-sub { display: block; margin: 0; padding: 0; border: 0; }
.app.collapsed .nav-sub .nav-item { padding: 10px; min-height: 40px; }
.app.collapsed .nav-item.active::before { inset-inline-start: -10px; }
.app.collapsed .sidebar-foot .nav-item { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 25; height: var(--header-h); background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.header-left { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs .cur { color: var(--navy); font-weight: 620; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--border-strong); display: inline-flex; }
.crumbs .crumb-mid { display: inline-flex; align-items: center; gap: 6px; }
.table td .mono, .table td .tag, .table td .pill, .table td .fchip { white-space: nowrap; }
.gsearch { position: relative; flex: 0 1 360px; min-width: 180px; }
.header-left { min-width: 140px; }
.gsearch .search-input .input { height: 40px; background: var(--bg-2); border-color: transparent; padding-inline-end: 64px; }
.gsearch .search-input .input:hover { border-color: var(--border); }
.gsearch .search-input .input:focus { background: #fff; border-color: var(--primary); }
.kbd { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; line-height: 18px; background: #fff; pointer-events: none; }
.gs-results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-3); max-height: 420px; overflow-y: auto; padding: 6px; z-index: 40; }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.gs-item[aria-selected="true"], .gs-item:hover { background: var(--primary-50); }
.gs-item .gs-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.gs-item[aria-selected="true"] .gs-ic { background: var(--primary); color: #fff; }
.gs-main { flex: 1; min-width: 0; }
.gs-main strong { color: var(--navy); }
.gs-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); padding: 6px 10px 4px; font-weight: 650; }
.header-right { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.ctx-select { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 0 4px 0 10px; height: 40px; background: #fff; color: var(--muted); min-width: 0; }
html[dir="rtl"] .ctx-select { padding: 0 10px 0 4px; }
.ctx-select select { border: 0; background: transparent; font: inherit; color: var(--navy); font-weight: 560; height: 36px; max-width: 190px; cursor: pointer; padding: 0 4px; }
.ctx-select select:focus { outline: none; }
.ctx-select:focus-within { box-shadow: var(--ring); border-color: var(--primary); }
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: #fff; height: 40px; align-items: center; }
.lang-toggle button { border: 0; background: none; padding: 0 9px; height: 32px; border-radius: 7px; font-weight: 650; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.bell { position: relative; }
.bell-badge { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.profile-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 6px 4px 4px; border-radius: 12px; cursor: pointer; min-width: 0; }
.profile-btn:hover { background: var(--bg-2); }
.profile-meta { text-align: start; line-height: 1.2; min-width: 0; }
.profile-meta strong { display: block; color: var(--navy); font-size: 13px; white-space: nowrap; }
.profile-meta span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 700; font-size: 12.5px; flex: none; letter-spacing: .02em; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.popover { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: 45; }
.hdr-pop { position: relative; }
.notif-pop { width: 380px; max-width: calc(100vw - 24px); }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.pop-head h3 { font-size: 15px; }
.pop-body { max-height: 400px; overflow-y: auto; }
.pop-foot { border-top: 1px solid var(--border); padding: 10px 16px; text-align: center; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; text-align: start; width: 100%; background: none; border-inline: 0; border-top: 0; }
.notif:hover { background: var(--bg-2); }
.notif.unread { background: #FBFEFE; }
.notif.unread::after { content: ""; position: absolute; inset-inline-end: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.notif-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.notif-ic.approval { background: var(--warning-bg); color: var(--warning); }
.notif-ic.reminder { background: var(--info-bg); color: var(--info); }
.notif-ic.error { background: var(--danger-bg); color: var(--danger); }
.notif-ic.info { background: var(--primary-50); color: var(--primary); }
.notif-title { font-weight: 600; color: var(--navy); font-size: 13.5px; padding-inline-end: 14px; }
.notif-body { font-size: 12.5px; color: var(--muted); }
.profile-pop { width: 320px; padding: 8px; }
.profile-pop .pp-user { display: flex; gap: 12px; align-items: center; padding: 10px; }
.role-list { display: grid; gap: 2px; padding: 4px 0; max-height: 330px; overflow-y: auto; }
.role-opt { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: start; width: 100%; }
.role-opt:hover { background: var(--bg-2); }
.role-opt[aria-checked="true"] { background: var(--primary-50); }
.role-opt .rc { font-size: 11px; font-weight: 700; color: var(--primary-700); background: var(--primary-100); border-radius: 6px; padding: 1px 6px; min-width: 38px; text-align: center; }
.role-opt .rcheck { margin-inline-start: auto; color: var(--primary); }
.pp-sep { height: 1px; background: var(--border); margin: 6px 0; }
.icon-btn.hamburger { display: none; }
.scrim { display: none; }
.content { padding: 24px 28px 48px; max-width: 1560px; width: 100%; margin: 0 auto; min-width: 0; }
.view-enter { animation: fadeUp 200ms var(--ease) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; line-height: 1.25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; font-weight: 520; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 450; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-side-l { grid-template-columns: 320px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt { margin-top: 20px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 20px; } .mb-s { margin-bottom: 10px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-title { font-size: 13px; font-weight: 650; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
html[lang="ar"] .section-title { letter-spacing: 0; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform var(--dur); text-decoration: none !important; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(8, 126, 139, .3); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--navy); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-700); background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--bg-3); color: var(--navy); }
.btn-soft { background: var(--primary-50); color: var(--primary-700); }
.btn-soft:hover { background: var(--primary-100); color: var(--primary-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8F1C13; color: #fff; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-danger-soft:hover { background: #F9D6D2; color: #8F1C13; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #106A40; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: background var(--dur), color var(--dur); flex: none; }
.icon-btn:hover { background: var(--bg-2); color: var(--navy); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.bordered { border-color: var(--border); background: #fff; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.link-btn:hover { color: var(--primary-700); text-decoration: underline; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.label { font-size: 13px; font-weight: 600; color: var(--navy); }
.req { color: var(--danger); }
.input { width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; background: #fff; font: inherit; color: var(--text); transition: border-color var(--dur), box-shadow var(--dur); min-width: 0; }
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566B79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
html[dir="rtl"] select.input { background-position: left 10px center; }
select.input[multiple] { height: auto; background-image: none; padding: 6px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: #A9C3C5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input:disabled { background: var(--bg-2); color: var(--muted); cursor: not-allowed; }
.input-sm { height: 32px; font-size: 12.5px; border-radius: 8px; padding: 0 10px; }
select.input-sm { padding-inline-end: 28px; background-position: right 6px center; }
html[dir="rtl"] select.input-sm { background-position: left 6px center; }
.has-error .input { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .2); }
.err { font-size: 12.5px; color: var(--danger); display: flex; align-items: center; gap: 5px; min-height: 0; }
.err:empty { display: none; }
.hint { font-size: 12px; color: var(--muted); }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-start-end-radius: 0; border-end-end-radius: 0; }
.affix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-inline-start: 0; border-start-end-radius: 10px; border-end-end-radius: 10px; background: var(--bg-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.search-input { position: relative; display: flex; align-items: center; min-width: 0; }
.search-input > .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.search-input .input { padding-inline-start: 38px; }
.check { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; margin: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.radio-card { border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; transition: border-color var(--dur), background var(--dur); background: #fff; }
.radio-card:hover { border-color: var(--primary-200); }
.radio-card.on { border-color: var(--primary); background: var(--primary-50); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card .rc-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.radio-card.on .rc-ic { background: var(--primary); color: #fff; }
.radio-card strong { color: var(--navy); display: block; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 520; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; transition: background var(--dur); flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--dur) var(--ease); }
.toggle input:checked + .track { background: var(--primary); }
.toggle input:checked + .track::after { transform: translateX(16px); }
html[dir="rtl"] .toggle input:checked + .track::after { transform: translateX(-16px); }
.toggle input:focus-visible + .track { box-shadow: var(--ring); }
.form-section { padding: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { font-size: 15px; margin-bottom: 4px; }
.form-section > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th { font-size: 12px; text-align: start; color: var(--muted); font-weight: 600; padding: 0 8px 6px 0; }
.lines-table td { padding: 4px 8px 4px 0; vertical-align: top; }

/* ---------------------------------------------------------------- stepper */
.stepper { list-style: none; display: flex; margin: 0; padding: 20px 24px; gap: 0; counter-reset: s; border-bottom: 1px solid var(--border); overflow-x: auto; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; position: relative; min-width: 150px; color: var(--muted); font-weight: 560; font-size: 13.5px; }
.step:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); margin: 0 12px; border-radius: 2px; min-width: 16px; }
.step.done:not(:last-child)::after { background: var(--primary); }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); font-size: 13px; font-weight: 700; background: #fff; flex: none; color: var(--muted); }
.step.current .step-num { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-100); }
.step.current { color: var(--navy); font-weight: 650; }
.step.done .step-num { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.step.done { color: var(--navy); }
.step-label { white-space: nowrap; }
.flow { list-style: none; display: flex; margin: 0; padding: 0; gap: 0; overflow-x: auto; }
.flow-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 92px; font-size: 11.5px; color: var(--muted); text-align: center; font-weight: 560; }
.flow-step::before { content: ""; position: absolute; top: 10px; inset-inline-start: calc(-50% + 12px); inset-inline-end: calc(50% + 12px); height: 2px; background: var(--border); }
.flow-step:first-child::before { display: none; }
.flow-step.done::before, .flow-step.current::before, .flow-step.rejected::before { background: var(--primary); }
.flow-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; display: grid; place-items: center; z-index: 1; }
.flow-step.done .flow-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.flow-step.current .flow-dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100); }
.flow-step.current .flow-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.flow-step.current { color: var(--navy); font-weight: 650; }
.flow-step.rejected .flow-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.flow-step.rejected { color: var(--danger); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 12px 14px; font-weight: 580; color: var(--muted); cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: 8px 8px 0 0; transition: color var(--dur); }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--primary-700); }
.tab.active::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tab-count { font-size: 11.5px; background: var(--bg-3); color: var(--muted); border-radius: 10px; padding: 0 7px; font-weight: 650; line-height: 19px; }
.tab.active .tab-count { background: var(--primary-100); color: var(--primary-700); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-3); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; }
.seg-btn { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg-btn.active { background: #fff; color: var(--primary-700); box-shadow: var(--sh-1); }

/* ---------------------------------------------------------------- pills / chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral); }
.pill-teal { background: var(--primary-50); color: var(--primary-700); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--bg-3); color: var(--neutral); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--primary-50); color: var(--primary-700); font-size: 12.5px; font-weight: 560; border: 1px solid var(--primary-100); }
html[dir="rtl"] .chip { padding: 0 10px 0 4px; }
.chip-k { color: var(--muted); font-weight: 500; }
.chip-x { border: 0; background: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--primary-700); }
.chip-x:hover { background: var(--primary-100); }
.chip-teal { background: #fff; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--navy); font-weight: 580; font-size: 12.5px; white-space: nowrap; text-decoration: none !important; transition: border-color var(--dur), background var(--dur); }
html[dir="rtl"] .fchip { padding: 0 4px 0 10px; }
.fchip:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.fchip-mark { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.fchip-id { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.sim-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: #6A4A00; background: #FFF0C7; border: 1px dashed #D9A62B; border-radius: 999px; padding: 2px 10px; letter-spacing: .01em; white-space: nowrap; }

/* ---------------------------------------------------------------- filter bar / table */
.filterbar { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .search-input { flex: 1 1 260px; max-width: 360px; }
.filters .input { height: 38px; }
.filters select.input { width: auto; min-width: 130px; max-width: 220px; }
.filters .grow { flex: 1; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); flex-wrap: wrap; animation: fadeUp 160ms var(--ease); }
.bulkbar strong { color: var(--primary-700); }
.table-card { min-width: 0; }
.table-wrap { overflow: auto; max-height: 640px; position: relative; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; z-index: 2; background: #FAFCFC; text-align: start; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border); white-space: nowrap; }
html[lang="ar"] .table th { letter-spacing: 0; }
.table td { padding: 8px 12px; height: 52px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table td.wrap, .table.compact td { white-space: normal; }
.table td.wrap { min-width: 180px; max-width: 320px; }
.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr[aria-selected="true"] { background: var(--primary-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); border-radius: 0; }
.table th:first-child, .table td:first-child { padding-inline-start: 16px; }
.table th:last-child, .table td:last-child { padding-inline-end: 16px; }
.table .col-check { width: 44px; padding-inline-end: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .act { width: 56px; text-align: end; }
.table .empty-row:hover { background: none; }
.table.compact td { height: 44px; padding: 6px 12px; }
.table.compact th { padding: 0 12px; height: 40px; }
.th-sort { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 4px 0; }
.th-sort .ic { opacity: .5; }
.th-sort.active { color: var(--primary-700); }
.th-sort.active .ic { opacity: 1; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main strong { color: var(--navy); font-weight: 620; display: block; white-space: nowrap; }
.cell-main .sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.f-avatar { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); color: var(--primary); display: grid; place-items: center; flex: none; }
.f-avatar.inactive { background: var(--neutral-bg); color: var(--subtle); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 10px; }
.pager-btn { min-width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; }
.pager-btn:hover { background: var(--bg-2); color: var(--navy); }
.pager-btn.active { background: var(--primary); color: #fff; }
.pager-gap { padding: 0 4px; color: var(--muted); }
.kebab { display: inline-block; }
.menu { position: fixed; z-index: 60; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--sh-3); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: start; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--bg-2); color: var(--navy); box-shadow: none; }
.menu-item .ic { color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ic { color: var(--danger); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------------------------------------------------------------- KPI */
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome h1 { font-size: 26px; }
.welcome .date { color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.ctx-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--sh-1); }
.ctx-filters label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; padding-inline-start: 6px; }
.ctx-filters select { width: auto; min-width: 150px; height: 34px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-1); cursor: pointer; transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur); display: flex; flex-direction: column; gap: 10px; text-align: start; min-width: 0; position: relative; }
a.kpi, a.kpi:hover { text-decoration: none; color: inherit; }
.kpi:hover { box-shadow: var(--sh-2); border-color: var(--primary-200); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.kpi-ic.warn { background: var(--warning-bg); color: var(--warning); }
.kpi-ic.danger { background: var(--danger-bg); color: var(--danger); }
.kpi-ic.green { background: var(--secondary-50); color: var(--secondary-700); }
.kpi-label { color: var(--muted); font-weight: 560; font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; font-weight: 600; color: var(--muted); margin-inline-start: 2px; }
.kpi-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 12px; border-radius: 6px; padding: 1px 6px; }
.delta.up { color: var(--success); background: var(--success-bg); }
.delta.down { color: var(--danger); background: var(--danger-bg); }
.kpi .go { color: var(--subtle); transition: color var(--dur), transform var(--dur); }
.kpi:hover .go { color: var(--primary); transform: translate(2px, -2px); }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.li-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.li-ic.hunt { background: #FFF3DC; color: var(--warning); }
.li-ic.med { background: var(--info-bg); color: var(--info); }
.li-main { flex: 1; min-width: 0; }
.li-main .t { font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-actions { display: flex; gap: 6px; flex: none; }

/* ---------------------------------------------------------------- profile */
.ph-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-ar { font-family: var(--font-ar); color: var(--muted); font-size: 18px; font-weight: 500; }
.meta-v .mono { white-space: nowrap; }
[lang="ar"] { font-family: var(--font-ar); }
.meta-k { font-size: 12px; color: var(--muted); font-weight: 560; display: flex; align-items: center; gap: 5px; }
.meta-v { font-weight: 600; color: var(--navy); margin-top: 2px; word-break: break-word; }
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; }
.dl > div { min-width: 0; }
.lineage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.lin-card { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--bg-2); min-width: 0; }
.lin-card .meta-k { margin-bottom: 4px; }
.lin-self { border-color: var(--primary); background: var(--primary-50); text-align: center; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--primary); background: var(--primary); margin-top: 4px; flex: none; }
.tl-dot.tl-success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.tl-dot.tl-danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.tl-dot.tl-warning { background: var(--accent-amber); box-shadow: 0 0 0 2px var(--accent-amber); }
.tl-dot.tl-info { background: var(--info); box-shadow: 0 0 0 2px var(--info); }
.tl-dot.tl-neutral { background: var(--subtle); box-shadow: 0 0 0 2px var(--subtle); }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--navy); }
.tl-comment { margin-top: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; min-width: 0; }
.file-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; color: var(--navy); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: 18px; text-align: center; color: var(--muted); background: var(--bg-2); cursor: pointer; transition: border-color var(--dur), background var(--dur); width: 100%; font: inherit; }
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.doc-group { margin-bottom: 20px; }
.doc-group h3 { font-size: 14px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- picker */
.fpicker { border: 1px solid var(--border-strong); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.fpicker-top { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); background: var(--bg-2); flex-wrap: wrap; }
.fpicker-top .search-input { flex: 1; min-width: 200px; }
.fpicker-sel { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); min-height: 46px; align-items: center; }
.fpicker-list { max-height: 260px; overflow-y: auto; }
.fpicker-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 120px; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.fpicker-row:hover { background: var(--bg-2); }
.fpicker-row.on { background: var(--primary-50); }
.fpicker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- boards */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.loc-card { display: flex; flex-direction: column; }
.loc-card .card-head { border-bottom: 0; padding-bottom: 6px; }
.loc-count { font-size: 30px; font-weight: 700; color: var(--navy); line-height: 1; }
.loc-bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin: 6px 20px 12px; }
.loc-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 18px; max-height: 220px; overflow-y: auto; }
.region-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 15px; }
.region-title:first-of-type { margin-top: 0; }
.cap-bar { height: 10px; border-radius: 5px; background: var(--bg-3); overflow: hidden; }
.cap-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 5px; transition: width .4s var(--ease); }
.cap-bar.full > span { background: linear-gradient(90deg, var(--accent-amber), #D77B1F); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat .v { font-size: 18px; font-weight: 700; color: var(--navy); }
.pair-card .pair-birds { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: stretch; padding: 16px 20px; }
.pair-card .heart { align-self: center; }
.pair-bird { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.pair-bird .meta-k { margin-bottom: 2px; }
.heart { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.egg-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: #fff; }
.egg-chip.near { border-color: var(--accent-amber); background: #FFF7E8; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-inline-start: 1px solid var(--border); }
.cal-dow { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; padding: 8px 10px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #FAFCFC; }
.cal-day { min-height: 108px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.other { background: #FAFCFC; color: var(--subtle); }
.cal-day.today { background: var(--primary-50); }
.cal-num { font-size: 12px; font-weight: 650; display: flex; justify-content: space-between; }
.cal-day.today .cal-num span:first-child { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal-ev { border: 0; text-align: start; font-size: 11.5px; padding: 3px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 560; width: 100%; border-inline-start: 3px solid; }
.cal-ev.s-Scheduled { background: var(--info-bg); color: var(--info); }
.cal-ev.s-Overdue { background: var(--danger-bg); color: var(--danger); }
.cal-ev.s-Completed { background: var(--success-bg); color: var(--success); }
.cal-ev.s-Cancelled { background: var(--neutral-bg); color: var(--neutral); text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--muted); padding-inline-start: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col { border: 1px solid var(--border); border-radius: 10px; min-height: 260px; display: flex; flex-direction: column; min-width: 0; }
.week-col.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.week-h { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 650; color: var(--navy); background: #FAFCFC; border-radius: 10px 10px 0 0; }
.week-b { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* matrix */
.matrix td.low { background: #FFF5F4; }
.matrix td.low .qty { color: var(--danger); font-weight: 700; }
.qty { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.perm { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--primary-50); color: var(--primary-700); }
.perm.none { background: transparent; color: var(--subtle); }

/* workbench */
.wb-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.wb-falcon { padding: 16px; display: flex; gap: 12px; align-items: center; }
.wb-list { max-height: 520px; overflow-y: auto; position: relative; }
.wb-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; width: 100%; text-align: start; cursor: pointer; }
.wb-row:hover { background: var(--bg-2); }
.wb-row.on { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
html[dir="rtl"] .wb-row.on { box-shadow: inset -3px 0 0 var(--primary); }
.entry { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.entry:last-child { border-bottom: 0; }
.entry-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.k-Diagnosis { background: #FDECEA; color: var(--danger); }
.k-Procedure { background: var(--info-bg); color: var(--info); }
.k-Vaccine { background: var(--secondary-50); color: var(--secondary-700); }
.k-Lab { background: #F1ECFB; color: #5B3BA8; }
.k-Note { background: var(--neutral-bg); color: var(--neutral); }
.k-Prescription { background: var(--warning-bg); color: var(--warning); }
.k-Quarantine { background: #FFF3DC; color: var(--warning); }
.k-Exam { background: var(--primary-50); color: var(--primary); }
.entry-main { flex: 1; min-width: 0; }
.entry-main .t { font-weight: 620; color: var(--navy); }
.entry-actions { display: flex; gap: 4px; flex: none; align-items: flex-start; }

/* report */
.report-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.report-card { padding: 18px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur); text-decoration: none !important; color: inherit; }
.report-card:hover { box-shadow: var(--sh-2); border-color: var(--primary-200); transform: translateY(-1px); color: inherit; }
.report-card h3 { font-size: 14.5px; }
.report-card p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.rc-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.print-head { display: none; }

/* recon */
.recon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.recon .stat .v.ok { color: var(--success); }
.recon .stat .v.bad { color: var(--danger); }

/* ---------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; background: rgba(23, 50, 77, .42); z-index: 80; display: grid; place-items: center; padding: 24px; animation: fadeIn var(--dur) ease both; }
.overlay.out { animation: fadeOut 150ms ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.modal { background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: pop 200ms var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-sm { max-width: 460px; } .modal-md { max-width: 640px; } .modal-lg { max-width: 860px; } .modal-xl { max-width: 1080px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 18px; }
.modal-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: #FAFCFC; border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap; }
.overlay-drawer { place-items: stretch end; padding: 0; }
.drawer { max-width: 560px; height: 100vh; max-height: 100vh; border-radius: 0; animation: slideIn 220ms var(--ease) both; justify-self: end; }
html[dir="rtl"] .drawer { animation-name: slideInR; }
.drawer .modal-foot { border-radius: 0; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInR { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.confirm-msg { margin: 0 0 12px; }
.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 95; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--navy); color: #fff; padding: 12px 12px 12px 14px; border-radius: 12px; box-shadow: var(--sh-3); animation: pop 200ms var(--ease) both; font-weight: 520; }
.toast.out { animation: fadeOut 180ms ease both; }
.toast-ic { margin-top: 1px; }
.toast-success .toast-ic { color: #6EE7B7; }
.toast-error .toast-ic { color: #FCA5A5; }
.toast-warning .toast-ic { color: #FCD34D; }
.toast-info .toast-ic { color: #7DD3FC; }
.toast-msg { flex: 1; }
.toast-x { border: 0; background: none; color: #B9C7D3; cursor: pointer; border-radius: 6px; padding: 2px; display: grid; }
.toast-x:hover { color: #fff; }

/* empty / skeleton / 404 */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { font-size: 15.5px; margin-bottom: 4px; }
.empty p { margin: 0 auto 14px; max-width: 380px; }
.sk { background: linear-gradient(90deg, #EAF2F2 0%, #F5FAFA 50%, #EAF2F2 100%); background-size: 200% 100%; animation: shimmer 1s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-title { height: 28px; width: 260px; margin-bottom: 10px; }
.sk-sub { height: 14px; width: 380px; max-width: 80%; margin-bottom: 24px; }
.sk-card { height: 110px; border-radius: var(--r-lg); }
.sk-block { height: 320px; border-radius: var(--r-lg); margin-top: 20px; }
.notfound { text-align: center; padding: 80px 20px; }
.notfound .code { font-size: 64px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-size: 13px; align-items: flex-start; }
.callout.warn { background: var(--warning-bg); color: var(--warning); }
.callout.danger { background: var(--danger-bg); color: var(--danger); }
.callout.teal { background: var(--primary-50); color: var(--primary-700); }
.callout strong { color: inherit; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--navy); font-weight: 560; word-break: break-word; }

/* =====================================================================
   Design refinement v2 · component layer
   ===================================================================== */
/* ---------- shell: sidebar ---------- */
.brand { padding: 0 16px; }
.brand-link { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none !important; border-radius: 10px; }
.brand-link:hover { color: inherit; }
.logo-mark { flex: none; display: block; filter: drop-shadow(0 2px 6px rgba(8, 94, 103, .22)); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--subtle); }
.sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 8px; }
.env-tag { font-size: 11px; font-weight: 600; color: var(--subtle); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; letter-spacing: .02em; }
.collapse-btn { color: var(--subtle); }
.collapse-btn:hover { color: var(--navy); }
.app.collapsed .sidebar-foot { justify-content: center; padding: 10px 0; }
.app.collapsed .env-tag { display: none; }
.app.collapsed .brand-link { justify-content: center; }
.nav-sec-label { font-size: 11px; letter-spacing: .08em; padding: 8px 12px 4px; }
.nav-item, .nav-group-btn { font-size: 13.5px; min-height: 38px; padding: 8px 12px; }
.nav-item.active { background: var(--primary-50); box-shadow: inset 0 0 0 1px rgba(8, 126, 139, .10); }

/* ---------- shell: header (search leads, utilities recede) ---------- */
.header { gap: 12px; padding: 0 20px 0 24px; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.5) blur(10px); }
.header-left { flex: 1 1 0; min-width: 120px; }
.gsearch { flex: 0 1 440px; min-width: 200px; }
.gsearch .search-input > .ic { inset-inline-start: 12px; color: var(--subtle); }
.gsearch .search-input .input { height: 38px; background: #F1F7F7; border-color: transparent; padding-inline-start: 36px; padding-inline-end: 52px; font-size: var(--fs-sm); border-radius: 10px; }
.gsearch .search-input .input::placeholder { color: #5A6C78; }
.gsearch .search-input .input:hover { background: #ECF4F4; border-color: transparent; }
.gsearch .search-input .input:focus { background: #fff; border-color: var(--primary); }
.kbd { font-size: 11px; color: var(--subtle); border-color: var(--border); border-bottom-width: 1px; line-height: 18px; padding: 0 5px; font-family: var(--font); }
.header-right { gap: 2px; }
.ctx-select { position: relative; border: 0; height: 36px; padding: 0 8px; gap: 6px; background: transparent; border-radius: 9px; color: var(--muted); cursor: pointer; transition: background var(--dur); }
.ctx-select:hover { background: var(--bg-2); }
.ctx-select select { appearance: none; -webkit-appearance: none; height: 36px; font-size: var(--fs-sm); font-weight: 560; color: var(--navy); max-width: 150px; padding: 0 18px 0 0; text-overflow: ellipsis; background-color: transparent; }
html[dir="rtl"] .ctx-select select { padding: 0 0 0 18px; }
.ctx-select .ctx-chev { position: absolute; inset-inline-end: 8px; pointer-events: none; color: var(--subtle); }
.ctx-select:focus-within { box-shadow: var(--ring); }
.lang-toggle { border: 0; background: var(--bg-2); height: 32px; padding: 2px; border-radius: 9px; margin: 0 4px; }
.lang-toggle button { height: 28px; min-width: 32px; padding: 0 8px; font-size: 12px; border-radius: 7px; color: var(--muted); transition: background var(--dur), color var(--dur); }
.lang-toggle button[lang="ar"] { font-family: var(--font-ar); font-size: 12px; }
.lang-toggle button:hover { color: var(--navy); }
.lang-toggle button[aria-pressed="true"] { background: #fff; color: var(--primary-700); box-shadow: var(--sh-1); }
.hdr-sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; flex: none; }
.icon-btn.bell { width: 36px; height: 36px; border-radius: 9px; }
.bell-badge { top: 2px; inset-inline-end: 1px; min-width: 17px; height: 17px; font-size: 10px; }
.profile-btn { gap: 8px; padding: 3px 6px 3px 3px; border-radius: 999px; }
html[dir="rtl"] .profile-btn { padding: 3px 3px 3px 6px; }
.profile-btn .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.profile-meta strong { font-size: var(--fs-sm); font-weight: 600; }
.profile-btn .pchev { color: var(--subtle); }
.profile-pop { width: 300px; padding: 6px; }
.pp-user { padding: 10px 10px 8px; }
.pp-id { min-width: 0; }
.pp-sec { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px 4px; }
.pp-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); }
.pp-roles > summary { list-style: none; }
.pp-roles > summary::-webkit-details-marker { display: none; }
.pp-summary .pp-cur { margin-inline-start: auto; font-weight: 650; }
.pp-summary .pp-chev { color: var(--subtle); transition: transform var(--dur) var(--ease); }
.pp-roles[open] .pp-chev { transform: rotate(180deg); }
.pp-roles .role-list { padding: 2px 0 6px 8px; max-height: none; overflow: visible; }
.profile-pop { max-height: calc(100vh - 80px); overflow-y: auto; overscroll-behavior: contain; }
.role-opt { min-height: 36px; }
.role-opt > .ic { color: var(--muted); flex: none; }

/* global search results */
.gs-item .gs-ic { width: 34px; height: 34px; border-radius: 9px; background: none; overflow: hidden; }
.gs-item .gs-ic .fph { border-radius: 9px; }

/* ---------- falcon photography ---------- */
.fph { display: inline-block; flex: none; object-fit: cover; border-radius: 10px; background: var(--bg-3); vertical-align: middle; }
.fph-empty { display: inline-grid; place-items: center; color: var(--subtle); border: 1px dashed var(--border-strong); background: var(--bg-2); }
.fph-inactive { filter: grayscale(1) contrast(.9); opacity: .75; }
.f-avatar.fph { width: 36px; height: 36px; border-radius: 10px; }
.fchip { padding: 0 10px 0 3px; gap: 7px; height: 30px; }
html[dir="rtl"] .fchip { padding: 0 3px 0 10px; }
.fchip .fph.fchip-mark { width: 22px; height: 22px; border-radius: 50%; }
.chip .chip-ph { width: 20px; height: 20px; border-radius: 50%; margin-inline-end: 4px; margin-inline-start: -6px; }
.fpicker-name { display: flex; align-items: center; gap: 10px; }
.fpicker-name .fph { width: 28px; height: 28px; border-radius: 8px; }
.wb-row .fph { border-radius: 8px; }
.wb-falcon .wb-ph { border-radius: 14px; }
.pb-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--navy); margin-top: 6px; }
.pb-row strong { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-row:hover { color: var(--primary); text-decoration: none; }
.pb-row .fph { border-radius: 10px; }

/* ---------- buttons ---------- */
.btn { transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform 90ms var(--ease); }
.btn-primary { background: var(--primary); box-shadow: 0 1px 2px rgba(6, 94, 103, .35), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { border-color: var(--border-strong); box-shadow: 0 1px 1px rgba(23, 50, 77, .04); }
.btn-secondary:hover { background: var(--bg-2); border-color: #AFC8CA; color: var(--navy); }
.btn-lg { height: 46px; padding: 0 20px; font-size: 14.5px; border-radius: 11px; }
.btn .btn-chev { margin-inline-start: -2px; opacity: .7; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; box-shadow: none; }
.btn-group { display: inline-flex; isolation: isolate; }
.btn-group > .btn { border-radius: 0; margin-inline-start: -1px; box-shadow: none; }
.btn-group > .btn:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; margin-inline-start: 0; }
.btn-group > .btn:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.btn-group > .btn:hover, .btn-group > .btn:focus-visible { z-index: 1; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-item .mi-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.menu-item .mi-hint { font-size: 11.5px; color: var(--subtle); }
.menu-item:disabled { opacity: .62; }
.menu-item:disabled .mi-hint { color: var(--muted); }
.menu { min-width: 220px; animation: menuIn var(--dur-in) var(--ease-out); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--primary); }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-3); color: var(--muted); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23647886' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-color: #fff; color: var(--text); background-position: right 11px center; }
select.input:hover:not(:disabled) { border-color: #A9C3C5; background-color: #FBFDFD; }
select.input:invalid, select.input option[value=""] { color: var(--subtle); }
select.input option { color: var(--text); }
.input { border-color: #CBDCDD; }
.input::placeholder { color: #5F717D; }
html { scroll-padding-top: 76px; scroll-padding-bottom: 84px; }
.chip-x { width: 24px; height: 24px; }
.label { font-size: var(--fs-sm); }
.form-section { padding: 24px; }
.form-section h3 { font-size: var(--fs-md); }
.form-section > p { max-width: 68ch; }
form.card > .card-foot { position: sticky; bottom: 0; z-index: 6; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: 0 -8px 24px -18px rgba(23, 50, 77, .35); padding: 12px 24px; }
.stepper { padding: 18px 24px; background: linear-gradient(180deg, #FAFDFD, #fff); border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* ---------- dashboard ---------- */
.dash-band { position: relative; margin: -24px -28px 20px; padding: 28px 28px 22px; background:
  radial-gradient(120% 140% at 100% 0%, rgba(15, 157, 146, .14) 0%, rgba(15, 157, 146, 0) 55%),
  linear-gradient(180deg, #E8F4F5 0%, rgba(244, 250, 250, 0) 100%); border-bottom: 1px solid rgba(220, 233, 233, .6); overflow: hidden; }
.dash-band::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 520px; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='200' viewBox='0 0 520 200' fill='none' stroke='%23087E8B' stroke-opacity='.16'%3E%3Cpath d='M0 170c80-30 160-60 260-40s180 10 260-40'/%3E%3Cpath d='M0 145c90-28 170-52 262-36s176 6 258-44'/%3E%3Cpath d='M0 120c96-26 176-44 264-32s172 2 256-48'/%3E%3Cpath d='M0 95c100-24 182-36 266-28s168-2 254-52'/%3E%3Cpath d='M0 70c106-22 188-28 268-24s164-6 252-56'/%3E%3C/svg%3E") right center / 520px 200px no-repeat; }
html[dir="rtl"] .dash-band::after { inset: 0 auto 0 0; transform: scaleX(-1); }
.dash-band .welcome { position: relative; z-index: 1; margin: 0; align-items: flex-end; }
.welcome h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; line-height: 1.15; margin-top: 4px; }
.welcome .date { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; margin: 0; }
.brief { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: var(--fs-sm); color: var(--text); flex-wrap: wrap; }
.brief > .ic { color: var(--primary); }
.brief a { color: var(--primary-700); font-weight: 600; }
.brief .sep { color: var(--border-strong); margin: 0 8px; }
.ctx-filters { background: rgba(255, 255, 255, .8); backdrop-filter: blur(6px); border-color: rgba(196, 216, 217, .7); padding: 6px; gap: 6px; }
.ctx-filters .cf { padding-inline-start: 8px; gap: 6px; color: var(--subtle); }
.ctx-filters select { min-width: 132px; height: 32px; border-color: transparent; background-color: transparent; font-weight: 560; color: var(--navy); }
.ctx-filters select:hover { background-color: var(--bg-2); border-color: transparent; }
.ctx-filters .cf + .cf { border-inline-start: 1px solid var(--border); }

/* KPI cards: whole card is the link */
.kpis { gap: 14px; }
.kpi { padding: 16px 18px 16px; gap: 6px; border-radius: 14px; border-color: var(--border); box-shadow: 0 1px 2px rgba(23, 50, 77, .04); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); border-color: var(--primary-200); }
.kpi:focus-visible { border-radius: 14px; box-shadow: var(--ring), var(--sh-hover); }
.kpi:active { transform: translateY(0); }
.kpi-top { justify-content: flex-start; gap: 10px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(8, 126, 139, .12); }
.kpi-warn .kpi-ic { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(150, 90, 0, .14); }
.kpi-danger .kpi-ic { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(180, 35, 24, .14); }
.kpi-green .kpi-ic { background: var(--secondary-50); color: var(--secondary-700); box-shadow: inset 0 0 0 1px rgba(10, 118, 110, .14); }
.kpi-label { font-size: var(--fs-sm); font-weight: 560; color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .go { color: var(--border-strong); opacity: 0; transform: translate(-3px, 3px); transition: opacity var(--dur), transform var(--dur) var(--ease), color var(--dur); }
.kpi:hover .go, .kpi:focus-visible .go { opacity: 1; color: var(--primary); transform: none; }
.kpi-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 40px; margin-top: 6px; }
.kpi-value { font-size: var(--fs-2xl); font-weight: 680; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--navy); }
.kpi-value small { font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; color: var(--subtle); margin-inline-start: 1px; }
.kpi-spark { display: block; line-height: 0; }
.kpi-sub { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 20px; }
.kpi-dot::before { content: "·"; margin-inline-end: 8px; color: var(--border-strong); }
.kpi-bit b { color: var(--navy); font-weight: 650; font-variant-numeric: tabular-nums; }
.delta { gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.delta.warn { color: var(--warning); background: var(--warning-bg); }

/* charts */
.g-chart { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.chart-card { display: flex; flex-direction: column; }
.card-head.stacked { flex-direction: column; align-items: flex-start; gap: 2px; border-bottom: 0; padding: 18px 20px 4px; }
.card-head.stacked h2 { font-size: var(--fs-md); }
.card-head.stacked .sub { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.chart-body { padding: 8px 20px 18px; flex: 1; }
.chart-box { height: 260px; }

/* lists */
.card-head h2 { font-size: var(--fs-md); }
.list-item { padding: 12px 20px; }
.list-item + .list-item { border-top: 0; }
.li-main .t { display: flex; align-items: center; gap: 8px; }
.li-main .t a { color: var(--navy); }
.li-main .t a:hover { color: var(--primary); }
.li-kind { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg-3); border-radius: 6px; padding: 0 6px; line-height: 18px; }
.li-ph { position: relative; flex: none; width: 36px; height: 36px; }
.li-ph .fph { border-radius: 10px; }
.li-badge { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 0 0 2px #fff; }
.li-badge.hunt { background: #B97A12; }
.li-badge.med { background: var(--info); }
.btn-approve { color: var(--success); }
.btn-approve:hover { background: var(--success-bg); border-color: #A6D8BC; color: #106A40; }
.btn-reject { color: var(--danger); }
.btn-reject:hover { background: var(--danger-bg); color: #8F1C13; }
.list-foot { justify-content: flex-start; }

/* ---------- falcon profile ---------- */
.profile { overflow: visible; }
.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding: 24px; background: linear-gradient(180deg, #F2F9F9 0%, #fff 70%); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ph-photo { position: relative; display: block; padding: 0; border: 0; background: none; border-radius: 18px; cursor: zoom-in; }
.ph-photo:disabled { cursor: default; }
.ph-photo img { display: block; width: 148px; height: 148px; object-fit: cover; border-radius: 18px; box-shadow: 0 0 0 4px #fff, 0 6px 20px rgba(23, 50, 77, .16); background: var(--bg-3); transition: transform var(--dur) var(--ease); }
.ph-photo:hover img { transform: scale(1.015); }
.ph-zoom { position: absolute; inset-inline-end: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(23, 50, 77, .72); color: #fff; opacity: 0; transition: opacity var(--dur); }
.ph-photo:hover .ph-zoom, .ph-photo:focus-visible .ph-zoom { opacity: 1; }
.ph-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ph-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-id { min-width: 0; }
.ph-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ph-title h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; line-height: 1.1; }
.ph-ar { font-size: var(--fs-lg); color: var(--muted); font-weight: 500; }
.ph-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); }
.ph-meta-line .mono { font-size: 12px; color: var(--subtle); }
.ph-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dl4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.stat-chip.sc-wide { grid-column: span 1; }
.sc-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.sc-t { display: flex; flex-direction: column; min-width: 0; }
.sc-k { font-size: 11.5px; color: var(--muted); font-weight: 560; }
.sc-v { font-size: var(--fs-base); font-weight: 650; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.sc-v .mono { font-size: 12.5px; }
.sc-x { font-size: 12px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-x .mono, .sc-v .mono { font-size: 12px; }
.stat-chip { align-items: flex-start; }
.sc-ic { margin-top: 2px; }
.ph-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.ph-note .ic { color: var(--subtle); }
.profile-tabs { padding: 0 16px; border-top: 1px solid var(--border); }
.profile-tabs .tabs { border-bottom: 1px solid var(--border); margin: 0 -16px; padding: 0 16px; }
.profile-body { background: #FBFDFD; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.panel.span-2 { grid-column: 1 / -1; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); margin-bottom: 14px; }
.panel-title .ic { color: var(--primary); }
.dl2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.dl2 dt { font-size: 12px; color: var(--muted); font-weight: 560; }
.dl2 dd { margin: 2px 0 0; font-weight: 600; color: var(--navy); word-break: break-word; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.metric-k { font-size: 12px; color: var(--muted); font-weight: 560; }
.metric-v { font-size: var(--fs-lg); font-weight: 680; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric-v small { font-size: var(--fs-xs); font-weight: 600; color: var(--subtle); letter-spacing: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gal-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--bg-3); cursor: zoom-in; display: block; width: 100%; }
.gal-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 300ms var(--ease-out); }
.gal-tile:hover img { transform: scale(1.03); }
.gal-cap { position: absolute; inset-inline-start: 10px; bottom: 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(23, 50, 77, .66); backdrop-filter: blur(4px); padding: 2px 8px; border-radius: 6px; }
.gal-missing { cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; background: var(--bg-2); border: 1.5px dashed var(--border-strong); padding: 12px; }
.gal-missing .gm-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--primary); border: 1px solid var(--border); margin-bottom: 4px; }
.gal-missing .btn { margin-top: 6px; }
.lineage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.lin-card { display: flex; align-items: center; gap: 12px; background: #fff; }
.lin-card .fph { border-radius: 10px; }
.lin-t { min-width: 0; }
.lin-t a.meta-v { display: block; color: var(--navy); }
.lin-t a.meta-v:hover { color: var(--primary); }
.lin-self { text-align: start; justify-content: flex-start; background: var(--primary-50); }

/* ---------- lightbox / credits ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 22, 33, .92); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fadeIn var(--dur-in) ease both; overscroll-behavior: contain; }
.lightbox.out { animation: fadeOut var(--dur-out) ease both; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: #fff; }
.lb-cap { font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.lb-count { font-size: 12px; color: #A8BCC9; font-variant-numeric: tabular-nums; }
.lb-stage { margin: 0; display: grid; place-items: center; padding: 0 72px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: pop var(--dur-in) var(--ease-out) both; }
.lb-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background var(--dur); }
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn:focus-visible { box-shadow: 0 0 0 3px rgba(124, 195, 201, .7); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { inset-inline-start: 16px; } .lb-next { inset-inline-end: 16px; }
.lb-credit { text-align: center; padding: 12px; font-size: 12px; color: #A8BCC9; }
.lb-link { border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.credits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.credits li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.credits img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }

/* ---------- sign-in ---------- */
body.is-login .app, body.is-login .toasts:empty { display: none; }
.login { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); background: #fff; overflow: auto; }
.login-hero { position: relative; overflow: hidden; min-height: 100dvh; background: var(--navy); }
.login-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; animation: heroIn 900ms var(--ease-out) both; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.login-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 44, .55) 0%, rgba(10, 30, 44, .08) 35%, rgba(10, 30, 44, .2) 55%, rgba(6, 40, 50, .88) 100%), linear-gradient(90deg, rgba(6, 94, 103, .35), rgba(6, 94, 103, 0) 60%); }
.login-brand { position: absolute; top: 32px; inset-inline-start: 40px; display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 650; font-size: var(--fs-md); }
.login-copy { position: absolute; inset-inline: 40px; bottom: 48px; color: #fff; max-width: 560px; }
.login-copy h1 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 680; }
.login-copy p { margin: 12px 0 0; color: rgba(255, 255, 255, .84); font-size: var(--fs-md); max-width: 46ch; }
.login-panel { display: grid; place-items: center; padding: 40px 32px; background: linear-gradient(180deg, #fff 0%, var(--bg-2) 100%); outline: none; }
.login-card { width: 100%; max-width: 460px; }
.login-mark { margin-bottom: 20px; }
.login-card h2 { font-size: var(--fs-xl); letter-spacing: -.02em; }
.login-card > p.muted { margin: 6px 0 24px; }
.btn-sso { width: 100%; gap: 10px; }
.ms-logo { display: grid; grid-template-columns: 8px 8px; gap: 2px; flex: none; }
.ms-logo i { width: 8px; height: 8px; display: block; }
.ms-logo i:nth-child(1) { background: #F25022; } .ms-logo i:nth-child(2) { background: #7FBA00; } .ms-logo i:nth-child(3) { background: #00A4EF; } .ms-logo i:nth-child(4) { background: #FFB900; }
.btn-sso[aria-busy="true"] .ms-logo { display: none; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--muted); font-size: var(--fs-xs); font-weight: 560; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.personas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.persona { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; text-align: start; min-width: 0; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur); min-height: 52px; }
.persona:hover { border-color: var(--primary-200); background: #FBFEFE; box-shadow: var(--sh-1); }
.persona .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.persona-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.persona-t > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-go { color: var(--border-strong); transition: color var(--dur), transform var(--dur) var(--ease); }
.persona:hover .persona-go { color: var(--primary); transform: translateX(2px); }
.login-foot { margin: 24px 0 0; }
.login-foot .lb-link { color: var(--primary-700); }

/* ---------- skeletons that mirror the page ---------- */
.sk-band { height: 108px; border-radius: var(--r-lg); margin-bottom: 20px; }
.sk-hero { height: 220px; border-radius: var(--r-lg); margin-bottom: 20px; }
.sk-table { border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; padding: 8px 16px; }
.sk-row { height: 36px; margin: 10px 0; border-radius: 8px; background: linear-gradient(90deg, #EEF5F5 0%, #F7FBFB 50%, #EEF5F5 100%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.g-chart .sk-block { margin-top: 0; height: 300px; }
.view-enter { animation: fadeUp var(--dur-in) var(--ease-out) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- tables ---------- */
.table th { font-size: 11.5px; letter-spacing: .05em; color: #5F7381; background: #F8FBFB; }
.table td { font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #F6FBFB; }
.cell-main strong { font-weight: 600; }
.empty-ic { border-radius: 14px; background: var(--primary-50); box-shadow: inset 0 0 0 1px rgba(8, 126, 139, .12); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1500px) {
  .crumbs .crumb-mid { display: none; }
}
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .profile-meta { display: none; }
}
@media (max-width: 1200px) {
  .g-side { grid-template-columns: minmax(0, 1fr); }
      .wb-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .kpi-value { font-size: 24px; }
  .recon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app, .app.collapsed { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .app .brand { padding: 0; justify-content: center; }
  .app .brand-text, .app .nav-label, .app .nav-sec-label, .app .chev, .app .nav-badge { display: none; }
  .app .nav { padding: 10px; }
  .app .nav-sec { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
  .app .nav-sec:first-child { border-top: 0; padding-top: 0; }
  .app .nav-item { justify-content: center; padding: 10px; }
  .app .nav-group-btn { display: none; }
  .app .nav-sub { display: block; margin: 0; padding: 0; border: 0; }
  .app .nav-sub .nav-item { padding: 10px; min-height: 40px; }
  .app .nav-item.active::before { inset-inline-start: -10px; }
  .collapse-btn { display: none !important; }
  .header { padding: 0 16px; gap: 10px; }
  .content { padding: 20px 20px 40px; }
  .crumbs .crumb-mid { display: none; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-layout { grid-template-columns: minmax(0, 1fr); }
  .wb-list { max-height: 240px; }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: var(--sh-3); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .app.drawer-open .sidebar { transform: none; }
  .app.drawer-open .scrim { display: block; }
  .app .brand { padding: 0 18px; justify-content: flex-start; }
  .app .brand-text, .app .nav-label, .app .nav-sec-label, .app .chev, .app .nav-badge { display: initial; }
  .app .nav { padding: 12px; }
  .app .nav-sec { border-top: 0; padding-top: 0; margin-top: 14px; }
  .app .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .app .nav-group-btn { display: flex; }
  .app .nav-sub { display: none; margin-inline-start: 21px; padding-inline-start: 8px; border-inline-start: 1px solid var(--border); }
  .app .nav-group.open .nav-sub { display: block; }
  .app .nav-sub .nav-item { padding: 7px 10px; min-height: 34px; }
  .app .nav-item.active::before { inset-inline-start: -12px; }
  .scrim { position: fixed; inset: 0; background: rgba(23, 50, 77, .4); z-index: 29; }
  .icon-btn.hamburger { display: inline-grid; }
  .crumbs { display: none; }
  .header-left { flex: 0 0 auto; }
  .gsearch { flex: 1 1 auto; }
  .kbd { display: none; }
  .gsearch .search-input .input { padding-inline-end: 12px; }
  .header-right { flex: 0 0 auto; gap: 6px; }
  .ctx-select select { max-width: 120px; }
  .ctx-select > .ic { display: none; }
  .form-grid, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .g-2, .g-3, .g-side-l { grid-template-columns: minmax(0, 1fr); }
        .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .fpicker-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .fpicker-row > :last-child { display: none; }
  .welcome h1 { font-size: 22px; }
  .page-title { font-size: 21px; }
  .week { grid-template-columns: repeat(7, minmax(84px, 1fr)); overflow-x: auto; }
  .cal-day { min-height: 84px; }
  .notif-pop, .profile-pop { position: fixed; top: 70px; inset-inline-end: 12px; }
}
@media (max-width: 1360px) {
  .gsearch { flex-basis: 340px; }
  .ctx-select select { max-width: 120px; }
}
@media (max-width: 1200px) {
  .g-chart { grid-template-columns: minmax(0, 1fr); }
  .profile-hero { grid-template-columns: auto minmax(0, 1fr); }
  .kpi-value { font-size: 26px; }
}
@media (max-width: 1100px) {
  .app .brand-link { justify-content: center; }
  .sidebar-foot { justify-content: center; padding: 10px 0; }
  .env-tag { display: none; }
  .dash-band { margin: -20px -20px 20px; padding: 24px 20px 20px; }
  .lang-toggle { margin: 0 2px; }
}
@media (max-width: 1024px) {
  .ctx-select > .ic:first-of-type { display: none; }
  .ph-stats, .dl4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .ph-photo img { width: 112px; height: 112px; }
}
@media (max-width: 860px) {
  .app .brand-link { justify-content: flex-start; }
  .app .sidebar-foot { justify-content: space-between; padding: 10px 14px; }
  .app .env-tag { display: inline; }
  .collapse-btn { display: none !important; }
  .hdr-sep { display: none; }
  .ctx-select select { max-width: 96px; }
  .dash-band::after { display: none; }
  .ctx-filters { width: 100%; }
  .ctx-filters .cf { flex: 1 1 0; min-width: 0; }
  .ctx-filters select { min-width: 0; width: 100%; }
  .profile-hero { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px; }
  .ph-photo img { width: 96px; height: 96px; border-radius: 14px; }
  .app .brand-text { display: flex; }
  .ctx-select > .ctx-chev { display: inline-block; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dl2 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { min-height: 260px; }
  .login-copy h1 { font-size: 24px; }
  .login-copy p { display: none; }
  .lineage { grid-template-columns: minmax(0, 1fr); }
  .credits { grid-template-columns: minmax(0, 1fr); }
  .lb-stage { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print */
@media print {
  body { background: #fff; }
  .sidebar, .header, .no-print, .toasts, .filterbar, .table-foot, .page-actions, .back-link { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .table-wrap { max-height: none; overflow: visible; }
  .table th { position: static; }
  .print-head { display: block; margin-bottom: 12px; }
  .chart-box { height: 240px; }
}
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* RTL: let mixed English content (IDs, numbers, English sentences) resolve its own direction */
html[dir="rtl"] :is(p, td, .kpi-sub, .li-main .t, .li-main .s, .page-sub, .card-head .sub, .small, .xs, .hint, .meta-v, .toast-msg, .notif-body, .notif-title, .tl-body, .date) { unicode-bidi: plaintext; }
.btn-icon-end { flex-direction: row-reverse; }
html[dir="rtl"] .btn-icon-end .ic { transform: scaleX(-1); }
html[dir="rtl"] :is(.brief a, .kpi-sub > span, .delta, .sc-x, .sc-v, .ph-meta-line, .li-kind, .stat-chip .sc-k) { unicode-bidi: plaintext; }
.lightbox { background: rgba(10, 22, 33, .95); backdrop-filter: blur(6px); }
