:root {
  --g: #1a3c96;
  --gd: #122b6e;
  --ink: #1f2a37;
  --mut: #6b7686;
  --line: #dfe5ec;
  --bg: #f2f5f8;
  --card: #fff;
  --err: #d93025;
  --ok: #188038;
  --warn: #b06000;
  --soft: #e8eefb;
  --chip: #eef1f5;
  --card2: #f8fafc;
  --okbg: #e6f4ea;
  --errbg: #fdeceb;
  --warnbg: #fff3e0;
  --errfg: #c62828;
  --okfg: #137333;
  --warnfg: #b45309;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --g: #4f7df3;
  --gd: #3a63d6;
  --ink: #e7ecf4;
  --mut: #98a5b8;
  --line: #2a364b;
  --bg: #0e1522;
  --card: #172033;
  --err: #ff6b60;
  --ok: #5fd38a;
  --warn: #ffb74d;
  --soft: #1e2d52;
  --chip: #243049;
  --card2: #1b263b;
  --okbg: rgba(46, 160, 90, 0.18);
  --errbg: rgba(229, 57, 53, 0.18);
  --warnbg: rgba(242, 153, 0, 0.16);
  --errfg: #ff8a80;
  --okfg: #5fd38a;
  --warnfg: #ffb74d;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  font-family: Cairo, Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
header {
  background: var(--card);
  border-bottom: 4px solid var(--g);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding-top: env(safe-area-inset-top, 0);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hd {
  max-width: 900px;
  margin: auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hd .brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  flex: none;
}
.brand .t {
  line-height: 1.3;
  min-width: 0;
}
.brand .t b {
  display: block;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand .t span {
  color: var(--mut);
  font-size: 12px;
}
.hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.pill {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--g);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
}
.back {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: var(--soft);
  color: var(--g);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}
[dir='ltr'] .back svg {
  transform: scaleX(-1);
}
[dir='rtl'] .back svg {
  transform: none;
}
nav.bar {
  max-width: 900px;
  margin: 10px auto 0;
  padding: 0 16px;
  display: flex;
  justify-content: flex-start;
}
main {
  max-width: 900px;
  margin: 16px auto;
  padding: 0 16px 40px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.card h2,
.sec {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.hero {
  background: linear-gradient(135deg, var(--gd), var(--g));
  color: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.hero h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
}
.hero p {
  margin: 0;
  opacity: 0.92;
  line-height: 1.7;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.full {
  grid-column: 1/-1;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
label i {
  color: var(--err);
  font-style: normal;
}
label small {
  color: var(--mut);
  font-weight: 400;
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  transition: 0.15s;
}
input[type='checkbox'],
input[type='radio'] {
  width: auto;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(26, 60, 150, 0.15);
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.bad {
  border-color: var(--err) !important;
}
.ltr {
  direction: ltr;
}
[dir='rtl'] .ltr {
  text-align: right;
}
[dir='ltr'] .ltr {
  text-align: left;
}
.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  transition: 0.15s;
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-p {
  background: var(--g);
  color: #fff;
}
.btn-p:hover {
  background: var(--gd);
}
.btn-ghost {
  background: var(--chip);
  color: var(--ink);
}
.btn-ok {
  background: var(--okbg);
  color: var(--ok);
}
.btn-no {
  background: var(--errbg);
  color: var(--err);
}
.btn-rec {
  background: var(--errbg);
  color: var(--err);
}
.btn-rec.on {
  background: var(--err);
  color: #fff;
  animation: pulse 1.2s infinite;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}
.submit {
  width: 100%;
  font-size: 17px;
  padding: 14px;
  border-radius: 12px;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(217, 48, 37, 0.18);
  }
}
.msg {
  display: none;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.6;
}
.msg.err {
  display: block;
  background: var(--errbg);
  color: var(--err);
}
.msg.ok {
  display: block;
  background: var(--okbg);
  color: var(--ok);
}
.infobox {
  background: var(--card2);
  border: 1px solid #cfdcf7;
  border-radius: 12px;
  padding: 11px 14px;
  line-height: 1.8;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs button {
  flex: 1;
  min-width: max-content;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--mut);
  border-radius: 10px;
  cursor: pointer;
}
.tabs button.on {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.seg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seg input {
  display: none;
}
.seg label {
  margin: 0;
  flex: 1;
  min-width: max-content;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: var(--card);
}
.seg input:checked + label {
  background: var(--g);
  color: #fff;
  border-color: var(--g);
}
.pr {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.pr input {
  display: none;
}
.pr label {
  margin: 0;
  text-align: center;
  padding: 10px 4px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: var(--card);
}
.pr small {
  display: block;
  font-size: 11px;
  color: var(--mut);
  font-weight: 400;
}
.pr input:checked + label {
  color: #fff;
  border-color: transparent;
}
.pr input:checked + label small {
  color: #fff;
}
.pr .p1:checked + label {
  background: #d93025;
}
.pr .p2:checked + label {
  background: #f29900;
}
.pr .p3:checked + label {
  background: #0e8a7d;
}
.pr .p4:checked + label {
  background: #5f6b7a;
}
.rec {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--mut);
}
audio {
  width: 100%;
  margin-top: 10px;
}
.hint {
  color: var(--mut);
  font-size: 12.5px;
  margin-top: 8px;
  line-height: 1.7;
}
.sw {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.sw button {
  flex: 1;
  font: inherit;
  font-weight: 700;
  padding: 11px;
  border: 0;
  background: var(--card);
  color: var(--mut);
  cursor: pointer;
}
.sw button.on {
  background: var(--g);
  color: #fff;
}
.tk {
  display: inline-block;
  margin: 10px 0;
  padding: 10px 22px;
  background: var(--soft);
  color: var(--gd);
  border-radius: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  direction: ltr;
}
.center {
  text-align: center;
  padding: 30px 20px;
}
.ck {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--g);
  color: #fff;
  font-size: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.ico {
  font-size: 46px;
  margin-bottom: 6px;
}
/* الرئيسية */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 60, 150, 0.12);
}
.tile .ic {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.tile b {
  font-size: 15px;
  line-height: 1.35;
}
.tile small {
  color: var(--mut);
  font-size: 12px;
  line-height: 1.4;
}
.tile .bd {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  background: var(--err);
  color: #fff;
  border-radius: 20px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.c1 {
  background: var(--soft);
}
.c2 {
  background: var(--errbg);
}
.c3 {
  background: var(--warnbg);
}
.c4 {
  background: var(--okbg);
}
.c5 {
  background: #f1e8fb;
}
.c6 {
  background: #e3f4f7;
}
.c7 {
  background: var(--warnbg);
}
.c8 {
  background: #e9ecef;
}
/* قوائم */
.it {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
}
.it .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.it .id {
  font-weight: 800;
  direction: ltr;
  color: var(--gd);
}
.it .meta {
  color: var(--mut);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.it .ds {
  margin-top: 8px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 10px;
  background: var(--chip);
  color: var(--ink);
}
.chip.open,
.chip.new {
  background: var(--soft);
  color: var(--gd);
}
.chip.closed,
.chip.good {
  background: var(--okbg);
  color: var(--ok);
}
.chip.late,
.chip.bad {
  background: var(--errbg);
  color: var(--err);
}
.chip.pend {
  background: var(--warnbg);
  color: var(--warn);
}
.chip.p-طارئ {
  background: #d93025;
  color: #fff;
}
.chip.p-عالي {
  background: #f29900;
  color: #fff;
}
.chip.p-متوسط {
  background: #0e8a7d;
  color: #fff;
}
.chip.p-منخفض {
  background: #5f6b7a;
  color: #fff;
}
.urow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.urow .nm {
  min-width: 0;
  overflow-wrap: anywhere;
}
.acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.photos .ph {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--chip);
}
.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.photos .rm {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  line-height: 1;
}
.lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}
.lb img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
/* جولات */
.chk {
  display: flex;
  gap: 6px;
}
.chk button {
  flex: 1;
  font: inherit;
  font-weight: 700;
  padding: 9px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  cursor: pointer;
}
.chk button.yes.on {
  background: var(--okbg);
  border-color: var(--ok);
  color: var(--ok);
}
.chk button.no.on {
  background: var(--errbg);
  border-color: var(--err);
  color: var(--err);
}
.ri {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ri:first-child {
  border-top: 0;
}
.ri .lbl {
  font-weight: 600;
  margin-bottom: 6px;
}
.ri input.out {
  border-color: var(--err);
  background: var(--errbg);
}
.ri .rng {
  font-size: 12px;
  color: var(--mut);
  margin-top: 4px;
}
/* جداول */
.tw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
}
th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  white-space: nowrap;
}
th {
  background: var(--card2);
  color: var(--mut);
  font-weight: 700;
  font-size: 12.5px;
}
td.n,
th.n {
  text-align: center;
}
tr.tot td {
  font-weight: 800;
  background: var(--card2);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 640px) {
  .kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.kpi b {
  display: block;
  font-size: 22px;
  color: var(--gd);
}
.kpi span {
  color: var(--mut);
  font-size: 12.5px;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
}
.qrs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.qrc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  background: var(--card);
  break-inside: avoid;
}
.qrc svg {
  width: 100%;
  height: auto;
  max-width: 150px;
}
.qrc b {
  display: block;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.4;
}
.qrc small {
  display: block;
  color: var(--mut);
  font-size: 11px;
  margin-top: 2px;
}
footer {
  text-align: center;
  color: var(--mut);
  font-size: 12.5px;
  padding: 6px 0 30px;
}
@media (max-width: 600px) {
  .grid,
  .row2 {
    grid-template-columns: 1fr;
  }
  .pr {
    grid-template-columns: 1fr 1fr;
  }
}
@media print {
  header,
  .tabs,
  .noprint,
  footer,
  .back,
  .bar {
    display: none !important;
  }
  body {
    background: #fff;
  }
  main {
    margin: 0;
    max-width: none;
  }
  .card {
    box-shadow: none;
  }
}

/* ===== لوحة المدير ===== */

/* ===== التقرير المطبوع ===== */
body.rpt-open {
  overflow: hidden;
}
.rpt-ov {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #cfd8d2;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.rpt-ov * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.rpt-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 14px;
  background: #0b1a12;
  color: #e8f3ec;
}
.rpt-bar label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #86efac;
}
.rpt-bar select {
  background: #fff;
  min-width: 150px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 0;
}
.rpt-bar .btn {
  margin-inline-start: 0;
}
.rpt-out {
  padding: 14px;
}
.rpt-wait {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
  font-weight: 700;
}
.rpt-sheet {
  background: #fff;
  color: #0f1a14;
  max-width: 794px;
  margin: 0 auto;
  padding: 26px 28px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  line-height: 1.6;
}
.rpt-head {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 3px solid #16a34a;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.rpt-head img {
  width: 58px;
  height: 58px;
  border-radius: 12px;
}
.rpt-head .t {
  flex: 1;
  min-width: 0;
}
.rpt-head .t b {
  color: #15803d;
  font-size: 12.5px;
}
.rpt-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #0b1a12;
}
.rpt-head .s {
  color: #4b5f54;
  font-weight: 700;
  font-size: 12.5px;
}
.rpt-head .m {
  font-size: 11.5px;
  color: #4b5f54;
  text-align: end;
}
.rpt-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.rpt-kpis.small {
  grid-template-columns: repeat(4, 1fr);
}
.rpt-kpis .k {
  background: #f1f8f3;
  border: 1px solid #cfe6d6;
  border-top: 3px solid #16a34a;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rpt-kpis .k b {
  font-size: 20px;
  font-weight: 800;
  color: #0b1a12;
}
.rpt-kpis .k span {
  font-size: 11px;
  color: #4b5f54;
  font-weight: 700;
}
.rpt-sec {
  margin-bottom: 14px;
  break-inside: avoid;
}
.rpt-sec h2 {
  margin: 0 0 7px;
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  background: #0b1a12;
  padding: 5px 11px;
  border-radius: 6px;
  border-inline-start: 5px solid #22c55e;
}
.rpt-sec ul {
  margin: 0;
  padding-inline-start: 20px;
}
.rpt-sec li {
  margin-bottom: 3px;
}
.rpt-sec .sub,
.rpt-sec .none {
  color: #6b7f73;
  font-size: 12px;
  margin: 2px 0 6px;
}
.rpt-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rpt-leg {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #4b5f54;
  margin-bottom: 2px;
}
.rpt-leg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 5px;
}
.rpt-hb .r {
  display: grid;
  grid-template-columns: minmax(80px, 38%) 1fr 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px;
}
.rpt-hb .n {
  overflow-wrap: anywhere;
}
.rpt-hb .b {
  height: 10px;
  background: #e6efe9;
  border-radius: 5px;
  overflow: hidden;
  display: block;
}
.rpt-hb .b i {
  display: block;
  height: 100%;
  border-radius: 5px;
}
.rpt-hb b {
  text-align: end;
}
.rpt-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rpt-sheet th {
  background: #e3f1e7;
  color: #0b1a12;
  text-align: start;
  padding: 6px 8px;
  border-bottom: 2px solid #16a34a;
}
.rpt-sheet td {
  padding: 5px 8px;
  border-bottom: 1px solid #e3ebe6;
}
.rpt-sheet .n {
  text-align: center;
}
.rpt-sheet tbody tr:nth-child(even) {
  background: #f7fbf8;
}
.rpt-foot {
  display: flex;
  gap: 30px;
  margin-top: 26px;
}
.rpt-foot .sig {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #4b5f54;
}
.rpt-foot .sig i {
  display: block;
  height: 34px;
  border-bottom: 1.5px solid #0b1a12;
}
@media (max-width: 640px) {
  .rpt-sheet {
    padding: 16px 14px;
  }
  .rpt-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .rpt-two {
    grid-template-columns: 1fr;
  }
  .rpt-head {
    flex-wrap: wrap;
  }
}
@media print {
  @page {
    size: A4;
    margin: 11mm;
  }
  body.rpt-open > *:not(.rpt-ov) {
    display: none !important;
  }
  body.rpt-open {
    overflow: visible;
    background: #fff;
  }
  .rpt-ov {
    position: static;
    background: #fff;
    overflow: visible;
  }
  .rpt-bar {
    display: none !important;
  }
  .rpt-out {
    padding: 0;
  }
  .rpt-sheet {
    box-shadow: none;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  .rpt-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
  .rpt-two {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== نافذة مسار البلاغ ===== */
body.lc-open {
  overflow: hidden;
}
.lc-ov {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(31, 42, 55, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.lc-box {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 0 0 18px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}
@media (min-width: 640px) {
  .lc-ov {
    align-items: center;
    padding: 20px;
  }
  .lc-box {
    border-radius: 18px;
  }
}
.lc-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.lc-x {
  border: 0;
  background: var(--chip);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}
.lc-x:hover {
  background: var(--soft);
}
.lc-body {
  padding: 12px 16px 0;
}
.lc-body h3 {
  font-size: 13px;
  color: var(--g);
  margin: 18px 0 8px;
  font-weight: 800;
}
.lc-hint {
  font-size: 12.5px;
  color: var(--mut);
  margin-top: 8px;
}
.lc-hint.err {
  color: var(--err);
}
.lc-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.lc-ban {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  background: var(--card2);
}
.lc-ban b {
  font-size: 15px;
}
.lc-ban span {
  font-size: 12.5px;
  color: var(--mut);
}
.lc-ban.cur {
  border-color: #9db6ec;
  background: var(--soft);
}
.lc-ban.bad {
  border-color: #f2a39c;
  background: var(--errbg);
}
.lc-ban.bad b {
  color: var(--err);
}
.lc-ban.ok b {
  color: var(--ok);
}
.lc-tl {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lc-n {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
}
.lc-n::before {
  content: '';
  position: absolute;
  inset-inline-start: 11px;
  top: 24px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}
.lc-n.last::before {
  display: none;
}
.lc-b {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--chip);
  border: 2px solid #c9d2dd;
  box-sizing: border-box;
  z-index: 1;
}
.lc-c {
  min-width: 0;
  flex: 1;
}
.lc-l {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
}
.lc-l em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--g);
  color: #fff;
}
.lc-l em.g {
  background: var(--chip);
  color: var(--mut);
}
.lc-m {
  font-size: 12.5px;
  color: var(--mut);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.lc-n.s-pending .lc-l b,
.lc-n.s-nolog .lc-l b {
  color: #98a3b0;
  font-weight: 600;
}
.lc-n.s-done .lc-b {
  background: var(--ok);
  border-color: #7fc491;
  box-shadow: 0 0 0 3px rgba(24, 128, 56, 0.15);
}
.lc-n.s-done::before {
  background: var(--ok);
}
.lc-n.s-current .lc-b {
  background: var(--card);
  border-color: var(--g);
  animation: lcp 1.6s infinite;
}
.lc-n.s-late .lc-b {
  background: var(--errbg);
  border-color: var(--err);
  animation: lcr 1.4s infinite;
}
.lc-n.s-late .lc-l em {
  background: var(--err);
  color: #fff;
}
.lc-n.s-warn .lc-b {
  background: #f29900;
  border-color: #fbd38d;
  box-shadow: 0 0 0 3px rgba(242, 153, 0, 0.18);
}
.lc-n.s-nolog .lc-b {
  background: transparent;
  border-style: dashed;
  border-color: #b6c0cc;
}
@keyframes lcp {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 60, 150, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(26, 60, 150, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 60, 150, 0);
  }
}
@keyframes lcr {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(217, 48, 37, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lc-n .lc-b {
    animation: none !important;
  }
}
.lc-ackb {
  margin-top: 8px;
  border: 0;
  background: var(--g);
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.lc-ackb:hover {
  background: var(--gd);
}
.lc-ackb:disabled {
  opacity: 0.6;
}
.lc-det {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 12px;
}
.lc-r {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.lc-r:last-child {
  border: 0;
}
.lc-r span {
  font-size: 11.5px;
  color: var(--mut);
}
.lc-r p {
  margin: 2px 0 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.lc-r a {
  color: var(--g);
}
.lc-sr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.lc-sr .ph {
  font-weight: 700;
  font-size: 13px;
}
.lc-sr small {
  flex-basis: 100%;
  color: var(--mut);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.lc-sr .st {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--chip);
  color: var(--ink);
}
.lc-sr .st.ok {
  background: var(--okbg);
  color: var(--ok);
}
.lc-sr .st.bad {
  background: var(--errbg);
  color: var(--err);
}
.lc-sr .st.warn {
  background: var(--warnbg);
  color: var(--warn);
}
/* كروت المراقبة في لوحة المدير */

/* ===================== القائمة الجانبية ===================== */
.menu-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: var(--soft);
  color: var(--g);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
}
#side {
  display: none;
}
body.with-side #side {
  display: block;
  position: fixed;
  inset-inline-start: 0;
  top: var(--hh, 64px);
  bottom: 0;
  width: 250px;
  z-index: 30;
  overflow-y: auto;
  background: linear-gradient(180deg, #14306f, #0f2557);
  color: #dfe8fb;
  padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0));
  box-shadow: 2px 0 14px rgba(8, 20, 60, 0.18);
  direction: rtl;
}
[dir='rtl'] body.with-side #side {
  box-shadow: -2px 0 14px rgba(8, 20, 60, 0.18);
}
[dir='ltr'] body.with-side #side {
  direction: ltr;
}
.sd-g {
  margin-top: 14px;
}
.sd-h {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8da4d8;
  padding: 0 10px 6px;
  text-transform: uppercase;
}
.sd-i {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #dfe8fb;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.sd-i .ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 16px;
  flex: none;
}
.sd-i .tx {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-i:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sd-i.on {
  background: #fff;
  color: #14306f;
}
.sd-i.on .ic {
  background: var(--soft);
}
.sd-bd {
  background: var(--err);
  color: #fff;
  border-radius: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
#scrim {
  display: none;
}
@media (max-width: 959px) {
  body.with-side #side {
    top: 0;
    width: 272px;
    transform: translateX(-105%);
    transition: transform 0.22s;
    z-index: 50;
    padding-top: calc(14px + env(safe-area-inset-top, 0));
  }
  [dir='rtl'] body.with-side #side {
    transform: translateX(105%);
  }
  body.with-side.side-open #side,
  [dir='rtl'] body.with-side.side-open #side {
    transform: none;
  }
  body.with-side.side-open #scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 35, 0.55);
    z-index: 45;
  }
}
@media (min-width: 960px) {
  .menu-btn {
    display: none;
  }
  body.with-side header .hd,
  body.with-side nav.bar,
  body.with-side main,
  body.with-side footer {
    max-width: none;
    margin-inline-start: 250px;
    margin-inline-end: 0;
  }
  body.with-side header .hd {
    padding-inline-start: 20px;
  }
  body.with-side main {
    padding: 0 24px 40px;
    margin-top: 16px;
  }
  body.with-side #screen {
    max-width: 1400px;
    margin: auto;
  }
  body.with-side nav.bar {
    padding: 0 24px;
  }
  body.with-side footer {
    padding: 0 24px;
  }
}

/* ===================== أدوات عامة جديدة ===================== */
.clk {
  cursor: pointer;
}
.ta-ck {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ta-ck label {
  margin: 0;
  font-weight: 600;
  font-size: 13.5px;
}
.ch-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: #1f2a37;
  color: #fff;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  direction: inherit;
}
.ch-tip .tt {
  font-weight: 800;
  margin-bottom: 2px;
}
.ch-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--mut);
  margin-bottom: 6px;
}
.ch-leg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
}
.ch-none {
  color: var(--mut);
  text-align: center;
  padding: 36px 8px;
  font-size: 13px;
}
.ch-dn {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.ch-dl {
  flex: 1;
  min-width: 140px;
  display: grid;
  gap: 6px;
}
.ch-dl > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 4px;
  border-radius: 7px;
}
.ch-dl > div.clk:hover {
  background: var(--bg);
}
.ch-dl i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.ch-dl span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-dl b {
  font-variant-numeric: tabular-nums;
}
.ch-hb {
  display: grid;
  gap: 11px;
}
.ch-hb .r.clk:hover {
  background: var(--card2);
}
.ch-hb .t {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 4px;
}
.ch-hb .t span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-hb .trk {
  height: 8px;
  border-radius: 99px;
  background: var(--chip);
  overflow: hidden;
}
.ch-hb .trk i {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.ch-hb small {
  color: var(--mut);
  font-size: 11.5px;
}
.ch-col {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 170px;
}
.ch-col .c {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  min-width: 0;
}
.ch-col .c b {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.ch-col .bar {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ch-col .bar i {
  display: block;
  width: 70%;
  max-width: 34px;
  border-radius: 7px 7px 2px 2px;
}
.ch-col span {
  font-size: 11.5px;
  color: var(--mut);
}

/* ===================== لوحة المعلومات ===================== */
.in-wrap {
  display: grid;
  gap: 14px;
}
.in-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.in-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.in-p {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--mut);
  border-radius: 99px;
  cursor: pointer;
}
.in-p.on {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.in-sel {
  width: auto !important;
  min-width: 150px;
  padding: 8px 12px !important;
  font-size: 14px !important;
}
.in-upd {
  color: var(--mut);
  font-size: 12.5px;
  margin-inline-start: auto;
}
.in-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.in-t {
  position: relative;
  font: inherit;
  text-align: start;
  border: 0;
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 92px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.in-t:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}
.in-t b {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.in-t small {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.82;
  line-height: 1.35;
}
.in-t .ic {
  position: absolute;
  top: 10px;
  inset-inline-end: 12px;
  font-size: 22px;
  opacity: 0.72;
}
.in-t.y {
  background: #fbe27a;
}
.in-t.g {
  background: #b9e5a7;
}
.in-t.b {
  background: #a9c8f0;
}
.in-t.o {
  background: #f6a94f;
}
.in-t.p {
  background: #d0bdf2;
}
.in-t.r {
  background: #f2ae98;
}
.in-t.o2 {
  background: #f8c98f;
}
.in-t.dk {
  background: #c9d0d9;
}
.in-t.t {
  background: #a8e0d6;
}
.in-t.r2 {
  background: #f5b8c8;
}
.in-t.gr {
  background: #d9e8a2;
}
.in-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.in-k {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
}
.in-k small {
  color: var(--mut);
  font-weight: 700;
  font-size: 12.5px;
}
.in-k b {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.in-k span {
  color: var(--mut);
  margin-inline-start: 6px;
  font-size: 13px;
}
.in-row2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
.in-row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.in-c {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  min-width: 0;
}
.in-c h2 {
  margin: 0;
  font-size: 15.5px;
}
.in-s {
  color: var(--mut);
  font-size: 12.5px;
  margin: 2px 0 8px;
}
.in-cv {
  margin-top: 10px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .in-row3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 820px) {
  .in-row2,
  .in-row3 {
    grid-template-columns: 1fr;
  }
  .in-kpis {
    grid-template-columns: 1fr;
  }
  .in-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================== كل البلاغات ===================== */
.ta-wrap {
  display: grid;
  gap: 12px;
}
.ta-top {
  margin: 0;
}
.ta-r1 {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 10px;
}
.ta-bar2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.ta-sv {
  width: auto !important;
  min-width: 150px;
  padding: 7px 10px !important;
  font-size: 13.5px !important;
}
.ta-sv-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background: var(--soft);
  border-radius: 10px;
}
.ta-sv-box input[type='text'],
.ta-sv-box input:not([type]) {
  flex: 1;
  min-width: 160px;
}
.ta-adv {
  margin: 0;
}
.ta-g {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  gap: 14px;
}
.ta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ta-ch input {
  display: none;
}
.ta-ch label {
  margin: 0;
  padding: 5px 11px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
  cursor: pointer;
  background: var(--card);
}
.ta-ch input:checked + label {
  background: var(--g);
  color: #fff;
  border-color: var(--g);
}
.ta-scroll {
  max-height: 130px;
  overflow: auto;
  padding: 2px;
}
.ta-ck {
  margin-top: 12px;
}
.ta-meta {
  display: flex;
  justify-content: space-between;
  color: var(--mut);
  font-weight: 700;
  font-size: 13px;
}
.ta-tbl {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.ta-tr {
  display: grid;
  grid-template-columns: 150px 80px 130px 1fr 1.3fr 110px 112px 112px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--chip);
  font-size: 13.5px;
}
.ta-tr > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ta-th {
  background: var(--card2);
  font-weight: 800;
  color: var(--mut);
  font-size: 12.5px;
}
.ta-th .srt {
  cursor: pointer;
  user-select: none;
}
.ta-th .srt.on {
  color: var(--g);
}
.ta-row {
  cursor: pointer;
}
.ta-row:hover {
  background: #f6f9ff;
}
.ta-row.s-late {
  box-shadow: inset 4px 0 0 var(--err);
}
.ta-row.s-held {
  box-shadow: inset 4px 0 0 #f29900;
}
[dir='rtl'] .ta-row.s-late {
  box-shadow: inset -4px 0 0 var(--err);
}
[dir='rtl'] .ta-row.s-held {
  box-shadow: inset -4px 0 0 #f29900;
}
.ta-row .c-id {
  font-weight: 800;
  color: var(--gd);
  font-size: 12.5px;
}
.ta-row .c-desc {
  grid-column: 1/-1;
  color: var(--mut);
  font-size: 12.5px;
  white-space: nowrap;
}
.ta-sub {
  display: block;
  font-size: 11.5px;
  color: var(--mut);
  margin-top: 3px;
  white-space: normal;
}
.ta-sub.bad {
  color: var(--err);
}
.ta-pg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--mut);
  font-weight: 700;
  font-size: 13px;
}
@media (max-width: 1180px) {
  .ta-tr {
    grid-template-columns: 140px 70px 120px 1fr 1fr 100px;
  }
  .ta-tr .c-due,
  .ta-tr .c-at {
    display: none;
  }
}
@media (max-width: 860px) {
  .ta-r1 {
    grid-template-columns: 1fr;
  }
  .ta-g {
    grid-template-columns: 1fr;
  }
  .ta-th {
    display: none;
  }
  .ta-tr {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    padding: 12px 14px;
  }
  .ta-tr .c-id {
    grid-column: 1/-1;
  }
  .ta-tr .c-due,
  .ta-tr .c-at {
    display: block;
  }
  .ta-tr > span[data-l]::before {
    content: attr(data-l) ': ';
    color: var(--mut);
    font-size: 11.5px;
    font-weight: 700;
  }
  .ta-tr .c-id::before,
  .ta-tr .c-prio::before,
  .ta-tr .c-st::before {
    display: none;
  }
  .ta-row .c-desc {
    white-space: normal;
  }
}

/* ===================== تفاصيل البلاغ ===================== */
.td-ov {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 20, 45, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.td-box {
  width: 100%;
  max-width: 720px;
  max-height: 94vh;
  overflow: auto;
  background: var(--card2);
  color: var(--ink);
  border-radius: 18px 18px 0 0;
  padding: 0 0 22px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}
@media (min-width: 760px) {
  .td-ov {
    align-items: center;
  }
  .td-box {
    border-radius: 18px;
    max-height: 90vh;
  }
}
.td-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.td-x {
  border: 0;
  background: var(--chip);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}
.td-body {
  padding: 14px 16px 0;
}
.td-hint {
  color: var(--mut);
  font-size: 13px;
  padding: 10px 2px;
}
.td-hint.err {
  color: var(--err);
}
.td-flash {
  background: var(--errbg);
  color: var(--err);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-weight: 700;
}
.td-flash.ok {
  background: var(--okbg);
  color: var(--ok);
}
.td-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.td-ban {
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.td-ban span {
  font-size: 12.5px;
  opacity: 0.85;
}
.td-ban.held {
  background: var(--warnbg);
  color: #8a4b00;
  border: 1px solid #f6d49a;
}
.td-ban.late {
  background: var(--errbg);
  color: var(--err);
  border: 1px solid #f5c2be;
}
.td-ban.sol {
  background: var(--soft);
  color: var(--gd);
  border: 1px solid #c5d3f3;
}
.td-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.td-sel {
  width: auto !important;
  min-width: 170px;
  padding: 7px 10px !important;
  font-size: 13.5px !important;
}
.td-hold {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-basis: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.td-hold select,
.td-hold input {
  flex: 1;
  min-width: 150px;
  padding: 8px 10px;
  font-size: 14px;
}
.td-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 12px;
  overflow-x: auto;
}
.td-tabs button {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  background: none;
  color: var(--mut);
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.td-tabs button.on {
  color: var(--g);
  border-color: var(--g);
}
.td-tabs em {
  font-style: normal;
  font-size: 11px;
  background: var(--soft);
  color: var(--gd);
  border-radius: 99px;
  padding: 1px 7px;
  margin-inline-start: 6px;
}
.td-det {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 14px;
}
.td-r {
  padding: 9px 0;
  border-bottom: 1px solid var(--chip);
}
.td-r:last-child {
  border: 0;
}
.td-r span {
  font-size: 11.5px;
  color: var(--mut);
  font-weight: 700;
}
.td-r p {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.td-cm {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.td-c {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.td-c.int {
  background: var(--warnbg);
  border-color: #f3dfae;
}
.td-c .h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.td-c .h small {
  color: var(--mut);
}
.td-c .h em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  background: #f6d49a;
  color: #8a4b00;
  border-radius: 99px;
  padding: 1px 8px;
}
.td-c .h span {
  margin-inline-start: auto;
  color: var(--mut);
  font-size: 11.5px;
}
.td-c p {
  margin: 6px 0 0;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.td-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.td-form textarea {
  min-height: 70px;
}
.td-fr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.td-fr select {
  width: auto;
  min-width: 160px;
  padding: 8px 10px;
  font-size: 14px;
}
.td-fr .btn {
  margin-inline-start: auto;
}
.td-tk {
  display: grid;
  gap: 8px;
}
.td-t {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.td-t.done .tt b {
  text-decoration: line-through;
  color: var(--mut);
}
.td-t .tt {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.td-t .tm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}
.td-t .tm select {
  width: auto;
  padding: 5px 8px;
  font-size: 13px;
}
.td-t select.st-doing {
  border-color: #f29900;
}
.td-t select.st-done {
  border-color: var(--ok);
}
.td-t .mi {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto;
}
.td-t .mi input {
  width: 76px;
  padding: 5px 8px;
  font-size: 13px;
}
.td-del {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 15px;
}
.td-sol {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.td-sol p {
  margin: 0 0 6px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.td-sol small {
  color: var(--mut);
}
.td-sst {
  margin-top: 8px;
  font-weight: 800;
  font-size: 13px;
  border-radius: 9px;
  padding: 6px 10px;
  display: inline-block;
}
.td-sst.pending {
  background: var(--warnbg);
  color: #8a4b00;
}
.td-sst.approved {
  background: var(--okbg);
  color: var(--ok);
}
.td-sst.rejected {
  background: var(--errbg);
  color: var(--err);
}
.td-hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.td-hist li {
  position: relative;
  padding: 8px 14px 12px;
  border-inline-start: 2px solid var(--line);
  margin-inline-start: 6px;
  display: grid;
  gap: 2px;
}
.td-hist li::before {
  content: '';
  position: absolute;
  inset-inline-start: -6px;
  top: 11px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--g);
}
.td-hist li span {
  color: var(--mut);
  font-size: 12.5px;
}
.td-hist li small {
  color: #8b97a6;
  font-size: 11.5px;
}

/* ===================== الأتمتة ===================== */
.au-it.off {
  opacity: 0.65;
}
.au-it .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.au-ev {
  display: flex;
  gap: 8px;
}
.au-ev input {
  max-width: 100px;
}

/* ===== لوحة المراقبة: نفس ثيم لوحة المعلومات (فاتح، بطاقات بيضاء) ===== */
@keyframes dshp {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 128, 56, 0.45);
  }
  100% {
    box-shadow: 0 0 0 9px rgba(24, 128, 56, 0);
  }
}
.dsh-wrap {
  position: relative;
  display: grid;
  gap: 14px;
}
.dsh {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dsh-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dsh-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
}
.dsh-live i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  animation: dshp 1.6s infinite;
}
.dsh-live.live {
  background: var(--okbg);
  color: var(--ok);
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid #cfe8d6;
}
.dsh-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dsh-p {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--mut);
  border-radius: 99px;
  cursor: pointer;
}
.dsh-p.on {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.dsh-sel {
  width: auto !important;
  min-width: 150px;
  max-width: 190px;
  padding: 8px 12px !important;
  font-size: 14px !important;
  margin-inline-start: auto;
}
.dsh-print {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--g);
  border-radius: 10px;
  cursor: pointer;
}
.dsh-print:hover {
  background: var(--soft);
}
.dsh-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.dsh-k {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.dsh-k::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--g);
}
.dsh-k .l {
  font-size: 12.5px;
  color: var(--mut);
  font-weight: 700;
}
.dsh-k .v {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 6px 0 3px;
}
.dsh-k .v b {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dsh-k .v span {
  font-size: 13px;
  color: var(--mut);
  font-weight: 700;
}
.dsh-k .d {
  font-size: 12px;
  color: var(--mut);
  min-height: 15px;
  line-height: 1.4;
}
.dsh .ring {
  --sz: 76px;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  margin: 8px 0 4px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--chip) 0);
  flex: none;
}
.dsh .ring b {
  width: calc(var(--sz) - 14px);
  height: calc(var(--sz) - 14px);
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}
.dsh-c {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  min-width: 0;
}
.dsh-c h2 {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}
.dsh-s {
  font-size: 12.5px;
  color: var(--mut);
  margin-bottom: 8px;
}
.dsh-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.dsh-cv {
  position: relative;
  width: 100%;
  margin-top: 8px;
  overflow: hidden;
}
.dsh-cv svg rect.bar-in {
  transition: opacity 0.15s;
}
.dsh-w {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: 12px;
  padding: 9px 12px;
  margin-top: 9px;
}
.dsh-w .t {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.dsh-w .m {
  font-size: 12px;
  color: var(--mut);
  margin: 3px 0 6px;
  overflow-wrap: anywhere;
}
.dsh .bar {
  height: 6px;
  border-radius: 4px;
  background: #e6ebf1;
  overflow: hidden;
}
.dsh .bar div {
  height: 100%;
  border-radius: 4px;
}
.dsh-hint {
  color: var(--mut);
  font-size: 13px;
  padding: 6px 0;
}
.dsh-tr {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.dsh-tr.hd {
  border: 0;
  font-size: 12px;
  color: var(--mut);
  font-weight: 700;
}
.dsh-tr span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dsh-tr .n {
  flex: none;
  width: 48px;
  text-align: center;
}
.dsh-tr em {
  font-style: normal;
  background: var(--soft);
  color: var(--gd);
  border-radius: 20px;
  padding: 1px 9px;
  font-weight: 800;
}
.dsh-f {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.dsh-f i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 8px;
}
.dsh-f .tx {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.dsh-f small {
  flex: none;
  font-size: 12px;
  color: var(--mut);
}
.dsh-tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: #1f2a37;
  color: #fff;
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.dsh-tip .tt {
  color: #fff;
  font-weight: 800;
}
.dsh-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mut);
  margin: 4px 0 6px;
}
.dsh-leg.c {
  justify-content: center;
  margin-top: 10px;
}
.dsh-leg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
}
.dsh-hb .r {
  padding: 8px 8px 7px;
  margin: 0 -8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.dsh-hb .r.clk {
  cursor: pointer;
}
.dsh-hb .r.clk:hover {
  background: var(--card2);
}
.dsh-hb .r.sel {
  background: var(--soft);
  outline: 1.5px solid var(--g);
}
.dsh-hb .t {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.dsh-hb .t span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.dsh-hb .trk {
  height: 8px;
  border-radius: 99px;
  background: var(--chip);
  overflow: hidden;
  margin-top: 5px;
}
.dsh-hb .trk i {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s;
}
.dsh-hb small {
  display: block;
  font-size: 11.5px;
  color: var(--mut);
  margin-top: 3px;
}
.dsh-w.clk,
.dsh-f.clk,
.dsh-o.clk {
  cursor: pointer;
}
.dsh-w.clk:hover,
.dsh-o.clk:hover {
  background: #f2f6fd;
}
.dsh-f.clk:hover .tx {
  text-decoration: underline;
}
.dsh-o {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: 12px;
  padding: 9px 12px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.dsh-o .m {
  font-size: 12px;
  color: var(--mut);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.dsh-o b {
  font-size: 13.5px;
}
.dsh-o .go {
  color: var(--g);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.dsh-srch {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.dsh-srch input {
  flex: 1;
  min-width: 0;
  direction: ltr;
  text-align: start;
  font-size: 14px;
  padding: 9px 12px;
}
.dsh-srch button {
  border: 0;
  background: var(--g);
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
}
.dsh-srch button:hover {
  background: var(--gd);
}
.dsh-sms {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.dsh-sms .nums {
  flex: 1;
  min-width: 160px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.dsh-sms .nums b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.dsh-sys {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--card2);
  font-size: 14px;
  line-height: 1.7;
}
.dsh-sys.ok {
  border-color: #cfe8d6;
  background: #f1faf3;
}
.dsh-sys.warn {
  border-color: #f6c667;
  background: var(--warnbg);
}
.dsh-sys.bad {
  border-color: #f2a39c;
  background: var(--errbg);
}
@media (max-width: 600px) {
  .dsh-sel {
    margin-inline-start: 0;
    max-width: none;
    flex: 1;
  }
  .dsh-k .v b {
    font-size: 24px;
  }
}

/* ===== المستودع ===== */
.st-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.st-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.st-tabs button.on {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.st-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.st-bar select,
.st-bar input {
  width: auto;
  flex: 1;
  min-width: 140px;
}
.st-dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mut);
}
.st-dt input {
  min-width: 130px;
}
.st-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.st-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.st-tile span {
  font-size: 20px;
}
.st-tile b {
  font-size: 26px;
  line-height: 1.1;
  color: var(--g);
}
.st-tile small {
  color: var(--mut);
  font-size: 12.5px;
}
.st-tile.warn {
  border-color: #f6d28a;
  background: var(--warnbg);
}
.st-tile.warn b {
  color: #b06a00;
}
.st-tile.bad {
  border-color: #f3b6b0;
  background: var(--errbg);
}
.st-tile.bad b {
  color: var(--err, #d93025);
}
.st-alarm {
  background: var(--errbg);
  border: 1px solid #f3b6b0;
  color: #a52714;
  font-weight: 800;
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  animation: stp 2.2s ease-in-out infinite;
}
.st-okb {
  background: var(--okbg);
  border: 1px solid #bfe3c9;
  color: #146c2e;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
@keyframes stp {
  50% {
    box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.12);
  }
}
.st-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-inline-start: 5px solid #188038;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
}
.st-row.low {
  border-inline-start-color: #f29900;
  background: var(--warnbg);
}
.st-row.out {
  border-inline-start-color: #d93025;
  background: var(--errbg);
}
.st-row.off {
  opacity: 0.55;
}
.st-main b {
  font-size: 15px;
}
.st-q {
  text-align: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.st-q b {
  font-size: 22px;
  color: var(--ink);
}
.st-row.out .st-q b {
  color: var(--errfg);
}
.st-row.low .st-q b {
  color: #b06a00;
}
.st-q small {
  color: var(--mut);
  font-size: 12px;
}
.st-acts {
  grid-column: 1/-1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.st-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--okbg);
  color: #146c2e;
}
.st-chip.low {
  background: var(--warnbg);
  color: #8a5200;
}
.st-chip.out {
  background: var(--errbg);
  color: #a52714;
}
.st-chip.k-receive,
.st-chip.k-return {
  background: var(--okbg);
  color: #146c2e;
}
.st-chip.k-issue {
  background: var(--errbg);
  color: #a52714;
}
.st-chip.k-adjust {
  background: var(--soft);
  color: var(--g);
}
.st-neg {
  color: var(--errfg);
  font-weight: 800;
}
.st-pos {
  color: var(--okfg);
  font-weight: 800;
}
.st-form .grid {
  margin-top: 8px;
}
.st-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: var(--soft);
  color: var(--g);
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 10px;
}
.st-pill .x {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
}
@media (max-width: 600px) {
  .st-tiles {
    gap: 8px;
  }
  .st-tile b {
    font-size: 22px;
  }
  .st-row {
    grid-template-columns: 1fr;
  }
  .st-q {
    align-items: flex-start;
    text-align: start;
  }
}
/* تلميحات الرسوم التفاعلية */
.mt-tip {
  position: fixed;
  z-index: 9999;
  background: #1a2b4d;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  pointer-events: none;
  max-width: 280px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  direction: rtl;
}
svg.chart rect[data-tip]:hover {
  fill: #2e86c1;
}
svg.chart circle[data-tip]:hover {
  filter: brightness(1.15);
}
svg.chart circle.hit {
  cursor: pointer;
}
svg.chart circle.hit:hover {
  fill: rgba(26, 60, 150, 0.12);
}
svg.chart circle[stroke]:hover {
  stroke-width: 8.6;
}
[data-tip] {
  cursor: default;
}

/* ===== الطوارئ ===== */
.em-mode {
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef3fb;
  color: #1a3a8a;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 14px;
}
.em-mode.live {
  background: #fdeceb;
  color: #b3261e;
}
.em-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.em-t {
  font: inherit;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  cursor: pointer;
}
.em-t .ic {
  font-size: 22px;
}
.em-t.on {
  border-color: #c62828;
  background: #fdeceb;
  color: #8e1b1b;
}
.em-sos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
}
.em-hold {
  --c: #e53935;
  --cg: rgba(229, 57, 53, 0.55);
  position: relative;
  width: 176px;
  height: 176px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: #fff;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.em-hold[data-s='2'] {
  --c: #22c55e;
  --cg: rgba(34, 197, 94, 0.6);
}
.em-hold[data-s='3'] {
  --c: #ff1f1f;
  --cg: rgba(255, 31, 31, 0.75);
}
.em-hold .em-halo {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cg) 0%, transparent 68%);
  opacity: 0.55;
  animation: emBreath 2.6s ease-in-out infinite;
  pointer-events: none;
}
.em-hold .em-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.em-hold .em-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 5;
}
.em-hold .em-prog {
  fill: none;
  stroke: var(--c);
  stroke-width: 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px var(--c));
  transition: stroke 0.25s;
}
.em-hold .em-core {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 32% 26%, #ff8a80 0%, #e53935 38%, #7f0d0d 100%);
  box-shadow:
    0 10px 26px rgba(150, 0, 0, 0.5),
    inset 0 2px 6px rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35);
  transition:
    background 0.25s,
    transform 0.15s;
}
.em-hold[data-s='2'] .em-core {
  background: radial-gradient(circle at 32% 26%, #a7f3c1 0%, #22c55e 40%, #0b5a27 100%);
  box-shadow:
    0 10px 26px rgba(0, 120, 50, 0.5),
    inset 0 2px 6px rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.3);
}
.em-hold[data-s='3'] .em-core {
  background: radial-gradient(circle at 32% 26%, #ffb3a0 0%, #ff1f1f 40%, #6b0000 100%);
}
.em-hold.go .em-core {
  transform: scale(0.92);
}
.em-hold.go .em-halo {
  animation: none;
  opacity: 0.9;
}
.em-hold .em-ico {
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
  transition:
    opacity 0.15s,
    transform 0.2s;
}
.em-hold .em-num {
  position: absolute;
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.em-hold.go .em-ico {
  opacity: 0;
  transform: scale(0.6);
}
.em-hold.go .em-num {
  opacity: 1;
}
.em-hold .em-num.pop {
  animation: emPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.em-hold .em-p {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  pointer-events: none;
  animation: emP 0.65s ease-out forwards;
}
.em-hold.done .em-core {
  animation: emDone 0.65s ease-out;
}
.em-hold.done::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--c);
  animation: emWave 0.65s ease-out forwards;
  pointer-events: none;
}
.em-sos .em-hl {
  font-size: 14px;
  font-weight: 700;
  color: var(--mut, #9aa6c8);
  letter-spacing: 0.2px;
  text-align: center;
}
.em-hold:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 6px;
}
.em-hold.shake {
  animation: emsh 0.35s;
}
@keyframes emsh {
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}
@keyframes emBreath {
  50% {
    transform: scale(1.12);
    opacity: 0.85;
  }
}
@keyframes emPop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes emP {
  to {
    transform: translate(var(--x), var(--y)) scale(0.2);
    opacity: 0;
  }
}
@keyframes emDone {
  0% {
    filter: brightness(2.2);
  }
  100% {
    filter: none;
  }
}
@keyframes emWave {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .em-hold .em-halo,
  .em-hold .em-p {
    animation: none;
  }
  .em-hold .em-num.pop {
    animation: none;
  }
  .em-hold.done::after {
    animation: none;
    opacity: 0;
  }
}
.em-ov {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(120, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: emfl 1s infinite;
}
.em-ov.conf {
  background: rgba(20, 20, 30, 0.88);
  animation: none;
}
@keyframes emfl {
  0%,
  100% {
    background: rgba(120, 0, 0, 0.97);
  }
  50% {
    background: rgba(200, 20, 20, 0.97);
  }
}
.em-bd {
  width: min(520px, 100%);
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.em-bd.dr .em-h {
  background: #f9a825;
  color: #3a2a00;
}
.em-ov.conf .em-bd {
  background: #fff;
  color: #1b1b1b;
  border-radius: 18px;
  padding: 22px;
}
.em-h {
  font-size: 22px;
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  color: #b3261e;
}
.em-ov.conf .em-h {
  background: #fdeceb;
}
.em-ic {
  font-size: 72px;
  line-height: 1;
}
.em-tp {
  font-size: 30px;
  font-weight: 900;
}
.em-wh {
  font-size: 19px;
  font-weight: 700;
}
.em-nt {
  font-size: 16px;
  opacity: 0.95;
}
.em-by {
  font-size: 14px;
  opacity: 0.9;
}
.em-cnt {
  font-size: 20px;
  font-weight: 800;
  color: #b3261e;
}
.em-ack {
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  padding: 18px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #1b5e20;
  cursor: pointer;
}
.em-snd {
  font: inherit;
  font-weight: 800;
  padding: 12px;
  border: 2px solid #fff;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.em-ov.conf .em-snd {
  border-color: #c62828;
  color: #c62828;
}
.em-more {
  font-weight: 800;
}
.em-ok {
  border-color: #2e7d32;
  background: #f1f8f2;
}
.em-card {
  border-inline-start: 5px solid #c62828;
}
.em-card.dr {
  border-inline-start-color: #f9a825;
}
.em-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.em-ic2 {
  font-size: 32px;
}

/* ===== جرس الإشعارات ===== */
.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line, var(--line));
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.15s;
}
.bell:hover {
  background: rgba(26, 60, 150, 0.08);
}
.bell[hidden] {
  display: none;
}
.bell-ic {
  display: flex;
}
.bell.has .bell-ic {
  animation: bellRing 2.4s ease-in-out infinite;
  transform-origin: 50% 10%;
}
.bell-n {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--card, #fff);
  box-sizing: content-box;
}
.bell-n[hidden] {
  display: none;
}
@keyframes bellRing {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  66% {
    transform: rotate(14deg);
  }
  72% {
    transform: rotate(-12deg);
  }
  78% {
    transform: rotate(9deg);
  }
  84% {
    transform: rotate(-6deg);
  }
  90% {
    transform: rotate(0);
  }
}
.bell-p {
  position: fixed;
  z-index: 8800;
  top: calc(var(--hh, 58px) + 6px);
  inset-inline-end: 12px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - var(--hh, 58px) - 24px));
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  color: var(--ink, #1f2a37);
  border: 1px solid var(--line, var(--line));
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(10, 20, 60, 0.28);
  overflow: hidden;
  animation: bpIn 0.18s ease-out;
}
.bell-p[hidden] {
  display: none;
}
@keyframes bpIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}
.bell-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line, var(--line));
}
.bell-all {
  border: 0;
  background: none;
  color: var(--g, #1a3c96);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.bell-all:hover {
  background: rgba(26, 60, 150, 0.08);
}
.bell-l {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bell-i {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: start;
  border: 0;
  border-bottom: 1px solid var(--line, #e6eaf5);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
}
.bell-i:hover {
  background: rgba(26, 60, 150, 0.06);
}
.bell-i .ic {
  font-size: 22px;
  flex: 0 0 auto;
}
.bell-i .tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bell-i .tx b {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.75;
}
.bell-i.un .tx b {
  font-weight: 800;
  opacity: 1;
}
.bell-i small {
  color: var(--mut, #6b7686);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: start;
}
.bell-i em {
  font-style: normal;
  font-size: 11px;
  color: var(--mut, #6b7686);
  flex: 0 0 auto;
}
.bell-i .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1a73e8;
  flex: 0 0 auto;
}
.bell-i.un {
  background: rgba(26, 115, 232, 0.07);
}
.bell-none {
  padding: 34px 16px;
  text-align: center;
  color: var(--mut, #6b7686);
}
.bell-toast {
  position: fixed;
  z-index: 9500;
  top: calc(var(--hh, 58px) + 10px);
  inset-inline: 12px;
  margin: auto;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  border: 0;
  border-radius: 14px;
  background: #1a3c96;
  color: #fff;
  font: inherit;
  padding: 13px 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  animation: bpIn 0.25s ease-out;
}
.bell-toast .ic {
  font-size: 24px;
}
.bell-toast .tx {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bell-toast small {
  opacity: 0.85;
  direction: ltr;
  text-align: start;
}
/* ===== التقييم داخل التطبيق + أزرار المسار ===== */
.rt-ov {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(10, 18, 40, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rt-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card, #fff);
  color: var(--ink, #1f2a37);
  border-radius: 20px;
  padding: 28px 20px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-top: 5px solid var(--g, #1a3c96);
  animation: bpIn 0.2s ease-out;
}
.rt-x {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
}
.rt-tk {
  display: inline-block;
  direction: ltr;
  font-weight: 800;
  background: #1a3c9618;
  color: var(--g, #1a3c96);
  border-radius: 8px;
  padding: 3px 12px;
  margin-bottom: 6px;
}
.rt-ic {
  font-size: 54px;
}
.rt-st {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 4px;
  direction: ltr;
  margin: 14px 0 4px;
}
.rt-st button {
  background: none;
  border: 0;
  font-size: 50px;
  line-height: 1;
  color: #c5cbe0;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.12s;
}
.rt-st button:hover,
.rt-st button:hover ~ button,
.rt-st button.on,
.rt-st button.on ~ button {
  color: #f9a825;
}
.rt-st button:active {
  transform: scale(1.2);
}
.rt-lb {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--mut, #6b7686);
  padding: 0 8px;
}
.lc-act {
  margin-top: 10px;
  border: 0;
  background: linear-gradient(135deg, #f9a825, #ef6c00);
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(239, 108, 0, 0.35);
  display: block;
  animation: actPulse 2s ease-in-out infinite;
}
@keyframes actPulse {
  50% {
    transform: scale(1.04);
  }
}
.lc-wait {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
}
.lc-tel {
  color: var(--g, #1a3c96);
  font-weight: 700;
  text-decoration: none;
}
.rate-chip {
  border: 0;
  background: #f9a825;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .bell.has svg,
  .lc-act {
    animation: none;
  }
}

/* ===== تقرير المناوب ===== */
.sf-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sf-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 6px solid var(--dc, var(--line));
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.sf-rh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sf-rh > span {
  display: flex;
  gap: 6px;
}
.sf-ic {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
}
.sf-ic.del {
  color: var(--err);
}
.sf-g {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.sf-f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sf-f.w2 {
  grid-column: 1/-1;
}
.sf-f label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
}
.sf-f input,
.sf-f select,
.sf-f textarea {
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 900px) {
  .sf-g {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sf-f.w2 {
    grid-column: span 2;
  }
}
.sf-tm {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sf-tm input {
  flex: 1;
  min-width: 0;
}
.sf-now {
  border: 0;
  background: var(--soft);
  color: var(--g);
  font-weight: 800;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.sf-st {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sf-st button {
  flex: 1;
  min-width: max-content;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.sf-st .s-done.on {
  background: #188038;
  border-color: #188038;
  color: #fff;
}
.sf-st .s-progress.on {
  background: #f9a825;
  border-color: #f9a825;
  color: var(--ink);
}
.sf-st .s-postponed.on {
  background: #6b7686;
  border-color: #6b7686;
  color: #fff;
}
.sf-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
  flex-wrap: wrap;
}
.sf-bar .sp {
  flex: 1;
}
.sf-cnt {
  font-weight: 800;
  color: var(--g);
}
.sf-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.chip-btn:hover {
  background: var(--soft);
  border-color: var(--g);
}
.sf-all {
  width: 100%;
  margin: 10px 0;
}
.sf-pl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sf-p {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
}
.sf-p.no {
  opacity: 0.6;
}
.sf-p .nm {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sf-p .nm small {
  color: var(--mut);
  direction: ltr;
  text-align: start;
}
.sf-p .ct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--g);
}

/* ===== الطوارئ: تصميم الخطوات ===== */
.em-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef3fb, #e2ebfa);
  color: #1a3a8a;
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid #cddaf3;
}
.em-mode.live {
  background: linear-gradient(135deg, #fdeceb, #fbd9d6);
  color: #b3261e;
  border-color: #f3b8b4;
  animation: emLive 2s ease-in-out infinite;
}
.em-md {
  font-size: 22px;
}
@keyframes emLive {
  50% {
    box-shadow: 0 0 0 5px rgba(198, 40, 40, 0.15);
  }
}
.em-step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.em-step.need {
  border-color: #c62828;
  box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.22);
  animation: emsh 0.4s;
}
.em-sh {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
}
.em-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--g);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.em-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 700px) {
  .em-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.em-t {
  position: relative;
  font: inherit;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
  min-height: 96px;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  cursor: pointer;
  transition:
    transform 0.12s,
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
  color: var(--ink);
}
.em-t:hover {
  border-color: #e57373;
}
.em-t:active {
  transform: scale(0.96);
}
.em-t .ic {
  font-size: 36px;
  line-height: 1;
}
.em-t .nm {
  font-size: 14px;
}
.em-t .ck {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c62828;
  color: #fff;
  font-style: normal;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
}
.em-t.on {
  border-color: #c62828;
  background: linear-gradient(160deg, #fff5f4, #fdd9d6);
  color: #8e1b1b;
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.25);
  transform: translateY(-2px);
}
.em-t.on .ck {
  display: flex;
}
.em-gps {
  width: 100%;
  border: 2px dashed #7aa2f0;
  background: #f3f7ff;
  color: #1a3a8a;
  font: inherit;
  font-weight: 800;
  border-radius: 12px;
  padding: 13px;
  cursor: pointer;
}
.em-gps.ok {
  border-style: solid;
  border-color: #188038;
  background: #e8f5ec;
  color: #136a2d;
}
.em-gps:disabled {
  opacity: 0.7;
}
.em-gs {
  margin-top: 6px;
  font-size: 13px;
  color: var(--mut);
}
.em-det label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--mut);
}
.em-sev {
  display: flex;
  gap: 8px;
}
.em-sev button {
  flex: 1;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}
.em-sev .sv-limited.on {
  background: #f9a825;
  border-color: #f9a825;
  color: #1f2a37;
}
.em-sev .sv-major.on {
  background: #ef6c00;
  border-color: #ef6c00;
  color: #fff;
}
.em-sev .sv-critical.on {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}
.em-step2 {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  direction: ltr;
}
.em-step2 button {
  width: 52px;
  height: 46px;
  border: 0;
  background: var(--soft);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  color: var(--g);
}
.em-step2 button:active {
  background: #d3dffa;
}
.em-in {
  min-width: 64px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}
.em-cnt2 {
  display: block;
  text-align: end;
  color: var(--mut);
  margin-top: 2px;
}
.em-ck {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.ck-i {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
}
.ck-i.ok {
  background: var(--okbg);
  color: #136a2d;
}
.ck-i.no {
  background: var(--errbg);
  color: var(--errfg);
}
.ck-i.warn {
  background: var(--warnbg);
  color: #8a5a00;
}
.em-sos.off .em-core {
  filter: grayscale(0.85) brightness(0.9);
}
.em-sos.off .em-halo {
  opacity: 0.15;
  animation: none;
}
.em-sos.off .em-hl {
  color: #b3261e;
}
.em-xs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}
.em-x {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.em-x.sev {
  border: 0;
  color: #fff;
}
.em-x.inj {
  background: #fff;
  color: #8e1b1b;
}
.em-card .em-xs {
  justify-content: flex-start;
}
.em-card .em-x {
  background: #f3f4f8;
  color: var(--ink);
  border-color: var(--line);
}
.em-card .em-x.sev {
  color: #fff;
  border: 0;
}
.em-okic {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #188038;
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  animation: emPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.em-ov.conf .em-x {
  background: #f3f4f8;
  color: #1f2a37;
  border-color: #dfe5ec;
}
.em-ov.conf .em-x.sev {
  color: #fff;
  border: 0;
}
.it[style*='--dc'] {
  border-inline-start: 5px solid var(--dc);
}
.dc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.dc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 8px;
  background: var(--card);
}
.dc-sw {
  flex: 1;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.dc-row input {
  width: 42px;
  height: 36px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

/* ===== لوحة المراقبة اللحظية ===== */
.lv {
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lv-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(120deg, #122b6e, #1a3c96 45%, #5b3fd1);
  box-shadow: 0 10px 26px rgba(26, 60, 150, 0.28);
}
.lv-h1 {
  font-size: 20px;
  font-weight: 800;
}
.lv-date {
  opacity: 0.85;
  font-size: 13px;
  margin-top: 2px;
}
.lv-hr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.lv-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 99px;
  font-weight: 800;
}
.lv-badge i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #69f0ae;
  animation: dshp 1.6s infinite;
}
.lv-btn {
  font: inherit;
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
}
.lv-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.lv-t {
  position: relative;
  color: #fff;
  border-radius: 18px;
  padding: 16px 16px 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}
.lv-t .ic {
  position: absolute;
  inset-inline-end: 12px;
  top: 10px;
  font-size: 30px;
  opacity: 0.35;
}
.lv-t .v {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}
.lv-t .l {
  font-weight: 800;
  font-size: 14px;
  margin-top: 2px;
}
.lv-t .s {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
  min-height: 16px;
}
.t-blue {
  background: linear-gradient(135deg, #3b6ee0, #6a4be0);
}
.t-green {
  background: linear-gradient(135deg, #00a152, #26c6a0);
}
.t-amber {
  background: linear-gradient(135deg, #f9a825, #fb6a00);
}
.t-teal {
  background: linear-gradient(135deg, #00897b, #4db6ac);
}
.t-red {
  background: linear-gradient(135deg, #d32f2f, #ff5252);
}
.lv-t.pulse {
  animation: lvpulse 1.8s infinite;
}
@keyframes lvpulse {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(211, 47, 47, 0.18),
      0 8px 24px rgba(211, 47, 47, 0.5);
  }
}
.lv-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.lv-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.lv-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  min-width: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.lv-card h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}
.lv-sub {
  color: var(--mut);
  font-size: 12px;
  margin-bottom: 8px;
}
.lv-sidecards {
  display: grid;
  gap: 14px;
  grid-template-rows: 1fr 1fr;
}
.lv-mini {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lv-big {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
}
.lv-leg {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 4px;
}
.lv-leg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 5px;
}
.lv-bar,
.lv-pr {
  margin: 9px 0;
}
.lv-bar .t {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
}
.trk {
  height: 9px;
  background: var(--chip);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.trk i {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s;
}
.lv-pr {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 4px 8px;
  align-items: center;
  font-weight: 700;
  font-size: 13.5px;
}
.lv-pr > i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.lv-pr .trk {
  grid-column: 1/-1;
}
.lv-ops {
  display: grid;
  gap: 9px;
}
.lv-o {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
}
.lv-o .ic {
  font-size: 22px;
}
.lv-o > div {
  flex: 1;
  min-width: 0;
}
.lv-o .l {
  font-weight: 800;
  font-size: 13.5px;
}
.lv-o .s {
  font-size: 11.5px;
  opacity: 0.8;
}
.lv-o b {
  font-size: 24px;
}
.o-blue {
  background: var(--soft);
  color: var(--g);
}
.o-teal {
  background: #e0f4f1;
  color: #00695c;
}
.o-amber {
  background: var(--warnbg);
  color: var(--warnfg);
}
.o-ok {
  background: var(--okbg);
  color: var(--okfg);
}
.o-warn {
  background: var(--warnbg);
  color: var(--warnfg);
}
.o-bad {
  background: var(--errbg);
  color: var(--errfg);
  animation: lvpulse 1.4s infinite;
}
.lv-f {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.lv-f:last-child {
  border: 0;
}
.lv-f i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.lv-f .tx {
  flex: 1;
  min-width: 0;
}
.lv-f small {
  color: var(--mut);
  white-space: nowrap;
}
.lv-f.clk {
  cursor: pointer;
}
.lv-none {
  color: var(--mut);
  text-align: center;
  padding: 14px 0;
  font-size: 13px;
}
.lv-sys {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}
.lv-sys.ok {
  background: var(--okbg);
  color: var(--okfg);
}
.lv-sys.warn {
  background: var(--warnbg);
  color: var(--warnfg);
}
.lv-sys.bad {
  background: var(--errbg);
  color: var(--errfg);
}
.lv-srch {
  display: flex;
  gap: 6px;
}
.lv-srch input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.lv-srch button {
  font: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  background: var(--g);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}
@media (max-width: 820px) {
  .lv-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lv-row,
  .lv-row3 {
    grid-template-columns: 1fr;
  }
  .lv-sidecards {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
  }
  .lv-t .v {
    font-size: 32px;
  }
}

/* مجموعات القائمة القابلة للطي */
.sd-tg {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-align: start;
  color: inherit;
}
.sd-tg span {
  flex: 1;
}
.sd-ar {
  font-style: normal;
  transition: transform 0.2s;
  opacity: 0.7;
}
.sd-g.shut .sd-ar {
  transform: rotate(90deg);
}
[dir='rtl'] .sd-g.shut .sd-ar {
  transform: rotate(90deg);
}
.sd-cnt {
  font-style: normal;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 0 7px;
  min-width: 18px;
  text-align: center;
}
.sd-g.shut .sd-bx {
  display: none;
}
.hm-h {
  font-weight: 800;
  font-size: 14px;
  color: var(--g);
  margin: 18px 2px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hm-h::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ===== المشتريات ===== */
.pu-h {
  font-size: 15px;
  font-weight: 800;
  margin: 16px 2px 8px;
}
.pu-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
}
.pu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.pu-chip {
  font-size: 12px;
  font-weight: 800;
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--mut);
  font-size: 12.5px;
  margin-top: 4px;
}
.pu-note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
}
.pu-note.smp {
  background: #f3e5f5;
  color: #6a1b9a;
}
.pu-note.ans {
  background: #e3f2fd;
  color: #0d47a1;
}
.pu-note.rej {
  background: var(--errbg);
  color: #a52714;
}
.pu-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pu-b {
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}
.pu-b.pri {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.pu-b.dng {
  color: var(--errfg);
  border-color: #f0b9b4;
}
.pu-b.smp {
  color: #6a1b9a;
  border-color: #d9b3e2;
}
.pu-b:disabled {
  opacity: 0.5;
}
.pu-form {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  gap: 8px;
}
.pu-form label {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
}
.pu-form input,
.pu-form select,
.pu-form textarea {
  font: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.pu-empty {
  color: var(--mut);
  text-align: center;
  padding: 18px 0;
}
.pu-log {
  margin-top: 8px;
  font-size: 12.5px;
}
.pu-log summary {
  cursor: pointer;
  color: var(--g);
  font-weight: 700;
}
.pu-ev {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.pu-ev i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g);
  flex: none;
}
.pu-ev span {
  flex: 1;
}
.pu-ev small {
  color: var(--mut);
}
.pu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pu-filters select {
  font: inherit;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

/* اقتراحات وشكاوى + حقوق */
.fb-link {
  display: none;
  font-size: 11px;
  color: var(--mut);
  text-decoration: underline;
  margin-inline-start: 10px;
}
body.with-side .fb-link {
  display: inline;
}
.fb-ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fb-box {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.fb-box h3 {
  margin: 0 0 4px;
}

/* الرئيسية: شبكة متصلة (اقتراح A) */
.hero-r {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hkp {
  display: flex;
  gap: 10px;
}
.hk {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 16px;
  text-align: center;
  min-width: 72px;
}
.hk b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}
.hk span {
  font-size: 12px;
  opacity: 0.9;
}
.hk.warn {
  background: rgba(217, 48, 37, 0.55);
}
.lg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.lg span,
.lg .gchip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  color: #fff;
  transition: opacity 0.15s;
}
.lg .gchip {
  font-size: 13px;
  padding: 6px 14px;
}
.tiles-a {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.tiles-a .tile {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 14px 16px;
  border-inline-start: 5px solid var(--g, #1a3c96);
}
.tile .tx {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tiles-a .tile .ic {
  flex: none;
}
.wm {
  display: flex;
  justify-content: center;
  padding: 48px 0 24px;
  pointer-events: none;
  user-select: none;
}
.wm img {
  width: min(260px, 60%);
  opacity: 0.12;
  filter: grayscale(0.3);
}
.em-ov:not(.conf) .em-snd {
  font-size: 20px;
  padding: 18px;
  background: #fff;
  color: #c62828;
  animation: emPulse 1s infinite;
}
@keyframes emPulse {
  50% {
    transform: scale(1.04);
  }
}

/* ===== الوضع الداكن: تفاصيل إضافية ===== */
:root[data-theme='dark'] body {
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme='dark'] input,
:root[data-theme='dark'] select,
:root[data-theme='dark'] textarea {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme='dark'] input::placeholder,
:root[data-theme='dark'] textarea::placeholder {
  color: var(--mut);
}
:root[data-theme='dark'] header {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
:root[data-theme='dark'] .lv-card,
:root[data-theme='dark'] .in-c,
:root[data-theme='dark'] .in-k {
  box-shadow: none;
}
:root[data-theme='dark'] img.qr,
:root[data-theme='dark'] .qrc img {
  background: #fff;
  padding: 6px;
  border-radius: 8px;
}
.theme-btn {
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
}

/* ===== ترتيب الشاشة بالسحب والإفلات (لوحة المراقبة + لوحة المعلومات) ===== */
.dg {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  grid-auto-flow: row dense;
}
.dw {
  position: relative;
  min-width: 0;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
}
.dw > .dw-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dw > .dw-body > * {
  flex: 1;
}
.dw[data-sp='3'] {
  grid-column: span 3;
}
.dw[data-sp='4'] {
  grid-column: span 4;
}
.dw[data-sp='6'] {
  grid-column: span 6;
}
.dw[data-sp='8'] {
  grid-column: span 8;
}
.dw[data-sp='12'] {
  grid-column: span 12;
}
.dw[hidden] {
  display: none;
}
.dw-ctl {
  display: none;
}
.dg.editing .dw {
  outline: 2px dashed var(--g);
  outline-offset: 3px;
  border-radius: 18px;
}
.dg.editing .dw-ctl {
  display: flex;
  position: absolute;
  z-index: 5;
  top: 6px;
  inset-inline-end: 6px;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.dw-ctl button {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dw-ctl .dw-grab {
  cursor: grab;
  touch-action: none;
  background: var(--g);
  color: #fff;
}
.dw-ctl button:hover {
  filter: brightness(1.1);
}
.dg.editing .dw-body {
  pointer-events: none;
  user-select: none;
}
.dw.dragging {
  opacity: 0.35;
}
.dw-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  overflow: hidden;
  transform: rotate(1.2deg);
}
.dg-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 4px;
}
.dg-bar .dg-b {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.dg-bar .dg-b.on {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.dg-hid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--mut);
}
.dg-hid button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px dashed var(--g);
  background: transparent;
  color: var(--g);
  cursor: pointer;
}
@media (max-width: 820px) {
  .dg {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .dw,
  .dw[data-sp] {
    grid-column: span 6;
  }
  .dw[data-sp='3'] {
    grid-column: span 3;
  }
}
.hk-b {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.12s,
    filter 0.12s;
}
.hk-b:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}
.hk-b:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===== Sidebar v2: grouped navigation with roadmap tags ===== */
.sd-soon {
  cursor: default;
  opacity: 0.6;
  pointer-events: none;
}
.sd-soon .ic {
  opacity: 0.5;
}
.sd-tag {
  margin-inline-start: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--soft);
  color: var(--g);
}
.sd-tag-addon {
  background: #fff3d6;
  color: #7a5200;
}
.sd-h {
  letter-spacing: 0.02em;
}
.sd-soon .tx {
  font-size: 12.5px;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* ===== Sidebar v2 skin: light surface, quiet group headers, soft active row =====
   Prefixed with `html` so it wins over the older dark rules in app.css/customize.css. */
html body.with-side #side {
  background: var(--card);
  color: var(--ink);
  border-inline-end: 1px solid var(--line);
  box-shadow: none;
  padding-top: 8px;
}
html body.with-side #side .sd-g {
  margin-top: 6px;
}
html body.with-side #side .sd-h {
  padding: 10px 12px 6px;
  color: var(--mut);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
html body.with-side #side .sd-i {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
html body.with-side #side .sd-i .ic {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  font-size: 15px;
  filter: grayscale(0.6);
}
html body.with-side #side .sd-i:hover {
  background: var(--chip);
}
html body.with-side #side .sd-i.on {
  background: var(--soft);
  color: var(--g);
}
html body.with-side #side .sd-i.on .ic {
  background: transparent;
  filter: none;
}
html body.with-side #side .sd-cnt {
  background: var(--chip);
  color: var(--mut);
}
html body.with-side #side .sd-soon .tx {
  color: var(--mut);
}
html body.with-side #side .sd-tag {
  background: var(--chip);
  color: var(--mut);
}
html body.with-side #side .sd-tag-addon {
  background: var(--warnbg);
  color: var(--warnfg);
}

/* ===== Icons and quick theme picker ===== */
.gi {
  display: block;
}
.pill .gi {
  margin: auto;
}
.qt-pop {
  position: fixed;
  z-index: 80;
  width: 232px;
  padding: 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(8, 20, 60, 0.18);
}
.qt-h {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
  margin-bottom: 10px;
}
.qt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.qt-sw {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--card);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.qt-sw[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--g);
}
.qt-cu {
  background: conic-gradient(
    #e5546d,
    #e07a2a,
    #f2c94c,
    #2fa37a,
    #22a5b8,
    #4f7df3,
    #9b6fe0,
    #e5546d
  );
  overflow: hidden;
}
.qt-cu input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.qt-more {
  margin-top: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.qt-more:hover {
  background: var(--chip);
}

/* ===== Assets and preventive maintenance (m-assets.js) ===== */
.as-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.as-bar input[type='search'] {
  flex: 1 1 240px;
  min-width: 0;
}
.as-bar select {
  width: auto;
  min-width: 140px;
}
.as-table {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.as-tr {
  display: grid;
  grid-template-columns: 110px minmax(160px, 2fr) 1fr 1.4fr 110px 90px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.as-tr.ppm {
  grid-template-columns: minmax(180px, 2fr) 120px 1fr 110px 110px 150px;
}
.as-tr:last-child {
  border-bottom: 0;
}
.as-th {
  background: var(--card2);
  color: var(--mut);
  font-size: 12.5px;
  font-weight: 700;
}
.as-row {
  cursor: pointer;
}
.as-row:hover {
  background: var(--chip);
}
.as-row.off {
  opacity: 0.65;
}
.as-row small {
  display: block;
  color: var(--mut);
}
.as-rowact {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.as-form .as-actions,
.as-det .as-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.as-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-weight: 500;
}
.as-chk input {
  width: auto;
}
.as-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}
.as-head h2 {
  margin: 0 0 4px;
}
.as-code {
  color: var(--mut);
  margin-bottom: 8px;
}
.as-qr {
  width: 150px;
  text-align: center;
}
.as-qr small {
  display: block;
  color: var(--mut);
  font-size: 11.5px;
  line-height: 1.4;
}
.as-kvs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 20px;
  margin-top: 14px;
}
.as-kv span {
  display: block;
  color: var(--mut);
  font-size: 12.5px;
}
.as-li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.as-li:last-child {
  border-bottom: 0;
}
.as-click {
  cursor: pointer;
}
@media (max-width: 760px) {
  .as-th {
    display: none;
  }
  .as-tr,
  .as-tr.ppm {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .as-tr [data-l]::before {
    content: attr(data-l) ': ';
    color: var(--mut);
    font-size: 12px;
  }
  .as-rowact {
    justify-content: flex-start;
  }
}
.as-print {
  display: none;
}
.as-lbl {
  width: 62mm;
  padding: 4mm;
  border: 1px solid #000;
  text-align: center;
  color: #000;
  font-family: sans-serif;
}
.as-lbl b,
.as-lbl span,
.as-lbl small {
  display: block;
  margin-top: 1mm;
}
@media print {
  body.as-printing > *:not(.as-print) {
    display: none !important;
  }
  body.as-printing .as-print {
    display: block;
  }
}

/* ===== "Powered by GyroFix" footer line ===== */
.pw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--mut);
  font-size: 12px;
}
.pw img {
  display: block;
}

/* ===== Work board (m-workboard.js) ===== */
.wb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.wb-top h1 {
  margin: 0;
  font-size: 22px;
}
.wb-sp {
  flex: 1;
}
.wb {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - var(--hh, 64px) - 130px);
  min-height: 460px;
}
.wb-list,
.wb-detail {
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.wb-list {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}
.wb-detail {
  overflow: auto;
  background: var(--card2);
}
.wb-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wb-sel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wb-sel select {
  min-width: 0;
}
.wb-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.wb-tab {
  flex: 1;
  padding: 9px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--mut);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wb-tab.on {
  color: var(--g);
  border-bottom-color: var(--g);
}
.wb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wb-chip {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.wb-chip.on {
  background: var(--soft);
  border-color: var(--g);
  color: var(--g);
  font-weight: 700;
}
.wb-count {
  color: var(--mut);
}
.wb-items {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wb-it {
  --pc: var(--mut);
  display: block;
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--pc);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.wb-it:hover {
  background: var(--chip);
}
.wb-it.on {
  background: var(--soft);
  border-color: var(--g);
  border-inline-start-color: var(--pc);
}
.wb-p-urg {
  --pc: var(--err);
}
.wb-p-high {
  --pc: #e07a2a;
}
.wb-p-med {
  --pc: #d9a400;
}
.wb-p-low {
  --pc: var(--ok);
}
.wb-t {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.wb-s {
  color: var(--mut);
  font-size: 12px;
  margin-top: 2px;
}
.wb-m {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--mut);
}
.wb-pr {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
}
.wb-pr i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc);
}
.wb-none {
  padding: 24px 8px;
  text-align: center;
  color: var(--mut);
}
.wb-empty {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--mut);
  opacity: 0.85;
}
.wb-empty img {
  opacity: 0.55;
}
.td-box.td-inline {
  max-width: none;
  max-height: none;
  min-height: 100%;
  border-radius: 0;
  box-shadow: none;
  background: var(--card2);
}
@media (max-width: 899px) {
  .wb {
    grid-template-columns: 1fr;
    height: auto;
  }
  .wb-list {
    max-height: none;
  }
  .wb-items {
    overflow: visible;
  }
  .wb.wb-show .wb-list,
  .wb:not(.wb-show) .wb-detail {
    display: none;
  }
}
.wb-filters input,
.wb-sel select {
  height: 38px;
  padding: 6px 10px;
  font-size: 14px;
}
