/* =====================================================================
   ERP Design System — RTL/LTR · Light/Dark · Responsive
   Brand tokens are injected per install from the white-label settings.
   ===================================================================== */

@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(../fonts/plex-arabic-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(../fonts/plex-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(../fonts/plex-arabic-600.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(../fonts/plex-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(../fonts/plex-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(../fonts/plex-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(../fonts/plex-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(../fonts/plex-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(../fonts/tajawal-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(../fonts/tajawal-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(../fonts/tajawal-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(../fonts/tajawal-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(../fonts/tajawal-arabic-800.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(../fonts/tajawal-latin-800.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #096B6A; --brand-rgb: 9,107,106;
  --brand-900: #042F2F; --brand-800: #06403F; --brand-700: #075150; --brand-600: #085E5D;
  --brand-400: #3E8C8B; --brand-300: #74ADAC; --brand-200: #B5D5D4; --brand-100: #DCEDEC; --brand-50: #EDF6F5;
  --brand-fg: #096B6A;
  --accent: #C6A15B; --accent-rgb: 198,161,91; --accent-50: #FAF5EB;

  --bg: #F1F6F5; --surface: #ffffff; --surface-2: #F8FBFB; --surface-3: #ECF3F2;
  --border: #DFE9E8; --border-2: #CFDDDC;
  --text: #0D2423; --text-2: #46605E; --muted: #5F7674;
  --shadow-sm: 0 1px 2px rgba(4,40,39,.05);
  --shadow: 0 10px 24px -18px rgba(4,40,39,.42), 0 1px 2px rgba(4,40,39,.04);
  --shadow-lg: 0 24px 48px -20px rgba(4,40,39,.32), 0 4px 12px rgba(4,40,39,.06);
  --ring: 0 0 0 3px rgba(var(--brand-rgb), .18);

  --success: #0E8A5F; --success-bg: #E6F6EF;
  --warning: #B26A00; --warning-bg: #FDF4E1;
  --danger: #C62828; --danger-bg: #FDECEC;
  --info: #1D5FD1; --info-bg: #E9F0FD;
  --neutral: #586C6B; --neutral-bg: #ECF2F1;

  --radius: 20px; --radius-sm: 12px; --radius-xs: 8px;
  --sb-w: 264px; --sb-w-collapsed: 92px; --top-h: 76px; --sb-gap: 12px;
  --font: "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Tajawal", "Plex Arabic", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #091312; --surface: #0F1C1B; --surface-2: #132322; --surface-3: #1A2D2C;
  --border: #213634; --border-2: #2B4442;
  --text: #E9F3F2; --text-2: #B6CBC9; --muted: #8EA5A3;
  --brand-50: rgba(var(--brand-rgb), .16); --brand-100: rgba(var(--brand-rgb), .28);
  --brand-fg: #7CCFC6;
  --accent-50: rgba(var(--accent-rgb), .12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 16px 50px rgba(0,0,0,.5);
  --success: #3DD19A; --success-bg: rgba(61,209,154,.12);
  --warning: #F2B64C; --warning-bg: rgba(242,182,76,.12);
  --danger: #F47171; --danger-bg: rgba(244,113,113,.12);
  --info: #7AA7FF; --info-bg: rgba(122,167,255,.12);
  --neutral: #A7BCBA; --neutral-bg: rgba(167,188,186,.1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: lining-nums; }
a { color: var(--brand-fg); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.cur { font-size: .8em; color: var(--muted); font-weight: 500; margin-inline-start: 2px; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 15px; height: 15px; } .i.lg { width: 22px; height: 22px; } .i.xl { width: 28px; height: 28px; }
[dir="rtl"] .flip { transform: scaleX(-1); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: rgba(var(--brand-rgb), .2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.scroll-thin { scrollbar-width: thin; }

/* ------------------------------ App shell ------------------------------ */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sb-w); z-index: 60; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-800) 55%, var(--brand-700) 100%); color: rgba(255,255,255,.82);
  transition: width .22s ease, transform .25s ease; }
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 300px at 110% -10%, rgba(var(--accent-rgb), .12), transparent 60%); }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; height: 72px; position: relative; z-index: 1; }
.sb-brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; flex: 1; }
.sb-brand:hover { text-decoration: none; }
.sb-logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sb-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sb-brand-text { min-width: 0; line-height: 1.25; }
.sb-brand-text b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand-text small { color: rgba(255,255,255,.55); font-size: 11.5px; white-space: nowrap; }
.sb-collapse { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; }
.sb-collapse:hover { background: rgba(255,255,255,.16); }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sb-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.4); padding: 14px 12px 6px; text-transform: uppercase; }
.sb-link, .sb-group-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; color: rgba(255,255,255,.78); font: inherit; font-size: 13.5px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: start; position: relative; transition: background .15s, color .15s; }
.sb-link:hover, .sb-group-btn:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sb-link.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sb-link.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
[dir="rtl"] .sb-link.active::before { border-radius: 3px 0 0 3px; }
.sb-link .i, .sb-group-btn .i { opacity: .9; }
.sb-link span, .sb-group-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-count { background: var(--accent); color: #0A2423; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 0 7px; line-height: 18px; min-width: 20px; text-align: center; }
.sb-group-btn .chev { transition: transform .2s; opacity: .6; width: 16px; height: 16px; }
.sb-group.open > .sb-group-btn .chev { transform: rotate(180deg); }
.sb-sub { display: none; padding: 2px 0 6px; margin-inline-start: 21px; border-inline-start: 1px solid rgba(255,255,255,.1); padding-inline-start: 8px; }
.sb-group.open > .sb-sub { display: block; }
.sb-sub .sb-link { padding: 7px 12px; font-size: 13px; color: rgba(255,255,255,.66); }
.sb-sub .sb-link.active::before { inset-inline-start: -9px; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.sb-portals { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-portals a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.75); background: rgba(255,255,255,.06); border-radius: 9px; padding: 8px 6px; white-space: nowrap; }
.sb-portals a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.sb-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sb-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin .22s ease; }
body.sb-collapsed .sidebar { width: var(--sb-w-collapsed); }
body.sb-collapsed .main { margin-inline-start: var(--sb-w-collapsed); }
body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-link span, body.sb-collapsed .sb-group-btn span, body.sb-collapsed .sb-label, body.sb-collapsed .sb-group-btn .chev, body.sb-collapsed .sb-count, body.sb-collapsed .sb-portals span { display: none; }
body.sb-collapsed .sb-sub { margin: 0; padding: 0; border: 0; }
body.sb-collapsed .sb-link, body.sb-collapsed .sb-group-btn { justify-content: center; padding: 10px; }
body.sb-collapsed .sb-head { flex-direction: column; height: auto; }
body.sb-collapsed .sb-portals { flex-direction: column; }

.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.tb-burger { display: none; }
.tb-search { display: flex; align-items: center; gap: 10px; height: 40px; min-width: 300px; max-width: 460px; flex: 0 1 420px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.tb-search:hover { border-color: var(--border-2); }
.tb-search > span:not(.kbd) { flex: 1; min-width: 0; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-search .kbd { flex: none; white-space: nowrap; }
.kbd { font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; color: var(--muted); background: var(--surface-2); direction: ltr; }
.tb-spacer { flex: 1; }
.tb-date { color: var(--text-2); font-size: 12.5px; text-align: end; line-height: 1.35; white-space: nowrap; }
.tb-date small { display: block; color: var(--muted); }
.tb-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); font: inherit; font-weight: 700; font-size: 12px; }
.tb-btn:hover { color: var(--brand-fg); border-color: var(--border-2); text-decoration: none; }
.tb-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px; padding-inline-end: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--shadow-sm); }
.tb-user-meta { text-align: start; line-height: 1.25; }
.tb-user-meta b { display: block; font-size: 13px; font-weight: 600; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user-meta small { color: var(--muted); font-size: 11.5px; }

.content { flex: 1; padding: 22px 24px 40px; width: 100%; max-width: 1640px; margin: 0 auto; }
.footer { padding: 16px 24px; color: var(--muted); font-size: 12px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); }
.footer a { color: var(--text-2); }

/* Progress bar (no spinners) */
#topProgress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 999; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
#topProgress.on { opacity: 1; }
#topProgress::before { content: ""; position: absolute; top: 0; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), var(--brand-300), transparent); animation: slidebar 1.1s ease-in-out infinite; }
@keyframes slidebar { 0% { inset-inline-start: -40%; } 100% { inset-inline-start: 100%; } }

/* ------------------------------ Page header ---------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; }
.ph-sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand-fg); }
.crumbs .i { width: 13px; height: 13px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-fg); flex: none; }

/* ------------------------------ Buttons -------------------------------- */
.btn { --bh: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--bh); padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; user-select: none; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(var(--brand-rgb), .3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--brand-600); }
:root[data-theme="dark"] .btn-primary { background: color-mix(in srgb, var(--brand) 70%, #fff 12%); }
.btn-accent { background: var(--accent); color: #0A2423; }
.btn-accent:hover { filter: brightness(.95); }
.btn-outline { background: var(--surface); border-color: var(--border-2); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--brand-300); color: var(--brand-fg); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--brand-50); color: var(--brand-fg); }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.93); }
.btn-soft-danger { background: var(--danger-bg); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-soft-success { background: var(--success-bg); color: var(--success); }
.btn-sm { --bh: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-xs { --bh: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-lg { --bh: 48px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn-icon { width: var(--bh); padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .65; pointer-events: none; }
.btn.loading::after { content: ""; width: 18px; height: 4px; border-radius: 4px; background: currentColor; animation: pulsebar .8s ease-in-out infinite alternate; }
@keyframes pulsebar { from { opacity: .25; transform: scaleX(.4); } to { opacity: 1; transform: scaleX(1); } }
.btn-group { display: inline-flex; border: 1px solid var(--border-2); border-radius: 11px; overflow: hidden; background: var(--surface); }
.btn-group .btn { border-radius: 0; border: 0; border-inline-end: 1px solid var(--border); height: 38px; }
.btn-group .btn:last-child { border-inline-end: 0; }
.btn-group .btn.active { background: var(--brand-50); color: var(--brand-fg); }

/* ------------------------------ Cards & grid --------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head.flat { border-bottom: 0; padding-bottom: 4px; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title .i { color: var(--brand-fg); }
.card-sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.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-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; } .mb-1 { margin-bottom: 8px; }

/* KPI tiles */
.kpi { position: relative; padding: 18px; display: flex; gap: 14px; align-items: flex-start; overflow: hidden; }
.kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand-fg); }
.kpi-icon.t-success { background: var(--success-bg); color: var(--success); }
.kpi-icon.t-warning { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.t-danger { background: var(--danger-bg); color: var(--danger); }
.kpi-icon.t-info { background: var(--info-bg); color: var(--info); }
.kpi-icon.t-accent { background: var(--accent-50); color: #9b7524; }
:root[data-theme="dark"] .kpi-icon.t-accent { color: var(--accent); }
.kpi-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 23px; font-weight: 700; line-height: 1.25; margin-top: 2px; direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }
.kpi-value .cur { font-size: 12px; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 3px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; direction: ltr; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }
a.kpi:hover { text-decoration: none; border-color: var(--brand-200); }

/* Hero / welcome band */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 24px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(900px 300px at 100% 0%, rgba(var(--accent-rgb), .28), transparent 55%), linear-gradient(120deg, var(--brand-900), var(--brand) 70%, var(--brand-400)); }
.hero::after { content: ""; position: absolute; inset-inline-end: -30px; bottom: -40px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255,255,255,.05); }
.hero h2 { font-size: 21px; }
.hero p { color: rgba(255,255,255,.75); margin: 6px 0 0; }
.hero .hero-meta { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.85); }
.hero .hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); box-shadow: none; }
.hero .btn-outline:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ------------------------------ Badges, chips -------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-warning { background: var(--warning-bg); color: var(--warning); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-neutral { background: var(--neutral-bg); color: var(--neutral); }
.tone-brand { background: var(--brand-50); color: var(--brand-fg); }
.tone-accent { background: var(--accent-50); color: #8a661c; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; font-size: 12px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.pill-count { background: var(--surface-3); color: var(--text-2); border-radius: 20px; padding: 0 8px; font-size: 11.5px; font-weight: 600; }

/* Avatars */
.avatar { --h: 270; width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; overflow: hidden;
  background: hsl(var(--h) 45% 92%); color: hsl(var(--h) 45% 32%); }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 60% 82%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; border-radius: 8px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; border-radius: 24px; }
.who { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.who b { font-weight: 600; display: block; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); display: block; line-height: 1.3; }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-inline-start: -8px; }
.avatars .avatar:first-child { margin-inline-start: 0; }

/* ------------------------------ Forms ---------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.fg { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fg.c-12 { grid-column: span 12; } .fg.c-8 { grid-column: span 8; } .fg.c-4 { grid-column: span 4; } .fg.c-3 { grid-column: span 3; } .fg.c-9 { grid-column: span 9; }
.label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 4px; }
.label .req { color: var(--danger); }
.hint { font-size: 12px; color: var(--muted); }
.err { font-size: 12px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-200); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.input[readonly], .input:disabled, .select:disabled { background: var(--surface-3); color: var(--text-2); }
.has-err .input, .has-err .select, .has-err .textarea, .has-err .combo-btn { border-color: var(--danger); }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; 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='%238C8397' 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: left 12px center; }
[dir="ltr"] .select { background-position: right 12px center; }
.input[type="date"], .input[type="datetime-local"], .input[type="time"], .input[type="month"] { direction: ltr; text-align: end; }
[dir="ltr"] .input[type="date"], [dir="ltr"] .input[type="datetime-local"], [dir="ltr"] .input[type="time"], [dir="ltr"] .input[type="month"] { text-align: start; }
.input[type="color"] { padding: 4px; width: 64px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group .input:first-child { border-start-start-radius: 11px; border-end-start-radius: 11px; }
.input-group .input:last-child { border-start-end-radius: 11px; border-end-end-radius: 11px; }
.input-addon { display: grid; place-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.input-addon:first-child { border-start-start-radius: 11px; border-end-start-radius: 11px; border-inline-end: 0; }
.input-addon:last-child { border-start-end-radius: 11px; border-end-end-radius: 11px; border-inline-start: 0; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 13px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-inline-start: 40px; }
.form-section { margin-bottom: 18px; }
.form-section-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }

.check, .radio { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 8px 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 20px; background: var(--border-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.rating-input { display: inline-flex; gap: 4px; direction: ltr; }
.rating-input label { cursor: pointer; color: var(--border-2); }
.rating-input input { display: none; }
.rating-input label.on { color: var(--accent); }
.rating-input .i { width: 24px; height: 24px; fill: currentColor; }
.file-drop { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.file-drop:hover, .file-drop.drag { border-color: var(--brand-300); background: var(--brand-50); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .fd-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--brand-fg); border: 1px solid var(--border); flex: none; }
.file-drop .fd-text { font-size: 13px; color: var(--text-2); min-width: 0; }
.file-drop .fd-text b { color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-current { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-top: 6px; flex-wrap: wrap; }
.img-preview { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }

/* Combobox (enhanced select) */
.combo { position: relative; }
.combo-btn { width: 100%; height: 42px; border: 1px solid var(--border-2); border-radius: 11px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; display: flex; align-items: center; gap: 8px; padding: 0 13px; cursor: pointer; text-align: start; }
.combo-btn:hover { border-color: var(--brand-200); }
.combo.open .combo-btn, .combo-btn:focus { border-color: var(--brand-400); box-shadow: var(--ring); outline: none; }
.combo-btn .combo-val { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-btn .combo-val.ph { color: var(--muted); }
.combo-btn .i { color: var(--muted); width: 16px; height: 16px; }
.combo-clear { border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.combo-clear:hover { background: var(--surface-3); color: var(--danger); }
.combo-pop { position: absolute; z-index: 80; top: calc(100% + 6px); inset-inline: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); display: none; overflow: hidden; }
.combo.open .combo-pop { display: block; }
.combo.up .combo-pop { top: auto; bottom: calc(100% + 6px); }
.combo-search { padding: 8px; border-bottom: 1px solid var(--border); }
.combo-search input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; font: inherit; background: var(--surface-2); color: var(--text); }
.combo-search input:focus { outline: none; border-color: var(--brand-300); }
.combo-list { max-height: 260px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.combo-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.combo-opt:hover, .combo-opt.hl { background: var(--brand-50); color: var(--brand-fg); }
.combo-opt.sel { font-weight: 600; color: var(--brand-fg); }
.combo-opt.sel::after { content: "✓"; margin-inline-start: auto; }
.combo-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.combo-add { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; }

/* ------------------------------ Tables --------------------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search-box { flex: 1 1 260px; max-width: 380px; }
.toolbar .select, .toolbar .input { height: 38px; font-size: 13px; }
.toolbar .select { width: auto; min-width: 150px; max-width: 220px; }
.filters-panel { display: none; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters-panel.open { display: block; }
.filters-panel .form-grid { gap: 12px; }
.filters-panel .fg { grid-column: span 3; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.table-wrap { width: 100%; overflow-x: auto; scrollbar-width: thin; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: start; font-weight: 600; font-size: 12px; color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--brand-fg); text-decoration: none; }
.table th.sorted { color: var(--brand-fg); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.row-link { cursor: pointer; }
.table .t-num { text-align: end; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .table .t-num { text-align: left; }
.table .t-check { width: 42px; }
.table .t-actions { width: 1%; white-space: nowrap; text-align: end; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table .title-cell { font-weight: 600; color: var(--text); }
.table .title-cell:hover { color: var(--brand-fg); }
.table .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.row-actions { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; padding: 0 8px; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); font-weight: 600; }
.pager-links a:hover { border-color: var(--brand-300); color: var(--brand-fg); text-decoration: none; }
.pager-links .cur-page { background: var(--brand); color: #fff; border-color: var(--brand); }
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--brand-fg); }
.bulk-bar.show { display: flex; }

/* Definition list */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.dl > div { padding: 12px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.dl > div:nth-child(odd) { border-inline-end: 1px solid var(--border); }
.dl dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.dl > .full { grid-column: span 2; border-inline-end: 0 !important; }
.dl.one { grid-template-columns: 1fr; } .dl.one > div { border-inline-end: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); }
.kv b { font-weight: 600; }
.kv.total { border-top: 2px solid var(--text); border-bottom: 0; font-size: 16px; padding-top: 12px; margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--brand-fg); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); border: 0; background: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg .active { background: var(--surface); color: var(--brand-fg); box-shadow: var(--shadow-sm); }

/* Dropdown */
.dd { position: relative; display: inline-flex; }
.dd-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 90; display: none; }
.dd.open .dd-menu { display: block; animation: pop .14s ease-out; }
.dd-menu.start { inset-inline-end: auto; inset-inline-start: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px; color: var(--text); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: start; white-space: nowrap; }
.dd-item:hover { background: var(--surface-3); text-decoration: none; }
.dd-item .i { color: var(--text-2); }
.dd-item.danger, .dd-item.danger .i { color: var(--danger); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 10px 11px 8px; }
.dd-head b { display: block; }
.dd-head small { color: var(--muted); }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 330px; }
.qa-grid a { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border-radius: 11px; font-size: 12px; color: var(--text-2); text-align: center; font-weight: 500; }
.qa-grid a:hover { background: var(--brand-50); color: var(--brand-fg); text-decoration: none; }
.qa-grid a span.ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand-fg); }

/* Notifications panel */
.notif-menu { width: 380px; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); position: relative; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--brand-50); }
.notif.unread::after { content: ""; position: absolute; top: 18px; inset-inline-end: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.notif-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand-fg); flex: none; }
.notif-body { min-width: 0; flex: 1; font-size: 13px; }
.notif-body b { display: block; font-weight: 600; padding-inline-end: 14px; }
.notif-body p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-body small { color: var(--muted); }
.notif-foot { padding: 10px; text-align: center; font-size: 13px; font-weight: 600; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,10,20,.5); backdrop-filter: blur(3px); animation: fade .15s; }
.modal-box { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; border: 1px solid var(--border); }
.modal-box.lg { max-width: 820px; } .modal-box.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.confirm-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); margin-bottom: 14px; }

/* Command palette */
.cmdk .modal-box { max-width: 640px; align-self: flex-start; margin-top: 8vh; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.cmdk-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); }
.cmdk-item:hover, .cmdk-item.hl { background: var(--brand-50); text-decoration: none; }
.cmdk-item .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--brand-fg); flex: none; }
.cmdk-item small { display: block; color: var(--muted); }

/* Toasts */
#toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: flex-start; gap: 12px; min-width: 280px; max-width: 420px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; font-size: 13.5px; }
.toast .t-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.toast.success .t-ic { background: var(--success-bg); color: var(--success); }
.toast.error .t-ic { background: var(--danger-bg); color: var(--danger); }
.toast.warning .t-ic { background: var(--warning-bg); color: var(--warning); }
.toast.info .t-ic { background: var(--info-bg); color: var(--info); }
.toast .t-close { margin-inline-start: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .i { margin-top: 2px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-error, .alert-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert b { color: inherit; }
.alert p { margin: 2px 0 0; color: var(--text-2); }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-fg); }
.empty-ic .i { width: 28px; height: 28px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }
.empty.sm { padding: 26px 16px; } .empty.sm .empty-ic { width: 46px; height: 46px; border-radius: 14px; }

/* Progress */
.progress { height: 8px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--brand), var(--brand-400)); }
.progress.sm { height: 5px; }
.progress.success > span { background: var(--success); } .progress.warning > span { background: var(--warning); } .progress.danger > span { background: var(--danger); } .progress.accent > span { background: var(--accent); }
.ring { --p: 50; --c: var(--brand); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 14px; direction: ltr; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-main small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand-fg); flex: none; }
.date-tile { width: 46px; text-align: center; border-radius: 11px; overflow: hidden; border: 1px solid var(--border); flex: none; background: var(--surface); }
.date-tile b { display: block; font-size: 17px; line-height: 1.2; padding-top: 3px; }
.date-tile small { display: block; font-size: 10.5px; background: var(--brand); color: #fff; padding: 1px 0; }

/* Timeline */
.timeline { position: relative; padding: 6px 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 0 18px 16px; }
.tl-item::before { content: ""; position: absolute; top: 30px; bottom: 0; inset-inline-start: 34px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); color: var(--brand-fg); display: grid; place-items: center; flex: none; position: relative; z-index: 1; border: 1px solid var(--border); }
.tl-dot .i { width: 15px; height: 15px; }
.tl-body { flex: 1; min-width: 0; font-size: 13px; padding-top: 5px; }
.tl-body b { font-weight: 600; }
.tl-body .muted { font-size: 12px; }
.tl-body .note-text { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 6px; white-space: pre-wrap; color: var(--text); }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scrollbar-width: thin; min-height: 60vh; }
.kb-col { flex: 0 0 300px; background: var(--surface-3); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); border: 1px solid var(--border); }
.kb-head { padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.kb-head .kb-sum { margin-inline-start: auto; font-size: 12px; color: var(--muted); font-weight: 600; direction: ltr; }
.kb-head .kb-bar { height: 3px; }
.kb-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; scrollbar-width: thin; }
.kb-list.over { background: var(--brand-50); border-radius: 12px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .15s, transform .15s; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.kb-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.kb-card.dragging { opacity: .5; transform: rotate(0deg) scale(.98); }
.kb-card-title { font-weight: 600; font-size: 13.5px; color: var(--text); display: block; margin-bottom: 6px; line-height: 1.45; }
.kb-card-title:hover { color: var(--brand-fg); text-decoration: none; }
.kb-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.kb-meta .i { width: 13px; height: 13px; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.kb-add { margin: 0 10px 10px; }
.prio { display: inline-block; width: 4px; height: 16px; border-radius: 3px; }
.prio-urgent { background: var(--danger); } .prio-high { background: #E8590C; } .prio-medium { background: var(--warning); } .prio-low { background: var(--muted); }
.kb-ghost { height: 60px; border: 2px dashed var(--brand-300); border-radius: 12px; background: var(--brand-50); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cal-dow { padding: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 118px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; min-width: 0; }
.cal-day:nth-child(7n) { border-inline-end: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--muted); opacity: .6; }
.cal-num { font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-ev { display: block; font-size: 11.5px; padding: 3px 7px; border-radius: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--brand-50); color: var(--brand-fg); border-inline-start: 3px solid var(--brand); font-weight: 500; }
.cal-ev:hover { text-decoration: none; filter: brightness(.97); }
.cal-more { font-size: 11px; color: var(--muted); padding: 2px 6px; }

/* Line items editor */
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lines-table td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--border); }
.lines-table .input, .lines-table .select, .lines-table .combo-btn { height: 38px; font-size: 13px; }
.lines-table .l-desc { min-width: 240px; }
.lines-table .l-num { width: 110px; }
.lines-table .l-qty { width: 84px; }
.lines-table .l-total { width: 130px; text-align: end; font-weight: 600; padding-top: 14px; direction: ltr; white-space: nowrap; }
[dir="rtl"] .lines-table .l-total { text-align: left; }
.lines-table .l-del { width: 40px; }
.lines-table .l-item { width: 190px; }
.totals-box { width: 100%; max-width: 380px; margin-inline-start: auto; }

/* Document (print-like) view */
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-sm); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 22px; border-bottom: 2px solid var(--brand); margin-bottom: 22px; flex-wrap: wrap; }
.doc-logo { height: 70px; }
.doc-title { text-align: end; }
.doc-title h2 { font-size: 26px; color: var(--brand-fg); }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.doc-party { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13px; }
.doc-party h4 { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th { background: var(--brand); color: #fff; padding: 10px; text-align: start; font-weight: 600; }
.doc-table th:first-child { border-start-start-radius: 8px; } .doc-table th:last-child { border-start-end-radius: 8px; }
.doc-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.doc-foot { display: flex; justify-content: space-between; gap: 24px; margin-top: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr-box { width: 130px; height: 130px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fff; }
.qr-box img, .qr-box canvas, .qr-box svg { width: 100%; height: 100%; }

/* Stats / misc */
.stat-row { display: flex; gap: 0; border-top: 1px solid var(--border); }
.stat-row > div { flex: 1; padding: 14px 16px; border-inline-end: 1px solid var(--border); }
.stat-row > div:last-child { border-inline-end: 0; }
.stat-row small { color: var(--muted); display: block; font-size: 12px; }
.stat-row b { font-size: 17px; direction: ltr; display: inline-block; }
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; } .chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-list .bl-row { display: grid; grid-template-columns: 130px 1fr 80px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.bar-list .bl-row b { text-align: end; direction: ltr; font-weight: 600; }
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px; flex-wrap: wrap; }
.profile-head h2 { font-size: 20px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.color-dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; vertical-align: middle; border: 1px solid rgba(0,0,0,.08); }
.check-list li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 22px 0 10px; letter-spacing: .02em; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: start; }
.perm-mod { background: var(--surface-2); font-weight: 700; }
.code-box { background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; direction: ltr; text-align: left; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.placeholder-list code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; direction: ltr; display: inline-block; margin: 2px; cursor: pointer; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Check-in widget */
.clock-card { text-align: center; padding: 26px 20px; }
.clock-time { font-size: 44px; font-weight: 700; letter-spacing: .02em; direction: ltr; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock-date { color: var(--muted); margin-top: 6px; }
.clock-btn { width: 170px; height: 170px; border-radius: 50%; margin: 22px auto 10px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font: inherit; font-weight: 700; font-size: 17px;
  background: radial-gradient(circle at 30% 25%, var(--brand-400), var(--brand) 60%, var(--brand-900)); box-shadow: 0 16px 40px rgba(var(--brand-rgb), .35), inset 0 2px 0 rgba(255,255,255,.2); transition: transform .15s, box-shadow .15s; position: relative; }
.clock-btn::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(var(--brand-rgb), .15); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); opacity: .5; } }
.clock-btn:hover { transform: translateY(-2px); }
.clock-btn.out { background: radial-gradient(circle at 30% 25%, #f08a6b, #D9480F 60%, #8a2c05); box-shadow: 0 16px 40px rgba(217,72,15,.3); }
.clock-btn.out::before { border-color: rgba(217,72,15,.18); }
.clock-btn.done { background: radial-gradient(circle at 30% 25%, #6fdcb0, var(--success) 60%, #065f41); box-shadow: 0 16px 40px rgba(14,138,95,.28); cursor: default; }
.clock-btn .i { width: 40px; height: 40px; display: block; margin: 0 auto 6px; }
.geo-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 12px; border-radius: 20px; background: var(--surface-3); color: var(--text-2); }

/* ------------------------------ Auth pages ----------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-brand { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(800px 500px at 110% -10%, rgba(var(--accent-rgb), .35), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(255,255,255,.08), transparent 60%), linear-gradient(150deg, var(--brand-900), var(--brand) 65%, var(--brand-400)); }
.auth-brand.has-bg { background-size: cover; background-position: center; }
.auth-brand.has-bg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(150deg, rgba(var(--brand-rgb), .92), rgba(var(--brand-rgb), .7)); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-dots { position: absolute; inset: 0; z-index: 0 !important; opacity: .09; background-image: radial-gradient(#fff 1.5px, transparent 1.6px); background-size: 26px 26px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent); }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo .sb-logo { width: 58px; height: 58px; border-radius: 16px; }
.auth-logo b { font-size: 20px; display: block; }
.auth-logo small { color: rgba(255,255,255,.65); }
.auth-hero h1 { font-size: 36px; line-height: 1.3; max-width: 520px; }
.auth-hero p { color: rgba(255,255,255,.75); font-size: 16px; max-width: 480px; margin-top: 14px; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin-top: 30px; }
.auth-feats div { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 11px 13px; font-size: 13.5px; backdrop-filter: blur(4px); }
.auth-feats .i { color: var(--accent); }
.auth-foot { color: rgba(255,255,255,.55); font-size: 12.5px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; position: relative; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; }
.auth-card .sub { color: var(--muted); margin: 8px 0 26px; }
.auth-portal-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: var(--brand-50); color: var(--brand-fg); font-weight: 600; font-size: 12.5px; margin-bottom: 18px; }
.auth-card .fg { margin-bottom: 16px; }
.auth-card .input { height: 48px; border-radius: 12px; }
.auth-top { position: absolute; top: 20px; inset-inline-end: 24px; display: flex; gap: 8px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: 13px; }
.auth-other { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; }
.auth-other a { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.auth-other a:hover { color: var(--brand-fg); border-color: var(--brand-200); text-decoration: none; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; direction: ltr; margin: 10px 0 20px; }
.otp-inputs input { width: 52px; height: 60px; text-align: center; font-size: 24px; font-weight: 700; border-radius: 13px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-family: inherit; }
.otp-inputs input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.pw-toggle { position: absolute; right: 8px; left: auto; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; } /* passwords are typed left-to-right: the eye sits on the opposite (right) side */

/* Super admin theme: darker, gold-accented */
body.portal-super .sidebar { background: linear-gradient(180deg, #021212 0%, #052322 60%, #08302F 100%); }
body.portal-super .sb-link.active { background: rgba(var(--accent-rgb), .14); color: var(--accent); }
body.portal-super .sb-link.active .i { color: var(--accent); }
.super-auth .auth-brand { background: radial-gradient(700px 500px at 110% -10%, rgba(var(--accent-rgb), .3), transparent 60%), linear-gradient(150deg, #031414, #062625 60%, #0B3634); }
.super-auth .auth-portal-tag { background: var(--accent-50); color: #8a661c; }

/* Employee portal: bottom tab bar on mobile */
.tabbar { display: none; }

/* Portal (employee/client) top-nav variant */
.pnav-shell .main { margin-inline-start: 0; }

/* ------------------------------ Responsive ----------------------------- */
/* Line items: popups must not be clipped; stack rows on smaller screens */
[data-lines] .table-wrap { overflow: visible; }
@media (max-width: 1100px) {
  [data-lines] .lines-table thead { display: none; }
  [data-lines] .lines-table, [data-lines] .lines-table tbody { display: block; }
  [data-lines] .lines-table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--surface-2); }
  [data-lines] .lines-table td { display: block; border: 0; padding: 0; width: auto; min-width: 0; }
  [data-lines] .lines-table td::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
  [data-lines] .lines-table td.l-del::before { content: none; }
  [data-lines] .lines-table .l-item, [data-lines] .lines-table .l-desc { grid-column: span 2; }
  [data-lines] .lines-table .l-total { grid-column: span 3; padding-top: 0; text-align: start; font-size: 15px; }
  [data-lines] .lines-table .l-del { grid-column: span 1; justify-self: end; align-self: end; }
}
@media (max-width: 560px) {
  [data-lines] .lines-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-lines] .lines-table .l-total { grid-column: span 1; }
}

@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr) 300px; }
  .tb-date { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(100%); width: var(--sb-w) !important; box-shadow: var(--shadow-lg); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  body.sb-open .sidebar { transform: none !important; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,6,14,.45); z-index: 55; backdrop-filter: blur(2px); }
  .main, body.sb-collapsed .main { margin-inline-start: 0; }
  body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-link span, body.sb-collapsed .sb-group-btn span, body.sb-collapsed .sb-label { display: initial; }
  .sb-collapse { display: none; }
  .tb-burger { display: grid; }
  .g-main, .g-side, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .g-side > .side-first { order: -1; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .filters-panel .fg { grid-column: span 6; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .content { padding: 16px 14px 90px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-search { min-width: 0; flex: 1; }
  .tb-search span, .tb-search .kbd { display: none; }
  .tb-search { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
  .tb-user-meta, .tb-hide-sm { display: none; }
  .tb-user { padding: 3px; }
  .g-2, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .g-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .span-2 { grid-column: auto; }
  .fg, .fg.c-8, .fg.c-4, .fg.c-3, .fg.c-9, .filters-panel .fg { grid-column: span 12; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 20px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
  .ph-actions .dd { flex: 1; } .ph-actions .dd .btn { width: 100%; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-icon { width: 40px; height: 40px; }
  .kpi-value { font-size: 19px; }
  .dl { grid-template-columns: 1fr; }
  .dl > div { border-inline-end: 0 !important; }
  .dl > .full { grid-column: auto; }
  .doc { padding: 18px; }
  .doc-parties { grid-template-columns: 1fr; }
  .notif-menu { width: calc(100vw - 24px); position: fixed; inset-inline: 12px; top: 70px; }
  .dd-menu { max-width: calc(100vw - 24px); }
  .qa-grid { width: calc(100vw - 40px); }
  .toolbar .select { flex: 1; max-width: none; }
  .toolbar .search-box { max-width: none; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .cmdk .modal-box { margin-top: 0; align-self: flex-end; }
  .form-actions { border-radius: 0; margin: 0 -1px; }
  .bar-list .bl-row { grid-template-columns: 90px 1fr 70px; }
  #toasts { inset-inline: 12px; bottom: 80px; }
  .toast { min-width: 0; max-width: none; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 18px; }
  .kb-col { flex-basis: 84vw; }
  .cal-day { min-height: 74px; padding: 3px; }
  .cal-ev { font-size: 10px; padding: 1px 4px; }
  .stat-row { flex-wrap: wrap; }
  .stat-row > div { flex: 1 1 50%; border-bottom: 1px solid var(--border); }
  .auth-main { padding: 28px 18px; justify-content: flex-start; padding-top: 80px; }

  /* Responsive tables → cards */
  .table.resp thead { display: none; }
  .table.resp, .table.resp tbody, .table.resp tr, .table.resp td { display: block; width: 100%; }
  .table.resp tr { padding: 12px 14px; border-bottom: 1px solid var(--border); position: relative; }
  .table.resp td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
  .table.resp td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; flex: none; }
  .table.resp td.t-primary { display: block; text-align: start; padding-bottom: 6px; font-size: 14.5px; }
  .table.resp td.t-primary::before, .table.resp td.t-check::before, .table.resp td.t-actions::before { display: none; }
  .table.resp td.t-check { position: absolute; top: 12px; inset-inline-end: 10px; width: auto; }
  .table.resp td.t-actions { justify-content: flex-end; padding-top: 8px; }
  .table.resp td.t-num { text-align: end; }
  .table.resp .row-actions { opacity: 1; }
  .table.resp tfoot { display: block; }
  .table.resp tfoot tr { display: flex; justify-content: space-between; padding: 10px 14px; }
  .table.resp tfoot td { display: inline; width: auto; padding: 0; }
  .table.resp tfoot td:empty { display: none; }

  /* Bottom tab bar (employee & client portals) */
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 6px 2px; border-radius: 10px; }
  .tabbar a.active { color: var(--brand-fg); background: var(--brand-50); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .i { width: 21px; height: 21px; }
}
@media (hover: none) { .row-actions { opacity: 1; } }

/* ------------------------------ Print ---------------------------------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #000; font-size: 12px; }
  .sidebar, .topbar, .footer, .no-print, .tabbar, #toasts, .ph-actions, .crumbs { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; max-width: none; }
  .card, .doc { box-shadow: none; border: 0; padding: 0; }
  .doc-table th { background: #096B6A !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge, .doc-party, .kv.total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }

/* ---------------- Maps / geofence ---------------- */
.geo-map { height: 440px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; direction: ltr; background: var(--surface-3); z-index: 0; }
.geo-map.sm { height: 300px; border-radius: 0 0 var(--radius) var(--radius); border: 0; border-top: 1px solid var(--border); }
.geo-map .leaflet-container, .geo-map.leaflet-container { font-family: inherit; }
.geo-dot span { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.geo-dot.handle span { width: 16px; height: 16px; cursor: ew-resize; }
.geo-dot.vertex span { cursor: move; }
.geo-dot.mid span { width: 11px; height: 11px; border-color: var(--brand, #096B6A); opacity: .8; }
.geo-dot.pt span { width: 11px; height: 11px; border-width: 2px; }
.geo-dot.me span { width: 16px; height: 16px; box-shadow: 0 0 0 6px rgba(29,95,209,.25); }
.geo-modes button.active { background: var(--surface); color: var(--brand-fg); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.geo-modes button .i { width: 14px; height: 14px; vertical-align: -2px; }
.geo-manual summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.geo-manual[open] summary { margin-bottom: 8px; }
.geo-search .input { min-width: 0; }
.geo-live-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.geo-live-status.ok { background: var(--success-bg); color: var(--success); }
.geo-live-status.out { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 640px) { .geo-map { height: 360px; } .geo-map.sm { height: 260px; } }

/* ---------------- Help centre ---------------- */
.help-hero h2 { display: flex; align-items: center; gap: 10px; }
.help-hero p { opacity: .85; margin-top: 4px; }
.help-search { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 6px 8px 6px 12px; backdrop-filter: blur(4px); }
.help-search > .i { opacity: .8; flex: none; }
.help-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 15px; padding: 6px 4px; }
.help-search input::placeholder { color: rgba(255,255,255,.7); }
.manual-card { display: flex; flex-direction: column; }
.manual-card > .card-body { flex: 1; }
.manual-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .35); }
.faq-list { padding: 4px 0; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; }
.faq-item summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 14px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary > span { flex: 1; }
.faq-item summary > .i:first-child { color: var(--brand-fg); flex: none; }
.faq-item summary > .i:last-child { transition: transform .2s; color: var(--muted); flex: none; }
.faq-item[open] summary > .i:last-child { transform: rotate(180deg); }
.faq-body { padding: 0 18px 16px 18px; padding-inline-start: 44px; color: var(--text-2); line-height: 2; font-size: 14px; }
.chip.active-chip { background: var(--brand); color: #fff; border-color: var(--brand); }
a.chip:hover { text-decoration: none; border-color: var(--brand-200); }
.actions-list .li-main small, .actions-list .li-main b { white-space: normal; overflow: visible; text-overflow: clip; }

/* =====================================================================
   v1.2 · «مِداد» — Midad visual layer
   Floating rail, calmer surfaces, Tajawal display type, gold accents.
   ===================================================================== */
:root { --heading: var(--brand-900); --peek-w: min(580px, 42vw); }
:root[data-theme="dark"] { --heading: var(--text); }
h1, h2, h3, .kpi-value, .stat-row b, .clock-time, .greet-title, .jr-sum b, .pulse-txt b, .ln-title h2, .p-hero h1, .p-clock-stats b, .gb-n { font-family: var(--font-display); }
h1, h2 { font-weight: 800; letter-spacing: 0; }
.midad-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.midad-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.t-brand { background: var(--brand-50); color: var(--brand-fg); }
.t-accent { background: var(--accent-50); color: #8a661c; }
.t-success { background: var(--success-bg); color: var(--success); }
.t-warning { background: var(--warning-bg); color: var(--warning); }
.t-danger { background: var(--danger-bg); color: var(--danger); }
.t-info { background: var(--info-bg); color: var(--info); }
.t-neutral { background: var(--neutral-bg); color: var(--neutral); }
.t-rose { background: #FBEAF1; color: #A3245B; }
:root[data-theme="dark"] .t-accent { color: var(--accent); }
:root[data-theme="dark"] .t-rose { background: rgba(232,121,170,.12); color: #F2A3C6; }

/* ---- Floating sidebar / rail ---- */
.sidebar { inset-block: var(--sb-gap); inset-inline-start: var(--sb-gap); border-radius: 26px; overflow: hidden;
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-800) 100%); box-shadow: 0 24px 48px -26px rgba(var(--brand-rgb), .7); }
.main { margin-inline-start: calc(var(--sb-w) + var(--sb-gap)); }
body.sb-collapsed .main { margin-inline-start: calc(var(--sb-w-collapsed) + var(--sb-gap)); }
.sb-head { height: 76px; padding: 18px 16px 12px; }
.sb-link, .sb-group-btn { border-radius: 12px; }
.sb-link.active { background: rgba(255,255,255,.11); }
[dir] .sidebar .sb-link.active::before { inset-inline-start: -9px; top: 50%; bottom: auto; margin-top: -9px; width: 4px; height: 18px; border-radius: 0;
  background: radial-gradient(circle, var(--accent) 1.9px, transparent 2.3px) center top / 4px 7px repeat-y; }
[dir] .sidebar .sb-sub .sb-link.active::before { inset-inline-start: -12px; }
.sb-sub { border-inline-start-color: rgba(var(--accent-rgb), .22); }
.sb-launch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; border: 1.5px solid rgba(var(--accent-rgb), .55);
  background: rgba(var(--accent-rgb), .08); color: #F3E3BD; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.sb-launch:hover { background: rgba(var(--accent-rgb), .16); }
.sb-launch span:not(.kbd) { flex: 1; text-align: start; }
.sb-launch .kbd { background: transparent; color: rgba(255,255,255,.55); border-color: rgba(255,255,255,.2); }
@media (min-width: 1025px) {
  body.sb-collapsed .sb-nav { padding: 6px 8px 16px; }
  body.sb-collapsed .sb-link, body.sb-collapsed .sb-group-btn { flex-direction: column; gap: 4px; padding: 9px 2px 7px; justify-content: center; }
  body.sb-collapsed .sb-link span, body.sb-collapsed .sb-group-btn span { display: block; width: 100%; text-align: center; font-size: 10.5px; font-weight: 500; line-height: 1.3; }
  body.sb-collapsed .sb-link.active::before { inset-inline-start: -5px; }
  body.sb-collapsed .sb-count { display: block; position: absolute; top: 3px; inset-inline-end: 8px; min-width: 18px; line-height: 16px; padding: 0 5px; font-size: 10px; }
  body.sb-collapsed .sb-group > .sb-sub { display: none; }
  body.sb-collapsed .sb-group.open > .sb-group-btn { background: rgba(255,255,255,.06); }
  body.sb-collapsed .sb-group.fly > .sb-group-btn { background: rgba(255,255,255,.12); color: #fff; }
  body.sb-collapsed .sb-group.fly > .sb-sub { display: block; position: fixed; z-index: 95; inset-inline-start: calc(var(--sb-gap) + var(--sb-w-collapsed) + 8px); width: 250px; max-height: calc(100vh - 24px); overflow-y: auto;
    margin: 0; padding: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: var(--brand-900); box-shadow: var(--shadow-lg); animation: pop .14s ease-out; }
  body.sb-collapsed .sb-group.fly > .sb-sub .sb-link { flex-direction: row; gap: 10px; padding: 8px 10px; justify-content: flex-start; }
  body.sb-collapsed .sb-group.fly > .sb-sub .sb-link span { text-align: start; font-size: 13px; }
  body.sb-collapsed .sb-group.fly > .sb-sub .sb-count { position: static; }
  body.sb-collapsed .sb-group.fly > .sb-sub .sb-link.active::before { inset-inline-start: -3px; }
  body.sb-collapsed .sb-launch { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 10px; text-align: center; }
  body.sb-collapsed .sb-launch span:not(.kbd) { text-align: center; }
  body.sb-collapsed .sb-launch .kbd { display: none; }
}

/* ---- Top bar ---- */
.topbar { height: var(--top-h); padding: 0 26px; gap: 12px; background: color-mix(in srgb, var(--bg) 86%, transparent); }
.tb-today { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; white-space: nowrap; }
.tb-today b { font-size: 13px; font-weight: 600; color: var(--text); }
.tb-today small { font-size: 12px; color: var(--muted); }
.tb-search { height: 50px; border-radius: 25px; flex: 0 1 580px; min-width: 280px; margin-inline: auto; padding: 0 18px; gap: 12px; font-size: 14px; box-shadow: 0 6px 18px -12px rgba(var(--brand-rgb), .35); }
.tb-search + .tb-spacer { display: none; }
.tb-btn { width: 44px; height: 44px; border-radius: 22px; }
.tb-new { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 23px; border: 0; background: var(--brand); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 20px -10px rgba(var(--brand-rgb), .7); }
.tb-new:hover { background: var(--brand-600); }
:root[data-theme="dark"] .tb-new { background: color-mix(in srgb, var(--brand) 70%, #fff 12%); }
.tb-user { border-radius: 24px; padding: 4px; padding-inline-end: 12px; }
.tb-user .avatar { border-radius: 50%; width: 34px; height: 34px; }
.tb-dot { background: var(--accent); color: #0A2423; }
.content { padding: 10px 28px 44px; }

/* ---- Page furniture ---- */
.page-head h1 { font-size: 27px; color: var(--heading); }
.head-icon { width: 50px; height: 50px; border-radius: 16px; }
.card-head { padding: 16px 20px; border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.card-title { font-size: 15.5px; }
.card-body { padding: 20px; }
.card { box-shadow: var(--shadow-sm); }
.btn { border-radius: 12px; }
.btn-sm { border-radius: 10px; }
.btn-lg { border-radius: 16px; }
.btn-primary { box-shadow: 0 8px 18px -10px rgba(var(--brand-rgb), .75), inset 0 1px 0 rgba(255,255,255,.12); }
.input, .select, .combo-btn { height: 44px; border-radius: 12px; }
.textarea { border-radius: 12px; }
.badge { border-radius: 8px; padding: 2px 9px; }
.chip { border-radius: 9px; }
.seg { border-radius: 13px; } .seg a, .seg button { border-radius: 10px; }
.table th { background: transparent; font-size: 12px; }
.table td { padding: 13px 14px; border-bottom-color: color-mix(in srgb, var(--border) 65%, transparent); }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-50) 70%, transparent); }
.table tbody tr.peeked, .table tbody tr.peeked:hover { background: var(--brand-50); }
.table tbody tr.peeked td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
[dir="ltr"] .table tbody tr.peeked td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.kpi { border-radius: var(--radius); padding: 18px 18px 16px; }
.kpi-value { font-size: 27px; font-weight: 800; color: var(--heading); }
.kpi-icon { border-radius: 14px; }
.kpi-spark { display: block; width: 100%; max-width: 170px; height: 32px; margin-top: 8px; color: var(--brand-fg); opacity: .9; }
.kpi-spark .dot-gold { fill: var(--accent); }
.hero { border-radius: 24px; background: radial-gradient(700px 260px at 100% 0%, rgba(var(--accent-rgb), .22), transparent 60%), linear-gradient(135deg, var(--brand-900), var(--brand-800)); }
.hero::after { border-color: rgba(var(--accent-rgb), .14); }
.modal-box { border-radius: 24px; }
.dd-menu { border-radius: 16px; }
.toast { border-radius: 16px; }
.empty-ic { border-radius: 22px; }

/* ---- Dashboard: "today for you" ---- */
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 24px; flex-wrap: wrap; }
.greet-main { min-width: 0; }
.greet-title { font-size: 40px; line-height: 1.2; color: var(--heading); margin-top: 8px; }
.greet-sub { font-size: 16px; color: var(--text-2); margin: 4px 0 0; }
.greet-sub b { color: var(--brand-fg); font-weight: 700; }
.pulse { display: flex; gap: 10px; flex-wrap: wrap; }
.pulse-chip { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; color: inherit; box-shadow: var(--shadow-sm); }
a.pulse-chip:hover { text-decoration: none; border-color: var(--brand-200); }
.pulse-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.pulse-txt { display: flex; flex-direction: column; line-height: 1.25; }
.pulse-txt b { font-size: 21px; font-weight: 800; color: var(--heading); }
.pulse-txt b.sm { font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--text); }
.pulse-txt small { font-size: 12px; color: var(--muted); }
.act-strip { margin-bottom: 22px; }
.strip-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.strip-head h2 { font-size: 18px; color: var(--heading); }
.strip-head .pill-count { background: var(--brand-50); color: var(--brand-fg); }
.strip-line { flex: 1; height: 1px; background: var(--border); margin: 0 4px; }
.strip-head a { font-size: 13px; font-weight: 600; }
.act-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.act-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.act-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.act-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.act-due.late { color: var(--danger); font-weight: 600; }
.act-title { font-size: 15px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-btns { margin-top: auto; padding-top: 4px; }
.act-form { display: flex; gap: 8px; margin: 0; }
.act-btns .btn { --bh: 38px; }
.act-go { flex: 1; background: var(--brand); color: #fff; }
.act-btns > .act-go { width: 100%; }
.act-go:hover { background: var(--brand-600); color: #fff; }
.act-alt { background: var(--surface); border-color: var(--border-2); color: var(--text-2); }
.act-card.feat { background: linear-gradient(160deg, var(--brand-900), var(--brand-800)); border-color: transparent; color: #fff; }
.act-card.feat::after { content: ""; position: absolute; inset-inline-end: -26px; bottom: -26px; width: 120px; height: 120px; border-radius: 50%; border: 22px solid rgba(var(--accent-rgb), .16); pointer-events: none; }
.act-card.feat .act-sub, .act-card.feat .act-due { color: rgba(255,255,255,.7); }
.act-card.feat .act-tag { background: #E7CF94; color: #06302F; }
.act-card.feat .act-go { background: var(--accent); color: #0A2423; position: relative; z-index: 1; }
.act-card.feat .act-alt { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; position: relative; z-index: 1; }
:root[data-theme="dark"] .act-card.feat { border-color: rgba(var(--accent-rgb), .3); }

/* ---- Launcher ---- */
.launcher { position: fixed; inset: 0; z-index: 210; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 20px; overflow-y: auto; background: rgba(20,10,28,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.ln-on { overflow: hidden; }
.ln-box { width: min(1180px, 100%); background: var(--bg); border-radius: 28px; padding: 24px 26px 28px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; border: 1px solid var(--border); }
.ln-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.ln-title { display: flex; flex-direction: column; gap: 4px; }
.ln-title h2 { font-size: 28px; color: var(--heading); line-height: 1.2; }
.ln-title small { color: var(--muted); font-size: 13px; }
.ln-search { flex: 1 1 320px; max-width: 520px; margin-inline-start: auto; height: 50px; border-radius: 25px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--muted); box-shadow: var(--shadow-sm); }
.ln-search:focus-within { border-color: var(--brand-300); box-shadow: var(--ring); }
.ln-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); outline: none; }
.ln-search input::-webkit-search-cancel-button { display: none; }
.ln-close { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.ln-close:hover { color: var(--danger); }
.ln-pins { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ln-pin { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 600; }
.ln-pin .i { color: var(--brand-fg); }
.ln-pin:hover { text-decoration: none; border-color: var(--brand-200); }
.ln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ln-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 14px 12px 10px; box-shadow: var(--shadow-sm); min-width: 0; }
.ln-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 0 2px; }
.ln-card-head b { font-size: 14.5px; font-weight: 700; }
.ln-n { margin-inline-start: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 0 8px; }
.ln-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ln-links { display: flex; flex-direction: column; gap: 1px; }
.ln-links a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; min-width: 0; }
.ln-links a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-links a:hover { background: var(--brand-50); color: var(--brand-fg); text-decoration: none; }
.ln-links a.active { color: var(--brand-fg); font-weight: 600; }
.ln-links a em, .ln-pin em { margin-inline-start: auto; background: var(--accent); color: #0A2423; font-size: 11px; font-weight: 700; font-style: normal; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.ln-empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---- Side peek (split view) ---- */
.peek { position: fixed; top: calc(var(--top-h) - 4px); bottom: var(--sb-gap); inset-inline-end: var(--sb-gap); width: var(--peek-w); z-index: 70; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateX(-24px); transition: opacity .18s, transform .18s; }
[dir="ltr"] .peek { transform: translateX(24px); }
body.peek-on .peek { opacity: 1; pointer-events: auto; transform: none; }
body.peek-on .content { padding-inline-end: calc(var(--peek-w) + 36px); }
.peek-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 26px 26px 0 0; }
.peek-nav { display: flex; align-items: center; gap: 2px; }
.peek-nav .kbd { margin-inline-start: 6px; }
.peek-spacer { flex: 1; }
.peek-body { flex: 1; overflow-y: auto; padding: 18px 20px 26px; scrollbar-width: thin; }
.peek-load { display: grid; gap: 12px; }
.peek-load .skeleton { display: block; }
.peek-body .crumbs, .peek-body .footer { display: none; }
.peek-body .page-head { margin-bottom: 14px; }
.peek-body .page-head h1 { font-size: 21px; }
.peek-body .head-icon { width: 42px; height: 42px; }
.peek-body .g-side, .peek-body .g-main, .peek-body .g-2, .peek-body .g-3 { grid-template-columns: minmax(0, 1fr); }
.peek-body .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.peek-body .doc { padding: 20px; }
.peek-body .doc-parties { grid-template-columns: 1fr; }
.peek-body .dl { grid-template-columns: 1fr; }
.peek-body .dl > div { border-inline-end: 0 !important; }
.peek-body .dl > .full { grid-column: auto; }
.peek-body .journey { padding: 14px; gap: 14px; }
.peek-body .jr-sum { align-items: flex-start; }
.peek-btn { display: none; }
@media (min-width: 1200px) { .table[data-peek] .peek-btn { display: inline-flex; } }
@media (max-width: 1199px) { .peek { display: none; } body.peek-on .content { padding-inline-end: 28px; } }

/* ---- Invoice journey ---- */
.journey { display: flex; align-items: center; gap: 28px; padding: 16px 22px; margin-bottom: 18px; flex-wrap: wrap; }
.jr-steps { list-style: none; margin: 0; padding: 0; display: flex; flex: 1 1 420px; align-items: flex-start; min-width: 0; }
.jr-step { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.jr-step::before { content: ""; position: absolute; top: 14px; inset-inline-start: calc(-50% + 18px); inset-inline-end: calc(50% + 18px); height: 2px; border-radius: 2px; background: var(--border); }
.jr-step:first-child::before { display: none; }
.jr-step.done::before, .jr-step.now::before, .jr-step.bad::before { background: var(--brand); }
.jr-dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-2); background: var(--surface); color: var(--muted); font-size: 12px; }
.jr-dot b { font-weight: 700; }
.jr-step.done .jr-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.jr-step.now .jr-dot { border-color: var(--accent); color: #8a661c; box-shadow: 0 0 0 4px var(--accent-50); }
.jr-step.bad .jr-dot { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.jr-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jr-step.todo .jr-label { color: var(--muted); font-weight: 500; }
.jr-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 190px; }
.jr-sum small { font-size: 12px; color: var(--muted); }
.jr-sum small.late { color: var(--danger); font-weight: 600; }
.jr-sum b { font-size: 28px; font-weight: 800; color: var(--heading); line-height: 1.15; }
.jr-sum b .cur { font-family: var(--font); }
.jr-sum b.late { color: var(--danger); } .jr-sum b.ok { color: var(--success); }

/* ---- Employee portal home ---- */
.p-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; padding: 24px 28px; margin-bottom: 16px; border-radius: 30px; color: #fff;
  background: radial-gradient(520px 300px at 0% 100%, rgba(var(--accent-rgb), .16), transparent 60%), linear-gradient(150deg, var(--brand-900), var(--brand-800)); }
.p-hero::before { content: ""; position: absolute; inset-inline-end: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; border: 34px solid rgba(255,255,255,.04); pointer-events: none; }
.p-hero.no-clock { grid-template-columns: 1fr; }
.p-hero-head { position: relative; display: flex; align-items: center; gap: 16px; min-width: 0; }
.p-hero-head .avatar { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .6); }
.p-hero h1 { font-size: 30px; color: #fff; line-height: 1.25; margin-top: 6px; }
.p-hero p { margin: 2px 0 0; color: rgba(255,255,255,.72); }
.p-clock { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.p-hero .geo-status { background: rgba(255,255,255,.08); color: #D6EEEB; border: 1px solid rgba(255,255,255,.14); }
.clock-btn.midad { width: 158px; height: 158px; margin: 8px auto 4px; color: #06302F; background: radial-gradient(circle at 30% 25%, #EFDDAE, var(--accent) 58%, #9b7524);
  box-shadow: 0 22px 40px -16px rgba(var(--accent-rgb), .85), inset 0 2px 0 rgba(255,255,255,.35); }
.clock-btn.midad::before { inset: -13px; border: 1.5px dashed rgba(var(--accent-rgb), .55); animation: none; }
.clock-btn.midad.out { color: #fff; background: radial-gradient(circle at 30% 25%, #f5a58a, #E0612F 58%, #8a2c05); box-shadow: 0 22px 40px -16px rgba(224,97,47,.8); }
.clock-btn.midad.done { color: #fff; background: radial-gradient(circle at 30% 25%, #6fdcb0, #0E8A5F 58%, #065f41); box-shadow: 0 22px 40px -16px rgba(14,138,95,.7); }
.p-clock-stats { display: flex; }
.p-clock-stats > div { padding: 0 16px; text-align: center; border-inline-start: 1px solid rgba(255,255,255,.14); }
.p-clock-stats > div:first-child { border-inline-start: 0; }
.p-clock-stats b { display: block; font-size: 18px; font-weight: 800; color: #fff; direction: ltr; }
.p-clock-stats b small { font-size: .5em !important; }
.p-clock-stats b.gold { color: #E7CF94; }
.p-clock-stats > div > small { display: block; font-size: 12px; color: rgba(255,255,255,.65); }
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.quick-tile:hover { text-decoration: none; border-color: var(--brand-200); transform: translateY(-1px); }
.qt-ic { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; }
.gold-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: 20px; background: var(--accent-50); border: 1px solid rgba(var(--accent-rgb), .35); color: var(--text); }
.gold-banner:hover { text-decoration: none; border-color: var(--accent); }
.gb-n { width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--accent); color: #0A2423; font-size: 20px; font-weight: 800; }
.gb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gb-txt b { font-size: 14.5px; }
.gb-txt small { color: var(--text-2); }
.gold-banner > .i { color: #8a661c; }

/* ---- Responsive ---- */
@media (max-width: 1280px) {
  .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-today { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(calc(100% + 30px)); }
  [dir="ltr"] .sidebar { transform: translateX(calc(-100% - 30px)); }
  .main, body.sb-collapsed .main { margin-inline-start: 0; }
  .tb-search { margin-inline: 0; }
}
@media (max-width: 760px) {
  :root { --top-h: 64px; }
  .content { padding: 8px 14px 110px; }
  .topbar { padding: 0 12px; }
  .tb-search { flex: 0 0 44px; width: 44px; min-width: 0; height: 44px; padding: 0; justify-content: center; border-radius: 22px; }
  .tb-search + .tb-spacer { display: block; }
  .tb-new { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 22px; }
  .tb-new span { display: none; }
  .greet { margin-bottom: 16px; }
  .greet-title { font-size: 28px; }
  .greet-sub { font-size: 14.5px; }
  .pulse { width: 100%; }
  .pulse-chip { flex: 1 1 140px; }
  .act-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 21px; }
  .kpi-spark { display: none; }
  .page-head h1 { font-size: 22px; }
  .journey { padding: 14px; gap: 14px; }
  .jr-label { font-size: 11px; }
  .jr-sum { align-items: flex-start; min-width: 0; }
  .p-hero { grid-template-columns: minmax(0, 1fr); padding: 20px 18px 22px; border-radius: 26px; margin-inline: -4px; }
  .p-hero h1 { font-size: 24px; }
  .p-clock-stats > div { padding: 0 12px; }
  .quick-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(86px, 1fr); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: -14px; padding-inline: 14px; }
  .quick-row::-webkit-scrollbar { display: none; }
  .quick-tile { padding: 12px 6px; font-size: 12px; border-radius: 18px; }
  .qt-ic { width: 44px; height: 44px; border-radius: 14px; }
  .ln-box { padding: 18px 14px 22px; border-radius: 24px; }
  .ln-title h2 { font-size: 22px; }
  .launcher { padding: 12px 10px; }
  /* floating bottom tab bar with centre check-in button */
  .tabbar { bottom: calc(10px + env(safe-area-inset-bottom)); inset-inline: 10px; padding: 6px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 18px 36px -20px rgba(var(--brand-rgb), .5); background: color-mix(in srgb, var(--surface) 96%, transparent); align-items: center; }
  .tabbar a { border-radius: 16px; position: relative; }
  .tabbar a.active { background: transparent; color: var(--brand-fg); }
  .tabbar a.active::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-top: 1px; }
  .tab-ic { position: relative; display: flex; }
  .tab-ic em { position: absolute; top: -6px; inset-inline-end: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #0A2423; font-size: 10px; font-weight: 700; font-style: normal; display: grid; place-items: center; line-height: 1; }
  .tabbar a.tab-fab { flex: 0 0 64px; padding: 0; overflow: visible; }
  .tabbar a.tab-fab::after { display: none; }
  .tab-fab > span { width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-900); color: #E7CF94; box-shadow: 0 0 0 5px var(--bg), 0 14px 24px -10px rgba(var(--brand-rgb), .8); }
  .tab-fab .i { width: 26px; height: 26px; }
  .tabbar a.tab-fab.active > span { background: var(--accent); color: #06302F; }
  #toasts { bottom: 100px; }
}
@media print { .peek, .launcher, .journey .jr-sum small { display: none !important; } body.peek-on .content { padding: 0 !important; } }
body.peek-on .table[data-peek] td, body.peek-on .table[data-peek] th { white-space: nowrap; }
body.peek-on .table[data-peek] .row-actions { opacity: 1; }
.ln-search input:focus-visible { box-shadow: none; }
[dir="rtl"] .kpi-spark { transform: scaleX(-1); }
.topbar .tb-burger { display: none; }
@media (max-width: 1024px) { .topbar .tb-burger { display: grid; } }

/* ---- v1.2.1 · mobile polish ---- */
.kpi > div:not(.ring) { min-width: 0; flex: 1; }
.kpi-value, .jr-sum b, .stat-row b, .pulse-txt b { white-space: nowrap; max-width: 100%; }
.kpi-value .cur, .jr-sum b .cur, .stat-row b .cur { font-size: 12px; }
.kpi-foot { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .kpi, .card.kpi { flex-direction: column; gap: 10px; padding: 14px; }
  .kpi-icon { width: 38px; height: 38px; border-radius: 12px; }
  .kpi-icon .i.lg { width: 19px; height: 19px; }
  .kpi > div:not(.ring) { width: 100%; }
  .kpi-label { font-size: 12px; line-height: 1.45; }
  .kpi-value { font-size: 22px; display: block; text-align: left; }
  [dir="rtl"] .kpi-value { text-align: right; }
  .kpi-foot { font-size: 11.5px; line-height: 1.5; }
  .g-4.keep-2 { gap: 10px; }
}
@media (max-width: 760px) {
  .form-actions { flex-wrap: wrap; padding: 12px 14px; }
  .form-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .tb-btn, .topbar .tb-new, .topbar .tb-search { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 20px; }
  .tb-user { padding: 3px; }
  .tb-user .avatar { width: 32px; height: 32px; }
}
@media (max-width: 760px) {
  /* action cards → swipeable carousel */
  .act-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-inline: -14px; padding: 2px 14px 10px; scrollbar-width: none; }
  .act-grid::-webkit-scrollbar { display: none; }
  .act-card { flex: 0 0 84%; scroll-snap-align: center; }
  .act-strip { margin-bottom: 14px; }
  .strip-head h2 { font-size: 17px; }
  /* compact announcements */
  .ann-alert { padding: 11px 13px; margin-bottom: 10px; }
  .ann-alert p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  .pulse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pulse-chip { padding: 9px 10px; gap: 9px; border-radius: 16px; min-width: 0; }
  .pulse-chip:nth-child(3):last-child { grid-column: span 2; }
  .pulse-ic { width: 34px; height: 34px; border-radius: 11px; }
  .pulse-txt { min-width: 0; }
  .pulse-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 760px) {
  .list-item { padding: 12px 14px; align-items: flex-start; }
  .list-item .li-main b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
  .list-item .li-main small { white-space: normal; line-height: 1.55; margin-top: 2px; }
  .list-item > .li-ic, .list-item > .date-tile, .list-item > .avatar { margin-top: 2px; }
}
@media (max-width: 760px) {
  /* toolbars never push the page sideways */
  .toolbar > * { max-width: 100%; }
  .toolbar .seg { display: flex; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .toolbar .seg a, .toolbar .seg button { flex: 1 0 auto; text-align: center; }
  .toolbar input[type="date"], .toolbar input[type="month"] { flex: 1 1 120px; width: auto !important; min-width: 0; }
  .toolbar .combo, .toolbar select { flex: 1 1 100%; min-width: 0 !important; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ph-actions .seg { width: 100%; }

  /* responsive tables → tidy record cards */
  .list-card { background: transparent; border: 0; box-shadow: none; }
  .list-card > .toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 10px; padding: 12px; }
  .list-card > .filters-panel { border: 1px solid var(--border); border-radius: 18px; margin-bottom: 10px; }
  .list-card > .bulk-bar { border-radius: 14px; margin-bottom: 10px; }
  .list-card > .empty { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
  .list-card .pager { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-top: 10px; }
  .table.resp tbody { display: flex; flex-direction: column; gap: 10px; }
  .list-card .table.resp tbody { padding: 0; }
  .card:not(.list-card) .table.resp tbody { padding: 10px; }
  .table.resp tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .table.resp tbody tr:hover { background: var(--surface); }
  .table.resp tbody tr.row-link:active { background: var(--brand-50); }
  .table.resp td { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px; padding: 0; border: 0; text-align: start; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }
  .table.resp td::before { font-size: 11px; font-weight: 500; color: var(--muted); }
  [dir="rtl"] .table.resp td.t-num { align-items: flex-end; }
  .table.resp td.t-num { font-weight: 600; }
  .table.resp td.t-primary { grid-column: 1 / -1; padding: 0 0 8px; margin-bottom: 2px; border-bottom: 1px dashed var(--border); font-size: 15px; }
  .table.resp td.t-primary .title-cell { font-weight: 700; color: var(--heading); }
  .table.resp td.t-check, .table.resp td.is-empty { display: none; }
  .list-card .table.resp td.t-actions { display: none; }
  .table.resp td.t-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; padding-top: 4px; }
  .table.resp tfoot { display: block; margin-top: 10px; }
  .table.resp tfoot tr { display: grid; background: var(--surface-2); }
  .table.resp tfoot td { display: flex; flex-direction: column; width: auto; padding: 0; background: none; border: 0; }
  .table.resp tfoot td:empty { display: none; }
  .list-card .table-wrap { overflow: visible; }
}
@media (max-width: 760px) {
  .toolbar .select, .toolbar > select { flex: 1 1 calc(50% - 5px); min-width: 0 !important; max-width: none; }
  .toolbar > .btn { flex: 1 1 auto; }
  .card:not(.list-card) .table.resp tr { background: var(--surface-2); box-shadow: none; }
}
@media (max-width: 760px) {
  .title-row { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  .title-row > div { min-width: 0; }
  .head-icon { width: 42px; height: 42px; border-radius: 14px; }
  .head-icon .i.lg { width: 20px; height: 20px; }
  .page-head { gap: 12px; margin-bottom: 14px; }
  .page-head h1 { line-height: 1.35; overflow-wrap: anywhere; }
  .ph-sub { font-size: 12.5px; }
  .ph-actions .btn { --bh: 42px; }
  .crumbs { font-size: 12px; margin-bottom: 4px; }
}
bdi.num { white-space: nowrap; }
.cal-agenda { display: none; }
.ag-ev { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--text); font-size: 13.5px; min-width: 0; }
.ag-ev:hover { text-decoration: none; color: var(--brand-fg); }
.ag-ev i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ag-ev span { flex: 1; min-width: 0; }
.ag-ev bdi { color: var(--muted); font-size: 12px; }
.ag-day.is-today .date-tile { border-color: var(--accent); }
@media (max-width: 760px) {
  .cal-agenda { display: block; margin-top: 14px; }
  .cal-day { min-height: 58px; padding: 4px 2px; text-align: center; }
  .cal-dow { padding: 8px 2px; font-size: 11px; }
  .cal-num { min-width: 24px; height: 24px; font-size: 12px; }
  .cal-day .cal-ev { display: inline-block; width: 8px; height: 8px; padding: 0; margin: 2px 1px 0; border-radius: 50%; font-size: 0; border-inline-start-width: 8px; overflow: hidden; vertical-align: top; }
  .cal-more { font-size: 10px; padding: 0; }
}
@media (max-width: 760px) {
  .cal-day { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
  .cal-day .cal-num { margin-inline: calc(50% - 12px); margin-bottom: 2px; }
  .cal-day .cal-more { flex: 0 0 100%; }
}
.cal-dow .ds { display: none; }
@media (max-width: 760px) {
  .cal-dow .dl { display: none; } .cal-dow .ds { display: inline; }
  .cal-dow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .doc { overflow-x: auto; }
}

/* ---- v1.2.2 · touch-friendly boards & launcher ---- */
.kb-card { position: relative; touch-action: manipulation; -webkit-touch-callout: none; transition: box-shadow .15s, transform .38s ease, background .2s; }
.kb-card a { -webkit-touch-callout: none; }
.kb-card.kb-press { transform: scale(.97); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .55), var(--shadow); }
.kb-ghost-card { transform: scale(1.03); box-shadow: 0 22px 44px -12px rgba(var(--brand-rgb), .45) !important; border-color: var(--accent) !important; opacity: .96; }
body.kb-dragging, body.kb-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.kb-card.kb-flash { background: var(--accent-50); }
.kb-move { display: none; position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); place-items: center; cursor: pointer; padding: 0; }
.kb-move:active { background: var(--brand-50); color: var(--brand-fg); }
.hint-touch { display: none; }
.kb-tabs { display: none; }
.kb-sheet-list { display: flex; flex-direction: column; gap: 6px; }
.kb-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: start; }
.kb-opt i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kb-opt span { flex: 1; }
.kb-opt em { font-style: normal; font-size: 12px; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 0 8px; }
.kb-opt:active { background: var(--brand-50); }
.kb-opt.cur { opacity: .55; cursor: default; }
@media (hover: none), (pointer: coarse) {
  .kb-move { display: grid; }
  .kb-card-title { padding-inline-end: 34px; }
  .hint-mouse { display: none; } .hint-touch { display: inline; }
}
@media (max-width: 760px) {
  .kb-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: calc(var(--top-h) - 2px); z-index: 30; margin: 0 -14px 10px; padding: 6px 14px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .kb-tabs::-webkit-scrollbar { display: none; }
  .kb-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .kb-tabs button i { width: 8px; height: 8px; border-radius: 50%; }
  .kb-tabs button em { font-style: normal; font-size: 11px; background: var(--surface-3); border-radius: 8px; padding: 0 6px; }
  .kb-tabs button.on { background: var(--brand-900); color: #fff; border-color: transparent; }
  .kb-tabs button.on em { background: var(--accent); color: #0A2423; }
  .kanban { scroll-snap-type: x mandatory; scroll-padding-inline: 14px; margin-inline: -14px; padding-inline: 14px; gap: 12px; min-height: 0; overscroll-behavior-x: contain; }
  .kb-col { flex-basis: calc(100vw - 56px); scroll-snap-align: center; scroll-snap-stop: always; max-height: calc(100vh - 250px); }
  body.kb-dragging .kanban { scroll-snap-type: none; }
}

/* launcher on phones */
@media (max-width: 760px) {
  .launcher { padding: 0; align-items: stretch; }
  .ln-box { width: 100%; min-height: 100%; border-radius: 0; border: 0; padding: 14px 14px 30px; }
  .ln-head { gap: 10px; flex-wrap: wrap; position: sticky; top: -14px; z-index: 2; background: var(--bg); margin: -14px -14px 12px; padding: 14px 14px 10px; }
  .ln-title { flex: 1; min-width: 0; }
  .ln-title small { display: none; }
  .ln-close { order: 2; width: 40px; height: 40px; }
  .ln-search { order: 3; flex: 1 1 100%; max-width: none; min-width: 0; margin: 0; height: 46px; }
  .ln-search .kbd { display: none; }
  .ln-pins { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .ln-pins::-webkit-scrollbar { display: none; }
  .ln-pin { flex: none; }
  .ln-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
.ln-search { min-width: 0; }

/* =====================================================================
   v1.3 — Workflow (task flow, batteries, plans, daily, imports, invites)
   ===================================================================== */
.fg.c-2 { grid-column: span 2; } .fg.c-5 { grid-column: span 5; } .fg.c-6 { grid-column: span 6; }
.t-c { text-align: center !important; }
.text-1 { color: var(--text); } .text-success { color: var(--success); } .text-danger { color: var(--danger); }
.dot.tone-success { background: var(--success); } .dot.tone-danger { background: var(--danger); } .dot.tone-info { background: var(--info); }
.dot.tone-warning { background: var(--warning); } .dot.tone-neutral { background: var(--border-2); } .dot.tone-brand { background: var(--brand); }
.seg-radio, .wf-prio, .wf-seg { display: inline-flex; flex-wrap: wrap; }
.seg-radio label, .wf-prio label, .wf-seg label { position: relative; cursor: pointer; margin: 0; }
.seg-radio input, .wf-prio input, .wf-seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span, .wf-prio span, .wf-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background .15s, color .15s; }
.seg-radio input:checked + span, .wf-prio input:checked + span, .wf-seg input:checked + span { background: var(--surface); color: var(--brand-fg); box-shadow: var(--shadow-sm); }
.wf-prio label:last-child input:checked + span { color: var(--danger); }
.seg-radio input:focus-visible + span, .wf-prio input:focus-visible + span, .wf-seg input:focus-visible + span { box-shadow: var(--ring); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; max-height: 300px; overflow: auto; padding: 8px 2px; }
.check-list > label[hidden] { display: none; }
.copy-field { display: flex; gap: 6px; align-items: center; } .copy-field .input { font-size: 12.5px; }
.divider-label { font-size: 13px; font-weight: 700; color: var(--text); padding-top: 8px; border-top: 1px dashed var(--border); }

/* --- battery --- */
.batt { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.batt-body { position: relative; width: 30px; height: 14px; border: 1.6px solid currentColor; border-radius: 4px; padding: 1.5px; display: inline-block; opacity: .9; }
.batt-body::after { content: ""; position: absolute; inset-inline-end: -4px; top: 3px; width: 2.5px; height: 5px; border-radius: 0 2px 2px 0; background: currentColor; }
[dir="rtl"] .batt-body::after { border-radius: 2px 0 0 2px; }
.batt-body i { display: block; height: 100%; border-radius: 2px; background: currentColor; min-width: 2px; max-width: 100%; transition: width .3s; }
.batt b { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.batt.lvl-ok { color: var(--success); } .batt.lvl-mid { color: #8a9a12; } .batt.lvl-high { color: var(--warning); } .batt.lvl-full { color: var(--danger); }
.batt.lvl-full .batt-body { animation: battPulse 1.6s ease-in-out infinite; }
@keyframes battPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .batt.lvl-full .batt-body { animation: none; } }

/* --- people picker --- */
.pick { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.pick-top { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pick-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.pick-cats::-webkit-scrollbar { display: none; }
.pick-cats button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.pick-cats button em { font-style: normal; font-size: 11px; color: var(--muted); }
.pick-cats button.on { background: var(--brand); color: #fff; border-color: var(--brand); } .pick-cats button.on em { color: rgba(255,255,255,.8); }
.pick-top .pick-q { height: 34px; max-width: 220px; flex: 0 1 220px; font-size: 13px; }
.pick-q { position: relative; display: flex; align-items: center; } .pick-q > .i { position: absolute; inset-inline-start: 11px; color: var(--muted); } .pick-q > .input { padding-inline-start: 34px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; padding: 10px; max-height: 340px; overflow: auto; }
.pick-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0; }
.pick-item[hidden] { display: none; }
.pick-item:hover { border-color: var(--border-2); }
.pick-item > input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .10); }
.pick-item:has(input:focus-visible) { box-shadow: var(--ring); }
.pick-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pick-who b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-who small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: transparent; flex: none; font-style: normal; }
.pick-check .i { width: 12px; height: 12px; }
.pick-item:has(input:checked) .pick-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick-item.is-full .pick-who b::after { content: " ●"; color: var(--danger); font-size: 9px; vertical-align: middle; }
.pick-item.is-leave { opacity: .62; }
.pick-leave { font-size: 10.5px; padding: 1px 7px; }
.pick-empty { padding: 18px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* --- task list --- */
.wf-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding: 2px; }
.wf-tabs::-webkit-scrollbar { display: none; }
.wf-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.wf-tabs a:hover { text-decoration: none; border-color: var(--border-2); color: var(--text); }
.wf-tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(var(--brand-rgb), .7); }
.wf-tabs em { font-style: normal; font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--danger); color: #fff; }
.wf-tabs a.on em { background: rgba(255,255,255,.22); }
.wf-list { display: flex; flex-direction: column; }
.wf-row { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); color: inherit; position: relative; }
.wf-row:hover { background: var(--surface-2); text-decoration: none; }
.wf-row.is-urgent::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--danger); }
.wf-type-ic { --c: var(--brand); width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.wf-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wf-row-main > b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-row-top, .wf-row-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.wf-row-top .chip { padding: 1px 8px; font-size: 11px; }
.wf-row-sub .late { color: var(--danger); font-weight: 600; }
.wf-step-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; background: var(--brand-50); color: var(--brand-fg); font-weight: 600; }
.wf-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.wf-prog { width: 86px; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.wf-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-400)); border-radius: 5px; }
.late { color: var(--danger); }

/* --- type cards --- */
.wf-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wf-type-card { --c: var(--brand); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.wf-type-card::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--c) 9%, transparent); }
.wf-type-card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.wf-type-card .wf-type-ic { width: 50px; height: 50px; border-radius: 15px; }
.wf-type-card b { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.wf-type-card small { color: var(--text-2); font-size: 12.5px; line-height: 1.7; min-height: 20px; }
.wf-type-card.is-off { opacity: .6; }
.wf-type-card.is-new { border-style: dashed; box-shadow: none; background: var(--surface-2); justify-content: center; align-items: center; text-align: center; }

/* --- path (create side) --- */
.wf-path { list-style: none; margin: 0; padding: 6px 18px 16px; }
.wf-path li { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.wf-path li::before { content: ""; position: absolute; inset-inline-start: 13px; top: 34px; bottom: -6px; width: 2px; background: var(--border); }
.wf-path li:last-child::before { display: none; }
.wf-path-dot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand-fg); position: relative; z-index: 1; }
.wf-path li.is-approval .wf-path-dot { background: var(--accent-50); color: #8a661c; }
.wf-path li > span:last-child { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }
.wf-path b { font-size: 13.5px; font-weight: 600; } .wf-path small { font-size: 11.5px; color: var(--muted); }

/* --- journey stepper (task page) --- */
.wf-journey { padding: 18px 18px 14px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.wf-steps { list-style: none; margin: 0; padding: 0; display: flex; min-width: max-content; }
.wf-st { position: relative; flex: 1 0 104px; max-width: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 4px; }
.wf-st::before { content: ""; position: absolute; top: 15px; inset-inline-start: calc(-50% + 18px); inset-inline-end: calc(50% + 18px); height: 2px; background: var(--border); }
.wf-st:first-child::before { display: none; }
.wf-st.done::before, .wf-st.skip::before, .wf-st.now::before, .wf-st.hold::before { background: var(--brand-300); }
.wf-st-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); border: 2px solid var(--border); position: relative; z-index: 1; font-size: 12.5px; }
.wf-st-dot .i { width: 15px; height: 15px; }
.wf-st.done .wf-st-dot { background: var(--success); border-color: var(--success); color: #fff; }
.wf-st.skip .wf-st-dot { background: var(--surface-3); border-style: dashed; color: var(--muted); }
.wf-st.now .wf-st-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(var(--brand-rgb), .14); }
.wf-st.hold .wf-st-dot { background: var(--warning); border-color: var(--warning); color: #fff; }
.wf-st-label { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.35; }
.wf-st.now .wf-st-label { color: var(--brand-fg); font-weight: 700; }
.wf-st.skip .wf-st-label { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.wf-st-who { font-size: 11px; color: var(--muted); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- current step card --- */
.wf-now { border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); box-shadow: 0 16px 34px -24px rgba(var(--brand-rgb), .55); }
.wf-now > .card-head { background: linear-gradient(90deg, var(--brand-50), transparent); }
.wf-waiting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.wf-waiting .who b { font-size: 13.5px; }
.wf-block { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: var(--surface); }
.wf-block-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.wf-block-title .i { color: var(--brand-fg); }
.wf-decide { display: flex; flex-direction: column; gap: 10px; }
.wf-part-toggle { margin-bottom: 0; }
.wf-part { margin-top: 12px; }
.wf-part[hidden] { display: none; }
.fg.has-err .input, .fg.has-err .textarea, .fg.has-err .select { border-color: var(--danger); }
.wf-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--border); }
.wf-actions .btn-success, .wf-actions .btn-primary { min-width: 180px; }
.wf-comment { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.wf-file-btn { cursor: pointer; }
.wf-data { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 5px 9px; }
.wf-data.tone-warning { background: var(--warning-bg); color: var(--warning); }
.wf-data b { color: var(--text); font-weight: 600; }
.wf-file { margin-top: 6px; margin-inline-end: 6px; }
.wf-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 10px; border-radius: 8px; background: var(--info-bg); color: var(--info); font-size: 12.5px; font-weight: 600; max-width: 100%; }
.wf-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-dot.tone-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.tl-dot.tone-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.tl-dot.tone-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.tl-dot.tone-brand { background: var(--brand-50); color: var(--brand-fg); border-color: transparent; }

/* --- designer --- */
.wf-d-step > .card-head { background: var(--surface-2); }
.wf-d-num { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700; margin-inline-end: 4px; }
.wf-d-sec { border-top: 1px dashed var(--border); margin-top: 16px; padding-top: 12px; }
.wf-d-sec > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; padding: 2px 0 10px; }
.wf-d-sec > summary::-webkit-details-marker { display: none; }
.wf-d-sec > summary::after { content: "+"; margin-inline-start: auto; color: var(--muted); font-weight: 400; font-size: 16px; }
.wf-d-sec[open] > summary::after { content: "−"; }
.wf-d-add { border-style: dashed; height: 52px; font-weight: 700; }
.wf-rep-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-pick label { position: relative; cursor: pointer; margin: 0; }
.chips-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chips-pick span { display: inline-block; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border-2); font-size: 12.5px; color: var(--text-2); background: var(--surface); transition: all .15s; }
.chips-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips-pick input:focus-visible + span { box-shadow: var(--ring); }
.wf-matrix td .sub { display: block; font-size: 11.5px; color: var(--muted); }
.wf-matrix .switch { justify-content: center; }

/* --- workload --- */
.wl-list .list-item { gap: 12px; }
.wl-rule { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.wl-rule.is-default { background: var(--brand-50); border-color: transparent; }
.wl-rule.is-default > b { display: block; margin-bottom: 10px; font-size: 13px; }
.wl-rule > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.wl-rule > summary::-webkit-details-marker { display: none; }
.wl-rule[open] > summary { margin-bottom: 10px; }
.wl-rule .form-grid { gap: 10px 12px; }

/* --- plans --- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.plan-card { --c: var(--brand); display: flex; flex-direction: column; gap: 12px; padding: 18px; color: inherit; border-top: 3px solid var(--c); transition: transform .15s; }
.plan-card:hover { text-decoration: none; transform: translateY(-2px); }
.pc-top { display: flex; gap: 12px; align-items: flex-start; }
.pc-top .date-tile small { background: var(--c); }
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-main b { font-weight: 700; font-size: 14.5px; } .pc-main small { color: var(--muted); font-size: 12px; }
.pc-period { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.pc-foot { display: flex; align-items: center; gap: 10px; } .pc-foot .progress { flex: 1; }
.plan-cal .cal-day { position: relative; }
.cal-day.out { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); }
.cal-add { position: absolute; top: 5px; inset-inline-end: 5px; width: 24px; height: 24px; border-radius: 7px; border: 1px dashed var(--border-2); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
@media (hover: none) { .cal-add { opacity: .7; } }
.plan-ev.st-done, .plan-ev.st-converted { opacity: .7; } .plan-ev.st-cancelled { text-decoration: line-through; opacity: .45; }
.plan-items .list-item { align-items: flex-start; }
.plan-item .date-tile small { background: var(--c, var(--brand)); }
.plan-item.st-cancelled { opacity: .55; }
.plan-item.is-focus { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .plan-item.is-focus { box-shadow: inset -3px 0 0 var(--brand); }
.pi-desc { margin: 6px 0 0; line-height: 1.7; }
.pi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.plan-log .list-item small { white-space: normal; }
.avatar-stack-list { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-stack-list .chip { padding-inline-start: 3px; }

/* --- daily --- */
.daily-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.daily-filter button.active { background: var(--surface); color: var(--brand-fg); box-shadow: var(--shadow-sm); }
.daily-list .list-item { align-items: flex-start; }
.daily-item[hidden] { display: none; }
.daily-item.st-done .li-main > a b { color: var(--text-2); }
.daily-slot { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.daily-note { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.daily-note .input.sm, .daily-note .select.sm { height: 34px; font-size: 13px; }
.daily-note .select.sm { width: auto; flex: none; }
.input.sm, .select.sm { height: 34px; font-size: 13px; padding: 0 10px; border-radius: 9px; }
.daily-confirm.is-ok { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.week-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.week-col.is-today { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .12); }
.wk-head { display: flex; align-items: center; gap: 8px; padding: 10px; color: inherit; position: relative; }
.wk-head:hover { text-decoration: none; background: var(--surface-2); }
.wk-head > div { display: flex; flex-direction: column; min-width: 0; } .wk-head b { font-size: 13px; } .wk-head small { font-size: 11px; color: var(--muted); }
.wk-ok { position: absolute; top: 8px; inset-inline-end: 8px; color: var(--success); }
.week-col > .progress { border-radius: 0; height: 3px; }
.wk-items { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.wk-item { display: flex; gap: 6px; align-items: flex-start; padding: 6px 7px; border-radius: 8px; background: var(--surface-2); color: inherit; font-size: 12px; line-height: 1.45; }
.wk-item:hover { text-decoration: none; background: var(--brand-50); }
.wk-item .dot { margin-top: 5px; } .wk-item > span { min-width: 0; } .wk-item small { display: block; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-item.st-done > span { text-decoration: line-through; text-decoration-color: var(--border-2); color: var(--text-2); }
.wk-empty { padding: 6px; text-align: center; }
.rep-dept { --c: var(--brand); padding: 0; overflow: hidden; }
.rep-dept > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.rep-dept > summary::-webkit-details-marker { display: none; }
.rep-dot { width: 10px; height: 38px; border-radius: 6px; background: var(--c); flex: none; }
.rep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rep-main b { font-weight: 700; } .rep-main small { color: var(--text-2); font-size: 12px; }
.rep-rate { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--brand-fg); }
.rep-body { border-top: 1px solid var(--border); padding: 12px 16px; }
.rep-body .list-item { gap: 10px; align-items: center; }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; }
.mb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.mb-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.mb-bars span { width: 40%; max-width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; }
.mb-col small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.mb-col.is-cur small { color: var(--brand-fg); font-weight: 700; }
.b1 { background: var(--brand-300); } .b2 { background: var(--success); }
.mb-col.is-cur .b1 { background: var(--brand); }
.dot.b1, .dot.b2 { vertical-align: middle; }

/* --- imports --- */
.imp-drop { min-height: 150px; }
.imp-drop .fd-text { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.imp-drop .fd-text small { color: var(--muted); }
.imp-guide h4 { font-size: 13.5px; margin: 16px 0 6px; display: flex; align-items: center; gap: 6px; color: var(--brand-fg); }
.imp-guide ol { margin: 0; padding-inline-start: 20px; line-height: 1.9; color: var(--text-2); }
.imp-map td { vertical-align: top; }
.imp-map tr.is-mapped td:first-child { box-shadow: inset 3px 0 0 var(--success); }
[dir="rtl"] .imp-map tr.is-mapped td:first-child { box-shadow: inset -3px 0 0 var(--success); }
.imp-preview { max-height: 360px; overflow: auto; }
.imp-preview td, .imp-preview th { white-space: nowrap; font-size: 12.5px; }

/* --- invites --- */
.inv-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.inv-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.inv-step > b { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-50); color: var(--brand-fg); display: grid; place-items: center; flex: none; font-weight: 800; }
.inv-step > div { display: flex; flex-direction: column; min-width: 0; } .inv-step > div b { font-size: 13px; } .inv-step small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.inv-bar { flex-wrap: wrap; gap: 10px; position: sticky; top: calc(var(--top-h) + 4px); z-index: 3; background: var(--surface); }
.inv-rows td { vertical-align: middle; }
.inv-rows .input.sm, .inv-rows .select.sm { min-width: 120px; }
.inv-rows tr.st-accepted, .inv-rows tr.st-cancelled { opacity: .7; }
.inv-who { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.inv-who span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; background: var(--surface-3); font-size: 12.5px; color: var(--text-2); }
.inv-accept-empty { text-align: center; }
.inv-mail { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-inline-start: 6px; font-size: 11.5px; font-weight: 600; color: var(--warning); }
.inv-mail.st-sent { color: var(--success); } .inv-mail.st-failed { color: var(--danger); }
.inv-mailq { align-items: center; flex-wrap: wrap; }

/* --- publish & clean start --- */
.pub-docs h4 { font-size: 13.5px; margin: 16px 0 4px; }
.pub-docs pre { background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12px; overflow-x: auto; text-align: left; white-space: pre; margin: 6px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.clean-card { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.clean-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.clean-counts > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.clean-counts b { font-size: 18px; font-family: var(--font-display); font-weight: 800; } .clean-counts small { font-size: 11.5px; color: var(--muted); }
.clean-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.clean-banner { align-items: center; } .clean-banner > div { flex: 1; } .clean-banner p { font-size: 13px; }

@media (max-width: 1100px) {
  .week-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fg.c-2, .fg.c-5, .fg.c-6 { grid-column: span 12; }
  .wf-row { padding: 12px 14px; gap: 10px; align-items: flex-start; }
  .wf-row .wf-type-ic { width: 36px; height: 36px; border-radius: 11px; }
  .wf-row-main > b { white-space: normal; font-size: 14px; }
  .wf-row-end { display: none; }
  .wf-type-grid, .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .wf-journey { padding: 14px 10px 10px; }
  .wf-st { flex-basis: 86px; }
  .wf-actions .btn { flex: 1 1 auto; min-width: 0; }
  .pick-list { grid-template-columns: minmax(0, 1fr); max-height: 300px; }
  .pick-top .pick-q { max-width: none; flex: 1 1 100%; }
  .week-board { grid-template-columns: minmax(0, 1fr); }
  .inv-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-bar { position: static; }
  .inv-rows .input.sm, .inv-rows .select.sm { min-width: 0; width: 100%; }
  .daily-note { flex-wrap: wrap; } .daily-note .input.sm { flex: 1 1 140px; }
  .pi-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .plan-items .list-item { flex-wrap: wrap; } .plan-items .pi-side { width: 100%; justify-content: flex-start; padding-inline-start: 58px; }
  .daily-list .list-item > .badge { display: none; }
  .rep-dept > summary { flex-wrap: wrap; } .rep-dept > summary .badge { margin-inline-start: 22px; }
  .clean-banner { flex-wrap: wrap; }
  .check-list { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .wf-actions, .wf-comment, .cal-add, .daily-note button, .pick-top { display: none !important; }
  .week-board { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
}
.wf-d-step > .card-head .card-title { cursor: pointer; flex-wrap: wrap; row-gap: 6px; }
.wf-d-sum { font-weight: 500; font-size: 11.5px; }
.wk-time { display: block; font-size: 10.5px; color: var(--brand-fg); font-weight: 700; }
.wf-type-card { min-width: 0; } .wf-type-card > .row { flex-wrap: wrap; } .wf-type-card small { overflow-wrap: anywhere; }
.wf-type-grid > * { max-width: 100%; } .wf-type-card.is-new > * { max-width: 100%; }
@media (max-width: 760px) { .cal-add { display: none; } }
.wf-d-adv { margin-top: 16px; border: 1px dashed var(--border-2); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.wf-d-adv > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.wf-d-adv > summary::-webkit-details-marker { display: none; }
.wf-d-adv > summary::after { content: "+"; margin-inline-start: auto; color: var(--muted); font-size: 16px; }
.wf-d-adv[open] > summary::after { content: "−"; }
.wf-d-adv[open] > summary { margin-bottom: 4px; }
.wf-type-ic.sm { width: 36px; height: 36px; border-radius: 11px; }
.wf-q-item .wf-step-chip { font-size: 11px; padding: 1px 8px; }
.wf-q-item .li-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.wa-tpl { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.wa-tpl .wa-del { margin-top: 8px; }
.wa-events { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }
.wa-events > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-2); }

/* My notifications */
.np-group { margin-bottom: 14px; }
.np-table th.np-ch, .np-table td.np-ch { text-align: center; width: 92px; }
.np-table th.np-ch { font-size: 11.5px; } .np-table th.np-ch .i { display: block; margin: 0 auto 2px; }
.switch.sm .track { transform: scale(.85); }
.notif-foot { position: relative; }
.notif-foot .notif-set { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; padding: 4px; border-radius: 8px; }
.notif-foot .notif-set:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 760px) {
  .np-table thead { display: none; }
  .np-table tr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .np-table td { border: 0 !important; padding: 2px !important; }
  .np-table td.t-primary { grid-column: 1 / -1; font-weight: 700; }
  .np-table td.np-ch { width: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
  .np-table td.np-ch::before { content: attr(data-label); color: var(--muted); }
}

/* Working inside another account (super "login as" / delegation) */
:root { --act-h: 46px; }
.act-bar { position: fixed; top: 0; inset-inline: 0; height: var(--act-h); z-index: 200; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: linear-gradient(90deg, #b42318, #d9480f); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 18px -10px rgba(0,0,0,.45); }
.act-bar.is-dlg { background: linear-gradient(90deg, var(--brand), #6b3a8a); }
.act-bar .act-ic { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.act-bar .act-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-bar .act-exit { margin: 0; flex: none; }
.act-bar .act-exit .btn { background: #fff; color: #111; border: 0; font-weight: 700; }
body.acting { padding-top: var(--act-h); }
body.acting .topbar { top: var(--act-h); }
body.acting .sidebar { inset-block-start: calc(var(--sb-gap) + var(--act-h)); }
@media (max-width: 760px) {
  :root { --act-h: 52px; }
  .act-bar { padding: 0 10px; font-size: 12px; gap: 8px; }
  .act-bar .act-txt { white-space: normal; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .act-bar .act-exit .btn span { display: none; }
  body.acting .sidebar { inset-block-start: var(--act-h); }
}
.proxy-tag { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--warning-bg); color: var(--warning); vertical-align: middle; white-space: nowrap; }
.proxy-tag .i { width: 12px; height: 12px; }

/* Delegations */
.dlg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dlg-list { display: flex; flex-direction: column; }
.dlg-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dlg-item:last-child { border-bottom: 0; }
.dlg-item .dlg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dlg-item .dlg-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.dlg-item .dlg-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.dlg-item .dlg-meta span { display: inline-flex; align-items: center; gap: 4px; }
.dlg-item .dlg-reason { font-size: 13px; color: var(--text); background: var(--surface-3); border-radius: 10px; padding: 8px 10px; }
.dlg-item .dlg-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.dlg-use { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.dlg-use .dlg-use-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--brand-50); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.dlg-use .dlg-use-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dlg-use .dlg-use-row small { color: var(--text-2); }
@media (max-width: 980px) { .dlg-grid { grid-template-columns: 1fr; } .dlg-item { flex-wrap: wrap; } .dlg-item .dlg-acts { width: 100%; justify-content: flex-start; } }

/* iPhone notch / Dynamic Island: the installed app draws under the status bar (black-translucent),
   so everything pinned to the top gets pushed below the safe area. env() is 0 on other devices. */
:root { --sat: env(safe-area-inset-top, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.topbar { height: calc(var(--top-h) + var(--sat)); padding-top: var(--sat); }
.act-bar { height: calc(var(--act-h) + var(--sat)); padding-top: var(--sat); }
body.acting { padding-top: calc(var(--act-h) + var(--sat)); }
body.acting .topbar { top: calc(var(--act-h) + var(--sat)); height: var(--top-h); padding-top: 0; }
.launcher { padding-top: calc(4vh + var(--sat)); }
.modal { padding-top: calc(20px + var(--sat)); }
.auth { padding-top: var(--sat); }
@media (max-width: 1024px) {
  .sidebar { inset-block-start: calc(var(--sb-gap) + var(--sat)); }
  body.acting .sidebar { inset-block-start: calc(var(--act-h) + var(--sat)); }
  .topbar { padding-inline: calc(12px + var(--sar)) calc(12px + var(--sal)); }
}

/* Field check-in camera */
.fp-cam { position: relative; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.fp-cam video, .fp-cam .fp-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-cam .fp-msg { position: absolute; inset-inline: 12px; bottom: 12px; color: #fff; font-size: 13px; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.att-photo { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; }
.leave-tasks ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 12.5px; }
.leave-tasks, .leave-hold { padding: 10px 12px; font-size: 13px; }
.leave-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); }
.leave-bo { display: flex; flex-direction: column; gap: 8px; }
.leave-bo-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 100px auto 100px; gap: 8px; align-items: center; }
@media (max-width: 600px) { .leave-bo-row { grid-template-columns: 1fr 80px auto 80px; } }
.wk-row { display: flex; flex-direction: column; gap: 3px; }
.wk-start { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-fg); margin-inline-start: 18px; }
.wk-start:hover { background: var(--brand); color: #fff; }

/* Daily KPI */
.kpi-lines { display: flex; flex-direction: column; }
.kpi-line { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.kpi-line[hidden] { display: none; }
.kpi-line.carried { background: color-mix(in srgb, var(--warning-bg) 55%, transparent); }
.kpi-carry { font-size: 11.5px; font-weight: 700; color: var(--warning); display: inline-flex; align-items: center; gap: 4px; }
.kpi-q { font-size: 12.5px; color: var(--text-2); }
.kpi-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.kpi-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kpi-line textarea { min-height: 38px; resize: vertical; }
.kpi-st label.st-done input:checked + span { background: var(--success); color: #fff; }
.kpi-st label.st-partial input:checked + span { background: #C98A12; color: #fff; }
.kpi-st label.st-not_started input:checked + span { background: #C2475B; color: #fff; }
.kpi-st input:disabled + span { opacity: .75; cursor: default; }
.kpi-add { padding: 12px 16px; }
.kpi-review { color: var(--text-2); }
b.st-done { color: var(--success); } b.st-partial { color: #C98A12; } b.st-not_started { color: #C2475B; }
.kpi-rv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-mini { display: flex; gap: 6px; flex-wrap: wrap; }
.kpi-mini > span { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 10px; border-radius: 12px; background: var(--surface-3); }
.kpi-mini b { font-size: 17px; line-height: 1.2; } .kpi-mini small { font-size: 11px; color: var(--muted); }
.kpi-mini .ok b { color: var(--success); } .kpi-mini .mid b { color: #C98A12; } .kpi-mini .no b { color: #C2475B; }
.kpi-mini.big > span { min-width: 92px; padding: 10px 14px; } .kpi-mini.big b { font-size: 24px; }
.kpi-person .card-body { padding: 16px; }
.kpi-steps { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; }
.kpi-step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; font-size: 13px; font-weight: 600; }
.kpi-step b { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; }
.kpi-step.done b { background: var(--success-bg); color: var(--success); }
.kpi-step.on { border-color: var(--brand); color: var(--brand-fg); background: var(--brand-50); }
.kpi-step.on b { background: var(--brand); color: #fff; }
.kpi-step:hover { text-decoration: none; color: var(--text); }
.kpi-day .card-head { padding-block: 10px; }
.kpi-day .kpi-line { padding: 10px 16px; }
.kpi-wiz-foot { display: flex; gap: 10px; margin: 6px 0 20px; position: sticky; bottom: 12px; z-index: 5; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); padding: 10px; border-radius: 16px; }
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .kpi-grid input[list] { grid-column: 1 / 2; }
  .kpi-st { display: flex; width: 100%; } .kpi-st label { flex: 1; } .kpi-st span { justify-content: center; width: 100%; padding: 8px 6px; font-size: 12.5px; }
  .kpi-wiz-foot { bottom: 92px; }
}

/* ---------- Electronic approval ---------- */
.es-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.es-side { position: sticky; top: 76px; }
.es-preview { background: var(--surface-3); padding: 12px; overflow: auto; min-height: 320px; border-radius: 0 0 16px 16px; }
.es-render .docx-wrapper { background: transparent !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center; }
.es-render section.docx { box-shadow: 0 2px 12px rgba(20, 10, 30, .14); margin: 0 auto 14px !important; color: #000; }
.es-render.es-capture section.docx { box-shadow: none; }
.es-loading { padding: 60px 20px; display: grid; gap: 10px; justify-items: center; }
.es-loading .progress { width: 200px; }
.es-sig { text-align: center; margin-bottom: 10px; }
.es-sig img { max-height: 80px; max-width: 100%; display: block; margin: 6px auto 0; background: #fff; border-radius: 10px; padding: 8px 14px; border: 1px dashed var(--border-2); }
.es-note { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.es-note.danger { background: var(--danger-bg); }
.es-sig-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.es-sig-row:last-child { border-bottom: 0; }
.es-sig-prev { height: 56px; border-radius: 10px; border: 1px dashed var(--border-2); background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; }
.es-sig-prev img { max-height: 50px; max-width: 140px; }
.es-verify { max-width: 460px; margin: 0 auto; padding: 40px 16px; }
.es-verify .vr-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 12px; }
.es-verify .vr-ic.ok { background: var(--success-bg); color: var(--success); } .es-verify .vr-ic.no { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 900px) {
  .es-grid { grid-template-columns: minmax(0, 1fr); }
  .es-side { position: static; }
  .es-preview { padding: 8px; }
  .es-sig-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .es-sig-row > :last-child { grid-column: 1 / -1; }
}
.es-pdf { padding: 0; }
.es-pdf iframe { display: block; width: 100%; height: 80vh; min-height: 520px; border: 0; background: #fff; border-radius: 0 0 16px 16px; }
.es-pages { background: var(--surface-3); padding: 12px; display: grid; gap: 12px; justify-items: center; border-radius: 0 0 16px 16px; }
.es-pages img { display: block; width: 100%; max-width: 820px; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(20, 10, 30, .14); -webkit-user-drag: none; }
@media (max-width: 900px) { .es-pages { padding: 8px; gap: 8px; } }
.chip.chip-xs { font-size: 11px; padding: 1px 7px; line-height: 1.5; vertical-align: 1px; }
.kpi-dept-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.kpi-dept-head:first-of-type { margin-top: 4px; }
.kpi-dept-head b { font-size: 15px; color: var(--text); }
/* ---------- Internal management notes ---------- */
.mn-compose .textarea { min-height: 64px; }
.mn-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.mn-list { list-style: none; margin: 0; padding: 0; }
.mn-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--border); }
.mn-item.pinned { background: color-mix(in srgb, var(--warning-bg, #FFF6E5) 60%, transparent); }
.mn-main { flex: 1; min-width: 0; }
.mn-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.mn-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.mn-body { margin-top: 6px; font-size: 14px; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; text-align: start; }
.mn-acts { display: flex; gap: 2px; flex: none; }
.mn-edit { margin-top: 6px; }
.mn-edit summary { cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; list-style: none; }
.mn-edit summary::-webkit-details-marker { display: none; }
.mn-edit[open] summary { margin-bottom: 6px; }
@media (max-width: 760px) { .mn-item { padding: 12px 14px; gap: 10px; } }
.err-detail { text-align: start; margin: 4px 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.err-detail summary { cursor: pointer; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.err-detail pre { margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; text-align: left; }
/* ---------- Official letters ---------- */
.lt-type label span { display: inline-flex; align-items: center; gap: 6px; }
.lt-groups { display: grid; gap: 12px; margin: 14px 0 0; }
.lt-group { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.lt-group-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.lt-gtitle { font-weight: 700; max-width: 340px; }
.lt-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.lt-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
@media (max-width: 760px) { .lt-row { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 6px; border-bottom: 1px dashed var(--border); } .lt-row input:first-child { grid-column: 1 / -1; } .lt-group-head { flex-wrap: wrap; } }
/* letters use "Sakkal Majalla": the real font when the computer has it (Windows), otherwise Amiri — the closest open Naskh face */
@font-face { font-family: "QWD Majalla"; font-weight: 400; size-adjust: 88%; src: url(../fonts/amiri-arabic-400-normal.woff2) format("woff2"); }
@font-face { font-family: "QWD Majalla"; font-weight: 700; size-adjust: 88%; src: url(../fonts/amiri-arabic-700-normal.woff2) format("woff2"); }
@font-face { font-family: "QWD Majalla"; font-weight: 400; size-adjust: 88%; src: url(../fonts/amiri-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "QWD Majalla"; font-weight: 700; size-adjust: 88%; src: url(../fonts/amiri-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
.es-render [style*="Sakkal Majalla"] { font-family: "Sakkal Majalla", "QWD Majalla", serif !important; }
.es-render section.docx > article { position: relative; z-index: 1; }
.es-sig-prev.tall { height: 84px; } .es-sig-prev.tall img { max-height: 78px; } .es-stamp-row { border-bottom-style: solid; padding-top: 0; }
.es-render img { max-width: none; }
.es-render { direction: ltr; }
/* ---------- Print-ready lists ---------- */
.pl-tools { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: grid; gap: 10px; }
.pl-tools-row { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.pl-cols { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.pl-sheet { background: #fff; color: #0D2423; border-radius: 6px; box-shadow: 0 2px 16px rgba(4,30,29,.10); padding: 22px 24px; }
.pl-head { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 2px solid #096B6A; }
.pl-logo { height: 58px; width: auto; }
.pl-titles { flex: 1; min-width: 0; }
.pl-company { font-size: 12px; color: #5F7674; }
.pl-titles h1 { font-size: 21px; margin: 2px 0; color: #06403F; }
.pl-filters { font-size: 11.5px; color: #5F7674; }
.pl-meta { display: grid; gap: 2px; font-size: 11.5px; text-align: start; }
.pl-meta div { display: flex; gap: 8px; justify-content: space-between; } .pl-meta span { color: #5F7674; } .pl-meta b { color: #0D2423; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 11.5px; line-height: 1.45; }
.pl-table th { background: #096B6A; color: #fff; font-weight: 600; text-align: start; padding: 6px 7px; white-space: nowrap; }
.pl-table td { padding: 5px 7px; border-bottom: 1px solid #DFE9E8; vertical-align: top; text-align: start; }
.pl-table tbody tr:nth-child(even) td { background: #F6FAFA; }
.pl-table .pl-n { width: 28px; text-align: center; color: #5F7674; }
.pl-table tr.pl-group td { background: #E8F2F1 !important; color: #06403F; font-weight: 700; font-size: 12.5px; padding-top: 8px; border-bottom: 1px solid #C9DCDA; }
.pl-table tr.pl-group span { font-weight: 400; color: #5F7674; }
.pl-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 8px; border-top: 1px solid #DFE9E8; font-size: 10.5px; color: #6E8482; }
.pl-sheet.portrait .pl-table { font-size: 10.5px; }
@media (max-width: 760px) { .pl-sheet { padding: 14px; overflow-x: auto; } .pl-head { flex-wrap: wrap; } }
@media print {
  body { background: #fff !important; }
  .pl-sheet { box-shadow: none; padding: 0; border-radius: 0; }
  .pl-table thead { display: table-header-group; }
  .pl-table tr { break-inside: avoid; }
  .pl-table tr.pl-group { break-after: avoid; }
  .pl-table th, .pl-table tr.pl-group td, .pl-table tbody tr:nth-child(even) td, .pl-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pl-table td.nw { white-space: nowrap; }
/* ---------- All requests ---------- */
.ar-types { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.ar-type { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.ar-type:hover { text-decoration: none; color: var(--text); }
.ar-type.on { border-color: var(--brand); color: var(--brand-fg); background: var(--brand-50); }
.ar-type em { font-style: normal; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; background: var(--warning-bg); color: var(--warning); }
.ar-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ar-kind { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* =====================================================================
   Qudra identity layer — teal & sand, diamond motif (from the logo's
   two diamond dots), Qudra wordmark, ALMOND copyright, Palmyra credit.
   ===================================================================== */
.powered-by { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); text-decoration: none !important; white-space: nowrap; direction: ltr; }
.powered-by img { width: 15px; height: auto; display: block; }
.powered-by .pb-k { opacity: .8; font-weight: 500; letter-spacing: .02em; }
.powered-by b { font-weight: 700; color: var(--text-2); }
.powered-by:hover b { color: var(--brand-fg); }
.powered-by.pb-light { color: rgba(255,255,255,.62); }
.powered-by.pb-light b { color: rgba(255,255,255,.92); }
.powered-by.pb-light:hover b { color: #fff; }

/* diamond pattern replaces the dot grid on brand surfaces */
.auth-dots { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cpath d='M17 13l4 4-4 4-4-4z' fill='%23fff'/%3E%3C/svg%3E"); background-size: 34px 34px; opacity: .07; }
.q-watermark { position: absolute; z-index: 0 !important; width: 520px; height: 520px; inset-inline-end: -150px; bottom: -120px; background: url(../img/logo-light.png) center / contain no-repeat; opacity: .07; pointer-events: none; }
.auth-brand { background: radial-gradient(760px 480px at 108% -12%, rgba(var(--accent-rgb), .28), transparent 62%), radial-gradient(640px 460px at -12% 112%, rgba(255,255,255,.07), transparent 60%), linear-gradient(155deg, var(--brand-900), var(--brand-700) 48%, var(--brand) 100%); }
.auth-logo-q { flex-direction: column; align-items: flex-start; gap: 10px; }
.auth-wordmark { height: 64px; width: auto; display: block; }
.auth-tag { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.78); font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 30px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.auth-tag::before { content: ""; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.auth-hero h1 { font-family: var(--font-display); font-weight: 800; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-m-logo, .auth-m-foot { display: none; }
@media (max-width: 1024px) {
  .auth-m-logo { display: block; height: 54px; width: auto; margin: 0 auto 26px; }
  .auth-m-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 30px; color: var(--muted); font-size: 11.5px; text-align: center; }
  :root[data-theme="dark"] .auth-m-logo { content: url(../img/qudra-wordmark-white.png); }
}
.sb-logo { background: #fff; }
.sb-brand-text b { font-family: var(--font-display); font-size: 17px; letter-spacing: 0; }

/* ---------------- Landing ---------------- */
.q-landing { min-height: 100vh; background: var(--brand-900); }
.q-land-hero { position: relative; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; color: #fff; padding: 28px clamp(16px, 4vw, 56px);
  background: radial-gradient(900px 560px at 105% -10%, rgba(var(--accent-rgb), .30), transparent 60%), radial-gradient(700px 520px at -10% 110%, rgba(255,255,255,.07), transparent 60%), linear-gradient(160deg, var(--brand-900), var(--brand-700) 55%, var(--brand)); }
.q-land-hero > :not(.auth-dots):not(.q-watermark) { position: relative; z-index: 1; }
.q-land-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-land-mark { height: 58px; width: auto; }
.q-land-lang { display: inline-flex; align-items: center; gap: 8px; color: #fff; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); font-size: 13px; }
.q-land-lang:hover { text-decoration: none; background: rgba(255,255,255,.14); }
.q-land-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 40px 0; max-width: 1040px; margin: 0 auto; width: 100%; }
.q-land-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.q-land-kicker::before, .q-land-kicker::after { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); }
.q-land-body h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5vw, 52px); line-height: 1.15; }
.q-land-body > p { color: rgba(255,255,255,.76); font-size: clamp(14px, 1.6vw, 17px); max-width: 640px; margin: 0; }
.q-journey-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 8px 0 14px; }
.q-journey-strip span { padding: 6px 12px; border-radius: 30px; font-size: 12.5px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.9); }
.q-journey-strip i { color: var(--accent); display: inline-flex; font-style: normal; }
.q-land-portals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.q-portal-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 18px 20px; border-radius: 22px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.q-portal-card:hover { text-decoration: none; transform: translateY(-3px); background: rgba(255,255,255,.12); border-color: rgba(var(--accent-rgb), .55); }
.q-portal-ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--accent); }
.q-portal-card b { font-size: 17px; font-family: var(--font-display); }
.q-portal-card small { color: rgba(255,255,255,.7); }
.q-portal-card em { font-style: normal; font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.q-land-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: rgba(255,255,255,.6); font-size: 12.5px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
@media (max-width: 760px) {
  .q-land-portals { grid-template-columns: 1fr; }
  .q-land-mark { height: 44px; }
  .q-land-foot { justify-content: center; text-align: center; }
  .q-watermark { width: 340px; height: 340px; inset-inline-end: -120px; bottom: -80px; }
}

/* ---------------- Qudra modules ---------------- */
.q-diamond { display: inline-block; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; flex: none; }
.q-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--brand-50); color: var(--brand-fg); white-space: nowrap; }
.q-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.q-level { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.q-level-1 { background: #FDECEC; color: #B42318; } .q-level-2 { background: #FDF4E1; color: #9A5B00; } .q-level-3 { background: #E9F0FD; color: #1D5FD1; } .q-level-4 { background: #E3F4EE; color: #0B7A55; }
:root[data-theme="dark"] .q-level-1 { background: rgba(244,113,113,.14); color: #F79C9C; } :root[data-theme="dark"] .q-level-2 { background: rgba(242,182,76,.14); color: #F2C46E; }
:root[data-theme="dark"] .q-level-3 { background: rgba(122,167,255,.14); color: #9BBDFF; } :root[data-theme="dark"] .q-level-4 { background: rgba(61,209,154,.14); color: #66DCB0; }

/* journey stepper (8 stages) */
.q-journey { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; position: relative; padding: 4px 0 2px; }
.q-journey::before { content: ""; position: absolute; top: 19px; inset-inline: 6%; height: 3px; border-radius: 3px; background: var(--border); }
.q-journey .qj-fill { position: absolute; top: 19px; inset-inline-start: 6%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
[dir="rtl"] .q-journey .qj-fill { background: linear-gradient(270deg, var(--brand), var(--accent)); }
.qj-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; padding: 0 4px; z-index: 1; }
.qj-dot { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-2); color: var(--muted); font-weight: 800; font-size: 14px; transform: rotate(45deg); transition: .2s; }
.qj-dot > * { transform: rotate(-45deg); }
.qj-step.done .qj-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.qj-step.now .qj-dot { background: var(--accent); border-color: var(--accent); color: #0A2423; box-shadow: 0 0 0 5px var(--accent-50); }
.qj-step b { font-size: 12px; line-height: 1.35; color: var(--text-2); font-weight: 600; }
.qj-step.now b { color: var(--text); font-weight: 800; }
.qj-step small { font-size: 11px; color: var(--muted); }
@media (max-width: 900px) {
  .q-journey { grid-template-columns: 1fr; gap: 10px; }
  .q-journey::before, .q-journey .qj-fill { display: none; }
  .qj-step { flex-direction: row; text-align: start; gap: 12px; }
  .qj-dot { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
}

/* maturity gauge */
.q-gauge { --v: 0; --c: var(--brand); width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); }
.q-gauge::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--surface); }
.q-gauge > div { position: relative; text-align: center; line-height: 1.15; }
.q-gauge b { font-size: 34px; font-weight: 800; font-family: var(--font-display); display: block; direction: ltr; }
.q-gauge small { color: var(--muted); font-size: 11.5px; }
.q-gauge.sm { width: 96px; height: 96px; } .q-gauge.sm::before { inset: 9px; } .q-gauge.sm b { font-size: 22px; }

/* dimension bars */
.q-dims { display: grid; gap: 11px; }
.q-dim { display: grid; grid-template-columns: minmax(130px, 210px) 1fr 46px; align-items: center; gap: 12px; font-size: 13px; }
.q-dim span { color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.q-dim .q-bar { height: 9px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.q-dim .q-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--brand-400), var(--brand)); }
[dir="rtl"] .q-dim .q-bar i { background: linear-gradient(270deg, var(--brand-400), var(--brand)); }
.q-dim b { text-align: end; font-variant-numeric: tabular-nums; direction: ltr; }
@media (max-width: 560px) { .q-dim { grid-template-columns: 1fr 44px; } .q-dim .q-bar { grid-column: 1 / -1; grid-row: 2; } }

/* overview hero */
.q-hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 24px 26px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(600px 300px at 105% -20%, rgba(var(--accent-rgb), .35), transparent 60%), linear-gradient(150deg, var(--brand-900), var(--brand)); box-shadow: var(--shadow); }
.q-hero::after { content: ""; position: absolute; width: 300px; height: 300px; inset-inline-end: -70px; bottom: -110px; background: url(../img/logo-light.png) center / contain no-repeat; opacity: .08; }
.q-hero > * { position: relative; z-index: 1; }
.q-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.q-hero p { color: rgba(255,255,255,.78); margin: 6px 0 0; max-width: 680px; }
.q-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.q-hero-stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 14px; }
.q-hero-stats b { display: block; font-size: 24px; font-weight: 800; font-family: var(--font-display); direction: ltr; text-align: start; }
[dir="rtl"] .q-hero-stats b { text-align: end; direction: ltr; }
.q-hero-stats small { color: rgba(255,255,255,.72); font-size: 12px; }
@media (max-width: 760px) { .q-hero-stats { grid-template-columns: 1fr 1fr; } .q-hero { padding: 20px 18px; } .q-hero h1 { font-size: 21px; } }

/* stage columns / funnel */
.q-funnel { display: grid; gap: 8px; }
.q-funnel a { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.q-funnel a:hover { text-decoration: none; border-color: var(--brand-200); }
.q-funnel .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-fg); font-weight: 800; font-size: 13px; }
.q-funnel .bar { height: 6px; border-radius: 6px; background: var(--surface-3); margin-top: 5px; overflow: hidden; } .q-funnel .bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.q-funnel b.c { font-size: 18px; font-weight: 800; direction: ltr; }

/* tracks cards */
.q-tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.q-track { border-radius: 18px; padding: 16px; border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.q-track::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--tc, var(--brand)); }
.q-track h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.q-track .units { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-track .units span { font-size: 11.5px; padding: 3px 9px; border-radius: 14px; background: var(--surface-3); color: var(--text-2); }
.q-track .big { font-size: 28px; font-weight: 800; font-family: var(--font-display); direction: ltr; display: inline-block; }
@media (max-width: 900px) { .q-tracks { grid-template-columns: 1fr; } }

/* milestones timeline */
.q-miles { display: grid; gap: 0; }
.q-mile { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
.q-mile::before { content: ""; position: absolute; top: 18px; bottom: 0; inset-inline-start: 10px; width: 2px; background: var(--border); }
.q-mile:last-child::before { display: none; }
.q-mile .md { width: 12px; height: 12px; margin: 5px 5px 0; transform: rotate(45deg); background: var(--border-2); border-radius: 2px; }
.q-mile.done .md { background: var(--brand); } .q-mile.now .md { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.q-mile b { font-size: 13.5px; display: block; } .q-mile small { color: var(--muted); }

/* journey board cards */
.kb-card .q-mini { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.kb-card .q-mini .q-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.kb-card .q-mini .q-bar i { display: block; height: 100%; background: var(--brand); }
.print-powered { margin-top: 10px; text-align: center; font-size: 10px; color: #8AA09E; direction: ltr; }
.print-powered img { width: 10px; vertical-align: -1px; margin: 0 3px; }
