@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/static/fonts/cairo-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/static/fonts/cairo-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/plex-arabic-arabic-400.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/plex-arabic-latin-400.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/plex-arabic-arabic-500.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/plex-arabic-latin-500.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/plex-arabic-arabic-600.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/plex-arabic-latin-600.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/plex-arabic-arabic-700.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family:'Plex Arabic'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/plex-arabic-latin-700.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ================= pivi design system: crisp medical workspace ================= */
:root {
  --bg: #F4F6FA;
  --panel: #FFFFFF;
  --head: #F8FAFC;
  --line: #E2E8F0;
  --line-soft: #EDF1F7;
  --text: #0A0F1A;
  --muted: #263244;
  --faint: #3F4E63;
  --accent: #2563EB;
  --accent-dark: #1D4ED8;
  --accent-soft: #EEF4FF;
  --bad: #B42318;
  --ok: #1F6B1B;
  --radius: 8px;
  --font: 'Cairo', 'Plex Arabic', Tahoma, Arial, sans-serif;
  /* status pills: background / border / text */
  --red-bg: #F8D4D4;    --red-bd: #D77B7B;    --red-tx: #8F1D1D;
  --orange-bg: #FBE3C0; --orange-bd: #E0A24A; --orange-tx: #7A4A06;
  --yellow-bg: #FFF2B8; --yellow-bd: #E3C74F; --yellow-tx: #6B5A00;
  --green-bg: #CFEFC9;  --green-bd: #7FC27A;  --green-tx: #1F5B1B;
  --blue-bg: #D5E6FB;   --blue-bd: #7FA8E0;   --blue-tx: #123F82;
  --purple-bg: #E5D9F7; --purple-bd: #AD92DA; --purple-tx: #4A2A86;
  --gray-bg: #E8EAEE;   --gray-bd: #BCC2CC;   --gray-tx: #3E4752;
}

* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; font-weight: 600; line-height: 1.55; min-height: 100vh; }
button, input, select, textarea { font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; line-height: 1.4; color: var(--text); }
.num, .mono { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 12.5px; font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; font-weight: 600; }
.hidden { display: none !important; }
svg.ic { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: var(--radius); border: 1px solid #94A3B8; background: var(--panel); color: #0F172A; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--head); border-color: #64748B; text-decoration: none; }
.btn:focus-visible, .topnav-item:focus-visible, .tab:focus-visible, .link-btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #8F1B12; border-color: #8F1B12; }
.btn-alert { background: #fff; border: 1px solid var(--bad); color: var(--bad); border-style: dashed; }
.btn-alert:hover { background: #FDEDEC; border-color: var(--bad); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-red { background: #C8102E; border-color: #C8102E; color: #fff; }
.btn-red:hover { background: #A30D26; border-color: #A30D26; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-weight: 500; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid #BFC5CE; border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--head); color: var(--text); }

/* ---------- forms ---------- */
.field { margin-bottom: 11px; }
.field > label, .lbl { display: block; font-weight: 700; font-size: 13.5px; color: #0F172A; margin-bottom: 4px; }
.hint { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.input, .select, .textarea { width: 100%; padding: 6px 10px; border: 1px solid #94A3B8; border-radius: var(--radius); background: var(--panel); outline: none; line-height: 1.5; color: var(--text); font-weight: 600; }
.input::placeholder, .textarea::placeholder { color: #64748B; font-weight: 500; }
.input, .select { height: 34px; padding-top: 0; padding-bottom: 0; }
.select { padding-inline-end: 28px; text-overflow: ellipsis; }
.textarea { resize: vertical; padding: 7px 10px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.input[readonly] { background: var(--head); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- top bar + filter bar ---------- */
.topbar { background: #FFFFFF; border-bottom: 1px solid #E5EAF2; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); display: flex; align-items: center; gap: 14px; padding: 8px 22px; min-height: 64px; flex-wrap: wrap; position: sticky; top: 0; z-index: 30; }
.brand-inline { display: flex; align-items: center; overflow: visible; gap: 8px; padding-inline-end: 18px; margin-inline-end: 2px; border-inline-end: 1px solid #E5EAF2; }
.brand-mark { width: 26px; height: 26px; border-radius: 4px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.topnav-item { display: inline-flex; align-items: center; gap: 7px; height: 38px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: transparent; border: 1px solid transparent; color: #0F172A; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; margin-bottom: 0; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.topnav-item:hover { background: #E8EEF7; color: #0A0F1A; }
.topnav-item.active { background: var(--accent); color: #FFFFFF; border-color: var(--accent); font-weight: 700; box-shadow: 0 2px 8px rgba(37, 99, 235, .24); }
.topnav-item.active:hover { background: var(--accent-dark); color: #FFFFFF; }
.nav-count { min-width: 19px; height: 19px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; }
.nav-count.neutral { background: #E2E8F0; color: #334155; }
.topnav-item.active .nav-count { background: #FFFFFF; color: var(--bad); }
.topnav-item.active .nav-count.neutral { background: rgba(255, 255, 255, .22); color: #FFFFFF; }
.top-right { display: flex; align-items: center; gap: 8px; }
.userbox { position: relative; }
.userbtn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: var(--radius); }
.userbtn:hover { background: var(--head); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #D9DEE6; color: #3A4452; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.who-l1 { font-weight: 600; font-size: 12px; line-height: 1.2; text-align: start; }
.who-l2 { font-size: 11px; color: var(--muted); line-height: 1.2; text-align: start; }
.menu { position: absolute; inset-inline-end: 0; top: 100%; margin-top: 8px; min-width: 220px; padding: 6px; background: var(--panel); border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 12px 28px rgba(15, 23, 42, .12); z-index: 50; display: none; }
.menu.open { display: block; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-weight: 600; background: none; border: none; text-align: start; color: var(--text); cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--head); text-decoration: none; }
.menu .sep { border-top: 1px solid var(--line-soft); margin-top: 4px; border-radius: 0 0 8px 8px; }
.menu .tm { padding: 8px 12px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line-soft); }

.filterbar { background: #F8FAFC; border-bottom: 1px solid #E5EAF2; display: flex; align-items: center; gap: 10px; padding: 10px 22px; flex-wrap: wrap; }
.filterbar .select, .filterbar .input { width: auto; }
.filterbar .dates { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.search-wrap { display: flex; align-items: center; margin-inline-start: auto; background: #FFFFFF; border: 1px solid #DCE3EE; border-radius: 999px; padding: 2px; transition: border-color .15s, box-shadow .15s; }
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-wrap .input { width: 270px; height: 30px; border: 0; background: transparent; border-radius: 999px; padding: 0 14px; box-shadow: none; }
.search-wrap .input:focus { border: 0; box-shadow: none; }
.search-wrap button { height: 30px; width: 32px; background: var(--accent); border: 0; color: #fff; cursor: pointer; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-wrap button:hover { background: var(--accent-dark); }
.reset-link { color: var(--accent); background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 600; }

.content { padding: 16px 22px 44px; }
.stack > * + * { margin-top: 12px; }

/* ---------- notices ---------- */
.notice { border: 1px solid; border-radius: var(--radius); padding: 8px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.notice.bad { background: #FDECEA; border-color: #F0B6B0; color: #7A1A12; }
.notice.warn { background: #FFF8E5; border-color: #E8D9A8; color: #6E4005; }
.notice.good { background: #E8F5E6; border-color: #B7DDB2; color: #1F5B1B; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: start; width: 100%; }
.kpi:hover { border-color: #A5ADB9; }
.kpi-ic { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--head); display: flex; align-items: center; justify-content: center; color: #44505E; flex-shrink: 0; }
.kpi-ic svg { width: 20px; height: 20px; }
.kpi.bad .kpi-ic { background: var(--red-bg); border-color: var(--red-bd); color: var(--red-tx); }
.kpi.warn .kpi-ic { background: var(--orange-bg); border-color: var(--orange-bd); color: var(--orange-tx); }
.kpi.good .kpi-ic { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-tx); }
.kpi-t { font-size: 16.5px; font-weight: 700; line-height: 1.3; color: #0A0F1A; }
.kpi-s { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-s.bad { color: var(--bad); font-weight: 700; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); min-height: 40px; flex-wrap: wrap; }
.panel-head .ic { color: #263244; width: 18px; height: 18px; }
.panel-title { font-size: 15.5px; font-weight: 700; color: #0A0F1A; }
.panel-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 12px; }
.panel-note { padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-soft); background: #FAFBFC; }
.grid-dash-1 { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; }
.grid-dash-2 { display: grid; grid-template-columns: 1.1fr 1fr 1fr 0.8fr; gap: 12px; }
@media (max-width: 1500px) { .grid-dash-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .grid-dash-1, .grid-dash-2 { grid-template-columns: 1fr; } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab { background: none; border: none; padding: 4px 10px; cursor: pointer; color: #1E293B; font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; }
.tab:hover { color: #0A0F1A; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.tab .t-n { color: inherit; font-weight: 600; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; font-weight: 600; }
.t th { text-align: start; font-weight: 700; color: #0F172A; padding: 8px 10px; background: var(--head); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line-soft); white-space: nowrap; font-size: 13px; }
.t td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tr:last-child td { border-bottom: none; }
.t tbody tr:hover td { background: #F7F9FC; }
.t tr.click { cursor: pointer; }
.t .cell-title { font-weight: 700; }
.t .nw { white-space: nowrap; }
.t td.act, .t th.act { text-align: end; white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; unicode-bidi: plaintext; max-width: 300px; }
.clamp.two { -webkit-line-clamp: 2; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.pager button { min-width: 24px; height: 24px; border: 1px solid transparent; background: none; border-radius: var(--radius); cursor: pointer; color: var(--text); }
.pager button:hover { background: var(--head); }
.pager button.on { border-color: var(--line); background: var(--head); font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: default; }
.view-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; background: none; border: none; cursor: pointer; }
.view-link:hover { text-decoration: underline; }

/* safety net: a table cell must never become inline-block (it breaks row borders) */
td.num, td.mono, th.num, th.mono { display: table-cell; }

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 1px 10px; line-height: 19px; border-radius: 999px; border: 1px solid; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.red { background: var(--red-bg); border-color: var(--red-bd); color: var(--red-tx); }
.pill.orange { background: var(--orange-bg); border-color: var(--orange-bd); color: var(--orange-tx); }
.pill.yellow { background: var(--yellow-bg); border-color: var(--yellow-bd); color: var(--yellow-tx); }
.pill.green { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-tx); }
.pill.blue { background: var(--blue-bg); border-color: var(--blue-bd); color: var(--blue-tx); }
.pill.purple { background: var(--purple-bg); border-color: var(--purple-bd); color: var(--purple-tx); }
.pill.gray { background: var(--gray-bg); border-color: var(--gray-bd); color: var(--gray-tx); }
.badge-n { display: inline-block; padding: 0 7px; line-height: 18px; border-radius: 2px; border: 1px solid; font-size: 12px; font-weight: 500; }

/* ---------- dashboard parts ---------- */
.alert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
@media (max-width: 700px) { .alert-grid { grid-template-columns: 1fr; } }
.acard { border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; background: #fff; cursor: pointer; text-align: start; width: 100%; }
.acard:hover { background: #FAFBFD; }
.acard.bad { background: #FFF8F7; border-color: #E8B7B1; }
.acard.warn { background: #FFFCF3; border-color: #E8D9A8; }
.acard.ok { background: #F7FCF6; border-color: #C5E1C1; }
.acard-t { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.acard.bad .acard-t { color: var(--bad); }
.acard.warn .acard-t { color: #8A5A00; }
.acard.ok .acard-t { color: var(--ok); }
.acard-t svg { width: 14px; height: 14px; }
.acard-s { font-size: 12px; color: var(--muted); }
.lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.lane-h { font-weight: 600; font-size: 12px; text-align: center; padding: 3px 6px; border: 1px solid; margin-bottom: 6px; border-radius: 2px; }
.lane-h.red { background: var(--red-bg); border-color: var(--red-bd); color: var(--red-tx); }
.lane-h.yellow { background: var(--yellow-bg); border-color: var(--yellow-bd); color: var(--yellow-tx); }
.lane-h.green { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-tx); }
.lcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.lcard:hover { background: #FAFBFD; }
.lcard b { display: block; font-size: 12.5px; }
.lcard .small { color: var(--muted); }
.src-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.src-row:last-child { border-bottom: none; }
.src-name { font-weight: 600; min-width: 84px; }
.src-meta { font-size: 12px; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 16px; padding: 14px 12px 6px; justify-content: center; flex-wrap: wrap; }
.donut { width: 112px; height: 112px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ''; position: absolute; inset: 24px; background: #fff; border-radius: 50%; }
.donut-c { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; z-index: 1; }
.legend { list-style: none; font-size: 12.5px; }
.legend li { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.panel-foot { padding: 6px 12px 12px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,28,40,.5); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 36px 16px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--panel); border-radius: 4px; width: 100%; max-width: 640px; box-shadow: 0 12px 40px rgba(20,28,40,.3); }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--head); border-radius: 4px 4px 0 0; }
.modal-head h3 { font-size: 16px; font-weight: 700; color: #0A0F1A; }
.modal-body { padding: 12px 14px; }
.modal-body .field { margin-bottom: 8px; }
.modal-body .grid-2 { gap: 0 10px; }
.modal-foot { display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--head); border-radius: 0 0 4px 4px; }
.x-btn { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 6px; border-radius: 3px; }
.x-btn:hover { background: #E3E6EB; color: var(--text); }
/* detail card: label and value pairs, two pairs per row; long values take the full row; empty ones are folded into one line */
.detail { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); gap: 3px 14px; align-items: baseline; padding: 7px 11px; font-size: 13px; font-weight: 600; line-height: 1.55; background: var(--head); border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 10px; }
.detail dt { color: var(--muted); font-weight: 700; white-space: nowrap; }
.detail dd { overflow-wrap: anywhere; white-space: pre-line; unicode-bidi: normal; text-align: start; font-weight: 600; }
.detail dd.full { grid-column: 2 / -1; }
.detail dt:has(+ dd.full) { grid-column: 1; }
.detail dd.lead { grid-column: 2 / -1; font-weight: 500; }
.detail dt.miss, .detail dd.miss { grid-column: auto; color: var(--faint); font-weight: 500; }
.detail dt.miss { grid-column: 1; }
.detail dd.miss { grid-column: 2 / -1; }
@media (max-width: 560px) { .detail { grid-template-columns: max-content minmax(0, 1fr); } .detail dd.full, .detail dd.lead, .detail dd.miss { grid-column: 2; } }
.step-title { font-weight: 600; margin: 12px 0 6px; padding-top: 9px; border-top: 1px solid var(--line); }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.box-title { font-weight: 600; margin-bottom: 2px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; inset-inline-start: 20px; background: #1F2933; color: #fff; padding: 10px 16px; border-radius: var(--radius); max-width: 440px; display: none; z-index: 200; }
#toast.err { background: var(--bad); }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 500; }
.section-title { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.help h3 { margin: 18px 0 4px; font-size: 14px; }
.help h3:first-child { margin-top: 0; }
.help p, .help li { max-width: 820px; }
.help ol { padding-inline-start: 22px; }
.help li { margin-bottom: 5px; }

/* ---------- login / public pages ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 28px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; padding: 0 0 20px; }
.auth-card .brand-mark { width: 34px; height: 34px; font-size: 14px; }
.form-error { color: var(--bad); font-weight: 500; min-height: 22px; margin-top: 10px; }
.public-top { background: var(--panel); border-bottom: 1px solid var(--line); }
.public-top-in { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.public-top-in .brand-mark { width: 30px; height: 30px; }
.public-main { max-width: 720px; margin: 22px auto 48px; padding: 0 16px; }
.public-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 24px; }
.public-card h1 { font-size: 20px; margin-bottom: 6px; }
.callout { background: var(--accent-soft); border: 1px solid #BFD4F2; border-radius: var(--radius); padding: 10px 12px; margin: 14px 0 18px; color: #123A66; }
.success-box { background: #E8F5E6; border: 1px solid #B7DDB2; color: #14502A; border-radius: var(--radius); padding: 14px; margin-top: 14px; }
.success-box b { display: block; font-size: 15px; margin-bottom: 3px; }
.error-box { background: #FDECEA; border: 1px solid #F0B6B0; color: #7A1A12; border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; }
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); opacity: 0; pointer-events: none; }

/* ---------- print ---------- */
@media print {
  .topbar, .filterbar, .notice, .no-print, #toast, .panel-end { display: none !important; }
  body, .content { background: #fff !important; padding: 0 !important; }
  .panel { border: 1px solid #999; }
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- logo (brand pack: the wordmark must never be narrower than 72px) ---------- */
.brand-logo { height: 42px; width: auto; max-width: 100%; display: block; }
.brand-logo.lg { height: 68px; margin: 0 auto 6px; }
.brand-inline { padding-inline-end: 18px; }
.login-brand { text-align: center; padding-bottom: 20px; }
.login-brand .brand-sub { margin-top: 2px; }
.public-top-in { gap: 14px; }

.brand-link { display: flex; align-items: center; border-radius: 4px; }
.brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-inline .brand-logo { height: 38px; width: auto; margin: 0; display: block; }
.public-top .brand-logo { margin: -2px 0; }


/* the interface font can be changed per person (حسابي): Cairo (default), IBM Plex or Tahoma */
html[data-font="plex"] { --font: 'Plex Arabic', 'Segoe UI', Tahoma, Arial, sans-serif; }
html[data-font="tahoma"] { --font: Tahoma, 'Segoe UI', 'Plex Arabic', Arial, sans-serif; }

/* ---------- no selecting or copying outside the typing fields (the same rule as the reporting app) ---------- */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img, svg, a { -webkit-user-drag: none; }

#pp-detail { max-width: 900px; }

/* ---------- collapsible blocks and the wider case window ---------- */
.modal.wide { max-width: 820px; }
.acc { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--panel); }
.acc > summary { cursor: pointer; padding: 6px 11px; font-weight: 700; background: var(--head); list-style: none; display: flex; align-items: center; gap: 8px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before { content: "+"; width: 14px; text-align: center; color: var(--accent); font-weight: 700; }
.acc[open] > summary::before { content: "\2212"; }
.acc[open] > summary { border-bottom: 1px solid var(--line-soft); }
.acc > .acc-body { padding: 9px 11px 2px; }
.grid-3f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
@media (max-width: 640px) { .grid-3f { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notice { padding: 6px 11px; }

/* the window never grows taller than the screen: title and buttons stay in view, only the middle scrolls */
.modal-backdrop { padding: 16px; }
.modal { max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-body { overflow-y: auto; min-height: 0; }
.modal-head, .modal-foot { flex: 0 0 auto; }
#m-case .textarea { min-height: 0; }
#m-case label, #m-case .lbl { font-size: 12.5px; margin-bottom: 2px; }
#m-case .step-title { margin: 8px 0 5px; padding-top: 7px; font-size: 13.5px; }

/* clickable status pills in the formal report */
a.plink { text-decoration: none; color: inherit; cursor: pointer; }
a.plink:hover .pill, a.plink:hover .cell-title { box-shadow: 0 0 0 2px var(--accent-soft); text-decoration: underline; }

/* ---------- printing one case ---------- */
#print-case { display: none; }
.pc-t { width: 100%; border-collapse: collapse; }
.pc-t th, .pc-t td { border: 1px solid #888; padding: 4px 8px; text-align: start; vertical-align: top; font-size: 12.5px; }
.pc-t th { width: 26%; background: #eee; font-weight: 700; }
@media print {
  body.printing-case > *:not(#print-case) { display: none !important; }
  body.printing-case #print-case { display: block !important; padding: 8mm; color: #000; }
}

/* ---------- searchable product box in the filter bar ---------- */
.combo { position: relative; width: 240px; }
.filterbar .combo .input { width: 100%; padding-inline-end: 26px; }
.combo-x { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 5px; }
.combo-x:hover { color: var(--text); }
.combo-list { position: absolute; top: 100%; inset-inline: 0; z-index: 60; background: var(--panel); border: 1px solid #A9B1BD; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); max-height: 300px; overflow-y: auto; box-shadow: 0 8px 20px rgba(20,28,40,.18); }
.combo-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.combo-item:hover, .combo-item.active { background: var(--accent-soft); }
.combo-item mark { background: var(--yellow-bg); color: inherit; padding: 0; }
.combo-hint { padding: 5px 10px; color: var(--muted); font-size: 12px; background: var(--head); }

/* ---------- filter bar: product, period, search; the two date boxes appear only for a custom period ---------- */
.filterbar { gap: 10px; }
.filterbar .select, .filterbar .input, .filterbar .btn { height: 36px; border-radius: 10px; }
.filterbar .select, .filterbar .input { border: 1px solid #DCE3EE; background: #FFFFFF; }
.filterbar .search-wrap .input { height: 30px; border: 0; background: transparent; border-radius: 999px; padding: 0 14px; box-shadow: none; width: 270px; }
.filterbar .btn-alert { border-radius: 999px; padding: 0 14px; background: #FEF2F2; border: 1.5px dashed #DC2626; color: #B91C1C; }
.filterbar #f-period { min-width: 130px; }
.filterbar .dates .input { width: 150px; }

/* ---------- ministry pages ---------- */
.kpis.kpis-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1250px) { .kpis.kpis-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .kpis.kpis-6 { grid-template-columns: 1fr 1fr; } }
.kpi-t .num { font-weight: 700; }
.ov-bar .select, .ov-filters .select { width: auto; }
.ov-dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ov-dates .input { width: auto; }
.ov-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
@media (max-width: 1000px) { .ov-grid { grid-template-columns: 1fr; } }
.ov-filters { background: var(--head); }
.ov-filters .combo { width: 260px; }
.ov-filters .combo .input, .panel-head .combo .input { width: 100%; padding-inline-end: 26px; }
.panel-head .combo { width: 260px; }
.ov-t th.sortable { cursor: pointer; user-select: none; }
.ov-t th.sortable:hover { color: var(--accent); }
.ov-t th.sortable.on { color: var(--accent); }
.bad-tx { color: var(--bad); font-weight: 600; }
/* chart: series 1 = non-serious (blue), series 2 = serious (orange); validated pair, recessive grid */
.ov-chart { position: relative; padding: 8px 10px 4px; }
.ov-chart svg { width: 100%; height: auto; display: block; font-family: inherit; direction: ltr; }
.ov-chart .grid { stroke: #E6E9EE; stroke-width: 1; }
.ov-chart .base { stroke: #9AA3AF; stroke-width: 1; }
.ov-chart .ax { fill: #5B6573; font-size: 10px; }
.ov-chart .val { fill: #1F2733; font-size: 11px; font-weight: 700; }
.ov-chart .s1, .ov-legend .sw.s1, .ov-tip .sw.s1 { fill: #2A78D6; background: #2A78D6; }
.ov-chart .s2, .ov-legend .sw.s2, .ov-tip .sw.s2 { fill: #EB6834; background: #EB6834; }
.ov-chart .hit { fill: transparent; }
.ov-chart .hit.on { fill: rgba(27,95,193,.07); }
.ov-chart .t { margin: 0; }
.ov-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-inline: 4px 2px; }
.ov-tip { position: absolute; z-index: 5; background: var(--panel); border: 1px solid #A9B1BD; border-radius: var(--radius); padding: 6px 9px; font-size: 12px; box-shadow: 0 6px 16px rgba(20,28,40,.16); pointer-events: none; min-width: 130px; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .ov-print-head { border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .ov-print-head h2 { font-size: 18px; }
  .kpis.kpis-6 { grid-template-columns: repeat(3, 1fr); }
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .kpi { break-inside: avoid; }
  .panel { break-inside: avoid-page; }
}

/* ---------- pages: clear arrows, first / last ---------- */
.pager { gap: 4px; flex-wrap: wrap; background: #FAFBFC; }
.pager .pg-count { margin-inline-end: auto; color: var(--muted); }
.pager button { min-width: 30px; height: 28px; border: 1px solid #BFC5CE; background: var(--panel); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; }
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pager button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.pager button .ic { width: 15px; height: 15px; }
.pager button:disabled { opacity: .4; }
.pager .pg-gap { padding: 0 2px; color: var(--muted); }
.pager .pg-of { margin-inline-start: 8px; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .pager .pg-wide span { display: none; } .pager .pg-of { display: none; } }
/* ---------- back button ---------- */
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); border-color: #9DB7E2; background: #F3F7FD; }
.back-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.back-btn .ic { width: 16px; height: 16px; }

/* ---------- the case window shown as a page (ministry: no pop-ups) ---------- */
.modal.page-modal { position: static; max-width: none; width: auto; max-height: none; box-shadow: none; transform: none; margin: 0; border: 1px solid var(--line); }
.modal.page-modal .x-btn { display: none; }
.modal.page-modal .modal-body { max-height: none; overflow: visible; }
.modal.page-modal .modal-foot { position: static; }
#ovcase-host:empty { display: none; }
.modal.page-modal .modal-head, .modal.page-modal .modal-close-btn { display: none; }

/* ---------- top right: circular action buttons; name and role inside the account menu ---------- */
.top-right .icon-btn { width: 38px; height: 38px; border-radius: 999px; background: #F8FAFC; border: 1px solid #CBD5E1; color: #1E293B; transition: background .15s, border-color .15s, color .15s; }
.top-right .icon-btn:hover { background: var(--accent-soft); border-color: #BFDBFE; color: var(--accent); }
.top-right .icon-btn .ic { width: 18px; height: 18px; }
.menu-who { display: flex; align-items: center; gap: 8px; padding: 8px 12px 9px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu .avatar { width: 32px; height: 32px; background: var(--accent-soft); color: var(--accent); font-weight: 700; flex-shrink: 0; }

.ac-user-hint { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ---------- product modal: multi-ingredient world INN chip picker ---------- */
.full-col { grid-column: 1 / -1; }
.ing-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ing-chips:empty { display: none; }
.ing-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #BFDBFE; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.ing-chip small { color: var(--muted); font-weight: 500; }
.ing-chip button { border: 0; background: none; color: var(--accent-dark); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 999px; }
.ing-chip button:hover { background: #DBEAFE; color: var(--bad); }
.combo.ing-combo { width: 100%; }
.ing-combo .combo-list { max-height: 220px; }
.ing-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ing-opt-main { display: flex; flex-direction: column; min-width: 0; }
.ing-opt-en { font-weight: 700; color: var(--text); direction: ltr; text-align: start; }
.ing-opt-ar { font-size: 12px; color: var(--muted); }
.ing-opt-atc { flex-shrink: 0; font-size: 11px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.modal-sec { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin-bottom: 10px; background: #FAFBFD; }
.modal-sec-t { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); }
.bc-row { display: flex; gap: 8px; align-items: center; }
.bc-row .input { flex: 1; min-width: 0; }
.bc-row .btn { height: 34px; flex-shrink: 0; }
.ing-chip.bc-chip { background: #F1F5F9; color: #0F172A; border-color: #CBD5E1; font-family: Consolas, 'Cascadia Mono', monospace; direction: ltr; }

/* ---------- mobile staff dashboard (phones & small tablets) ---------- */
@media (max-width: 768px) {
  body:not(.rapp) { overflow-x: hidden; }
  .topbar {
    position: static;
    padding: 8px 12px;
    gap: 8px;
    min-height: 0;
    justify-content: space-between;
  }
  .brand-inline {
    padding-inline-end: 0;
    margin-inline-end: 0;
    border-inline-end: 0;
  }
  .brand-inline .brand-logo { height: 34px; }
  .top-right .icon-btn { width: 34px; height: 34px; }
  .topnav {
    order: 3;
    flex: 0 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 4px 0 2px;
    border-top: 1px solid var(--line-soft);
  }
  .topnav-item {
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    flex: 0 0 auto;
  }
  .filterbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .filterbar .combo,
  .filterbar #f-tenant,
  .filterbar #f-period,
  .filterbar .dates,
  .filterbar .search-wrap,
  .filterbar .btn-alert {
    width: 100%;
    max-width: 100%;
    margin-inline-start: 0;
  }
  .filterbar .dates { flex-wrap: wrap; }
  .filterbar .dates .input { flex: 1 1 120px; width: auto; min-width: 0; }
  .filterbar .search-wrap .input { width: 100%; flex: 1 1 auto; min-width: 0; }
  .content { padding: 10px 12px 32px; }
  .panel-head { padding: 9px 10px; gap: 6px; }
  .panel-end { margin-inline-start: 0; width: 100%; flex-wrap: wrap; }
  .panel-head .input,
  .panel-head .combo,
  .ov-filters .combo { width: 100% !important; max-width: 100%; flex: 1 1 180px; }
  .lanes { grid-template-columns: 1fr; padding: 10px; }
  .table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
  .t th, .t td { padding: 6px 8px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  #toast { inset-inline: 12px; max-width: none; }
}
@media (max-width: 520px) {
  .kpis, .kpis.kpis-6 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px; gap: 8px; }
  .kpi-ic { width: 32px; height: 32px; }
  .kpi-ic svg { width: 17px; height: 17px; }
  .kpi-t { font-size: 14px; }
  .kpi-s { font-size: 11px; }
  .src-row { flex-wrap: wrap; gap: 6px; }
}

/* ---------- reports per dosage form: a plain single-colour bar beside the printed number ---------- */
.fbar-cell { width: 34%; }
.fbar { display: block; height: 10px; background: #EEF1F5; border-radius: 2px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: #2A78D6; border-radius: 0 2px 2px 0; }
@media print { .fbar i { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
