﻿:root {
  --k-primary: #1d2b64;
  --k-primary-2: #3949ab;
  --k-bg: #f4f5f9;
  --k-line: #e2e5ef;
}
html, body { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; background: var(--k-bg); }
/* an LTR field (mobile, number) whose hint is Arabic: the hint reads right-to-left, the typed value stays LTR */
input[dir="ltr"].ltr-ph::placeholder { direction: rtl; text-align: right; }
.app { display: flex; min-height: 100vh; }
/* Fixed while the page scrolls: sticks to the viewport top, full height, scrolls on its own if taller than the screen. */
.sidebar { width: 264px; background: #111a44; color: #dfe4ff; flex-shrink: 0; padding: 16px 12px 0; transition: width .2s;
           position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.rating { color: #c58a00; white-space: nowrap; }
/* Recurring plans: frequency chips and filter pills */
.freq-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .76rem; margin: 1px 0 1px 4px; white-space: nowrap; }
.freq-Daily { background: #e6f0ff; color: #1d4ed8; } .freq-EveryNDays { background: #e0f2fe; color: #075985; }
.freq-Weekly { background: #eef2ff; color: #3949ab; } .freq-Monthly { background: #f3e8ff; color: #6b21a8; }
.freq-Quarterly { background: #fde8e8; color: #9b1c1c; } .freq-Yearly { background: #ecfdf5; color: #065f46; }
.filter-pill { padding: 4px 12px; border-radius: 999px; border: 1px solid #c9cee3; font-size: .82rem; text-decoration: none; color: var(--k-primary); background: #fff; }
.version-row { cursor: pointer; }
.version-row:hover td { background: #f6f7fc; }
.version-row[aria-expanded="true"] td { background: #eef1fb; }
.version-detail td { background: #fafbff; border-top: 0; }
.chg { color: #1d4ed8; font-weight: 600; }
.chg-box { background: #fff7d6; border-radius: 6px; }
.filter-pill.on { background: var(--k-primary-2); border-color: var(--k-primary-2); color: #fff; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex: none; }
.brand .logo { width: 40px; height: 40px; border-radius: 10px; background: #f2c14e; color: #111a44; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.brand b { display: block; color: #fff; }
.brand small { color: #C6CCEE; }   /* 2026-11-28: the company line one shade lighter (sun on a phone) */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--k-line); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; }
.content { padding: 22px; }
/* Top bar: user card (name + position • unit) and grouped actions */
.user-card { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; border: 1px solid var(--k-line); border-radius: 999px; background: #f8f9fd; }
.user-card .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--k-primary-2), var(--k-primary)); color: #fff;
                     display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.user-card .who { display: flex; flex-direction: column; line-height: 1.25; }
.user-card .who b { color: var(--k-primary); font-size: .92rem; }
.user-card .who small { color: #6b7394; font-size: .76rem; white-space: nowrap; }
.user-card .sep { margin: 0 6px; color: #b5bbd3; }
.top-actions { display: flex; align-items: center; border: 1px solid var(--k-line); border-radius: 10px; overflow: hidden; background: #fff; }
.top-actions a, .top-actions button { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: .82rem; color: #4a5272;
                                      text-decoration: none; background: none; border: 0; border-inline-start: 1px solid var(--k-line); }
.top-actions > :first-child { border-inline-start: 0; }
.top-actions form button { border-inline-start: 1px solid var(--k-line); }
.top-actions a:hover, .top-actions button:hover { background: #f1f3fa; color: var(--k-primary); }
.top-actions .logout { color: #b42318; }
.top-actions .logout:hover { background: #fdecea; color: #b42318; }
.top-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.desktop-user { display: flex; }
.visit-sticky, .ans > i { display: none; }
/* v0.19.4 optional photo on any visit item: a discreet link that opens the upload only when wanted */
.ev-add > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer; font-size: .82rem; color: var(--k-primary-2);
                    padding: 3px 10px; border: 1px dashed #c9cee3; border-radius: 999px; background: #fff; user-select: none; }
.ev-add > summary::-webkit-details-marker { display: none; }
.ev-add > summary:hover { background: #f1f3fa; }
.ev-add[open] > summary { border-style: solid; background: #eef1fb; }
.ev-add .ev-opt { color: #8a90a8; }
/* v0.19.5 observations that need me: alert tiles, highlighted rows with a plain "waiting for…" line, menu dot */
/* user 2026-11-21: expired goods on the shelf — must catch the supervisor's eye (dashboard banner + inbox) */
.shelf-alert { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: .75rem 1rem; border-radius: .6rem;
  background: #fdecee; border: 1px solid #f1aeb5; border-inline-start: 6px solid #dc3545; color: #842029; }
.inbox-urgent { border-inline-start: 5px solid #dc3545 !important; }
.inbox-urgent.unread { background: #fdecee !important; }
.inbox-urgent .badge-urgent { background: #dc3545; color: #fff; font-size: .7rem; vertical-align: middle; }
.kpi.kpi-alert { border-color: #f3c0c5; background: linear-gradient(180deg, #fff 0%, #fff6f7 100%); box-shadow: 0 2px 10px rgba(220,53,69,.08); }
.kpi.kpi-back { border-color: #a3d9b8; background: linear-gradient(180deg, #fff 0%, #f1fbf5 100%); box-shadow: 0 2px 10px rgba(25,135,84,.10); }
tr.needs-me > td { background: #fff8f0 !important; }
tr.needs-me > td:first-child { box-shadow: inset -3px 0 0 #f0a04b; }
.waiting { font-size: .76rem; color: #7a819c; margin-top: 2px; }
.waiting.mine { color: #b45309; font-weight: 600; }
.nav-toggle { position: relative; }
.menu-dot { position: absolute; top: 7px; left: 7px; width: 9px; height: 9px; border-radius: 50%; background: #dc3545; box-shadow: 0 0 0 2px #fff; }
.nav-toggle, .m-user, .bottom-nav, .drawer-close, .nav-backdrop { display: none; }
.card-k { background: #fff; border: 1px solid var(--k-line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--k-line); border-radius: 12px; padding: 16px; height: 100%; }
.kpi .v { font-size: 1.8rem; font-weight: 700; color: var(--k-primary-2); }
.kpi .l { color: #626a85; font-size: .9rem; }
.kpi small { color: #8a90a8; display: block; font-size: .75rem; margin-top: 4px; }
/* WhatsApp page (phase A) */
.wa-group { border: 1px solid var(--k-line); border-radius: 10px; padding: 10px 12px; height: 100%; background: #fbfcfe; }
.wa-template { border: 1px solid var(--k-line); border-radius: 10px; padding: 12px 14px; height: 100%; background: #f7fbf8; }
.wa-pre { white-space: pre-wrap; font-family: inherit; background: #fff; border: 1px dashed #b7d9c2; border-radius: 8px; padding: 8px 10px; margin: 4px 0 8px; font-size: .9rem; }
.wa-log .wa-msg { min-width: 200px; max-width: 420px; }
.table th { background: #e8ebf8; font-weight: 600; white-space: nowrap; }
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #111a44, #3949ab); }
.auth-card { background: #fff; border-radius: 16px; padding: 32px; width: min(420px, 92vw); }
.progress { height: 8px; }
.overdue { color: #b91c1c; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-right: 3px solid var(--k-primary-2); padding: 4px 12px; margin-bottom: 8px; }
tr[hidden] { display: none !important; }

/* v0.19.2 — one pattern for every record: view (read-only) and edit panels with a clear way out without saving */
tr.row-open > td { background: #f2f4fc !important; }
:target { scroll-margin-top: calc(76px + env(safe-area-inset-top)); }
tr.panel-row > td { padding: 0 !important; border-bottom: 0; background: transparent !important; }
.record-panel { margin: 4px 0 14px; padding: 14px 16px; border: 1px solid #d9def0; border-radius: 12px; background: #fff;
                box-shadow: 0 4px 14px rgba(17,26,68,.06); }
.record-panel.editing { border-color: #c4ccef; background: #fbfcff; border-top: 3px solid var(--k-primary-2); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px;
              margin-bottom: 12px; border-bottom: 1px solid var(--k-line); }
.panel-head b { color: var(--k-primary); font-size: 1.02rem; }
.panel-kicker { display: block; font-size: .74rem; color: #7a819c; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--k-line); }
.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; }
.view-grid > div { padding: 8px 10px; border-radius: 10px; background: #f7f8fc; }
.view-grid dt { font-weight: 400; font-size: .76rem; color: #7a819c; margin-bottom: 2px; }
.view-grid dd { margin: 0; font-weight: 600; color: #2c3350; overflow-wrap: anywhere; }
.view-grid dd[dir="ltr"] { text-align: right; }
.member-name { color: var(--k-primary); }
.role-card .panel-head { margin-bottom: 10px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { padding: 3px 10px; border-radius: 999px; background: #eef1fb; color: #2f3b7a; font-size: .78rem; border: 1px solid #dfe3f3; }

/* ═══════════════ v0.19 — Mobile & tablet (below 992px). The desktop layout above is untouched. ═══════════════ */
@media (max-width: 991.98px) {
  body { -webkit-tap-highlight-color: transparent; }
  .app { display: block; }

  /* Sidebar → slide-in drawer from the right (RTL), over a dimmed backdrop */
  .sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 86vw); height: 100dvh; z-index: 1045;
             transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); padding-top: calc(18px + env(safe-area-inset-top));
             scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; overscroll-behavior: contain; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; box-shadow: -12px 0 40px rgba(8,12,40,.35); }
  /* user 2026-11-29 (phone screenshot of /Offers cut on the right): the closed drawer waits OFF-screen to the right, and a phone
     (iPhone Safari, the Edge/Chrome phone emulation) lets the page pan sideways towards it — every page slid and lost its right edge.
     The page never scrolls sideways on a phone (clip, unlike hidden, keeps the sticky top bar and tab bars working), and the closed
     drawer is hidden outright (it also stops the keyboard from tabbing into an invisible menu). */
  html, body { overflow-x: clip; }
  .sidebar { visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
  body.nav-open .sidebar { visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(8,12,40,.5); opacity: 0; pointer-events: none;
                  transition: opacity .28s; backdrop-filter: blur(1.5px); }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .drawer-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); color: #dfe4ff; }
  .drawer-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
  .sn-rail-btn { display: none !important; }
  .snav .sn-head { min-height: 48px; }
  .snav .sn-kids a { min-height: 44px; font-size: .95rem; }

  /* Compact top bar: ☰ · title · avatar menu, sticky under the status bar */
  .topbar { position: sticky; top: 0; z-index: 1030; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
            box-shadow: 0 1px 0 var(--k-line), 0 4px 14px rgba(17,26,68,.05); border-bottom: 0; }
  .desktop-user { display: none; }
  .nav-toggle, .m-user { display: block; }
  .icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--k-line); background: #fff; color: var(--k-primary);
              display: grid; place-items: center; flex-shrink: 0; }
  .icon-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
  .page-title { flex: 1; min-width: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--k-primary); }
  .avatar-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; font-weight: 700; font-size: 1.05rem;
                background: linear-gradient(135deg, var(--k-primary-2), var(--k-primary)); box-shadow: 0 2px 8px rgba(57,73,171,.35); }
  .m-user-menu { min-width: 260px; border-radius: 14px; padding: 6px; margin-top: 6px !important; }
  .m-user-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--k-line); }
  .m-user-head .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0;
                         background: linear-gradient(135deg, var(--k-primary-2), var(--k-primary)); }
  .m-user-head b { display: block; color: var(--k-primary); }
  .m-user-head small { display: block; color: #6b7394; font-size: .78rem; line-height: 1.5; }
  .m-user-head .sep { margin: 0 5px; color: #b5bbd3; }
  .m-user-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 10px; font-size: .95rem; }
  .m-user-menu .dropdown-item svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

  /* Bottom navigation: the five field destinations, always in thumb reach */
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: rgba(255,255,255,.97);
                backdrop-filter: saturate(1.6) blur(10px); border-top: 1px solid var(--k-line); padding-bottom: env(safe-area-inset-bottom);
                box-shadow: 0 -6px 20px rgba(17,26,68,.07); }
  .bottom-nav a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                  min-height: 60px; padding: 7px 2px 6px; color: #6b7394; text-decoration: none; font-size: .72rem; }
  .bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
                    transition: transform .15s; }
  .bottom-nav a.active { color: var(--k-primary-2); font-weight: 600; }
  .bottom-nav a.active svg { stroke-width: 2.2; transform: translateY(-1px); }
  .bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 4px 4px; background: var(--k-primary-2); }
  .bottom-nav a:active svg { transform: scale(.9); }
  .bottom-nav .dot { position: absolute; top: 6px; left: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
                     background: #dc3545; color: #fff; font-style: normal; font-size: .64rem; font-weight: 700; display: grid; place-items: center;
                     box-shadow: 0 0 0 2px #fff; }

  /* Content: breathing room above the bottom bar */
  .content { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .card-k { padding: 14px; border-radius: 14px; margin-bottom: 14px; }

  /* Touch-friendly controls: 16px text stops iPhone from zooming into fields; comfortable tap heights */
  .form-control, .form-select { font-size: 16px; min-height: 44px; }
  .form-control-sm, .form-select-sm { min-height: 40px; }
  textarea.form-control { min-height: 88px; }
  .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .btn-sm { min-height: 36px; }
  .btn-link { min-height: 0; }
  .alert { border-radius: 12px; }

  /* Task page: one column; the actions card moves right under the header (desktop keeps its side column) */
  /* nowrap: Bootstrap's .row wraps, and a wrapping column takes the width of its widest item — the tab bar's full length — so the page
     scrolled sideways (review 2026-11-28) */
  .task-layout { display: flex; flex-direction: column; flex-wrap: nowrap; margin: 0; }
  .task-layout > [class*="col-"] { display: contents; }
  .task-layout .card-k { order: 9; width: 100%; }
  .task-layout .tl-head { order: 1; } .task-layout .tl-actions { order: 2; } .task-layout .tl-progress { order: 3; }
  .task-layout .mtabs-bar { order: 1; width: auto; min-width: 0; } .task-layout .tl-files { order: 4; } .task-layout .tl-comments { order: 5; } .task-layout .tl-history { order: 6; }
  .tl-head > .d-flex > .text-end { text-align: start !important; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
  .tl-head > .d-flex > .text-end > div { margin: 0 !important; }
  .tl-head h2 { font-size: 1.2rem; font-weight: 700; color: var(--k-primary); }
  .tl-actions { border: 1.5px solid #c9d0f0; box-shadow: 0 4px 16px rgba(57,73,171,.08); }
  .tl-actions .btn.w-100 { min-height: 48px; font-size: 1rem; font-weight: 600; border-radius: 12px; }
  .task-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px !important; border-bottom: 1px dashed #edf0f7; margin: 0 !important; }
  .task-facts > div:last-child { border-bottom: 0; }
  .task-facts > div > b { color: #8a90a8; font-weight: 400; flex-shrink: 0; }
}

@media (max-width: 767.98px) {
  /* Dashboard tiles: two per row, tighter */
  .kpi { padding: 12px 12px 10px; border-radius: 14px; }
  .kpi .v { font-size: 1.55rem; line-height: 1.2; }
  .kpi .l { font-size: .86rem; font-weight: 600; color: #3f4766; }
  .kpi small { font-size: .7rem; line-height: 1.45; }
  /* An odd tile out fills its row instead of leaving a hole */
  .row > .col-6:last-child:nth-child(odd) { flex: 0 0 100%; max-width: 100%; }
  .row > .col-6:last-child:nth-child(odd) .kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
  .row > .col-6:last-child:nth-child(odd) .kpi .v { grid-row: span 2; min-width: 44px; text-align: center; }
  h1, .h1 { font-size: 1.35rem; } h2, .h2 { font-size: 1.15rem; }

  /* Tabs (nav-pills): one swipeable row of compact pills instead of wrapping lines */
  .content .nav-pills { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .content .nav-pills::-webkit-scrollbar { display: none; }
  .content .nav-pills .nav-link { white-space: nowrap; border-radius: 999px; padding: 7px 14px; font-size: .88rem; background: #f1f3fa; color: #4a5272; }
  .content .nav-pills .nav-link.active { background: var(--k-primary-2); color: #fff; }

  /* Home redesign 2026-11-27: the bottom bar's gold «+» holds «مهمة جديدة» on every page; the tasks page's own floating button
     (it sat under the floating «سند») is not needed on the phone any more */
  .m-fab { display: none !important; }

  /* Visit field mode (inspector on site): sticky progress, one card per item, big answer buttons */
  .visit-sticky { display: block; position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 1020; margin: -14px -12px 12px;
                  padding: 9px 14px 10px; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-bottom: 1px solid var(--k-line);
                  font-size: .9rem; color: var(--k-primary); }
  .visit-sticky .progress { height: 6px; margin-top: 7px; border-radius: 99px; }
  .v-item.border-bottom { border: 1px solid #e3e7f3 !important; border-radius: 14px; padding: 12px !important; margin-bottom: 10px; background: #fbfcff;
                          transition: box-shadow .3s, border-color .3s; }
  .v-item.v-done.ans-ok { border-inline-start: 5px solid #198754 !important; }
  .v-item.v-done.ans-no { border-inline-start: 5px solid #dc3545 !important; }
  .v-item.v-done.ans-na { border-inline-start: 5px solid #adb5bd !important; }
  .v-item.v-focus { border-color: var(--k-primary-2) !important; box-shadow: 0 0 0 4px rgba(57,73,171,.18); }
  .v-item, #visit-complete { scroll-margin-top: calc(124px + env(safe-area-inset-top)); }
  .v-item > .d-flex:first-child { flex-direction: column; }
  .v-item > .d-flex:first-child > div:first-child { font-size: 1rem; line-height: 1.6; }
  .ans-choices { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px !important; width: 100%; }
  .ans-choices label.ans { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                           min-height: 66px; border: 1.5px solid #dfe3f0; border-radius: 14px; background: #fff; font-size: .86rem; font-weight: 600;
                           color: #4a5272; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
  .ans-choices label.ans:active { transform: scale(.97); }
  .ans-choices label.ans input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .ans > i { display: block; font-style: normal; font-size: 1.4rem; line-height: 1; }
  .ans-ok:has(input:checked) { background: #e8f6ee; border-color: #198754; color: #146c43; }
  .ans-no:has(input:checked) { background: #fdecec; border-color: #dc3545; color: #b02a37; }
  .ans-na:has(input:checked) { background: #f1f3f5; border-color: #6c757d; color: #495057; }
  .ans-save { min-height: 48px !important; font-size: 1rem; font-weight: 600; background: var(--k-primary-2); border-color: var(--k-primary-2); color: #fff; border-radius: 12px; }
  .ans-evidence { flex-direction: column; border-radius: 12px; padding: 10px; transition: box-shadow .3s; }
  .ans-evidence.required { background: #fff5f5; border: 1.5px dashed #e8939c; }
  .ans-evidence.optional { background: #f7f8fc; border: 1px dashed #c9cee3; }
  .ans-evidence.v-focus { box-shadow: 0 0 0 4px rgba(220,53,69,.2); }
  .ev-add > summary { min-height: 38px; padding: 6px 14px; font-size: .86rem; }
  .ev-add .ans-evidence.optional { margin-top: 8px !important; }
  .ans-evidence .btn { min-height: 44px; }
  .visit-complete { border: 1.5px solid #a3cfbb; background: #f6fbf8; }
  .visit-complete .btn { width: 100%; min-height: 50px; font-size: 1.02rem; font-weight: 600; border-radius: 12px; }

  /* Tables → cards (labels filled in by the layout script) */
  .table-responsive { overflow: visible; }
  table.t-cards, table.t-cards tbody { display: block; width: 100%; }
  table.t-cards { background: transparent; }
  table.t-cards thead { display: none; }
  table.t-cards > tbody > tr { display: flex; flex-flow: row wrap; align-items: center; column-gap: 6px; background: #fff; border: 1px solid var(--k-line); border-radius: 14px;
                               padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(17,26,68,.05); }
  .card-k table.t-cards > tbody > tr { background: #fafbfe; box-shadow: none; border-color: #e8ebf5; }
  table.t-cards > tbody > tr.panel-row { padding: 0; border: 0; background: transparent; box-shadow: none; margin-top: -6px; }
  table.t-cards > tbody > tr.row-open { border-color: var(--k-primary-2); }
  .view-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .view-grid > div:has(dd[dir="ltr"]) { grid-column: 1 / -1; }
  .view-grid dd[dir="ltr"] { overflow-wrap: normal; word-break: normal; }
  table.t-cards > tbody > tr.card-link { cursor: pointer; }
  table.t-cards > tbody > tr.card-link:active { background: #f6f7fc; }
  table.t-cards > tbody > tr > td { flex: 1 1 100%; display: flex; align-items: baseline; gap: 12px; padding: 6px 0 !important; border: 0 !important;
                                    border-bottom: 1px dashed #edf0f7 !important; background: transparent !important; box-shadow: none !important; }
  table.t-cards > tbody > tr > td:last-child { border-bottom: 0 !important; }
  table.t-cards td[data-label]::before { content: attr(data-label); flex: 0 0 auto; max-width: 42%; color: #8a90a8; font-size: .8rem; }
  table.t-cards td > .cv { flex: 1; min-width: 0; text-align: end; overflow-wrap: anywhere; }
  table.t-cards td.cell-title { order: -3; padding-top: 2px !important; padding-bottom: 6px !important; border-bottom: 0 !important; }
  /* Meta cells: small chips on one line under the title (number, type, priority, status) */
  table.t-cards td.cell-meta { order: -2; flex: 0 0 auto; padding: 0 0 8px !important; border-bottom: 0 !important; }
  table.t-cards td.cell-meta > .cv { text-align: start; font-size: .76rem; color: #4a5272; background: #f1f3fa; border-radius: 999px; padding: 2px 10px; }
  table.t-cards td.cell-meta:has(.badge) > .cv, table.t-cards td.cell-meta:has(a) > .cv { background: none; padding: 0; }
  table.t-cards td.cell-meta a { color: #7a819c; text-decoration: none; font-size: .76rem; }
  table.t-cards td.cell-meta .badge { font-size: .74rem; font-weight: 600; padding: .35em .7em; }
  table.t-cards td.cell-meta .badge + div, table.t-cards td.cell-meta > .cv > div { display: inline; }  table.t-cards td.cell-title > .cv { text-align: start; font-weight: 600; font-size: 1.02rem; color: var(--k-primary); }
  table.t-cards td.cell-full, table.t-cards td.cell-plain { display: block; }
  table.t-cards td.cell-full > .cv, table.t-cards td.cell-plain > .cv { text-align: start; }
  table.t-cards td.cell-plain .btn, table.t-cards td.cell-plain form { margin-top: 2px; }
  table.t-cards td.cell-empty { display: none; }
  /* Mini cells: a row of small counters (e.g. rating distribution) — label above, value below */
  table.t-cards td.cell-mini { flex: 1 1 0; display: block; text-align: center; margin: 6px 0; padding: 6px 2px !important; background: #fff !important;
                               border: 1px solid #e8ebf5 !important; border-radius: 10px; }
  table.t-cards td.cell-mini + td.cell-mini { margin-inline-start: 0; }
  table.t-cards td.cell-mini::before { display: block; max-width: none; font-size: .7rem; margin-bottom: 2px; }
  table.t-cards td.cell-mini > .cv { text-align: center; font-weight: 700; color: var(--k-primary); }
  /* Left-to-right cells (phone numbers, e-mails): keep the card's right-to-left order, write the value itself LTR */
  table.t-cards td[dir="ltr"] { direction: rtl; }
  table.t-cards td[dir="ltr"] > .cv { direction: ltr; text-align: left; }
  table.t-cards td.cell-title > .cv > .small { font-weight: 400; font-size: .8rem; }
  table.t-cards td .progress { min-width: 90px; }
  table.t-cards td > .cv:has(> .progress) { display: flex; align-items: center; gap: 8px; }
  table.t-cards td > .cv > .progress { flex: 1; height: 7px; border-radius: 99px; }
  table.t-cards td > .cv > .progress + small { font-size: .76rem; color: #6b7394; min-width: 42px; }
  table.t-cards td.overdue > .cv { color: #b91c1c; font-weight: 600; }
  table.t-cards td[style*="min-width"] { min-width: 0 !important; }
  table.t-cards td .d-flex { justify-content: flex-end; }
  table.t-cards td.cell-full .d-flex, table.t-cards td.cell-plain .d-flex { justify-content: flex-start; }
}

/* v0.13 — plans: daily load per assignee, supervisory stop, copy to team plan, policy page */
.load-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: #eef1fb; color: #1d2b64; border: 1px solid #dfe3f0; }
.load-chip.over { background: #fdecec; color: #9b1c1c; border-color: #f3c2c2; font-weight: 600; }
.stop-box > summary, .copy-box > summary { list-style: none; cursor: pointer; }
.stop-box > summary::-webkit-details-marker, .copy-box > summary::-webkit-details-marker { display: none; }
.stop-box[open] { min-width: 320px; }
.policy-list { display: grid; gap: 10px; }
.policy-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid #dfe3f0; border-radius: 10px; cursor: pointer; }
.policy-item input { margin-top: 5px; }
.policy-item span { display: flex; flex-direction: column; gap: 2px; }
.policy-item small { color: #5a6282; }

/* DEC-057: in-place time field [hh]:[mm] [AM/PM] — compact, thumb-friendly, Latin digits, 16px (no zoom on phones) */
.tfield { display: inline-flex; align-items: center; gap: .25rem; direction: ltr; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .5rem; padding: .2rem .35rem; background: #fff; }
.tfield .tf-h, .tfield .tf-m { width: 2.6rem; text-align: center; border: 0; border-radius: .35rem; background: #f3f5fa; font-size: 16px; padding: .3rem 0; font-variant-numeric: tabular-nums; }
.tfield .tf-h:focus, .tfield .tf-m:focus { outline: 2px solid #3d5afe; background: #eef1ff; }
.tfield .tf-sep { font-weight: 700; }
.tfield .tf-h::placeholder, .tfield .tf-m::placeholder { color: #9aa3b5; opacity: 1; }
.tfield .tf-ap { border: 0; border-radius: .35rem; background: #1f2a5c; color: #fff; font-size: 14px; font-weight: 600; padding: .35rem .6rem; min-width: 3.1rem; }

/* Documents archive filter (2026-11-18): status / window chips, inline on desktop, a bottom sheet on phones (offcanvas-md). */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.filter-label { font-size: .8rem; color: #6b7280; min-width: 5.5rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid #d4d9e6; border-radius: 999px; padding: .3rem .75rem;
        font-size: .85rem; background: #fff; color: #1f2a5c; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none; }
.chip:hover { border-color: #3d5afe; }
.chip input[type=checkbox], .chip input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.chip b { font-weight: 600; }
.chip.warn b { color: #c62828; }
.chip.on { background: #1f2a5c; border-color: #1f2a5c; color: #fff; }
.chip.on.warn b { color: #ffcdd2; }
.chip-input input { width: 3.6rem; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; text-align: center; font-size: 16px; }
.chip.removable { font-size: .8rem; padding: .2rem .65rem; }
@media (max-width: 767.98px) {
  .doc-sheet.offcanvas-bottom { height: auto; max-height: 85vh; border-radius: 1rem 1rem 0 0; }
  .filter-label { width: 100%; }
  .chip { padding: .45rem .8rem; }   /* finger-sized */
}
/* DEC-063 phase B — near-expiry observations (phone first) */
.obs-form .form-control-lg, .obs-form .input-group-lg .btn { font-size: 1.15rem; }
.obs-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e8d9a6; border-radius: 10px; background: #fff; cursor: pointer; }
.obs-choice input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.obs-choice span { display: flex; flex-direction: column; }
.obs-choice small { color: #6b7280; }
.obs-choice:has(input:checked) { border-color: var(--k-primary-2); box-shadow: 0 0 0 2px rgba(57,73,171,.15); }
.obs-recent { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--k-line); border-radius: 10px; color: inherit; text-decoration: none; background: #fff; }
.obs-recent span { display: flex; flex-direction: column; }
.obs-recent small { color: #6b7280; font-size: .78rem; }
a.obs-recent[href]:hover { border-color: var(--k-primary-2); }
.scan-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(10,14,35,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.scan-overlay[hidden] { display: none; }
.scan-frame { position: relative; width: min(92vw, 420px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.6); background: #000; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff4d4f; box-shadow: 0 0 8px #ff4d4f; }
.shake { animation: kshake .4s; }
@keyframes kshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.band { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.band-due { background: #212529; color: #fff; }
.band-urgent { background: #fde2e1; color: #b42318; }
.band-near { background: #fff1d6; color: #9a6400; }
.band-far { background: #e8f3ec; color: #1f7a45; }
.est { color: #6b7280; font-size: .78rem; }

/* a return voucher takes the oldest lots: no expiry date column */
.kind-return .vdatecol { display: none !important; }

/* DEC-063: item picker (similar items of the item base under a name field) */
.item-picker { position: absolute; z-index: 1050; inset-inline: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid var(--k-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(17,26,68,.14); max-height: 320px; overflow-y: auto; }
.item-picker[hidden] { display: none; }
.item-picker-head { padding: 6px 12px; font-size: .75rem; color: #6b7280; border-bottom: 1px solid var(--k-line); }
.item-hit { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid #f1f3fa; background: #fff; text-align: start; }
.item-hit:hover, .item-hit:focus { background: #f1f3fa; }
.item-hit small { color: #6b7280; font-size: .75rem; }
.item-new { color: var(--k-primary-2); font-weight: 600; }

/* User 2026-11-20 — searchable drop-down (js-combo): an input over the real <select>, with a filtered list */
.combo { position: relative; }
.combo .combo-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.combo-list { position: absolute; z-index: 1060; inset-inline: 0; top: calc(100% + 2px); max-height: 280px; overflow-y: auto;
  background: var(--bs-body-bg, #fff); border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .5rem; box-shadow: 0 .5rem 1rem rgba(0,0,0,.12); }
.combo-item { padding: .45rem .75rem; cursor: pointer; }
.combo-item:hover, .combo-item.act { background: var(--bs-primary-bg-subtle, #e7f1ff); }
.combo-item.sel { font-weight: 600; }
.combo-empty { padding: .45rem .75rem; color: var(--bs-secondary-color, #6c757d); }
.combo-input { background-image: var(--bs-form-select-bg-img); background-repeat: no-repeat; background-position: left .75rem center; background-size: 16px 12px; padding-left: 2.25rem; }
.combo-input:disabled { background-color: var(--bs-secondary-bg); }
/* ---- AI module phase A: «اسأل المساعد» + «ملخص اليوم» ---- */
.ai-answer p { margin-bottom: .45rem; line-height: 1.75; }
.ai-answer p:last-child { margin-bottom: 0; }
.ai-answer .ai-list { padding-inline-start: 1.2rem; margin-bottom: .5rem; }
.ai-answer .ai-list li { margin-bottom: .2rem; line-height: 1.7; }
.ai-answer .ai-head { font-weight: 600; margin-top: .4rem; }
.ai-answer a { font-weight: 500; }
.ai-meta { font-size: .78rem; color: #6c757d; margin-top: .6rem !important; }
.ai-digest { border-inline-start: 4px solid var(--k-primary-2); background: linear-gradient(180deg, #f7f8ff 0, #fff 70%); }
.ai-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--k-primary-2); color: #fff; font-size: .85rem; }
.ai-loading::after { content: ''; display: inline-block; width: .8em; height: .8em; margin-inline-start: .5em; border: 2px solid #c5cae9; border-top-color: var(--k-primary-2); border-radius: 50%; animation: ai-spin .8s linear infinite; vertical-align: -.1em; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-chat { max-width: 860px; }
.ai-weekly { max-width: 900px; }
.ai-weekly .ai-answer .ai-head { font-size: 1rem; margin-top: 1rem; padding-bottom: .2rem; border-bottom: 1px solid var(--k-line); }
.ai-weekly .ai-answer .ai-head:first-child { margin-top: 0; }
.ai-archive li { padding: .35rem 0; border-bottom: 1px dashed var(--k-line); }
.ai-archive li:last-child { border-bottom: 0; }
.ai-draft-btn { white-space: nowrap; }
@media print { .sidebar, .topbar, .bottom-nav, .mobile-top { display: none !important; } .ai-weekly { max-width: none; } }
.ai-suggest { display: flex; flex-wrap: wrap; gap: .5rem; }
.ai-suggest .btn { text-align: start; white-space: normal; border-radius: 18px; }
.ai-thread { display: flex; flex-direction: column; gap: .6rem; }
.ai-q { align-self: flex-start; max-width: 85%; background: var(--k-primary); color: #fff; padding: .55rem .9rem; border-radius: 14px 14px 14px 4px; scroll-margin-top: 80px; }
.ai-q small { display: block; opacity: .7; font-size: .72rem; margin-top: .15rem; }
.ai-a { align-self: flex-end; width: 100%; background: #fff; border: 1px solid var(--k-line); padding: .8rem 1rem; border-radius: 14px 14px 4px 14px; }
.ai-a-error { border-color: #f1aeb5; background: #fff8f8; }
.ai-form textarea { resize: vertical; min-height: 60px; }
.ai-log-qa { min-width: 280px; max-width: 520px; }
.ai-log-qa summary { cursor: pointer; }
@media (max-width: 575.98px) { .ai-q { max-width: 100%; } .ai-a { padding: .7rem .8rem; } }

/* ---- standard org model (2026-11-25): the company tree on /Org/Structure. Level colours match the approved model page. */
.org-tree { list-style: none; margin: 0; padding: 0; }
.org-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 9px 10px; border-bottom: 1px solid var(--k-line); }
.org-row:last-child { border-bottom: 0; }
.org-row.off { opacity: .6; }
.org-row .org-main { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.org-row .org-indent { flex: none; align-self: stretch; width: calc(var(--d, 0) * 28px); border-inline-end: 2px solid #d3d9ec; }
.org-row .org-indent[style*="--d:0"] { display: none; }
.org-row .org-name { font-weight: 600; color: var(--k-primary); overflow-wrap: anywhere; }
.org-row .org-code { font-size: .78rem; color: #8a91a6; font-variant-numeric: tabular-nums; }
.org-row .org-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .84rem; color: #5a6377; }
.org-row .org-vacant { color: #a15c07; }
.org-row .org-actions { display: inline-flex; gap: 4px; margin-inline-start: auto; }
.ut { display: inline-block; flex: none; font-size: .72rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1.5px solid; white-space: nowrap; }
.ut-1 { color: #2f45b5; border-color: #2f45b5; background: #e6eafb; }
.ut-2 { color: #bf5c08; border-color: #bf5c08; background: #fde9d6; }
.ut-3 { color: #0d8577; border-color: #0d8577; background: #dcf2ee; }
.ut-4 { color: #4a6074; border-color: #8696a8; background: #eef2f6; }
.ut-5 { color: #a9661c; border-color: #a9661c; background: #fbf0e0; }
.ut-br { color: #2c8538; border-color: #2c8538; background: #e0f2e3; }
.org-template { border: 1px dashed #b9c2e6; background: #f7f8fe; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
@media (max-width: 575.98px) {
  .org-row { padding: 10px 4px; }
  .org-row .org-indent { width: calc(var(--d, 0) * 12px); }
  .org-row .org-actions { margin-inline-start: 0; width: 100%; justify-content: flex-end; }
}

/* ------------------------------------------------------------------ employees screen (spec 2026-11-25, batch 2) */
.emp-page { position: relative; }
.emp-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.emp-count { font-size: .85rem; color: #5d6588; font-weight: 400; margin-inline-start: 6px; }
.emp-filters { display: grid; grid-template-columns: minmax(220px, 2fr) auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.emp-more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.emp-filters-btn { display: none; }
@media (min-width: 768px) { .emp-filters { grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(130px, 1fr)); } .emp-more { display: contents; } }
.emp-search { position: relative; }
.emp-search .form-control { padding-inline-start: 36px; min-height: 40px; }
.emp-search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: #5d6588; }
.emp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.emp-chip { display: inline-flex; gap: 6px; align-items: center; background: #eceffd; color: var(--k-primary); border-radius: 999px; padding: 3px 12px; font-size: .82rem; text-decoration: none; }
.emp-chip:hover { background: #dfe4fb; }
.emp-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.emp-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--k-line); background: #fff; color: inherit; text-decoration: none; }
.emp-alert:hover { background: #f7f8fc; }
.emp-alert b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.emp-alert span { font-size: .82rem; line-height: 1.35; }
.emp-alert.crit b { color: #b42318; } .emp-alert.warn b { color: #9a5b00; } .emp-alert.info b { color: var(--k-primary-2); }
.emp-alert.on { border-color: var(--k-primary-2); box-shadow: 0 0 0 2px #eceffd; }
.emp-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: .82rem; color: #5d6588; }
.emp-switch { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.emp-tog { width: 30px; height: 18px; border-radius: 999px; background: #ccd2e6; position: relative; transition: background .15s; }
.emp-tog::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.emp-tog.on { background: var(--k-primary-2); } .emp-tog.on::after { inset-inline-start: 14px; }
.emp-table { overflow: hidden; }
.emp-table th { background: #f7f8fc; font-size: .8rem; color: #5d6588; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.emp-table th a { color: inherit; text-decoration: none; }
.emp-row { cursor: pointer; }
.emp-row:hover td { background: #f7f8fc; }
.emp-grp td { background: #f2f4fa; font-weight: 600; font-size: .88rem; }
.emp-who { display: flex; gap: 10px; align-items: center; }
.emp-av { width: 34px; height: 34px; border-radius: 50%; background: #eceffd; color: var(--k-primary); display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.emp-av-lg { width: 56px; height: 56px; font-size: 1.4rem; }
.emp-name { font-weight: 600; color: inherit; text-decoration: none; }
.emp-name:hover { text-decoration: underline; }
.emp-meta { font-size: .78rem; color: #5d6588; }
.emp-badge-mgr { background: #eceffd; color: var(--k-primary); font-weight: 600; }
.emp-page mark { background: #fff1b8; padding: 0 1px; border-radius: 3px; }
.emp-cards { display: none; }
.emp-pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; font-size: .82rem; color: #5d6588; }
.emp-empty { text-align: center; padding: 36px 16px; }
.emp-addcard summary { cursor: pointer; }
.emp-fab { display: none; }
.min-w-0 { min-width: 0; }
@media (max-width: 767.98px) {
  .emp-filters-btn { display: inline-flex; }
  .emp-more { display: none; grid-template-columns: 1fr; }
  .emp-more.open { display: grid; }
  .emp-table { display: none; }
  .emp-cards { display: flex; flex-direction: column; gap: 8px; }
  .emp-alerts { grid-template-columns: 1fr 1fr; }
  .emp-add-top { display: none; }
  .emp-fab { display: inline-flex; position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); margin: 12px 0 0 auto; width: max-content; border-radius: 999px; box-shadow: 0 8px 24px rgba(17,26,68,.25); min-height: 48px; padding-inline: 20px; z-index: 15; align-items: center; }
}
.emp-card { background: #fff; border: 1px solid var(--k-line); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; cursor: pointer; }
.emp-card .emp-line { grid-column: 2 / 4; font-size: .82rem; color: #5d6588; }
.emp-acts { grid-column: 1 / 4; display: flex; gap: 6px; margin-top: 6px; }
.emp-acts .btn { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.emp-grp-c { font-weight: 600; font-size: .85rem; color: #5d6588; padding: 6px 2px 0; }
/* employee page */
.emp-back { margin-bottom: 10px; }
.emp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.emp-crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: .82rem; color: #5d6588; margin-top: 4px; }
.emp-crumbs a { color: var(--k-primary-2); text-decoration: none; }
.emp-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
@media (max-width: 767.98px) { .emp-head { grid-template-columns: auto 1fr; } .emp-head > .btn { grid-column: 1 / -1; } .emp-quick .btn { flex: 1; min-height: 44px; } }

/* employee page (batch 3) */
.emp-back { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.emp-nav { display: flex; gap: 6px; align-items: center; }
/* «نعم، هذا جوال مشترك» under a mobile another employee has */
.shared-mobile { margin-top: 6px; padding: 10px 12px; border: 1px solid #f0d48a; border-radius: 10px; background: #fff8e1; color: #5c4400; font-size: .88rem; display: grid; gap: 6px; }
.shared-mobile[hidden] { display: none; }
.shared-mobile .form-check { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; font-weight: 600; }
.shared-mobile .form-check-input { float: none; margin: 0; flex: none; width: 1.25em; height: 1.25em; border-color: #8a6d1b; }
.shared-mobile.is-missing { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220,53,69,.15); }
.emp-head-tabs { border-radius: 14px 14px 0 0; margin-bottom: 0; }
.emp-menu { position: relative; align-self: start; }
.emp-menu > summary { list-style: none; }
.emp-menu > summary::-webkit-details-marker { display: none; }
.emp-menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); width: 240px; background: #fff; border: 1px solid var(--k-line); border-radius: 12px; box-shadow: 0 10px 28px rgba(17,26,68,.16); padding: 6px; z-index: 30; display: grid; gap: 4px; }
.emp-menu-item { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.emp-menu-item:hover { background: #f4f5f9; }
.emp-menu-form { padding: 6px 4px; border-top: 1px solid var(--k-line); border-bottom: 1px solid var(--k-line); }
.emp-menu-sub > summary { cursor: pointer; list-style: none; }
.emp-menu-sub > summary::-webkit-details-marker { display: none; }
.emp-menu-end { border-top: 1px solid var(--k-line); border-radius: 0 0 8px 8px; }
.emp-tabs { display: flex; gap: 2px; background: #fff; border: 1px solid var(--k-line); border-top: 0; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.emp-tabs a { padding: 11px 14px; color: #5d6588; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.emp-tabs a.on { color: var(--k-primary-2); border-bottom-color: var(--k-primary-2); }
.emp-tab-n { font-size: .72rem; background: #eef0f7; border-radius: 999px; padding: 0 7px; margin-inline-start: 5px; }
.emp-panel { border-radius: 0 0 14px 14px; border-top: 0; }
.emp-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.emp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.emp-grid2 .emp-wide, .view-grid .emp-wide { grid-column: 1 / -1; }
.emp-actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 16px; }
.emp-tag { font-size: .7rem; font-weight: 600; color: var(--k-primary-2); background: #eceffd; border-radius: 6px; padding: 0 6px; margin-inline-start: 4px; }
.emp-adv { margin-top: 14px; border: 1px dashed #ccd2e6; border-radius: 12px; padding: 8px 12px; }
.emp-adv summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.emp-result { background: #e8eefc; border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: .9rem; }
.emp-result.warn { background: #fff1d6; }
.emp-result ul { margin: 6px 0 0; padding-inline-start: 18px; }
.emp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-days label { cursor: pointer; }
.emp-days input { position: absolute; opacity: 0; pointer-events: none; }
.emp-days span { display: inline-block; border: 1px solid #ccd2e6; border-radius: 999px; padding: 6px 14px; min-height: 38px; background: #fff; }
.emp-days input:checked + span { background: var(--k-primary-2); border-color: var(--k-primary-2); color: #fff; }
.emp-days input:focus-visible + span { outline: 2px solid var(--k-primary-2); outline-offset: 2px; }
.emp-held { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.emp-held-item { border: 1px solid var(--k-line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; align-content: start; }
.emp-held-item b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.emp-end { margin-top: 18px; border: 1px solid #f3c2bc; background: #fff8f7; border-radius: 14px; padding: 14px; }
.emp-timeline { list-style: none; margin: 0; padding: 0 0 0 0; border-inline-start: 2px solid var(--k-line); margin-inline-start: 6px; }
.emp-timeline li { position: relative; padding: 0 18px 16px; }
.emp-timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--k-primary-2); }
.emp-cred { border: 1px dashed #b7d9c2; background: #f4fbf6; display: grid; gap: 8px; }
.emp-cred-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.emp-cred-row code { font-size: 1.2rem; font-weight: 700; letter-spacing: .05em; color: inherit; }
@media (max-width: 767.98px) {
  .emp-grid2 { grid-template-columns: 1fr; }
  .emp-head-tabs .emp-menu { grid-column: 1 / -1; }
  .emp-menu-pop { inset-inline-end: auto; inset-inline-start: 0; }
  .emp-actions .btn { flex: 1; min-height: 44px; }
  .emp-tabs { padding: 0 4px; }
  .emp-tabs a { padding: 10px 9px; font-size: .86rem; }
}
/* add wizard (batch 4) */
.emp-wizard .emp-form { max-width: 880px; }
.emp-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; }
.emp-steps li { flex: 1; font-size: .8rem; font-weight: 600; color: #5d6588; padding-top: 8px; border-top: 3px solid var(--k-line); }
.emp-steps li.on { color: var(--k-primary-2); border-top-color: var(--k-primary-2); }
.emp-steps li.done { color: #1e7a4c; border-top-color: #1e7a4c; }
.emp-wizard fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.emp-done { max-width: 640px; }
/* import (batch 5) */
.emp-drop { border: 2px dashed #ccd2e6; border-radius: 16px; padding: 28px 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.emp-drop.over { border-color: var(--k-primary-2); background: #eceffd; }
.emp-drop .form-control { max-width: 420px; }
.emp-itabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.emp-itabs a { border: 1px solid #ccd2e6; border-radius: 999px; padding: 4px 12px; text-decoration: none; color: inherit; font-size: .85rem; background: #fff; }
.emp-itabs a.on { background: var(--k-primary); border-color: var(--k-primary); color: #fff; }
.emp-itabs a.err b { color: #b42318; } .emp-itabs a.on.err b { color: #fff; }
.emp-map td, .emp-map th { white-space: nowrap; }
.emp-map select { min-width: 140px; }
/* bulk actions (batch 5) */
.emp-cb { width: 36px; }
.emp-row.sel td, .emp-card.sel { background: #eceffd; }
.emp-card { position: relative; }
.emp-card:has(.emp-card-cb) { padding-inline-start: 40px; }
.emp-card-cb { position: absolute; inset-inline-start: 12px; top: 16px; width: 20px; height: 20px; }
.emp-bulk { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 20; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #0F1636; color: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 10px 28px rgba(17,26,68,.25); }
.emp-bulk-acts { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 768px) { .emp-bulk { padding-inline-end: 92px; } }   /* the assistant button sits at the bottom-left corner */
.emp-bulk .btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.emp-bulk .btn:hover { background: rgba(255,255,255,.2); }
.emp-dlg { border: 0; border-radius: 16px; padding: 18px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 16px 40px rgba(17,26,68,.25); }
.emp-dlg::backdrop { background: rgba(10,15,40,.45); }
@media (max-width: 767.98px) { .emp-bulk { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } .emp-bulk-acts .btn { flex: 1 1 45%; min-height: 40px; } }
/* Date/time pickers on every screen (was phone-only, review 2026-11-28): left-to-right so the empty "dd/mm/yyyy" mask is not drawn reversed inside the RTL page */
input[type=date], input[type=datetime-local], input[type=time] { direction: ltr; text-align: right; }
/* …but Chrome/Edge in Arabic still draw the empty mask reversed: hidden while empty and not focused (the class is set in _Layout) */
input.dt-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
/* A date in both calendars (2026-12-01): Gregorian | Hijri day-month-year side by side, one under the other where there is no room */
.hdate { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.hdate .hd-part { display: flex; flex-direction: column; min-width: 0; }
.hdate .hd-part:first-child { flex: 1 1 145px; }
.hdate .hd-part:nth-child(2) { flex: 100 1 285px; }
.hdate .hd-tag { font-size: .75rem; opacity: .8; }
.hdate .hd-boxes { display: flex; gap: 4px; }
.hdate .hd-boxes > * { min-width: 0; }
.hdate .hd-d { flex: 0 0 50px; } .hdate .hd-y { flex: 0 0 64px; } .hdate .hd-m { flex: 1 1 150px; padding-inline-start: 8px; }
.hdate .hd-d, .hdate .hd-y { text-align: center; padding-inline: 6px; font-variant-numeric: tabular-nums; }
.hdate .hd-note { flex: 1 0 100%; font-size: .8rem; color: #8a4b00; }
:is([data-theme="night"], [data-theme="dark"]) .hdate .hd-note { color: #ffc46b; }
.dual-date > span { white-space: nowrap; }
.dual-date .dd-h::before { content: "· "; }
.dd-stack .dual-date .dd-h::before { content: none; }
.dd-stack .dual-date > span { display: block; }
.dd-stack .dd-h { opacity: .8; }
/* Task page: nothing for me to do here (e.g. an executor waiting for the approver) — say so instead of an empty card */
.tl-actions > h3:only-child::after { content: "لا إجراء مطلوب منك الآن."; display: block; margin-top: 6px; font-size: .875rem; font-weight: 400; color: #6c757d; }

/* Long pages on a phone: sticky tab bar, one section at a time (js/mobile-tabs.js). Desktop never sees any of it. */
.mtabs-bar, .mtabs-only, .mseg-bar, .mfilter-empty { display: none; }
.mtabs-on .mtabs-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: 4px; overflow-x: auto; scrollbar-width: none; position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 1020;
  margin: 0 -12px 12px; padding: 4px 10px 0; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-bottom: 1px solid var(--k-line); }
.mtabs-bar::-webkit-scrollbar { display: none; }
.mtabs-bar button { border: 0; background: none; padding: 11px 8px 9px; font-weight: 600; font-size: .9rem; color: #5d6588; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.mtabs-bar button .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 5px; border-radius: 999px; background: #eceef6; color: #5d6588; font-size: .72rem; line-height: 18px; font-variant-numeric: tabular-nums; }
.mtabs-bar button[aria-selected="true"] { color: var(--k-primary-2); border-bottom-color: var(--k-primary-2); }
.mtabs-bar button[aria-selected="true"] .n { background: #e8ebfb; color: var(--k-primary-2); }
.mtabs-bar button:focus-visible { outline: 2px solid var(--k-primary-2); outline-offset: -2px; }
.mtabs-on [data-mpane]:not(.mpane-on) { display: none !important; }
.mtabs-on .mtabs-only { display: revert; }
.mtabs-on .mtabs-hide { display: none !important; }
.mtabs-on .mseg-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: #f1f3fa; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.mseg-bar button { border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-size: .86rem; font-weight: 600; color: #5d6588; }
.mseg-bar button[aria-pressed="true"] { background: #fff; color: var(--k-primary); box-shadow: 0 1px 3px rgba(17,26,68,.12); }
.mtabs-on [data-mseg-pane]:not(.on) { display: none !important; }
.mtabs-on .mfilter-empty:not([hidden]) { display: block; padding: 14px 4px; color: #6b7394; font-size: .88rem; }
.mtabs-help { background: #fff; border: 1px solid var(--k-line); border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; font-size: .86rem; color: #5d6588; }
.mtabs-help summary { color: var(--k-primary); font-weight: 600; cursor: pointer; }
.mtabs-help p { margin: 8px 0 0; line-height: 1.7; }
.mtabs-fab { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); margin: 12px 0 0 auto; width: max-content; border-radius: 999px; min-height: 46px;
  padding-inline: 20px; box-shadow: 0 8px 24px rgba(17,26,68,.25); z-index: 15; }
.mtabs-on .mtabs-fab { display: block; }
/* ---- Roles page (user 2026-11-26, approved mockup): one line per role, the role in sections, list | role side by side on a desktop ---- */
.rl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.rl-head > div { flex: 1 1 280px; }
.rl-title { font-size: 1.35rem; font-weight: 700; color: var(--k-primary); margin: 0; }
.rl-sub { font-size: .85rem; color: #5b6275; }
.rl-new { min-height: 44px; display: inline-flex; align-items: center; }
.rl-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--k-line); margin-bottom: 14px; overflow-x: auto; }
.rl-tabs a { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #5b6275;
             border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.rl-tabs a span { font-size: .75rem; background: #eef0f5; border-radius: 10px; padding: 0 7px; }
.rl-tabs a.on { color: var(--k-primary-2); border-bottom-color: var(--k-primary-2); font-weight: 700; }
.rl-tabs a.on span { background: #e7eaf8; color: var(--k-primary-2); }
.rl-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rl-list { flex: 1 1 300px; max-width: 380px; min-width: 0; background: #fff; border: 1px solid var(--k-line); border-radius: 14px; padding: 12px;
           position: sticky; top: 76px; }
.rl-search input { min-height: 42px; }
.rl-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.rl-chips .filter-pill { min-height: 34px; cursor: pointer; }
.rl-items { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 290px); overflow-y: auto; }
.rl-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; min-height: 56px; }
.rl-item:hover { background: #f6f7fc; }
.rl-item.on { background: #eef1fb; box-shadow: inset -3px 0 0 var(--k-primary-2); }
.rl-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rl-item-name { font-weight: 600; font-size: .95rem; color: #1b1f33; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rl-item-meta { font-size: .78rem; color: #5b6275; display: flex; align-items: center; gap: 10px; white-space: nowrap; flex-wrap: nowrap; }
.rl-legend { font-size: .8rem; color: #5b6275; margin: 0; display: flex; align-items: baseline; gap: 6px; }
.rl-legend i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: #c2410c; display: inline-block; }
.rl-legend b { color: #8a3b00; }
.rl-segs { display: inline-flex; gap: 2px; }
.rl-segs i { width: 9px; height: 6px; border-radius: 2px; background: #e3e6ef; }
.rl-segs i.part { background: #8e9ad6; } .rl-segs i.full { background: var(--k-primary-2); }
.rl-chev { color: #9aa1b3; flex: none; }
.rl-none { text-align: center; color: #5b6275; font-size: .9rem; margin: 12px 0; }
.rl-badge { font-size: .68rem; font-weight: 600; color: #8a3b00; background: #fff1e6; border-radius: 6px; padding: 1px 7px; }
.rl-badge-t { color: #5b4a00; background: #fff8d6; } .rl-badge-off { color: #5b6275; background: #eef0f5; }
.rl-detail { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rl-back { display: none; }
.rl-card { background: #fff; border: 1px solid var(--k-line); border-radius: 14px; padding: 14px 16px; }
.rl-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rl-sum-text { flex: 1 1 280px; min-width: 0; }
.rl-name { font-size: 1.3rem; font-weight: 700; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #1b1f33; }
.rl-desc { margin: 4px 0 0; font-size: .88rem; color: #5b6275; line-height: 1.6; }
.rl-stats { display: flex; gap: 8px; }
.rl-stat { background: #f4f6fb; border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #5b6275; font-size: .78rem; min-width: 96px; }
.rl-stat b { font-size: 1.3rem; color: #1b1f33; } a.rl-stat span { color: var(--k-primary-2); }
.rl-actions { display: flex; gap: 8px; } .rl-actions .btn { min-height: 42px; }
.rl-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rl-group { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.rl-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .95rem; width: 100%; float: none; margin: 0 0 2px; padding: 0; }
.rl-pill { font-size: .75rem; font-weight: 600; border-radius: 10px; padding: 2px 9px; background: #e7eaf8; color: var(--k-primary-2); white-space: nowrap; }
.rl-pill.zero { background: #f1f2f6; color: #6b7286; }
.rl-empty { font-size: .82rem; color: #6b7286; }
.rl-granted { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .86rem; }
.rl-granted li { display: flex; align-items: flex-start; gap: 7px; } .rl-granted svg { color: #1f7a4d; flex: none; margin-top: 3px; }
.rl-granted li.admin { color: #8a3b00; } .rl-granted li.admin svg { color: #c2410c; }
.rl-edit-fields { flex: 1; display: grid; grid-template-columns: 1fr; gap: 4px; max-width: 640px; }
.rl-kicker { font-size: .78rem; color: var(--k-primary-2); font-weight: 600; }
.rl-all { font-size: .8rem; color: var(--k-primary-2); display: flex; align-items: center; gap: 6px; border-bottom: 1px dashed var(--k-line); padding-bottom: 6px; min-height: 32px; cursor: pointer; }
.rl-perm { display: flex; align-items: flex-start; gap: 8px; font-size: .86rem; min-height: 30px; cursor: pointer; }
.rl-perm input, .rl-all input { width: 17px; height: 17px; accent-color: var(--k-primary-2); margin-top: 2px; flex: none; }
.rl-perm.admin span { color: #8a3b00; } .rl-perm small { color: #c2410c; }
.rl-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 12px; background: #1b1f33; color: #fff; border-radius: 14px; padding: 10px 14px;
          display: flex; flex-wrap: wrap; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(27,31,51,.25); }
.rl-bar span { flex: 1 1 220px; font-size: .9rem; } .rl-bar .btn { min-height: 42px; }
/* the floating assistant ✦ sits at the bottom-left: the bar's buttons keep clear of it */
.rl-bar { padding-left: 92px; }
.rl-hint { font-size: .82rem; color: #5b6275; margin: 0 0 10px; }
.rl-table-wrap { overflow-x: auto; }
.rl-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: .86rem; }
.rl-table th, .rl-table td { padding: 9px 8px; border-top: 1px solid var(--k-line); text-align: center; white-space: nowrap; }
.rl-table thead th { border-top: 0; color: #5b6275; font-weight: 600; }
.rl-th-role { text-align: right !important; position: sticky; right: 0; background: #fff; z-index: 1; }
.rl-th-role a { text-decoration: none; font-weight: 600; color: #1b1f33; } .rl-th-role a:hover { color: var(--k-primary-2); }
.rl-held { color: #5b6275; }
.rl-cell { font-weight: 600; } .rl-cell.l0 { color: #9aa1b3; }
.rl-cell.l1 { background: #e7eaf8; } .rl-cell.l2 { background: #c5cbee; } .rl-cell.l3 { background: #6f7fd0; color: #fff; } .rl-cell.l4 { background: var(--k-primary-2); color: #fff; }
.rl-retired { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rl-ret { display: flex; align-items: center; gap: 10px; border-style: dashed; }
.rl-ret-name { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: #5b6275; } .rl-ret-name span { font-size: .78rem; color: #6b7286; }
@media (max-width: 991.98px) {
  /* the phone shows the list OR the role */
  .rl-list { max-width: none; position: static; padding: 10px; }
  .rl-items { max-height: none; overflow: visible; }
  .rl-wrap.rl-focused .rl-list { display: none; }
  .rl-wrap:not(.rl-focused) .rl-detail { display: none; }
  .rl-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; color: var(--k-primary-2); }
  .rl-tabs { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 6; background: var(--k-bg); margin: 0 -12px 12px; padding: 0 12px; }
  .rl-tabs a { flex: 1; justify-content: center; padding: 10px 6px; }
  .rl-item.on.rl-auto { background: transparent; box-shadow: none; }   /* the phone's list: nothing is open yet
  */
  .rl-head .rl-new { position: fixed; right: 16px; left: auto; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 20; border-radius: 24px; box-shadow: 0 6px 16px rgba(29,43,100,.28); }
  .rl-focused ~ * .rl-new, body:has(.rl-focused) .rl-head .rl-new { display: none; }
  .rl-groups { grid-template-columns: 1fr; }
  .rl-stats { flex: 1 1 100%; } .rl-stat { flex: 1; }
  .rl-actions { flex: 1 1 100%; } .rl-actions .btn, .rl-actions form { flex: 1; } .rl-actions form .btn { width: 100%; }
  .rl-bar { bottom: calc(70px + env(safe-area-inset-bottom)); padding-left: 80px; }
}
/* ---- The menu (user 2026-11-26, approved mockup): nine sections, one open at a time, counts, search, ✦ pinned at the bottom ---- */
.sn-rail-btn { width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: transparent; color: #c9cfee;
               display: grid; place-items: center; flex: none; cursor: pointer; }
.sn-rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sn-rail-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; transition: transform .2s; }
.sn-search { position: relative; display: block; margin: 0 2px 10px; flex: none; }
.sn-search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07);
                   color: #fff; padding: 0 34px 0 10px; font-size: .85rem; font-family: inherit; }
.sn-search input::placeholder { color: #aab3e6; }
.sn-search input:focus { outline: 2px solid #8b9cff; outline-offset: 1px; }
.sn-search input::-webkit-search-cancel-button { filter: invert(1); }
.sn-search svg { position: absolute; right: 11px; top: 11px; width: 16px; height: 16px; stroke: #aab3e6; fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.snav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 0 10px; display: flex; flex-direction: column; gap: 2px;
        scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.snav[hidden] { display: none; }
.snav .sn-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; margin: 0; border: 0; border-radius: 11px;
                 background: transparent; color: #d5daf3; text-align: right; text-decoration: none; font-weight: 600; font-size: .93rem; cursor: pointer; font-family: inherit; }
.snav .sn-head:hover { background: rgba(255,255,255,.06); color: #fff; }
.sn-ico { position: relative; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.06); }
.sn-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sn-name { flex: 1; min-width: 0; }
.sn-badge { min-width: 20px; height: 20px; border-radius: 10px; background: #e5484d; color: #fff; font-size: .7rem; font-weight: 700;
            display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex: none; }
.sn-dot { display: none; position: absolute; top: -5px; left: -5px; min-width: 17px; height: 17px; border-radius: 9px; background: #e5484d; color: #fff;
          font-size: .6rem; font-style: normal; font-weight: 700; place-items: center; padding: 0 4px; box-shadow: 0 0 0 2px #0F1636; }
.sn-chev { width: 14px; height: 14px; stroke: #aab3e6; fill: none; stroke-width: 2.2; stroke-linecap: round; transition: transform .2s; flex: none; }
.sn-sec.open > .sn-head { background: rgba(255,255,255,.08); color: #fff; }
.sn-sec.open > .sn-head .sn-chev { transform: rotate(-90deg); }
.sn-sec.open > .sn-head > .sn-badge { display: none; }   /* open: each page shows its own count */
.snav .sn-sec.current:not(.open) > .sn-head, .snav .sn-single.current { background: var(--k-primary-2); color: #fff; }
.sn-sec.current:not(.open) > .sn-head .sn-ico, .sn-single.current .sn-ico { background: rgba(255,255,255,.18); }
.sn-kids { display: none; margin: 2px 22px 8px 0; padding-right: 12px; border-right: 1px solid rgba(255,255,255,.14); flex-direction: column; gap: 1px; }
.sn-sec.open > .sn-kids { display: flex; }
.snav .sn-kids a { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; margin: 0; border-radius: 9px; color: #c9cfee;
                   text-decoration: none; font-size: .88rem; }
.snav .sn-kids a > span:first-child { flex: 1; }
.snav .sn-kids a:hover { background: rgba(255,255,255,.06); color: #fff; }
.snav .sn-kids a.active { background: var(--k-primary-2); color: #fff; font-weight: 600; }
.sn-sub { font-size: .7rem; color: #8e97c8; font-weight: 600; padding: 8px 10px 2px; }
.sn-results { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 0 10px; }
.sn-results[hidden] { display: none; }
.sn-hit { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 9px; color: #fff; text-decoration: none; min-height: 44px; }
.sn-hit:hover, .sn-hit:focus { background: rgba(255,255,255,.08); color: #fff; }
.sn-hit small { color: #aab3e6; font-size: .72rem; }
.sn-none { color: #aab3e6; font-size: .85rem; padding: 8px 10px; margin: 0; }
.sn-foot { flex: none; padding: 10px 2px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); background: #111a44; }
.sn-ai { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; color: #fff; text-decoration: none;
         font-weight: 600; font-size: .9rem; background: linear-gradient(135deg, #5b6cf0, #8b5cf6); box-shadow: 0 6px 16px rgba(91,108,240,.3); }
.sn-ai:hover, .sn-ai.active { color: #fff; filter: brightness(1.08); }
.sn-ai svg { width: 18px; height: 18px; fill: currentColor; }
/* folded on a desktop: icons only; a section's count rides on its icon; a click unfolds on that section */
@media (min-width: 992px) {
  html.nav-rail .sidebar { width: 76px; padding-inline: 10px; }
  html.nav-rail .sidebar .sn-label, html.nav-rail .sidebar .sn-name, html.nav-rail .sidebar .sn-badge, html.nav-rail .sidebar .sn-chev,
  html.nav-rail .sidebar .sn-kids, html.nav-rail .sidebar .sn-search, html.nav-rail .sidebar .sn-results { display: none !important; }
  html.nav-rail .sidebar .snav { display: flex !important; }
  html.nav-rail .brand { flex-direction: column; gap: 10px; }
  html.nav-rail .snav .sn-head { justify-content: center; padding: 6px 0; }
  html.nav-rail .sn-dot { display: grid; }
  html.nav-rail .snav .sn-sec.current > .sn-head { background: var(--k-primary-2); color: #fff; }
  html.nav-rail .sn-rail-btn svg { transform: rotate(180deg); }
  html.nav-rail .sn-ai { width: 44px; margin: 0 auto; }
}/* the phone menu has its own «اسأل المساعد»: while it is open the floating ✦ waits under the dimmed page */
body.nav-open .ai-fab { z-index: 1030; }

/* ════════ Identity (user 2026-11-26, approved boards https://claude.ai/artifact/3LJDPg8dRNDA33gkowmbpj):
   «ذهبي كيان» #F8BC18 from the logo for the main action and the active place; «ليل كيان» #0F1636 for the menu and titles;
   «نيلي العمل» #2E3D9A for links and secondary actions; Readex Pro for headings. Gold is never a warning colour. ════════ */
:root {
  --k-primary: #0F1636; --k-primary-2: #2E3D9A; --k-gold: #F8BC18; --k-gold-hover: #EFAE00; --k-gold-press: #E0A50A; --k-gold-soft: #FFF6DB;
  --bs-primary: #2E3D9A; --bs-primary-rgb: 46, 61, 154; --bs-link-color: #2E3D9A; --bs-link-color-rgb: 46, 61, 154;
  --bs-link-hover-color: #0F1636; --bs-link-hover-color-rgb: 15, 22, 54;
  --k-head: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
}
h1, h2, h3, .h1, .h2, .h3, .page-title, .rl-title, .rl-name, .kpi .v, .brand b, .auth-title { font-family: var(--k-head); }
.gold { color: var(--k-gold); }
/* the main action: gold with dark text (never white on gold: too faint) */
.btn-primary { --bs-btn-color: #0F1636; --bs-btn-bg: #F8BC18; --bs-btn-border-color: #F8BC18;
  --bs-btn-hover-color: #0F1636; --bs-btn-hover-bg: #EFAE00; --bs-btn-hover-border-color: #EFAE00;
  --bs-btn-active-color: #0F1636; --bs-btn-active-bg: #E0A50A; --bs-btn-active-border-color: #E0A50A;
  --bs-btn-disabled-color: #5B6275; --bs-btn-disabled-bg: #F6DC8E; --bs-btn-disabled-border-color: #F6DC8E;
  --bs-btn-focus-shadow-rgb: 248, 188, 24; font-weight: 600; }
.btn-outline-primary { --bs-btn-color: #2E3D9A; --bs-btn-border-color: #2E3D9A; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #2E3D9A;
  --bs-btn-hover-border-color: #2E3D9A; --bs-btn-active-color: #fff; --bs-btn-active-bg: #24307B; --bs-btn-active-border-color: #24307B;
  --bs-btn-focus-shadow-rgb: 46, 61, 154; }
/* user 2026-11-29 («كل الأزرار مستطيل فاضي… وين الألوان؟»): secondary actions are never an empty white box — a soft fill of
   their colour, the full colour on hover. One rule for every page (gold stays the one main action). */
.btn-outline-primary { --bs-btn-bg: #EAEEFB; --bs-btn-border-color: #C9D1F0; font-weight: 600; }
.btn-outline-secondary { --bs-btn-color: #3B4256; --bs-btn-bg: #F0F2F7; --bs-btn-border-color: #DCE0EA; --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #5B6275; --bs-btn-hover-border-color: #5B6275; --bs-btn-active-color: #fff; --bs-btn-active-bg: #464C5E; --bs-btn-active-border-color: #464C5E; }
.btn-outline-danger { --bs-btn-color: #B8232D; --bs-btn-bg: #FDECEE; --bs-btn-border-color: #F4C6CA; --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #D33840; --bs-btn-hover-border-color: #D33840; --bs-btn-active-color: #fff; --bs-btn-active-bg: #B8232D; --bs-btn-active-border-color: #B8232D; font-weight: 600; }
.btn-outline-success { --bs-btn-color: #17714A; --bs-btn-bg: #E7F6EE; --bs-btn-border-color: #BFE5D0; --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1A7B4C; --bs-btn-hover-border-color: #1A7B4C; --bs-btn-active-color: #fff; --bs-btn-active-bg: #156640; --bs-btn-active-border-color: #156640; font-weight: 600; }
/* review 2026-11-30: a DISABLED outline button (e.g. «حذف» of a unit that has records) fell back to Bootstrap's transparent —
   a white box with a frame again; it keeps its soft fill, faded */
.btn-outline-primary { --bs-btn-disabled-bg: #EAEEFB; --bs-btn-disabled-border-color: #C9D1F0; }
.btn-outline-secondary { --bs-btn-disabled-color: #3B4256; --bs-btn-disabled-bg: #F0F2F7; --bs-btn-disabled-border-color: #DCE0EA; }
.btn-outline-danger { --bs-btn-disabled-color: #B8232D; --bs-btn-disabled-bg: #FDECEE; --bs-btn-disabled-border-color: #F4C6CA; }
.btn-outline-success { --bs-btn-disabled-color: #17714A; --bs-btn-disabled-bg: #E7F6EE; --bs-btn-disabled-border-color: #BFE5D0; }
.form-control:focus, .form-select:focus { border-color: #2E3D9A; box-shadow: 0 0 0 .2rem rgba(46,61,154,.15); }
.form-check-input:checked { background-color: #2E3D9A; border-color: #2E3D9A; }
/* progress: the logo's launch line — full gold that fades at its tip (status bars keep their own colours) */
.progress-bar:not([class*="bg-"]) { background: linear-gradient(270deg, #F8BC18 0%, #F8BC18 70%, #FDE7A8 100%); color: #0F1636; }

/* the menu on «ليل كيان»; the place you are in is marked in gold */
.sidebar, .sn-foot { background: #0F1636; }
.brand-logo { width: 46px; height: auto; flex: none; }
.brand b { font-size: 1.05rem; }
.snav .sn-kids a.active { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset -3px 0 0 #F8BC18; }
.snav .sn-sec.current:not(.open) > .sn-head, .snav .sn-single.current { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset -3px 0 0 #F8BC18; }
.sn-sec.current:not(.open) > .sn-head .sn-ico, .sn-single.current .sn-ico, .sn-sec.open > .sn-head .sn-ico { color: #F8BC18; background: rgba(248,188,24,.16); }
.sn-ai { background: transparent; border: 1px solid rgba(248,188,24,.55); color: #F8BC18; box-shadow: none; }
.sn-ai:hover, .sn-ai.active { background: rgba(248,188,24,.1); color: #F8BC18; filter: none; }
@media (min-width: 992px) {
  html.nav-rail .snav .sn-sec.current > .sn-head { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset -3px 0 0 #F8BC18; }
  html.nav-rail .brand-logo { width: 40px; }
}
/* the phone's bottom bar: the open place is a gold pill */
.bottom-nav a.active { color: #0F1636; font-weight: 700; }
.bottom-nav a.active::before { display: none; }
.bottom-nav a.active svg { background: #F8BC18; border-radius: 14px; padding: 3px 10px; box-sizing: content-box; stroke: #0F1636; transform: none; }

/* sign-in: the form on white beside «ليل كيان» with the launch lines (approved board) */
.auth:has(.auth-split) { display: block; background: #fff; padding: 0; }
.auth { background: #0F1636; }
.auth-split { display: flex; width: 100%; min-height: 100vh; min-height: 100dvh; }
.auth-form { flex: 0 0 min(560px, 100%); display: flex; align-items: center; justify-content: center; padding: 40px 28px; box-sizing: border-box; background: #fff; }
.auth-form-in { width: 100%; max-width: 400px; }
.auth-logo { width: 84px; height: auto; margin-bottom: 18px; }
.auth-title { font-size: 2rem; font-weight: 700; margin: 0; color: #1B1F33; }
.auth-sub { color: #5B6275; margin: 6px 0 22px; }
.auth-help { font-size: .85rem; color: #5B6275; margin: 16px 0 0; }
.auth-hero { flex: 1; position: relative; overflow: hidden; background: #0F1636; color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-lines { position: absolute; left: -60px; top: 17%; display: flex; flex-direction: column; gap: 22px; }
.auth-lines i { display: block; height: 18px; border-radius: 9px; background: #F8BC18; }
.auth-lines i:nth-child(1) { width: 560px; opacity: .9; } .auth-lines i:nth-child(2) { width: 410px; opacity: .6; }
.auth-lines i:nth-child(3) { width: 270px; opacity: .38; } .auth-lines i:nth-child(4) { width: 135px; opacity: .2; }
.auth-brand { position: relative; display: flex; align-items: center; gap: 14px; }
.auth-brand b { font-family: var(--k-head); font-size: 1.6rem; }
.auth-brand > span { color: #AEB6E0; border-right: 2px solid rgba(255,255,255,.25); padding-right: 14px; }
.auth-pitch { position: relative; max-width: 560px; margin-top: 34vh; }
.auth-pitch h2 { font-family: var(--k-head); font-size: 2.6rem; line-height: 1.35; font-weight: 700; margin: 0; }
.auth-pitch ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; color: #D5DAF3; }
.auth-pitch li { display: flex; align-items: center; gap: 10px; }
.auth-pitch li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F8BC18; flex: none; }
.auth-copy { position: relative; color: #8E97C8; }
@media (max-width: 991.98px) {
  .auth-split { flex-direction: column-reverse; }
  .auth-form { flex: 1; align-items: flex-start; padding-top: 28px; }
  .auth-hero { flex: none; padding: 20px 20px 58px; min-height: 0; gap: 0; }
  .auth-lines { top: auto; bottom: 12px; left: -30px; gap: 5px; }
  .auth-lines i { height: 5px; } .auth-lines i:nth-child(1) { width: 220px; } .auth-lines i:nth-child(2) { width: 150px; }
  .auth-lines i:nth-child(3) { width: 90px; } .auth-lines i:nth-child(4) { width: 45px; }
  .auth-pitch, .auth-copy { display: none; }
  .auth-brand b { font-size: 1.35rem; } .auth-brand > span { font-size: .85rem; }
}
/* قرار الفحص 1 (النموذج المعتمد 2026-11-27): شاشات التحقق بخطوتين داخل إطار صفحة الدخول */
.mfa-wide .auth-form { flex-basis: min(720px, 100%); }
.mfa-wide .auth-form-in { max-width: 560px; }
.mfa-chip { display: inline-block; font-size: .8rem; font-weight: 600; color: #8A5A00; background: #FEF3D0; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.mfa-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: #0F1636; margin-bottom: 14px; }
.mfa-icon svg { width: 26px; height: 26px; fill: none; stroke: #F8BC18; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mfa-steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 18px; counter-reset: mfa; }
.mfa-steps > li { display: flex; gap: 12px; align-items: flex-start; counter-increment: mfa; }
.mfa-steps > li::before { content: counter(mfa); flex: none; width: 28px; height: 28px; border-radius: 50%; background: #0F1636; color: #F8BC18; font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; }
.mfa-steps > li > div { flex: 1; min-width: 0; }
.mfa-muted { color: #4A5170; font-size: .9rem; }
.mfa-scan { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mfa-qr { flex: none; width: 168px; height: 168px; padding: 8px; border: 1px solid #DDE0EA; border-radius: 10px; background: #fff; box-sizing: border-box; }
.mfa-qr svg { width: 100%; height: 100%; display: block; }
.mfa-key { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.mfa-key code { flex: 1; min-width: 0; font-family: Consolas, monospace; font-size: 1rem; letter-spacing: 1px; text-align: center; color: #0F1636; background: #F3F4F8; border: 1px solid #DDE0EA; border-radius: 8px; padding: 9px 8px; overflow-wrap: anywhere; }
.mfa-code { font-family: Consolas, monospace; font-size: 1.6rem; letter-spacing: .4em; text-align: center; height: 58px; }
.mfa-open { display: none; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: #F3F4F8; border: 1px solid #DDE0EA; border-radius: 12px; padding: 14px; font-family: Consolas, monospace; font-size: 1rem; letter-spacing: 1px; color: #0F1636; text-align: center; margin: 0 0 12px; list-style: none; }
.mfa-codes li { padding: 4px 0; }
.mfa-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.mfa-done { background: #E7F5EC; color: #1C6B3A; border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 14px; }
/* على الجوال: زر يفتح التطبيق بدل رمز QR (لا يُمسح رمز من الشاشة نفسها) */
@media (max-width: 991.98px) {
  .mfa-qr, .mfa-scan-hint { display: none; }
  .mfa-open { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
}
@media print { .auth-hero, .mfa-tools, .mfa-noprint { display: none !important; } }
/* Bootstrap parts that carry their own fixed blue: the system's «نيلي العمل» instead */
.nav-pills { --bs-nav-pills-link-active-bg: #2E3D9A; }
.nav-link { --bs-nav-link-color: #2E3D9A; --bs-nav-link-hover-color: #0F1636; }
.pagination { --bs-pagination-color: #2E3D9A; --bs-pagination-hover-color: #0F1636; --bs-pagination-active-bg: #2E3D9A; --bs-pagination-active-border-color: #2E3D9A; --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(46,61,154,.2); }
.dropdown-menu { --bs-dropdown-link-active-bg: #2E3D9A; }
.list-group { --bs-list-group-active-bg: #2E3D9A; --bs-list-group-active-border-color: #2E3D9A; }
.btn-link { --bs-btn-color: #2E3D9A; --bs-btn-hover-color: #0F1636; }

/* ==== Home — approved model 3 (2026-11-27, https://claude.ai/artifact/8KyjNum2BDeTwjm82pGPb6 «النموذج الثالث»). Scoped to .hm. ==== */
.hm { --hm-navy: #0F1636; --hm-ink: #1B1F33; --hm-muted: #5B6275; --hm-soft: #F0F2F8;
      --hm-shadow: 0 1px 2px rgba(15,22,54,.05), 0 6px 16px rgba(15,22,54,.05); font-variant-numeric: tabular-nums; }
.hm-greet { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.hm-greet h1 { margin: 0; font-family: "Readex Pro", sans-serif; font-size: 22px; font-weight: 700; color: var(--hm-navy); }
.hm-greet p { margin: 3px 0 0; font-size: 13px; color: var(--hm-muted); }
.hm-new { display: none; align-items: center; gap: 8px; border-radius: 12px; font-weight: 700; padding: 10px 18px; box-shadow: 0 6px 14px rgba(248,188,24,.35); }
.hm-new svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hm-grid { display: flex; flex-direction: column; gap: 16px; }
.hm .tone-green { background: #E7F5EE; color: #1E7A4F; } .hm .tone-blue { background: #EEF0FA; color: #2E3D9A; }
.hm .tone-red { background: #FDECEC; color: #C8333A; } .hm .tone-amber { background: #FFF4DC; color: #9A6400; }
.hm .tone-gold { background: #F8BC18; color: #0F1636; }
.hm .fg-green { color: #1E7A4F; } .hm .fg-blue { color: #2E3D9A; } .hm .fg-red { color: #C8333A; } .hm .fg-amber { color: #9A6400; }

/* the navy card: the one number that matters most to this person */
.hm-hero { border-radius: 22px; padding: 20px; color: #fff; display: flex; flex-direction: column;
           background: radial-gradient(120% 90% at 0% 0%, rgba(248,188,24,.16) 0%, rgba(248,188,24,0) 45%), linear-gradient(155deg, #1C2870 0%, #0F1636 62%);
           box-shadow: 0 14px 30px rgba(15,22,54,.25); }
.hm-hero-top { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #CDD3F0; font-weight: 500; }
.hm-hero-ic { width: 38px; height: 38px; border-radius: 12px; background: rgba(248,188,24,.14); display: flex; align-items: center; justify-content: center; flex: none; }
.hm-hero-ic svg { width: 20px; height: 20px; fill: none; stroke: #F8BC18; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-hero-num { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: #fff; text-decoration: none; }
.hm-hero-num:hover { color: #fff; }
.hm-hero-num b { font-family: "Readex Pro", sans-serif; font-size: 46px; font-weight: 700; line-height: 1; }
.hm-hero-num span { font-size: 13px; color: #CDD3F0; }
.hm-bar-label { margin-top: 16px; display: flex; justify-content: space-between; font-size: 12px; color: #CDD3F0; }
.hm-bar-label b { color: #fff; }
.hm-bar { margin-top: 14px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.hm-bar-label + .hm-bar { margin-top: 6px; }
.hm-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(270deg, #F8BC18, #FFD465); }
.hm-mini { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: rgba(255,255,255,.07);
           border: 1px solid rgba(255,255,255,.09); border-radius: 14px; overflow: hidden; }
.hm-mini a { padding: 10px 12px; color: #fff; text-decoration: none; min-height: 44px; }
.hm-mini a + a { border-inline-start: 1px solid rgba(255,255,255,.1); }
.hm-mini a:hover { background: rgba(255,255,255,.05); color: #fff; }
.hm-mini small { display: block; font-size: 12px; color: #AEB6E0; }
.hm-mini b { font-family: "Readex Pro", sans-serif; font-size: 20px; font-weight: 700; }
.hm-mini b.late { color: #FF8C91; } .hm-mini b.good { color: #7FDDAA; }

/* quick buttons (phone only) */
.hm-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hm-quick a { background: #fff; border-radius: 16px; box-shadow: var(--hm-shadow); padding: 12px 4px 10px; display: flex; flex-direction: column;
              align-items: center; gap: 8px; text-decoration: none; color: var(--hm-ink); font-size: 12px; font-weight: 600; text-align: center; }
.hm-quick a > span { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.hm-quick svg, .hm-card-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* the four cards: icon + what it is, the number, one line that says what to do */
.hm-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* 2026-11-27: an odd number of cards (a member who creates no tasks) — the last one takes the whole row instead of sitting alone */
.hm-cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.hm-card { background: #fff; border-radius: 18px; box-shadow: var(--hm-shadow); padding: 14px; text-decoration: none; color: var(--hm-ink);
           display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "ic l" "v v" "f f"; column-gap: 8px; row-gap: 10px; align-items: center; }
.hm-card:hover { color: var(--hm-ink); box-shadow: 0 1px 2px rgba(15,22,54,.06), 0 10px 22px rgba(15,22,54,.09); }
.hm-card-t { display: contents; }
.hm-card-ic { grid-area: ic; width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.hm-card-ic svg { width: 18px; height: 18px; }
.hm-card-l { grid-area: l; font-size: 13px; color: var(--hm-muted); font-weight: 500; line-height: 1.35; }
.hm-card-v { grid-area: v; font-family: "Readex Pro", sans-serif; font-size: 28px; font-weight: 700; line-height: 1; }
.hm-card-f { grid-area: f; font-size: 12px; font-weight: 600; }

/* «سند»: today's digest, kept short; the whole of it opens in place */
.hm-sanad.ai-digest, .hm-sanad { border: 0; border-radius: 20px; padding: 16px; background: #0F1636; color: #fff; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 24px rgba(15,22,54,.2); }
.hm-sanad-head { display: flex; align-items: center; gap: 10px; }
.hm-sanad-ic { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #FFD465, #F8BC18); color: #0F1636; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.hm-sanad h2 { margin: 0; font-family: "Readex Pro", sans-serif; font-size: 16px; font-weight: 700; color: #fff; }
.hm-sanad-head small { color: #AEB6E0; font-size: 12px; }
.hm-sanad-body { max-height: 8.8em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.hm-sanad-body.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.hm-sanad .ai-answer { color: #E4E8F8; font-size: 14px; line-height: 1.85; }
.hm-sanad .ai-answer :is(h1, h2, h3, h4, h5, strong, b) { color: #fff; }
.hm-sanad .ai-answer :is(h1, h2, h3, h4, h5) { font-size: 14px; margin: .4em 0 .2em; }
.hm-sanad .ai-answer a { color: #FFD465; }
.hm-sanad .ai-answer p:last-child, .hm-sanad .ai-answer ul:last-child { margin-bottom: 0; }
.hm-sanad .ai-act { background: rgba(248,188,24,.14); color: #FFD465; border-color: transparent; }
.hm-sanad-acts { display: flex; gap: 8px; margin-top: auto; }
.hm-more { flex: 1; min-height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; }
.hm-more[hidden] { display: none; }
.hm-ask { flex: 1; min-height: 42px; border-radius: 12px; background: #F8BC18; color: #0F1636; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hm-ask:hover { background: #FFC93D; color: #0F1636; }

/* white panels */
.hm-panel { background: #fff; border-radius: 20px; box-shadow: var(--hm-shadow); padding: 16px; }
.hm-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hm-panel-head h2 { margin: 0; font-family: "Readex Pro", sans-serif; font-size: 16px; font-weight: 600; color: var(--hm-ink); }
.hm-panel-head small { display: block; font-size: 12px; color: var(--hm-muted); margin-top: 2px; }
.hm-panel-head > a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.hm-seg { display: flex; background: var(--hm-soft); border-radius: 10px; padding: 3px; flex: none; }
.hm-seg button { border: 0; border-radius: 8px; background: transparent; padding: 5px 10px; font: inherit; font-size: 12px; color: var(--hm-muted); min-height: 32px; }
.hm-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(15,22,54,.12); color: var(--hm-navy); font-weight: 600; }

/* the curve: today on the left (time runs right to left), its value in the navy tag */
.hm-plot { display: flex; gap: 6px; padding-top: 6px; }
.hm-plot[hidden], .hm-x[hidden] { display: none; }
.hm-y { display: flex; flex-direction: column; justify-content: space-between; height: 160px; font-size: 11px; color: #8A90A6; width: 22px; text-align: left; flex: none; }
.hm-svg { flex: 1; position: relative; height: 160px; min-width: 0; }
.hm-svg svg { width: 100%; height: 160px; display: block; overflow: visible; }
.hm-svg line { stroke: #EEF0F5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.hm-svg line.base { stroke: #E2E5EF; }
.hm-svg .area { fill: rgba(46,61,154,.12); }
.hm-svg .line { fill: none; stroke: #2E3D9A; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hm-today { position: absolute; left: -6px; width: 12px; height: 12px; border-radius: 50%; background: #F8BC18; box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(248,188,24,.35); }
.hm-tip { position: absolute; left: 14px; top: -6px; background: #0F1636; color: #fff; font-size: 11px; font-weight: 600; border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.hm-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: 13px; color: var(--hm-muted); }
.hm-x { display: flex; justify-content: space-between; margin: 6px 28px 0 0; font-size: 11px; color: #8A90A6; }

/* weakest branches: bars by the last visit's score */
.hm-wrow { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--hm-ink); padding: 7px 0; }
.hm-wrow:hover { color: var(--hm-ink); }
.hm-wrow-t { display: flex; align-items: center; gap: 8px; }
.hm-wrow-t .n { flex: 1; font-size: 14px; font-weight: 500; }
.hm-wrow-t em { font-style: normal; font-size: 12px; color: #C8333A; font-weight: 600; }
.hm-wrow-t small { font-size: 12px; color: #8A90A6; }
.hm-wrow-t b { font-family: "Readex Pro", sans-serif; font-size: 15px; min-width: 46px; text-align: left; }
.hm-wbar { height: 8px; border-radius: 4px; background: var(--hm-soft); overflow: hidden; }
.hm-wbar i { display: block; height: 100%; border-radius: 4px; }
.hm-wbar i.bg-red { background: #D93F45; } .hm-wbar i.bg-amber { background: #E8A317; } .hm-wbar i.bg-green { background: #2E9E6A; }

/* my next tasks: the time (or the date) first */
.hm-trow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hm-soft); text-decoration: none; color: var(--hm-ink); }
.hm-trow:hover { color: var(--hm-ink); background: #FAFBFD; }
.hm-when { flex: none; width: 60px; height: 46px; border-radius: 12px; background: var(--hm-soft); color: var(--hm-navy); display: flex; flex-direction: column;
           align-items: center; justify-content: center; line-height: 1.25; }
.hm-when b { font-size: 13px; font-weight: 700; } .hm-when small { font-size: 11px; }
.hm-when.today { background: #EEF0FA; color: #2E3D9A; } .hm-when.late { background: #FDECEC; color: #B3262C; }
.hm-trow-t { flex: 1; min-width: 0; }
.hm-trow-t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-trow-t small { display: block; font-size: 12px; color: var(--hm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-none { margin: 0; color: var(--hm-muted); font-size: 14px; }

/* every old number, one tap away */
.hm-all { margin-top: 16px; background: #fff; border-radius: 16px; box-shadow: var(--hm-shadow); padding: 0 16px; }
.hm-all[open] { padding-bottom: 16px; }
.hm-all > summary { cursor: pointer; min-height: 50px; display: flex; align-items: center; font-weight: 600; color: var(--hm-navy); list-style: none; }
.hm-all > summary::-webkit-details-marker { display: none; }
.hm-all > summary::after { content: "+"; margin-inline-start: auto; font-size: 20px; line-height: 1; }
.hm-all[open] > summary::after { content: "−"; }

@media (max-width: 991.98px) {
  .hm { padding-bottom: 56px; }   /* the floating «سند» never hides the last line */
}
@media (min-width: 992px) {
  .hm-greet h1 { font-size: 24px; }
  .hm-new { display: inline-flex; }
  .hm-quick { display: none; }
  .hm-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
  .hm-hero { grid-column: span 4; padding: 22px; }
  .hm-hero-num b { font-size: 52px; }
  .hm-cards { grid-column: span 8; gap: 20px; }
  .hm-card { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "ic l v" "ic f v"; padding: 18px 20px; column-gap: 16px; row-gap: 6px; }
  .hm-card-ic { width: 52px; height: 52px; border-radius: 15px; }
  .hm-card-ic svg { width: 21px; height: 21px; }
  .hm-card-l { font-size: 15px; }
  .hm-card-v { font-size: 38px; }
  .hm-chart { grid-column: span 8; order: 1; } .hm-chart.wide { grid-column: span 12; }
  .hm-sanad { grid-column: span 4; order: 2; padding: 20px; }
  .hm-weak { grid-column: span 5; order: 3; }
  .hm-tasks { grid-column: span 7; order: 4; } .hm-tasks.wide { grid-column: span 12; }
  .hm-panel { padding: 20px; }
  .hm-panel-head h2 { font-size: 17px; }
}

/* bottom bar: the raised gold «+» and its list (home redesign 2026-11-27, phone only — the bar itself is hidden on desktop) */
.bottom-nav .bn-add { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; border: 0; background: none;
                      padding: 0 0 7px; font: inherit; font-size: 11px; font-weight: 700; color: #0F1636; }
.bottom-nav .bn-add i { width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: #F8BC18; display: flex; align-items: center; justify-content: center;
                        box-shadow: 0 8px 18px rgba(248,188,24,.45), 0 0 0 5px #fff; }
.bottom-nav .bn-add svg { width: 24px; height: 24px; fill: none; stroke: #0F1636; stroke-width: 2.6; stroke-linecap: round; }
.bottom-nav .bn-add[aria-expanded="true"] i { transform: rotate(45deg); }
.add-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(8,12,40,.45); }
.add-sheet { position: fixed; z-index: 1045; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); background: #fff; border-radius: 20px;
             padding: 8px 14px 10px; box-shadow: 0 20px 50px rgba(15,22,54,.3); max-width: 480px; margin: 0 auto; }
.add-sheet[hidden], .add-backdrop[hidden] { display: none; }
.add-head { display: flex; align-items: center; min-height: 44px; }
.add-head b { flex: 1; font-family: "Readex Pro", sans-serif; font-size: 16px; color: #0F1636; }
.add-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: #F0F2F8; display: flex; align-items: center; justify-content: center; }
.add-x svg { width: 18px; height: 18px; fill: none; stroke: #0F1636; stroke-width: 2; stroke-linecap: round; }
.add-sheet > a { display: flex; align-items: center; gap: 12px; min-height: 56px; border-top: 1px solid #F0F2F8; text-decoration: none; color: #1B1F33; }
.add-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.add-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.add-gold { background: #F8BC18; color: #0F1636; } .add-amber { background: #FFF4DC; color: #9A6400; } .add-red { background: #FDECEC; color: #C8333A; }
.add-green { background: #E7F5EE; color: #1E7A4F; } .add-blue { background: #EEF0FA; color: #2E3D9A; }
.add-t b { display: block; font-size: 15px; font-weight: 600; } .add-t small { display: block; font-size: 12px; color: #5B6275; }
@media (min-width: 992px) { .add-sheet, .add-backdrop { display: none !important; } }
/* ── Tasks review 2026-11-28 (approved mockup, batch ب) ───────────────────────────────────────────── */
/* list: tabs with a count, quick counts that filter, overdue rows marked at their start */
.task-tabs .tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; background: #dc3545; color: #fff; font-size: .72rem; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.task-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.task-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--k-line, #e3e6f0); background: #fff; color: #5d6588; font-size: .875rem; text-decoration: none; }
.task-chip b { font-family: "Readex Pro", inherit; font-size: 1.05rem; color: var(--k-primary, #0F1636); font-variant-numeric: tabular-nums; }
.task-chip.hot { border-color: #f2b9c0; background: #fdecee; color: #b02a37; } .task-chip.hot b { color: #b02a37; }
.task-chip.wait { border-color: #f3d58a; background: #fff4d6; color: #8a5a00; } .task-chip.wait b { color: #8a5a00; }
.task-chip:hover { filter: brightness(.97); }
.task-chip.on { box-shadow: inset 0 0 0 2px var(--k-primary, #0F1636); }
.task-chip:focus-visible { outline: 2px solid var(--k-primary-2, #2E3D9A); outline-offset: 2px; }
.task-table .task-title a { font-weight: 600; }
.task-table .task-no { font-size: .75rem; font-variant-numeric: tabular-nums; }
.task-table tr.row-late > td:first-child { box-shadow: inset -3px 0 0 #dc3545; }
/* task page: what the approver weighs, next to the decision */
.approve-context { display: grid; gap: 6px; }
.ctx-quote { border-inline-start: 3px solid var(--k-primary-2, #2E3D9A); background: #f5f6fb; border-radius: 8px; padding: 7px 10px; font-size: .875rem; }
.ctx-quote small { display: block; color: #6c757d; font-size: .75rem; margin-top: 2px; }
/* create: what → for whom → when, the rest folded */
.task-create .tc-step + .tc-step, .task-create .tc-more { margin-top: 18px; }
.task-create .tc-h { font-size: 1rem; font-weight: 600; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.task-create .tc-h small { font-size: .8rem; }
.tc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tc-picked:empty { display: none; }
.tc-chip { border: 0; background: #e8ebfb; color: var(--k-primary-2, #2E3D9A); border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; }
.tc-people { border: 1px solid var(--k-line, #e3e6f0); border-radius: 10px; overflow: hidden; }
.tc-people .tc-search { border: 0; border-bottom: 1px solid var(--k-line, #e3e6f0); border-radius: 0; background: #f5f6fb; }
.tc-list { max-height: 280px; overflow: auto; }
.tc-person { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--k-line, #e3e6f0); }
.tc-person:first-child { border-top: 0; }
.tc-person.me { background: #f8f9fc; }
.tc-person label { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.tc-person small { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-person .qty { width: 150px; flex: none; }
.tc-person[hidden], .tc-kind[hidden], .tc-self[hidden] { display: none !important; }
.tc-more { border: 1px dashed #c8cde0; border-radius: 10px; padding: 10px 14px; }
.tc-more > summary { cursor: pointer; font-weight: 600; color: var(--k-primary-2, #2E3D9A); }
@media (max-width: 767.98px) {
  /* the phone card is the row itself: as specific as the card rule (.card-k table.t-cards > tbody > tr) and then some */
  .card-k table.task-table.t-cards > tbody > tr.row-late { box-shadow: inset -4px 0 0 #dc3545, 0 1px 3px rgba(17,26,68,.05); }
  .card-k table.task-table.t-cards > tbody > tr.row-late > td:first-child { box-shadow: none; }
  .task-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .task-chip { flex: none; }
  .tc-person { flex-wrap: wrap; }
  .tc-person small { white-space: normal; }
  .tc-person .qty { width: 100%; }
}
/* ── Approvals review 2026-11-28 (approved mockup, batch ب) ─────────────────────────────────────── */
.appr-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; }
.appr-empty .appr-ok { width: 46px; height: 46px; border-radius: 50%; background: #e7f5ec; color: #17804a; display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; }
.appr-empty b { font-family: "Readex Pro", inherit; font-size: 1.05rem; }
.appr-empty span:last-child { color: #6c757d; font-size: .875rem; max-width: 46ch; }
.appr-need { display: inline-block; padding: 3px 10px; border-radius: 8px; font-weight: 600; font-size: .8rem; white-space: nowrap; }
.appr-need.work { background: #e8ebfb; color: var(--k-primary-2, #2E3D9A); }
.appr-need.hold { background: #fff4d6; color: #8a5a00; }
.appr-need.share { background: #e7f5ec; color: #17804a; }
.appr-req { border: 1px solid var(--k-line, #e3e6f0); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.appr-req + .appr-req { margin-top: 10px; }
.appr-ask { font-size: 1rem; font-weight: 600; }
.appr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 4px; }
.appr-actions > form { margin: 0; }
details.appr-act > summary { list-style: none; }
details.appr-act > summary::-webkit-details-marker { display: none; }
details.appr-act[open] { flex-basis: 100%; }          /* the open one keeps its place and its form takes the full row */
details.appr-act[open] > summary { margin-bottom: 8px; }
.appr-form { border-top: 1px dashed var(--k-line, #e3e6f0); padding-top: 8px; }
@media (max-width: 767.98px) {
  .appr-sum { display: none; }   /* the phone has the tabs with their counts */
  .appr-need { white-space: normal; }
}
/* user decision 2026-11-28: a task is never sent at 0% — the send box asks the progress itself */
.send-progress { background: #fff4d6; border: 1px solid #f3d58a; border-radius: 10px; padding: 8px 10px; }
.send-progress label { color: #8a5a00; display: block; margin-bottom: 4px; }


/* ── Inbox review 2026-11-28 (approved design v2) ─────────────────────────────────────────────────── */
.inbox2 { max-width: 860px; margin: 0 auto; display: grid; gap: 10px; }
.ib-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ib-seg { display: inline-flex; background: #fff; border: 1px solid var(--k-line, #e3e6f0); border-radius: 10px; padding: 3px; }
.ib-seg a { font-weight: 600; font-size: .875rem; color: #5d6588; padding: 6px 12px; border-radius: 7px; text-decoration: none; }
.ib-seg a[aria-current="page"] { background: var(--k-primary, #0F1636); color: #fff; }
.ib-seg i { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 9px; background: #dc3545; color: #fff; font-size: .72rem; line-height: 18px; text-align: center; }
.ib-seg a[aria-current="page"] i { background: #fff; color: var(--k-primary, #0F1636); }
.ib-markall { border: 0; background: none; color: var(--k-primary-2, #2E3D9A); font-weight: 600; font-size: .85rem; padding: 6px 4px; }
.ib-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.ib-f { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px; border: 1px solid var(--k-line, #e3e6f0); background: #fff; font-weight: 600; font-size: .82rem; color: var(--k-primary, #0F1636); text-decoration: none; }
.ib-f b { font-size: .74rem; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #f1f2f8; color: #5d6588; text-align: center; line-height: 18px; font-variant-numeric: tabular-nums; }
.ib-f.k-urg b { background: #dc3545; color: #fff; }
.ib-f[aria-current="true"] { border-color: var(--k-primary, #0F1636); box-shadow: inset 0 0 0 1px var(--k-primary, #0F1636); }
.ib-f[aria-current="true"] b { background: var(--k-primary, #0F1636); color: #fff; }
.ib-f:focus-visible, .ib-seg a:focus-visible, .ib-row:focus-visible, .ib-markall:focus-visible { outline: 2px solid var(--k-primary-2, #2E3D9A); outline-offset: 2px; }
.ib-list { background: #fff; border: 1px solid var(--k-line, #e3e6f0); border-radius: 12px; overflow: hidden; }
.ib-day { font-weight: 600; font-size: .78rem; color: #5d6588; padding: 9px 14px 6px; background: #f5f6fb; border-top: 1px solid var(--k-line, #e3e6f0); }
.ib-list > .ib-day:first-child { border-top: 0; }
.ib-pin { background: #fdecee; border-bottom: 1px solid #f2c4ca; }
.ib-pin .ib-day { background: transparent; color: #b02a37; border-top: 0; }
.ib-form { margin: 0; }
.ib-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--k-line, #e3e6f0); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ib-day + .ib-form .ib-row, .ib-pin .ib-form:first-of-type .ib-row { border-top: 0; }
.ib-row:hover { background: #fafbfe; }
.ib-pin .ib-row:hover { background: #fbe3e6; }
.ib-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.ib-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-urg .ib-ic { background: #dc3545; color: #fff; }
.k-act .ib-ic { background: #fff4d6; color: #8a5a00; }
.k-new .ib-ic { background: #e8ebfb; color: var(--k-primary-2, #2E3D9A); }
.k-rem .ib-ic { background: #efebfb; color: #5b3fb8; }
.k-res .ib-ic { background: #e7f5ec; color: #17804a; }
.k-info .ib-ic { background: #f5f6fb; color: #6c757d; border: 1px solid var(--k-line, #e3e6f0); }
.ib-main { display: block; min-width: 0; }
.ib-t { display: block; font-weight: 500; line-height: 1.4; }
.ib-row.unread .ib-t { font-weight: 700; }
.ib-row.read .ib-t, .ib-row.read .ib-b { color: #6c757d; }
.ib-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: .76rem; color: #6c757d; }
.ib-no { font-variant-numeric: tabular-nums; }
.ib-st { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.ib-st.wait { background: #fff4d6; color: #8a5a00; }
.ib-st.done { background: #f5f6fb; color: #6c757d; border: 1px solid var(--k-line, #e3e6f0); }
.ib-st.run { background: #e8ebfb; color: var(--k-primary-2, #2E3D9A); }
.ib-st.hold { background: #2b2f45; color: #fff; }
.ib-st.late { background: #fdecee; color: #b02a37; }
.ib-b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; color: #6c757d; font-size: .84rem; }
.ib-side { display: grid; justify-items: end; gap: 6px; }
.ib-tm { display: inline-flex; align-items: center; gap: 6px; color: #6c757d; font-size: .76rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ib-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--k-primary-2, #2E3D9A); }
.ib-row.read .ib-dot { visibility: hidden; }
.ib-act { border-radius: 8px; padding: 4px 10px; font-weight: 700; font-size: .78rem; background: var(--k-primary, #0F1636); color: #fff; white-space: nowrap; }
.k-urg .ib-act { background: #dc3545; }
.ib-empty { display: grid; justify-items: center; gap: 4px; padding: 28px 16px; text-align: center; color: #6c757d; }
.ib-empty b { color: var(--k-primary, #0F1636); font-family: "Readex Pro", inherit; }
.ib-more { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--k-line, #e3e6f0); color: var(--k-primary-2, #2E3D9A); font-weight: 600; font-size: .875rem; text-decoration: none; }
@media (max-width: 767.98px) {
  /* the type buttons stay in reach while scrolling, in one line that slides */
  .ib-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 5; background: var(--k-bg, #f3f4f9); margin: 0 -12px; padding: 6px 12px; }
  .ib-filters::-webkit-scrollbar { display: none; }
  .ib-row { padding: 10px 12px; gap: 9px; }
  .ib-act { padding: 3px 8px; }
}
/* recurring review 2026-11-28 (approved batch ب): the «مهامي الدورية» strip, the task page's path line, the create form opened on demand */
.rec-recv { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; padding:.7rem 1rem; border:1px solid var(--bs-border-color); border-radius:.6rem;
  background:var(--bs-body-bg); color:inherit; text-decoration:none; }
.rec-recv:hover { border-color:var(--bs-primary); }
.rec-recv b { display:block; }
.rec-recv small { display:block; color:var(--bs-secondary-color); }
.rec-crumb { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem .4rem; font-size:.875rem; color:var(--bs-secondary-color); }
.rec-crumb b { color:var(--bs-body-color); font-weight:600; min-width:0; overflow-wrap:anywhere; }
.rec-new > summary { list-style:none; }
.rec-new > summary::-webkit-details-marker { display:none; }
.rec-new-form { border:1px solid var(--bs-border-color); border-radius:.6rem; padding:1rem; background:var(--bs-tertiary-bg); }
/* ════════ Buttons — ONE rule for the whole project (user 2026-11-29: «لا أريد أي بوتون بخلفية بيضاء وإطار عادي… على كل المشروع،
   في كل مكان وفي كل صفحة»). Every clickable element has a fill in its own identity colour: gold = the one main action,
   «نيلي العمل» soft = secondary, red soft = delete, green soft = confirm, grey-blue soft = neutral (back, cancel, light).
   The chosen / active state stays the full colour so it is still clearly different. New buttons: use these classes, never a bare white box. ════════ */
.btn-light { --bs-btn-color: #2E3D9A; --bs-btn-bg: #EEF1F8; --bs-btn-border-color: #DCE1EE; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #2E3D9A;
  --bs-btn-hover-border-color: #2E3D9A; --bs-btn-active-color: #fff; --bs-btn-active-bg: #24307B; --bs-btn-active-border-color: #24307B; font-weight: 600; }
.btn-outline-warning { --bs-btn-color: #8A5A00; --bs-btn-bg: #FFF6DB; --bs-btn-border-color: #F3DD9B; --bs-btn-hover-color: #0F1636;
  --bs-btn-hover-bg: #F8BC18; --bs-btn-hover-border-color: #F8BC18; --bs-btn-active-color: #0F1636; --bs-btn-active-bg: #E0A50A; --bs-btn-active-border-color: #E0A50A; font-weight: 600; }
.btn-outline-dark { --bs-btn-color: #0F1636; --bs-btn-bg: #E6E9F2; --bs-btn-border-color: #CFD4E3; --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0F1636; --bs-btn-hover-border-color: #0F1636; --bs-btn-active-color: #fff; --bs-btn-active-bg: #0F1636; --bs-btn-active-border-color: #0F1636; font-weight: 600; }
.card-k .btn-outline-secondary, .btn-outline-secondary { font-weight: 600; }
/* review 2026-11-30: disabled keeps the soft fill too (see the outline colours above) */
.btn-light { --bs-btn-disabled-color: #2E3D9A; --bs-btn-disabled-bg: #EEF1F8; --bs-btn-disabled-border-color: #DCE1EE; }
.btn-outline-warning { --bs-btn-disabled-color: #8A5A00; --bs-btn-disabled-bg: #FFF6DB; --bs-btn-disabled-border-color: #F3DD9B; }
.btn-outline-dark { --bs-btn-disabled-color: #0F1636; --bs-btn-disabled-bg: #E6E9F2; --bs-btn-disabled-border-color: #CFD4E3; }
/* the file picker's own button («اختيار ملف») */
.form-control::file-selector-button { background: #EAEEFB; color: #2E3D9A; font-weight: 600; border-color: #C9D1F0; }
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background: #2E3D9A; color: #fff; }
/* pills, chips, tabs-as-links, small toggles — soft when idle, full colour when chosen (their .on / :checked rules above still win) */
.filter-pill:not(.on) { background: #EEF1FB; border-color: #D5DBF3; color: #2E3D9A; font-weight: 600; }
.filter-pill:not(.on):hover { background: #DFE5FA; }
.chip:not(.on) { background: #EEF1FB; border-color: #D5DBF3; color: #1F2A5C; }
.chip:not(.on):hover { background: #DFE5FA; border-color: #2E3D9A; }
.emp-itabs a:not(.on) { background: #EEF1FB; border-color: #D5DBF3; color: #2E3D9A; }
.emp-days input:not(:checked) + span { background: #F0F2F8; border-color: #DCE0EC; }
.ev-add > summary { background: #EEF1FB; border-style: solid; border-color: #D5DBF3; font-weight: 600; }
.icon-btn { background: #EEF1FB; border-color: #D5DBF3; }
.top-actions { background: #F3F5FA; }
.top-actions a:hover, .top-actions button:hover { background: #E6EAF5; }
/* the answer tiles of a visit (ممتثل / غير ممتثل / لا ينطبق): idle soft, chosen in its colour */
.ans-choices label.ans:not(:has(input:checked)) { background: #F4F6FB; }
.ans-choices .ans-na:has(input:checked) { background: #E3E6EE; border-color: #5B6275; color: #2F3444; }
/* the task filter chips: idle soft navy (the hot / waiting ones keep their colours), the chosen one filled */
.task-chip:not(.hot):not(.wait) { background: #EEF1FB; border-color: #D5DBF3; color: #2E3D9A; }
.task-chip.on:not(.hot):not(.wait) { background: #2E3D9A; border-color: #2E3D9A; color: #fff; box-shadow: none; } .task-chip.on:not(.hot):not(.wait) b { color: #fff; }
/* a phone card's small cell that only holds a button (تعديل، فتح…) is not a white box around it — just the button */
@media (max-width: 767.98px) {
  table.t-cards td.cell-mini:has(.btn) { background: transparent !important; border: 0 !important; flex: 0 0 auto; }
}

/* ════════ The long list on the PHONE — one shared pattern (user 2026-11-29: «قائمة طويلة جدًا… تصميم حرفي»): one compact line per record —
   initial tile · bold name (one line) · small sub-line · coloured chip · 44px icon button. Use it for every long list on the phone
   (suppliers, items…); `data-kl-page="30"` on .kl-list shows 30 then «عرض المزيد» (mobile-tabs.js). ════════ */
.kl-list { display: flex; flex-direction: column; }
.kl-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--k-line, #e3e6f0); }
.kl-row:last-child { border-bottom: 0; }
.kl-row.more-hide, .kl-row[hidden] { display: none; }
.kl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.kl-av { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #EAEEFB; color: #2E3D9A; display: grid; place-items: center; font-weight: 700; font-family: var(--k-head); font-size: 1.05rem; }
.kl-row.hot .kl-av { background: #FFF6DB; color: #8A5A00; }
.kl-row.off .kl-av { background: #EEF0F4; color: #8A90A2; }
.kl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.kl-t b { color: var(--k-primary, #0F1636); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kl-t small { color: #6B7290; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kl-chip { flex: none; font-weight: 700; font-size: .85rem; color: #2E3D9A; background: #EAEEFB; border: 1px solid #C9D1F0; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.kl-row.hot .kl-chip, .kl-chip.gold { color: #8A5A00; background: #FFF6DB; border-color: #F3DD9B; }
.kl-chip small { font-weight: 600; font-size: .7rem; }
.kl-btn { flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 12px; }
.kl-more { margin-top: .5rem; }
/* a red tile (expired / urgent) and a tile holding a number with its unit (the documents list: days left) */
.kl-row.bad .kl-av { background: #FDECEC; color: #B42318; }
.kl-row.good .kl-av { background: #E7F6EC; color: #1E7B3A; }
.kl-av.doc-days, .kl-av.num { flex-direction: column; gap: 0; line-height: 1; }
.kl-av.doc-days b, .kl-av.num b { font-size: .95rem; }
.kl-av.num b { font-size: .85rem; }
.kl-av.doc-days small, .kl-av.num small { font-size: .62rem; font-weight: 600; opacity: .8; }
.kl-av.num { width: 46px; }
.kl-t small b { color: inherit; font-size: inherit; font-weight: 700; }
/* the documents filter on the phone: the drop-downs fold behind «خيارات» */
@media (max-width: 767.98px) {
  .doc-filter:not(.open) .doc-opts { display: none; }
  .doc-opts-btn { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
}/* document types (user 2026-11-30): a list to read; «تعديل» opens the type's form under its line */
.dt-item { border-bottom: 1px solid var(--k-line, #e3e6f0); }
.dt-item:last-child { border-bottom: 0; }
.dt-item .kl-row { border-bottom: 0; }
.dt-item.open { background: #F7F8FE; border-radius: 12px; }
.dt-form { padding: 4px 12px 14px; }
/* new delegation (user 2026-11-30): behind «+ تفويض جديد»; permissions in folded sections with a count and «الكل» */
.dlg-new > summary { list-style: none; display: inline-flex; }
.dlg-new > summary::-webkit-details-marker { display: none; }
.dlg-new[open] > summary { margin-bottom: .25rem; }
.dlg-groups { display: flex; flex-direction: column; gap: 6px; }
.dlg-g { border: 1px solid var(--k-line, #e3e6f0); border-radius: 12px; background: #FAFBFE; }
.dlg-g.has { border-color: #C9D1F0; background: #F4F6FD; }
.dlg-g > summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; min-height: 44px; }
.dlg-g-name { font-weight: 700; color: var(--k-primary, #0F1636); flex: 1; }
.dlg-g-n { font-size: .8rem; color: #6B7290; font-weight: 600; }
.dlg-g.has .dlg-g-n { color: #2E3D9A; }
.dlg-g > .row { padding: 0 12px 10px; }
.dlg-p { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; padding: 6px 8px; border-radius: 8px; cursor: pointer; width: 100%; }
.dlg-p:hover { background: #EEF1FB; }
.dlg-p .form-check-input { margin-top: .2rem; flex: none; }

/* User 2026-12-02: on a plan's own page the plan name stays visible while scrolling (desktop; on a phone the sticky top bar already shows it). */
.plan-sticky { position: sticky; top: 0; z-index: 1010; background: var(--k-bg); padding: 8px 2px; margin-bottom: 8px; font-weight: 700; border-bottom: 1px solid var(--k-line); }
@media (max-width: 991.98px) { .plan-sticky { display: none; } }
/* User 2026-12-03 (the complaint stages' screen): the chosen action stands out in every theme — gold with navy text (contrast ≈ 10:1),
   the theme files do not touch it; the others keep the soft grey fill (never a white button). */
.cmp-tabs .btn-check:checked + .btn, .cmp-tabs .btn-check:checked + .btn:hover { background: #F8BC18; border-color: #F8BC18; color: #0F1636; font-weight: 700; }
.cmp-tabs .btn { white-space: normal; min-height: 42px; }

/* ════════ User 2026-12-05 «المراسلات» — internal memos: one compact line per memo (contacts-style on the phone), the memo page with its
   route on the side. Night/dark twins come from tools/theme-gen.ps1. ════════ */
.memo-list { display: flex; flex-direction: column; border: 1px solid #e2e5ef; border-radius: 12px; overflow: hidden; background: #fff; }
.memo-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef0f6; color: #0F1636; text-decoration: none; min-height: 60px; }
.memo-row:last-child { border-bottom: 0; }
.memo-row:hover { background: #f7f8fc; color: #0F1636; }
.memo-row.is-needs { background: #fffbea; box-shadow: inset -3px 0 0 #F8BC18; }
.memo-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: #EAEEFB; color: #2E3D9A; font-family: var(--k-head); }
.memo-tile.is-secret { background: #FDECEE; color: #B8232D; }
.memo-main { min-width: 0; }
.memo-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-main small { display: block; color: #5B6275; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-side { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.memo-empty { border: 1px dashed #c9cee3; border-radius: 12px; padding: 28px 18px; text-align: center; color: #5B6275; display: flex; flex-direction: column; gap: 4px; }
.memo-empty b { color: #0F1636; font-size: 1.02rem; }
.memo-head { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef0f6; padding-bottom: 10px; margin-bottom: 12px; }
.memo-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 12px; font-size: .92rem; }
.memo-meta dt { color: #5B6275; font-weight: 600; }
.memo-meta dd { margin: 0; }
.memo-body { white-space: pre-wrap; overflow-wrap: anywhere; background: #f8f9fd; border: 1px solid #eef0f6; border-radius: 10px; padding: 12px 14px; line-height: 1.85; margin-bottom: 12px; }
.memo-files { margin-bottom: 12px; }
.memo-file { display: inline-flex; align-items: center; gap: 4px; background: #f0f2f7; border-radius: 8px; padding: 4px 10px; margin: 0 0 6px 6px; font-size: .88rem; }
.memo-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px dashed #e2e5ef; padding-top: 12px; }
.memo-actions form { margin: 0; }
.memo-panel { margin-top: 14px; border: 1px solid #e2e5ef; border-top: 3px solid #2E3D9A; border-radius: 12px; padding: 12px 14px; background: #fbfcff; }
.memo-panel details > summary { list-style: none; display: inline-block; }
.memo-panel details > summary::-webkit-details-marker { display: none; }
.memo-route { background: #EAEEFB; color: #24307B; border-radius: 10px; padding: 9px 12px; font-size: .92rem; }
.memo-route b { color: #0F1636; }
.memo-tl { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid #e2e5ef; }
.memo-tl li { position: relative; padding: 0 14px 12px; font-size: .9rem; }
.memo-tl li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #2E3D9A; border: 2px solid #fff; }
.memo-tl li.is-ok::before { background: #1A7B4C; }
.memo-tl li.is-bad::before { background: #D33840; }
.memo-tl li.is-wait::before { background: #F8BC18; }
.memo-tl li small { display: block; color: #5B6275; }
.memo-tl-text { margin-top: 4px; background: #f6f7fb; border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .memo-row { grid-template-columns: 40px minmax(0, 1fr); }
  .memo-side { grid-column: 2; justify-content: flex-start; }
  .memo-head { flex-direction: column; }
  .memo-actions { justify-content: stretch; }
  .memo-actions > .btn, .memo-actions form, .memo-actions form .btn { flex: 1 1 100%; width: 100%; }
}
/* user 2026-12-05: «what is asked of ME» stands apart from the memo's text — gold side bar, larger type (memo page and its task) */
.memo-ask { background: #FFF6DB; border: 1px solid #F3DC93; border-inline-start: 5px solid #F8BC18; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.memo-ask-h { font-family: var(--k-head); font-weight: 700; color: #8a6400; font-size: .9rem; margin-bottom: 2px; }
.memo-ask-t { font-size: 1.12rem; font-weight: 600; color: #0F1636; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.memo-ask-f { font-size: .82rem; color: #5B6275; margin-top: 4px; }
/* user trial 2026-12-05 (memo page redesign): on top what is needed from me now and the final answer; the referees as people with
   their result in green; «جديد» on what others wrote after my last action; on the phone one section at a time (mobile-tabs) */
.memo-top { margin-bottom: 14px; }
.memo-now { margin-top: 10px; background: #EAEEFB; color: #24307B; border-radius: 10px; padding: 9px 12px; font-weight: 600; }
.memo-now.is-me { background: #FFF6DB; color: #6b4e00; border-inline-start: 4px solid #F8BC18; }
.memo-answer { margin-top: 10px; background: #E7F6EE; border: 1px solid #BFE5D0; border-inline-start: 5px solid #1A7B4C; border-radius: 12px; padding: 10px 14px; }
.memo-answer.is-bad { background: #FDECEE; border-color: #F4C6CA; border-inline-start-color: #D33840; }
.memo-answer-h { font-size: .82rem; color: #3B4256; font-weight: 600; margin-bottom: 2px; }
.memo-answer-t { font-size: 1.05rem; font-weight: 600; color: #0F1636; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-refs { display: flex; flex-direction: column; gap: 10px; }
.memo-ref { border: 1px solid #e2e5ef; border-radius: 12px; padding: 10px 12px; background: #fff; }
.memo-ref.is-done { border-color: #BFE5D0; }
.memo-ref-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.memo-ref-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #EAEEFB; color: #2E3D9A; font-weight: 700; flex: none; }
.memo-ref-who { flex: 1 1 160px; min-width: 0; }
.memo-ref-who b { display: block; }
.memo-ref-who small { color: #5B6275; }
.memo-ref-ask { margin-top: 6px; font-size: .9rem; color: #3B4256; }
.memo-ref-ask span { color: #8a6400; font-weight: 700; }
.memo-ref-result { margin-top: 8px; background: #E7F6EE; border-radius: 10px; padding: 8px 12px; }
.memo-ref-result-h { font-size: .78rem; font-weight: 700; color: #17714A; }
.memo-ref-result-t { font-weight: 600; color: #0F1636; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-ref-notes { margin-top: 6px; font-size: .88rem; }
.memo-ref-notes summary { cursor: pointer; color: #2E3D9A; font-weight: 600; }
.memo-tl li.is-new { background: #FFFBEA; border-radius: 8px; }
.memo-note-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.memo-note-opts input[type=file] { max-width: 280px; }
.memo-done-opt { background: #E7F6EE; border-radius: 10px; padding: 8px 12px 8px 12px; padding-inline-start: 2.2em; }
@media (max-width: 575.98px) {
  .memo-note-opts input[type=file] { max-width: 100%; }
  .memo-answer-t, .memo-ask-t { font-size: 1rem; }
}
/* user 2026-12-05 «المراسلات» — circulars: a green «ت» tile; the audience picker (radio + indented units, searchable); the reader's
   «اطلعت والتزمت» stays at the bottom of the phone screen; the sender's read rates by unit as bars */
.circ-tile { background: #E7F6EE; color: #17714A; }
.circ-aud { display: flex; flex-wrap: wrap; gap: 10px; }
.circ-aud-opt { display: flex; align-items: center; gap: 8px; border: 1px solid #DCE0EA; background: #F0F2F7; border-radius: 10px; padding: 9px 12px; cursor: pointer; min-height: 44px; }
.circ-aud-opt:has(input:checked) { border-color: #F8BC18; background: #FFF6DB; }
.circ-pick { max-height: 300px; overflow-y: auto; border: 1px solid #e2e5ef; border-radius: 10px; background: #fff; }
.circ-pick-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #f1f2f7; cursor: pointer; min-height: 40px; }
.circ-pick-row:last-child { border-bottom: 0; }
.circ-pick-row:has(input:checked) { background: #EAEEFB; }
.circ-pos > summary { cursor: pointer; }
.circ-body { font-size: 1.02rem; }
.circ-ack { margin-top: 14px; }
.circ-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.circ-kpis div { border: 1px solid #e2e5ef; border-radius: 10px; padding: 8px 10px; background: #fff; }
.circ-kpis b { display: block; font-family: var(--k-head); font-size: 1.35rem; color: #2E3D9A; }
.circ-kpis small { color: #5B6275; }
.circ-units-tbl { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.circ-unit-row { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) max-content; gap: 8px; align-items: center; font-size: .88rem; }
.circ-unit-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circ-bar { height: 9px; }
.circ-unit-num { font-variant-numeric: tabular-nums; color: #3B4256; }
.circ-waiting { list-style: none; padding: 0; margin: 6px 0 0; max-height: 320px; overflow-y: auto; }
.circ-waiting li { padding: 5px 0; border-bottom: 1px solid #f1f2f7; }
@media (max-width: 991.98px) {
  .circ-ack { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 15; background: #fff; padding: 8px 0 4px; }
}
