/* ==========================================================================
   وصاب (Wasab) — App UI (dashboards for all roles)
   Identity: "Enterprise Command Center" — dual-pane RIGHT nav (dark #0b1120 module rail +
   lighter #1a2333 page panel with a prominent company card), white top bar with breadcrumb,
   soft-gray #f3f4f6 page, white 1px-border panels with module colour dots, KPI tiles with a
   left colour bar, «بانتظار قرارك» as an action inbox, floating blue "📞 الهاتف" pill.
   Type: headings "Reem Kufi" + body Cairo.
   Builds on ../../../shared/css/base.css · --brand is re-themed per company by app.js
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@500;600;700&display=swap");

:root {
  --brand: #2563eb;          /* company accent (re-themed at runtime) */
  --brand-600: #1d4ed8;
  --brand-soft: #dbeafe;
  --co: #2563eb;
  --blue: #2563eb; --blue-soft: #dbeafe;
  --green: #16a34a; --green-soft: #dcfce7;
  --orange: #ea580c; --orange-soft: #ffedd5;
  --red: #dc2626; --red-soft: #fee2e2;
  --violet: #7c3aed; --violet-soft: #ede9fe;
  --cyan: #0891b2; --cyan-soft: #cffafe;
  --navy: #111827;
  --navy-2: #1f2937;
  --navy-3: #0f172a;
  --sidebar: #111827;
  --sidebar-2: #1f2937;
  --sidebar-text: #e5e7eb;
  --sidebar-muted: #9ca3af;
  --bg: #f3f4f6;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #9ca3af;
  --success: #16a34a; --success-soft: #dcfce7;
  --warning: #d97706; --warning-soft: #fef3c7;
  --danger: #dc2626; --danger-soft: #fee2e2;
  --info: #2563eb; --info-soft: #dbeafe;
  --rail-w: 72px;
  --sub-w: 244px;
  --sidebar-w: calc(var(--rail-w) + var(--sub-w));
  --header-h: 64px;
  --font-head: "Reem Kufi", "Cairo", system-ui, sans-serif;
}

html { overflow-x: clip; }
body.app { background: var(--bg); overflow-x: hidden; color: var(--text); }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------- Layout: "Enterprise Command Center" — dual-pane nav (dark module rail + lighter page panel) ---------- */
.sidebar {
  position: fixed; inset-block: 0; right: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: row; color: var(--sidebar-text);
  transition: transform .25s ease, width .2s ease;
}
.main { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .2s ease; }
.content { padding: 22px 26px 34px; flex: 1; width: 100%; max-width: 1560px; margin-inline: auto; }

/* Module rail (icon column) */
.rail { width: var(--rail-w); flex-shrink: 0; background: #0b1120; display: flex; flex-direction: column; align-items: center; padding: 12px 0; border-left: 1px solid #1f2937; position: relative; z-index: 2; }
.rail-brand { width: 44px; height: 44px; border-radius: 12px; padding: 4px; background: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.35); position: relative; flex-shrink: 0; margin-bottom: 10px; }
.rail-brand::after { content: ""; position: absolute; bottom: -8px; width: 18px; height: 3px; border-radius: 3px; background: var(--brand); }
.rail-nav { flex: 1; width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px; overflow-y: auto; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-btn { --m: #94a3b8; position: relative; width: 100%; min-height: 56px; border: 0; background: none; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 7px 2px; color: #9ca3af; cursor: pointer; font: inherit; transition: background .15s, color .15s; flex-shrink: 0; }
.rail-btn .rb-e { font-size: 19px; line-height: 1; filter: grayscale(.6); opacity: .8; transition: .15s; }
.rail-btn small { font-size: 9.5px; font-weight: 700; line-height: 1.3; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rail-btn:hover { background: rgba(255,255,255,.05); color: #e5e7eb; }
.rail-btn:hover .rb-e, .rail-btn.active .rb-e { filter: none; opacity: 1; }
.rail-btn.active { background: color-mix(in srgb, var(--m) 18%, #111827); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--m) 30%, transparent); }
.rail-btn.active::before { content: ""; position: absolute; right: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px 0 0 3px; background: var(--m); box-shadow: 0 0 10px var(--m); }
.rb-count { position: absolute; top: 4px; left: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-style: normal; font-weight: 800; display: grid; place-items: center; border: 2px solid #0b1120; line-height: 1; }
.rail-foot { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 0; border-top: 1px solid #1f2937; }
.rail-foot .rail-btn { min-height: 40px; }
.rail-pin svg { width: 18px; height: 18px; transition: transform .2s; }
body.nav-mini .rail-pin svg { transform: scaleX(-1); }
.rail-me { margin-top: 6px; display: grid; place-items: center; }
.rail-me .avatar { box-shadow: 0 0 0 2px #0b1120, 0 0 0 4px var(--brand); }

/* Page panel (lighter dark) */
.subnav { width: var(--sub-w); flex-shrink: 0; min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, #1a2333 0%, #151c2b 100%); border-left: 1px solid #263041; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 12px; color: #fff; }
.subnav .brand { justify-content: space-between; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #1f2937, #374151); display: grid; place-items: center; font-size: 21px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.25); flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 21px; letter-spacing: .3px; line-height: 1.1; font-family: var(--font-head); }
.brand-name small { display: block; font-size: 11px; font-weight: 600; color: var(--sidebar-muted); letter-spacing: 0; margin-top: 4px; font-family: var(--font); }
.brand-ver { font-size: 10.5px; font-weight: 700; color: #9ca3af; border: 1px solid #334155; border-radius: 6px; padding: 1px 6px; direction: ltr; flex-shrink: 0; }

/* Company card (switcher) */
.co-card-wrap { margin: 2px 12px 8px; }
.co-card { --co: var(--brand); width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--co) 45%, #263041); background: linear-gradient(135deg, color-mix(in srgb, var(--co) 30%, #111827) 0%, #111827 78%); color: #fff; cursor: pointer; font: inherit; text-align: right; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.co-card::after { content: ""; position: absolute; left: -34px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; border: 18px solid color-mix(in srgb, var(--co) 22%, transparent); pointer-events: none; }
.co-card:hover { border-color: var(--co); box-shadow: 0 12px 28px rgba(0,0,0,.3), 0 0 0 3px color-mix(in srgb, var(--co) 25%, transparent); }
.co-card.static { cursor: default; }
.co-card.static:hover { border-color: color-mix(in srgb, var(--co) 45%, #263041); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.co-card .co-logo { box-shadow: 0 0 0 3px rgba(255,255,255,.1), 0 8px 18px color-mix(in srgb, var(--co) 45%, transparent); position: relative; z-index: 1; }
.cc-meta { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cc-meta small { display: block; font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--co) 35%, #cbd5e1); line-height: 1.3; }
.cc-meta b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta em { display: block; font-style: normal; font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-card > svg { width: 16px; height: 16px; color: #9ca3af; position: relative; z-index: 1; }
.co-card-wrap .co-menu { right: 0; left: auto; top: calc(100% + 8px); }
.role-chip { margin: 0 12px 4px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px dashed #334155; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.role-chip small { display: block; font-size: 10.5px; color: var(--sidebar-muted); line-height: 1.3; }
.role-chip b { color: #fff; font-weight: 700; font-size: 12.5px; display: block; line-height: 1.35; }
.rc-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); flex-shrink: 0; }

/* Module pages */
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 14px; scrollbar-width: thin; scrollbar-color: #374151 transparent; }
.nav-group { display: none; }
.nav-group.show { display: block; animation: fade .2s ease; }
.nav-section { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 13.5px; font-weight: 600; color: #f3f4f6; padding: 12px 8px 8px; letter-spacing: 0; }
.nav-section small { margin-right: auto; font-family: var(--font); font-size: 10.5px; font-weight: 700; color: #9ca3af; background: rgba(255,255,255,.06); border-radius: 999px; padding: 0 8px; line-height: 18px; }
.m-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--m, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m, var(--brand)) 25%, transparent); flex-shrink: 0; display: inline-block; }
.nav-divider { height: 1px; background: #263041; margin: 12px 8px 8px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 2px; border-radius: 9px; color: #cbd5e1; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: #f9fafb; color: #111827; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.nav-link.active::before { content: ""; position: absolute; right: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px 0 0 3px; background: var(--co); box-shadow: 0 0 10px var(--co); }
.nav-emoji { width: 22px; text-align: center; font-size: 15px; line-height: 1; flex-shrink: 0; filter: saturate(.9); }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .count { margin-right: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; min-width: 20px; text-align: center; }
.sidebar-foot { padding: 12px 16px 14px; border-top: 1px solid #263041; font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot a { color: #d1d5db; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.sidebar-foot a:hover { color: #fff; }
.by-almgrat { display: inline-flex; align-items: center; gap: 6px; color: #6b7280; }
.by-almgrat img { width: 18px; height: 18px; }

/* Icon-only ("mini") nav: pinned collapsed or mid-size screens — the page panel becomes a flyout */
@media (min-width: 1025px) {
  body.nav-mini .sidebar { width: var(--rail-w); }
  body.nav-mini .main { margin-right: var(--rail-w); }
  body.nav-mini .subnav { position: absolute; top: 0; bottom: 0; right: var(--rail-w); opacity: 0; visibility: hidden; transform: translateX(14px); transition: opacity .18s ease, transform .18s ease, visibility .18s; box-shadow: -24px 0 50px rgba(0,0,0,.3); }
  body.nav-mini.nav-fly .subnav { opacity: 1; visibility: visible; transform: none; }
}

/* Company logo chips */
.co-logo { --co: var(--brand); width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, color-mix(in srgb, var(--co) 78%, #fff), var(--co)); box-shadow: 0 4px 12px color-mix(in srgb, var(--co) 35%, transparent); letter-spacing: -.3px; }
.co-logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.co-logo.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 17px; }
.co-chip { --co: var(--brand); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--co) 10%, #fff); color: color-mix(in srgb, var(--co) 85%, #000); white-space: nowrap; border: 1px solid color-mix(in srgb, var(--co) 22%, #fff); }
.co-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--co); }

/* ---------- Header ---------- */
.topbar-app {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
}
.topbar-app::after { content: ""; position: absolute; bottom: -1px; right: 0; width: 140px; height: 2px; background: linear-gradient(270deg, var(--brand), transparent); }
.page-title { min-width: 0; flex-shrink: 0; }
.page-title small { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; line-height: 1.4; }
.page-title .pt-sep { color: #d1d5db; }
.page-title b { display: block; font-family: var(--font-head); font-size: 18px; font-weight: 600; line-height: 1.35; white-space: nowrap; color: var(--text); }
.menu-toggle, .hdr-co { display: none; }
.hdr-co { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; color: var(--text-2); cursor: pointer; position: relative; transition: .15s; font-size: 17px; }
.icon-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, #fff); background: var(--brand-soft); }
.icon-btn .dot-count { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.icon-btn .bell { line-height: 1; }

.global-search { position: relative; flex: 1; max-width: 480px; margin-inline-start: auto; min-width: 0; }
.global-search input { width: 100%; height: 40px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 0 42px 0 44px; font: inherit; font-size: 14px; transition: .15s; color: var(--text); }
.global-search input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.global-search > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search kbd { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: #fff; }
.search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 60; min-width: 340px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* legacy header company button (kept for compatibility; the switcher now lives in the nav company card) */
.co-btn { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 6px; border-radius: 14px; border: 1px solid var(--border); background: #fff; cursor: pointer; font: inherit; text-align: right; transition: .15s; height: 46px; }
.co-btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, #fff); background: var(--brand-soft); }
.co-btn.static { cursor: default; }
.co-btn.static:hover { background: #fff; border-color: var(--border); }
.co-btn .meta b { display: block; font-size: 13px; line-height: 1.2; color: var(--text); white-space: nowrap; }
.co-btn .meta small { font-size: 11px; color: var(--muted); }
.co-btn > svg { width: 15px; color: var(--muted); }
.co-menu { width: 330px; }
.co-item { align-items: center !important; }
.co-item .ci-meta { flex: 1; min-width: 0; }
.co-item .ci-meta b { display: block; font-size: 14px; }
.co-item .ci-meta small { display: block; font-size: 12px; color: var(--muted); }
.co-item.active { background: var(--brand-soft) !important; }
.co-item .ci-check { color: var(--brand) !important; }
.co-hint { font-size: 11.5px; color: var(--muted); padding: 8px 12px 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 10px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; font: inherit; text-align: right; }
.user-btn:hover { background: var(--surface-2); border-color: var(--border); }
.user-btn .meta b { display: block; font-size: 14px; color: var(--text); line-height: 1.2; white-space: nowrap; }
.user-btn .meta small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.user-btn > svg { color: var(--muted); width: 16px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 240px; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 44px rgba(17,24,39,.14);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text); font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--surface-2); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--muted); }
.dropdown-menu .mi { width: 20px; text-align: center; }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-head { padding: 12px 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-head b { font-size: 15px; }
.notif-menu { width: 390px; padding: 0; }
.notif-list { max-height: 400px; overflow-y: auto; }
.dropdown-menu a.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; border-radius: 0; align-items: flex-start; }
.notif-item.unread { background: #f8faff; }
.notif-item.unread::after { content: ""; position: absolute; left: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.n-emoji { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: 18px; }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.notif-item b { font-size: 14px; display: block; }
.notif-item small { font-size: 12px; color: var(--muted); }
.dropdown-menu a.notif-foot { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--text-2); border-radius: 0 0 14px 14px; }

.search-panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 44px rgba(17,24,39,.14); padding: 8px; max-height: 460px; overflow-y: auto; }
.search-group { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--text-2); padding: 10px 10px 4px; }
.search-group small { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: var(--muted); }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.search-item:hover, .search-item.focus { background: var(--brand-soft); }
.search-item .s-emoji { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.search-item .s-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .tail { margin-right: auto; flex-shrink: 0; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.search-all { display: block; text-align: center; padding: 10px; margin-top: 6px; border-top: 1px solid var(--border); font-weight: 700; font-size: 13px; }

/* ---------- Footer ---------- */
.app-foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: #fff; }
.app-foot a { color: var(--muted); }
.app-foot a:hover { color: var(--brand); }
.app-foot .sep { opacity: .6; }

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; max-width: 100%; }

/* ---------- Buttons (extend base) ---------- */
.btn { border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 700; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 25%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 85%, #000); color: #fff; }
.btn-soft { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 85%, #000); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 18%, #fff); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-danger-soft { background: var(--red-soft); color: #b91c1c; }
.btn-danger-soft:hover { background: #fecaca; }
.btn-success-soft { background: var(--green-soft); color: #15803d; }
.btn-success-soft:hover { background: #bbf7d0; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; font-size: 15px; }
.btn-icon:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, #fff); background: var(--brand-soft); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap instead of stretching the page */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 22px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--green); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand); } .text-navy { color: var(--navy); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(17,24,39,.04); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.h-emoji { font-size: 17px; }

/* ---------- KPI cards (Wasab style: thick coloured start border + emoji) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi-card { --c: var(--blue); background: #fff; border: 1px solid var(--border); border-right: 5px solid var(--c); border-radius: 12px; padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: .18s ease; position: relative; overflow: hidden; min-width: 0; box-shadow: 0 1px 2px rgba(17,24,39,.04); }
a.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(17,24,39,.08); }
.kpi-card::after { content: ""; position: absolute; left: -30px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 9%, transparent), transparent 70%); pointer-events: none; }
.k-top { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.k-val { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.k-val small { font-size: 13px; color: var(--muted); font-weight: 700; margin-right: 3px; }
.k-emoji { font-size: 24px; line-height: 1; }
.k-label { font-size: 13px; color: var(--text-2); font-weight: 600; line-height: 1.5; }
.k-foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.k-foot b { color: var(--c); }
.k-blue { --c: var(--blue); } .k-green { --c: var(--green); } .k-orange { --c: var(--orange); } .k-red { --c: var(--red); }
.k-violet { --c: var(--violet); } .k-cyan { --c: var(--cyan); } .k-slate { --c: #64748b; } .k-pink { --c: #db2777; }

/* legacy KPI vocabulary (kept for page agents) */
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand)); font-size: 20px; }
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.3px; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: #15803d; background: var(--green-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }
.trend.flat { color: var(--text-2); background: #f1f5f9; }
.kpi-foot { font-size: 12px; color: var(--muted); }
.c-blue   { --c: #2563eb; --c-soft: #dbeafe; }
.c-green  { --c: #16a34a; --c-soft: #dcfce7; }
.c-orange { --c: #ea580c; --c-soft: #ffedd5; }
.c-red    { --c: #dc2626; --c-soft: #fee2e2; }
.c-violet { --c: #7c3aed; --c-soft: #ede9fe; }
.c-cyan   { --c: #0891b2; --c-soft: #cffafe; }
.c-amber  { --c: #d97706; --c-soft: #fef3c7; }
.c-slate  { --c: #334155; --c-soft: #eef2f6; }
.c-navy   { --c: #111827; --c-soft: #e5e7eb; }

/* Welcome */
.welcome-w { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome-w h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.welcome-w p { margin: 0; color: var(--text-2); font-size: 14px; }
.welcome-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pill b { color: var(--text); }

/* Quick shortcuts (اختصارات سريعة) */
.shortcuts { display: flex; flex-wrap: wrap; gap: 10px; }
.shortcut { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; transition: .15s; }
.shortcut:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.shortcut .plus { width: 22px; height: 22px; border-radius: 7px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; line-height: 1; font-weight: 800; }

/* ---------- Badges ---------- */
.badge { font-size: 12px; padding: 3px 10px; gap: 6px; white-space: nowrap; display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-navy { background: #e5e7eb; color: #111827; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-cyan { background: #cffafe; color: #0e7490; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-lg { font-size: 13px; padding: 5px 12px; }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--av, var(--brand)); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 92px; height: 92px; font-size: 32px; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(17,24,39,.12); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.person:hover b { color: var(--brand); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:last-child { margin-left: 0; }

/* ---------- Tables ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search-input { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search-input input { padding-right: 40px; }
.toolbar .search-input svg { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-weight: 700; font-size: 12px; color: var(--text-2); background: #f9fafb; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid #f1f2f4; vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.table .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); direction: ltr; display: inline-block; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.pagination button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text); transition: .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; }
.select[multiple] { background-image: none; padding: 6px; }
.toolbar .select { width: auto; min-width: 140px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(-20px); }
.check { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.note-box { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); font-size: 13px; color: var(--text-2); line-height: 1.7; }
.conflict-box { padding: 10px 14px; border-radius: 10px; background: var(--green-soft); color: #166534; font-size: 13px; line-height: 1.7; }
.conflict-box.warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.dropzone { border: 2px dashed #d1d5db; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; background: var(--surface-2); transition: .15s; }
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-emoji { font-size: 30px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone .dz-name { font-size: 13px; font-weight: 700; color: var(--brand); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; transition: .15s; background: #fff; position: relative; text-align: center; }
.choice:hover { border-color: color-mix(in srgb, var(--brand) 40%, #fff); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice .emoji { font-size: 28px; line-height: 1; margin-bottom: 8px; display: block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 16px; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .cnt { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 4px; background: #eef0f3; border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-2); padding: 6px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(17,24,39,.1); }
/* Segmented controls never widen the page on phones */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex-shrink: 0; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(17,24,39,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); transform: translateY(12px) scale(.98); transition: transform .2s ease; }
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.success-mark { width: 74px; height: 74px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 4px auto 16px; animation: pop .35s ease; }
.success-mark svg { width: 36px; height: 36px; stroke-width: 2.5; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 84px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 400px; background: var(--navy); color: #fff; border-radius: 14px; padding: 13px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 18px 40px rgba(17,24,39,.25); font-size: 14px; animation: toastIn .25s ease; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(34,197,94,.2); color: #4ade80; flex-shrink: 0; }
.toast.error .t-icon { background: rgba(239,68,68,.2); color: #f87171; }
.toast.info .t-icon { background: rgba(59,130,246,.22); color: #93c5fd; }
.toast.warning .t-icon { background: rgba(245,158,11,.2); color: #fbbf24; }
.toast.hide { animation: toastOut .25s ease forwards; }

/* ---------- Lists / Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 16px; }
.feed p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.feed small { color: var(--muted); font-size: 12px; }
.t-info { background: var(--info-soft); color: var(--info); }
.t-success { background: var(--green-soft); color: var(--green); }
.t-warning { background: var(--warning-soft); color: var(--warning); }
.t-danger { background: var(--danger-soft); color: var(--danger); }
.t-brand { background: var(--brand-soft); color: var(--brand); }
.t-violet { background: var(--violet-soft); color: var(--violet); }
.t-slate { background: #f1f5f9; color: #475569; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f2f4; min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); display: block; }
a.lr-title:hover { color: var(--brand); }
.list-row .lr-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-tail { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.e-tile { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); }
.empty-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 28px 12px; color: var(--muted); font-size: 13px; }
.empty-mini span { font-size: 30px; opacity: .85; }
.empty-mini b { color: var(--text-2); font-size: 14px; }

/* Approvals («بانتظار قرارك») */
.appr { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid #f1f2f4; align-items: center; }
.appr:last-child { border-bottom: 0; }
.appr .a-type { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; background: color-mix(in srgb, var(--c) 11%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); }
.appr .a-main { flex: 1; min-width: 0; }
.appr .a-kind { font-size: 11.5px; font-weight: 800; color: var(--c); }
.appr .a-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text); }
.appr .a-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appr .a-actions { display: flex; gap: 6px; flex-shrink: 0; }
.appr.done { opacity: .55; }
.appr .a-result { font-size: 12px; font-weight: 700; }
.a-blue { --c: #2563eb; } .a-green { --c: #16a34a; } .a-orange { --c: #ea580c; } .a-red { --c: #dc2626; } .a-violet { --c: #7c3aed; } .a-cyan { --c: #0891b2; }

/* Progress */
.progress { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--brand)); transition: width .6s ease; }
.ring { --p: 75; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef0f3 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 26px; font-weight: 800; display: block; line-height: 1; }
.ring small { font-size: 12px; color: var(--muted); }

/* Chart containers */
.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 210px; }
.chart-box.lg { height: 330px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Empty state */
.empty-state { padding: 44px 24px; text-align: center; }
.empty-state .empty-icon { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 26px; }

/* Info list */
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.info-list div small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-list div b { font-size: 14px; font-weight: 700; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal .day { min-height: 92px; border-radius: 10px; padding: 6px; font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--border); color: var(--text-2); position: relative; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal .day.today { outline: 2px solid var(--brand); outline-offset: -1px; }
.cal .day.out { background: transparent; border-style: dashed; color: #d1d5db; }
.cal .day.weekend { background: #fafafa; }
.cal .ev { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; background: color-mix(in srgb, var(--c, var(--brand)) 12%, #fff); color: color-mix(in srgb, var(--c, var(--brand)) 80%, #000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 3px solid var(--c, var(--brand)); }

/* Agenda / sessions (meetings timeline) */
.session { display: flex; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; align-items: center; border-right: 4px solid var(--c, var(--brand)); min-width: 0; }
.session .time { text-align: center; min-width: 62px; flex-shrink: 0; }
.session .time b { display: block; font-size: 15px; font-weight: 800; }
.session .time small { font-size: 11px; color: var(--muted); }
.session h4 { margin: 0 0 2px; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.session .meta span { display: inline-flex; align-items: center; gap: 4px; }
.session.now { background: color-mix(in srgb, var(--c, var(--brand)) 6%, #fff); }

/* QR (pseudo) */
.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 12px; display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; border: 1px solid var(--border); }
.qr i { display: block; aspect-ratio: 1; }
.qr i.on { background: #111827; }

/* Timeline (document stages / history) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 28px 16px 0; }
.timeline li::before { content: ""; position: absolute; right: 7px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; right: 2px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #d1d5db; }
.timeline li.done::after { border-color: var(--green); background: var(--green); }
.timeline li.current::after { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.timeline b { display: block; font-size: 14px; }
.timeline small { color: var(--muted); font-size: 12px; }

/* Stage stepper (إعداد → مراجعة → اعتماد → صادر) */
.stepper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stepper .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; white-space: nowrap; }
.stepper .st.done { background: var(--green-soft); color: #15803d; }
.stepper .st.current { background: var(--orange-soft); color: #c2410c; }
.stepper .arrow { color: #cbd5e1; font-size: 12px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; align-items: start; }
.kb-col { background: #fff; border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; min-height: 200px; scroll-snap-align: start; border-top: 3px solid var(--c, #64748b); }
.kb-col.drag-over { background: color-mix(in srgb, var(--c, var(--brand)) 6%, #fff); outline: 2px dashed var(--c, var(--brand)); outline-offset: -4px; }
.kb-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.kb-head b { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.kb-head .kb-count { min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: #f1f5f9; font-size: 12px; font-weight: 800; color: var(--text-2); }
.kb-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 120px; }
.kb-card { background: #f9fafb; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; cursor: grab; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; gap: 7px; }
.kb-card:hover { box-shadow: 0 8px 20px rgba(17,24,39,.08); background: #fff; }
.kb-card.dragging { opacity: .5; transform: rotate(-1.5deg); }
.kb-card h4 { margin: 0; font-size: 13.5px; font-weight: 800; line-height: 1.5; }
.kb-card .kb-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.kb-card .kb-meta span { display: inline-flex; align-items: center; gap: 4px; }
.kb-card .kb-due.over { color: var(--danger); font-weight: 800; }
.kb-card .kb-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.kb-card .kb-tags span { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.kb-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 6px; border: 1.5px dashed var(--border); border-radius: 10px; }
.kanban-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kanban-mini .col { border-radius: 12px; padding: 12px; background: #f9fafb; border: 1px solid var(--border); border-top: 3px solid var(--c, var(--brand)); color: inherit; transition: .15s; min-width: 0; }
.kanban-mini .col:hover { background: #fff; box-shadow: 0 10px 24px rgba(17,24,39,.06); }
.kanban-mini .col small { display: block; font-size: 12px; color: var(--text-2); font-weight: 700; }
.kanban-mini .col b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; margin-top: 4px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-strip > div { background: #f9fafb; border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.stat-strip small { display: block; font-size: 12px; color: var(--muted); }
.stat-strip b { font-size: 18px; font-weight: 800; }
.money { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money small { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 2px; }

/* Company comparison rows */
.co-row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f2f4; font-size: 13px; }
.co-row:last-child { border-bottom: 0; }
.co-row.head { font-size: 11.5px; font-weight: 800; color: var(--muted); padding-top: 0; }
.co-row .co-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co-row .co-name b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-row .co-name small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-row .v b { font-size: 15px; font-weight: 800; display: block; }
.co-row .v small { font-size: 11px; color: var(--muted); }

/* ---------- Floating phone widget ---------- */
.phone-fab { position: fixed; left: 22px; bottom: 22px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0; background: #2563eb; color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(37,99,235,.42); transition: transform .15s, box-shadow .15s; }
.phone-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(37,99,235,.5); }
.phone-fab .pf-dot { position: absolute; top: 2px; left: 4px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid #2563eb; box-shadow: 0 0 0 2px #fff; }
.phone-fab .pf-dot::after { content: ""; position: absolute; inset: 1px; border-radius: 50%; background: #22c55e; }
.phone-panel { position: fixed; left: 22px; bottom: 78px; z-index: 80; width: 360px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 110px)); background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 70px rgba(17,24,39,.25); display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(10px) scale(.98); transition: .18s ease; overflow: hidden; }
.phone-panel.open { opacity: 1; visibility: visible; transform: none; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: #111827; color: #fff; }
.pp-head b { display: block; font-size: 14px; }
.pp-head small { font-size: 12px; color: #9ca3af; }
.pp-head .btn-icon { background: transparent; border-color: #374151; color: #e5e7eb; }
.pp-search { position: relative; padding: 12px 14px 6px; }
.pp-search svg { position: absolute; right: 26px; top: 50%; transform: translateY(-25%); color: var(--muted); width: 16px; }
.pp-search .input { padding-right: 38px; height: 40px; }
.pp-tabs { margin: 4px 14px 6px; }
.pp-list { overflow-y: auto; padding: 0 8px 8px; flex: 1; }
.pp-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.pp-row:hover { background: var(--surface-2); }
.pp-av { position: relative; flex-shrink: 0; }
.pres { position: absolute; bottom: -1px; left: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #9ca3af; }
.pres.available { background: #22c55e; } .pres.busy { background: #ef4444; } .pres.away { background: #f59e0b; }
.pp-meta { flex: 1; min-width: 0; }
.pp-meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-meta small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-chip { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; flex-shrink: 0; }
.call-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #dcfce7; cursor: pointer; font-size: 15px; flex-shrink: 0; transition: .15s; }
.call-btn:hover { background: #22c55e; transform: scale(1.06); }
.pp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pp-foot a { font-weight: 800; }

/* ---------- Employee (mobile-app style) ---------- */
.tabbar { display: none; }
body[data-role="employee"] .content { max-width: 980px; }
.app-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 1px 2px rgba(17,24,39,.04); }
.punch-hero { border-radius: 22px; padding: 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #1e3a8a 0%, #111827 60%); position: relative; overflow: hidden; }
.punch-hero::after { content: ""; position: absolute; width: 220px; height: 220px; left: -70px; bottom: -90px; border-radius: 50%; border: 36px solid rgba(255,255,255,.05); }
.punch-btn { width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; margin: 10px auto; font: inherit; color: #fff; font-weight: 800; font-size: 15px; background: radial-gradient(circle at 50% 35%, #3b82f6, #1d4ed8); box-shadow: 0 0 0 10px rgba(59,130,246,.18), 0 0 0 22px rgba(59,130,246,.08), 0 18px 40px rgba(29,78,216,.45); transition: transform .15s; position: relative; z-index: 1; }
.punch-btn:hover { transform: scale(1.03); }
.punch-btn .pe { font-size: 40px; display: block; line-height: 1.1; }
.punch-btn.out { background: radial-gradient(circle at 50% 35%, #f97316, #c2410c); box-shadow: 0 0 0 10px rgba(249,115,22,.18), 0 0 0 22px rgba(249,115,22,.08), 0 18px 40px rgba(194,65,12,.45); }
.punch-btn.done { background: radial-gradient(circle at 50% 35%, #22c55e, #15803d); box-shadow: 0 0 0 10px rgba(34,197,94,.18), 0 18px 40px rgba(21,128,61,.4); cursor: default; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; background: #fff; border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text); text-align: center; cursor: pointer; font-family: inherit; transition: .15s; }
.quick-tile:hover { border-color: var(--brand); color: var(--brand); }
.quick-tile .qt-e { font-size: 24px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }

/* Animations */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.fade-in { animation: fade .3s ease both; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; display: inline-block; animation: pulse 1.6s infinite; }

/* ==========================================================================
   Command Center refinements — denser panels, Reem Kufi headings, module dots,
   KPI tiles with a left colour bar, «بانتظار قرارك» action inbox
   ========================================================================== */
body.app h1, body.app h2, body.app h3, body.app h4 { font-family: var(--font-head); letter-spacing: 0; }
.page-head h1, .welcome-w h1 { font-size: 25px; font-weight: 700; line-height: 1.45; }
.page-head, .welcome-w { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; position: relative; }
.page-head::after, .welcome-w::after { content: ""; position: absolute; bottom: -1px; right: 0; width: 56px; height: 2px; background: var(--mod, var(--brand)); }
.breadcrumb { font-size: 12.5px; }

/* Panels: white, 1px border, flat, tighter radius */
.card { border-radius: 10px; box-shadow: none; }
.card-head { padding: 13px 18px; background: linear-gradient(180deg, #fcfcfd, #fff); border-radius: 10px 10px 0 0; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; background: var(--mod, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mod, var(--brand)) 18%, transparent); }
.card-head p { font-size: 12px; }
.card-body { padding: 16px 18px; }
.card-pad { padding: 18px; }
.card-foot { padding: 11px 18px; background: #fcfcfd; border-radius: 0 0 10px 10px; }
.modal-head h3 { font-weight: 600; }
.app-card { border-radius: 12px; box-shadow: none; }
.kb-col, .kanban-mini .col, .stat-strip > div { border-radius: 10px; }
.table th { background: #f9fafb; font-size: 11.5px; letter-spacing: .2px; color: #6b7280; }
.table td { padding-block: 10px; }
.pill { border-radius: 8px; }
.shortcut { border-radius: 9px; }
.btn { border-radius: 9px; }

/* KPI tiles — label top, big Reem Kufi value, emoji badge, LEFT colour bar */
.kpi-grid { gap: 12px; }
.kpi-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label icon" "val icon" "foot foot"; column-gap: 10px; row-gap: 2px; align-items: start; border: 1px solid var(--border); border-right-width: 1px; border-radius: 10px; padding: 14px 16px 12px 20px; box-shadow: none; }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.kpi-card::after { display: none; }
a.kpi-card:hover { transform: none; border-color: color-mix(in srgb, var(--c) 40%, var(--border)); box-shadow: 0 8px 22px rgba(17,24,39,.07); }
.k-top { display: contents; }
.k-emoji { grid-area: icon; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); }
.k-val { grid-area: val; font-family: var(--font-head); font-size: 27px; font-weight: 700; line-height: 1.25; letter-spacing: 0; min-width: 0; }
.k-label { grid-area: label; font-size: 12.5px; font-weight: 700; color: #6b7280; line-height: 1.5; }
.k-foot { grid-area: foot; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border); }
.kpi { border-radius: 10px; }
.kpi-value { font-family: var(--font-head); font-weight: 700; }

/* «بانتظار قرارك» — action inbox (dashboard approval lists) */
.card:has(#apprList), .card:has(> #pending), .app-card:has(> #pending) { border-color: color-mix(in srgb, var(--orange) 32%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 7%, transparent); }
.card:has(#apprList) > .card-head, .card:has(> #pending) > .card-head { background: linear-gradient(270deg, #fff7ed, #fff 70%); border-bottom-color: #fed7aa; }
.card:has(#apprList) > .card-head h3::before, .card:has(> #pending) > .card-head h3::before { background: var(--orange); box-shadow: 0 0 0 3px rgba(234,88,12,.2); animation: pulse 2s infinite; }
#apprList, #pending { padding: 10px 12px !important; display: flex; flex-direction: column; gap: 8px; background: #fafafa; }
#apprList .appr, #pending .appr { padding: 11px 14px 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; position: relative; transition: border-color .15s, box-shadow .15s; }
#apprList .appr:last-child, #pending .appr:last-child { border-bottom: 1px solid var(--border); }
#apprList .appr::before, #pending .appr::before { content: ""; position: absolute; right: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px 0 0 3px; background: var(--c, var(--brand)); }
#apprList .appr:hover, #pending .appr:hover { border-color: color-mix(in srgb, var(--c, var(--brand)) 35%, var(--border)); box-shadow: 0 6px 16px rgba(17,24,39,.06); }
#apprList .appr.done, #pending .appr.done { background: #f9fafb; }
#apprList .search-all, #pending .search-all { margin-top: 0; border-top: 0; border: 1px dashed var(--border); border-radius: 10px; background: #fff; }
#apprList .empty-mini, #pending .empty-mini { background: #fff; border: 1px dashed var(--border); border-radius: 10px; }

/* Mobile overlay */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 35; opacity: 0; visibility: hidden; transition: .2s; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-title .pt-date { display: none; }
}
@media (max-width: 1100px) {
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-btn .meta { display: none; }
}
@media (max-width: 1024px) {
  /* drawer: rail + page panel slide in together */
  .sidebar { width: min(var(--sidebar-w), 92vw); transform: translateX(100%); box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: -20px 0 60px rgba(0,0,0,.3); }
  body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }
  .subnav { width: auto; flex: 1; }
  .rail-pin { display: none; }
  .co-card-wrap .co-menu { left: 0; right: 0; width: auto; min-width: 0; }
  .main { margin-right: 0; }
  .menu-toggle { display: grid; }
  .hdr-co { display: grid; }
  .topbar-app { padding: 0 18px; gap: 12px; }
  .content { padding: 22px 18px 34px; }
  .user-btn .meta { display: none; }
  .page-title { display: none; }
  .global-search { margin-inline-start: 0; }
}
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kanban-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .grid-5 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .info-list { grid-template-columns: minmax(0, 1fr); }
  .topbar-app { gap: 8px; padding: 0 12px; height: 60px; }
  .icon-btn { width: 38px; height: 38px; }
  .co-btn { height: 40px; padding: 3px 6px; gap: 4px; }
  .co-btn > svg { display: none; }
  .co-btn .co-logo { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
  .user-btn { padding: 2px; }
  .user-btn > svg { display: none; }
  .user-btn .avatar { width: 34px; height: 34px; font-size: 13px; }
  .header-actions { gap: 6px; }
  .global-search kbd { display: none; }
  .global-search input { padding-left: 10px; padding-right: 36px; height: 40px; font-size: 13px; }
  .global-search > svg { right: 11px; width: 16px; }
  .search-results { position: fixed; top: 64px; left: 10px; right: 10px; min-width: 0; }
  .content { padding: 18px 14px 30px; }
  .page-head h1, .welcome-w h1 { font-size: 21px; }
  .card-pad, .card-body { padding: 16px 14px; }
  .card-head, .toolbar, .card-foot { padding-inline: 14px; }
  .notif-menu { position: fixed; top: 62px; left: 10px; right: 10px; width: auto; }
  .co-menu { position: fixed; top: 62px; left: 10px; right: 10px; width: auto; }
  .co-card-wrap .co-menu { position: absolute; top: calc(100% + 8px); left: 0; right: 0; }
  .topbar-app::after { width: 80px; }
  .page-head h1, .welcome-w h1 { line-height: 1.5; }
  .kpi-card { padding: 12px 12px 10px 16px; }
  .k-emoji { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  #userDrop .dropdown-menu { position: fixed; top: 62px; left: 10px; right: auto; }
  .toast-wrap { left: 12px; right: 12px; bottom: 80px; }
  .toast { max-width: none; min-width: 0; }
  .hide-sm { display: none !important; }
  .co-row { grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); }
  .co-row .hide-sm { display: none; }
  .appr { flex-wrap: wrap; }
  .appr .a-main { flex-basis: calc(100% - 56px); }
  .appr .a-actions { width: 100%; justify-content: flex-end; }
  .phone-fab { left: 12px; bottom: 14px; padding: 10px 16px; font-size: 13px; }
  .phone-panel { left: 12px; right: 12px; width: auto; max-width: none; bottom: 66px; }
  .cal .day { min-height: 56px; padding: 4px; }
  .cal .ev { font-size: 0; padding: 0; height: 5px; border-right: 0; background: var(--c, var(--brand)); }
  .app-foot { padding-bottom: 70px; }
  /* employee app — bottom tab bar */
  body.has-tabbar .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
  .tabbar a span { font-size: 20px; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
  .tabbar a.active { color: var(--brand); background: var(--brand-soft); }
  .tabbar a.active span { filter: none; opacity: 1; }
  body.has-tabbar .phone-fab { bottom: 78px; }
  body.has-tabbar .phone-panel { bottom: 130px; }
  body.has-tabbar .toast-wrap { bottom: 140px; }
  body.has-tabbar .app-foot { padding-bottom: 90px; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick-tile { padding: 10px 2px; font-size: 11.5px; border-radius: 14px; }
  .quick-tile .qt-e { width: 40px; height: 40px; font-size: 21px; }
}
@media (max-width: 420px) {
  .k-val { font-size: 22px; }
  .k-emoji { font-size: 15px; width: 30px; height: 30px; }
  .kpi-card { padding: 12px 11px 10px 14px; }
  .k-label { font-size: 12px; }
  .shortcut { padding: 8px 12px; font-size: 13px; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 16px; }
}
@media print {
  .sidebar, .topbar-app, .page-actions, .toolbar, .toast-wrap, .phone-fab, .phone-panel, .tabbar, .app-foot { display: none !important; }
  .main { margin: 0; }
  body.app { background: #fff; }
}

/* Product logo (Wasab) */
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-tile { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.12); }
