/* ARIDO Dishdasha — the home screen's figures, the alerts screen and the reports (SPEC §10, §11) */

/* ───────── home: period chips and the dashboard tiles ───────── */
.dash-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.dash-kpis { transition: opacity .15s; }
@media (min-width: 1280px) { .dash-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dash-kpis.busy, .report-kpis.busy, .card.busy { opacity: .6; }
.kpi .k-c b { font-weight: 700; }
.kpi.skeleton { min-height: 96px; background: linear-gradient(90deg, #F3F1EB 0%, #FBFAF7 50%, #F3F1EB 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* the share of the first part (wholesale, cash) of a two-part figure, drawn under its value */
.split-bar { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-bottom: 2px; }
.split-bar i { display: block; height: 100%; background: var(--sky-2); border-radius: 3px; }
.kpi.teal .split-bar i { background: var(--teal); }

.rank-list { padding: 4px 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text); border-bottom: 1px solid var(--border-2); }
.rank-row:last-child { border-bottom: 0; }
a.rank-row[href]:hover { background: var(--row); color: var(--text); }
.rank-row .rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-2); font-weight: 800; flex: none; font-size: 12.5px; }
.rank-row .grow { min-width: 0; }
.rank-bar { display: block; height: 4px; border-radius: 2px; background: var(--border-2); margin-top: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--sky-2); border-radius: 2px; }
.tbl tr.cancelled td { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(185, 28, 28, .45); }
.tbl tr.cancelled td .doc-status { text-decoration: none; }

/* ───────── alerts screen ───────── */
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }
.fchip svg { width: 15px; height: 15px; color: var(--muted); }
.fchip:hover { background: var(--hover); }
.fchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.fchip.on svg, .fchip.on .muted { color: #CFE3F7; }
.alert-row.page-row { cursor: default; align-items: center; }
.alert-row.page-row .acts { display: flex; gap: 6px; flex: none; }
.alert-row.resolved .sev { background: #EEF2F6; color: var(--faint); }
.alert-row.resolved .t { color: var(--muted); }

/* ───────── reports: cards by group ───────── */
.report-group { margin-bottom: 18px; }
.report-group .section-t { font-size: 14.5px; margin: 10px 0 10px; }
.report-group .section-t svg { width: 18px; height: 18px; color: var(--sky-2); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.report-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); color: var(--text); box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.report-card:hover { border-color: var(--sky-light); box-shadow: var(--shadow-md); color: var(--text); }
.report-card .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-2); flex: none; }
.report-card .ic svg { width: 22px; height: 22px; }
.report-card .grow { min-width: 0; display: flex; flex-direction: column; }
.report-card .t { font-weight: 700; color: var(--ink); }
.report-card .s { font-size: 12px; color: var(--muted); line-height: 1.45; }
.report-card .go { width: 18px; height: 18px; color: var(--faint); flex: none; }
.report-card.locked { cursor: not-allowed; opacity: .6; box-shadow: none; }
.report-card.locked .ic { background: #EEF2F6; color: var(--muted); }

/* ───────── reports: the report view (a ruled table, like the printed one) ───────── */
.report-filters .field > label { font-size: 12.5px; }
.report-kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.report-kpis .kpi .k-ico { width: 36px; height: 36px; }
.report-kpis .kpi .k-ico svg { width: 18px; height: 18px; }
.report-kpis .kpi .k-v { font-size: 21px; }
.report-tbl { border-collapse: collapse; }
.report-tbl th, .report-tbl td { border-inline-start: 1px solid var(--border-2); }
.report-tbl th:first-child, .report-tbl td:first-child { border-inline-start: 0; }
.report-tbl thead th { background: var(--navy-2); color: #fff; border-bottom: 0; border-inline-start-color: rgba(255, 255, 255, .15); }
.report-tbl td.code, .report-tbl th.code { text-align: center; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-weight: 600; }
.report-tbl td.num { font-variant-numeric: tabular-nums; }
.report-tbl tbody tr:nth-child(even) td { background: #FCFBF8; }
.report-tbl tbody tr:hover td { background: var(--sky-soft); }
.report-tbl tr.neg td { color: var(--amber); }
.report-tbl tfoot td { background: #E8EEF6; color: var(--navy); border-top: 2px solid var(--navy-3); }
/* the chart is drawn by coordinates: left to right inside, so ECharts places its labels where it measured them (the axes themselves are
   inverted for right to left); its tooltip is Arabic again */
.chart-box { direction: ltr; }
.report-notes { padding: 10px 14px; border-top: 1px solid var(--border-2); line-height: 1.7; }

@media (max-width: 760px) {
  .dash-bar .seg { flex: 1 1 100%; }
  .dash-bar .seg button { flex: 1; padding: 0 8px; }
  .report-cards { grid-template-columns: 1fr; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters .field { min-width: 0 !important; flex: 1 1 100%; }
  .report-filters .date-in { width: 100%; }
  .alert-row.page-row { flex-wrap: wrap; }
  .alert-row.page-row .acts { width: 100%; justify-content: flex-end; }
  [data-report-view] .ph .actions { width: 100%; }
  [data-report-view] .ph .actions .btn { flex: 1; padding: 0 10px; }
}
