/* =====================================================================
   insights.css — لوحة التحكم بمستوياتها، صفحة التنبيهات، وإضافات الجدول المشترك
   (ترتيب بالكيبورد، الأعمدة والعروض، زر «فتح»، نطاق التحديد). بالألوان والمقاسات العامة من tokens.css فقط.
   ===================================================================== */

/* ---------- لوحة التحكم: ثلاثة مستويات ---------- */
.dash-level { margin-bottom: 22px; }
.dash-level-t { font-size: var(--fs-md, 15px); font-weight: 700; color: var(--text-2); margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.dash-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid.dash-grid-ex { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } /* what needs action first: on top on a phone */
.dash-grid > .dash-wide { min-width: 0; }
.dash-ex { color: inherit; text-decoration: none; background: none; border-inline: 0; border-top: 0; cursor: pointer; font: inherit; }
.dash-ex:hover { background: var(--surface-hover); text-decoration: none; }
.dash-ex .dash-ex-n { font-size: 15px; color: var(--text); min-width: 2ch; text-align: center; }
.dash-alert-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.dash-alert-link:hover { text-decoration: none; }
.dash-groups { display: flex; flex-direction: column; gap: 10px; }
.dash-group { padding: 0; }
.dash-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; min-height: 44px; border-radius: var(--r-lg); }
.dash-group > summary::-webkit-details-marker { display: none; }
.dash-group > summary:hover { background: var(--surface-hover); }
.dash-group-t { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dash-group > summary .card-meta { margin-inline-start: auto; }
.dash-chev { color: var(--muted); transition: transform .15s var(--ease, ease); }
.dash-group[open] .dash-chev { transform: rotate(180deg); }
.dash-group-b { padding: 4px 18px 18px; }
.dash-payroll { display: block; margin-bottom: 10px; }
@media (max-width: 1180px) { .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid, .dash-grid.dash-grid-ex { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .dash-quick .btn { flex: 1 1 calc(50% - 8px); justify-content: center; min-height: 44px; }
  .dash-group > summary { padding: 12px 14px; flex-wrap: wrap; }
  .dash-group > summary .card-meta { margin-inline-start: 0; flex-basis: 100%; order: 3; }
  .dash-group-b { padding: 4px 12px 14px; }
}

/* ---------- الجدول المشترك ---------- */
table.t th .th-sort { all: unset; display: inline-flex; align-items: center; gap: 3px; cursor: pointer; border-radius: 4px; color: inherit; font: inherit; }
table.t th .th-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
table.t th.sortable { cursor: default; }
table.t td .t-acts { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.t-view-btn { white-space: nowrap; }
.t-views { padding: 6px 4px; min-width: 260px; max-width: 320px; }
.t-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 4px 8px 6px; }
.t-cols .check { font-size: 13px; display: flex; align-items: center; gap: 6px; min-height: 32px; }
.t-view-list { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.t-view-row { display: flex; align-items: center; gap: 4px; }
.t-view-row .btn { justify-content: flex-start; }
.t-view-none { padding: 2px 10px 6px; }
.t-view-save { display: flex; gap: 6px; padding: 6px 8px 4px; }
.t-view-save .input { height: 32px; font-size: 13px; }
.t-views .hint { padding: 2px 8px 4px; color: var(--muted); }
.t-bulk { align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.t-bulk .t-scope { color: var(--text-2); font-size: 12.5px; }
.toolbar .t-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.toolbar .page-actions .t-date .input { min-width: 0; width: 150px; }

/* ---------- التنبيهات ---------- */
.alerts-kpis { margin-bottom: 16px; }
.alert-msg { white-space: normal; display: block; min-width: 240px; color: var(--text); }
.alert-now { white-space: normal; min-width: 170px; }
.alert-now .sub { display: block; }
table.t tr.alert-new td:first-child { box-shadow: inset -3px 0 0 var(--info); }
.alert-detail .timeline { margin-top: 6px; }
