/* Ported from the prototype's admin.css — kept in the 'legacy' cascade layer so Tailwind utilities can override it. */
@layer legacy {
/* =========================================================
   الأترجة — لوحة الإدارة
   The workspace's identity (dashboard.css tokens: ivory page,
   forest ink, sage, muted gold, hairline borders, soft shadows),
   tuned for operational work: a long collapsible sidebar, a
   quiet topbar, denser tables, compact filters and forms.
   Loaded after dashboard.css · student.css · extras.css.
   ========================================================= */

.ad{
  --side-w: 288px;
  --top-h: 72px;
  --row-h: 72px;
  --ad-gold-ink:#8A6A24;
  background:var(--pg);
}
.ad .db-main{ margin-inline-start:var(--side-w); min-height:100vh; display:flex; flex-direction:column; }
.ad .db-page{ flex:1; padding:24px 32px 40px; }

/* =========================================================
   SIDEBAR
   ========================================================= */
.cp-side{
  position:fixed; inset-block:0; right:0; z-index:40;
  width:var(--side-w);
  display:flex; flex-direction:column;
  background:var(--side);
  border-inline-start:1px solid var(--line);
}
.cp-side-head{ flex:none; padding:20px 20px 14px; }
.cp-brand{ display:flex; align-items:center; gap:10px; }
.cp-brand img{ height:40px; width:auto; display:block; }
.cp-brand-tag{ margin-inline-start:auto; padding:3px 9px; border-radius:99px; font-size:11.5px; font-weight:600; color:var(--ink-2); background:rgba(255,253,248,.7); border:1px solid var(--line); }
.cp-me{ display:flex; align-items:center; gap:10px; margin-top:16px; padding:10px 12px; border-radius:16px; background:rgba(255,253,248,.72); border:1px solid var(--line); }
.cp-me-av{ display:grid; place-items:center; width:38px; height:38px; flex:none; border-radius:12px; font-weight:700; color:#FFFDF8; background:var(--ink); }
.cp-me b{ display:block; font-size:14px; font-weight:600; line-height:1.4; }
.cp-me small{ display:block; font-size:12px; color:var(--ink-3); direction:ltr; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-me > span:last-child{ min-width:0; }

.cp-nav{ flex:1; overflow-y:auto; padding:4px 12px 20px; scrollbar-width:thin; scrollbar-color:rgba(18,60,53,.18) transparent; }
.cp-nav-h{ margin:18px 12px 6px; font-size:11.5px; font-weight:700; letter-spacing:.02em; color:var(--ink-3); }
.cp-nav ul{ margin:0; padding:0; list-style:none; }
.cp-link, .cp-grp > button{
  display:flex; align-items:center; gap:11px; width:100%;
  min-height:42px; padding:0 12px; border:0; border-radius:12px;
  font:inherit; font-size:14.5px; font-weight:500; text-align:right;
  color:var(--ink); background:none; cursor:pointer;
  transition:background .2s, color .2s;
}
.cp-link svg, .cp-grp > button svg{ width:19px; height:19px; flex:none; color:var(--ink-2); }
.cp-link:hover, .cp-grp > button:hover{ background:rgba(255,253,248,.7); }
.cp-grp > button .cp-chev{ margin-inline-start:auto; width:16px; height:16px; color:var(--ink-3); transition:transform .25s var(--ease); }
.cp-grp.is-open > button .cp-chev{ transform:rotate(180deg); }
.cp-grp.has-active > button{ font-weight:600; }
.cp-grp.has-active > button > svg:first-child{ color:var(--gold-deep); }
.cp-sub{ display:none; margin:2px 0 6px; padding-inline-start:22px; position:relative; }
.cp-grp.is-open .cp-sub{ display:block; }
.cp-sub::before{ content:""; position:absolute; top:4px; bottom:4px; right:21px; width:1px; background:var(--line-2); }
.cp-sub a{ display:flex; align-items:center; gap:8px; min-height:36px; padding:0 14px; border-radius:10px; font-size:13.5px; color:var(--ink-2); }
.cp-sub a:hover{ color:var(--ink); background:rgba(255,253,248,.7); }
.cp-link.is-active, .cp-sub a.is-active{ color:#FFFDF8; background:var(--ink); font-weight:600; }
.cp-link.is-active svg{ color:var(--gold); }
.cp-sub a.is-active::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--gold); }
.cp-side-foot{ flex:none; padding:12px 20px 16px; border-top:1px solid var(--line); font-size:12px; color:var(--ink-3); }

/* =========================================================
   TOPBAR
   ========================================================= */
.cp-top{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:16px;
  height:var(--top-h); padding:0 32px;
  background:rgba(247,244,236,.86); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.cp-top-t{ min-width:0; }
.cp-crumbs{ display:flex; align-items:center; gap:6px; margin:0; padding:0; list-style:none; font-size:12.5px; color:var(--ink-3); }
.cp-crumbs li + li::before{ content:"/"; margin-inline-end:6px; color:var(--line-2); }
.cp-crumbs a:hover{ color:var(--ink); }
.cp-top h1{ font-size:20px; font-weight:700; line-height:1.4; }
.cp-top-acts{ display:flex; align-items:center; gap:8px; margin-inline-start:auto; }
.cp-ib{
  position:relative; display:grid; place-items:center; width:42px; height:42px;
  border:1px solid var(--line); border-radius:13px; background:var(--card); color:var(--ink); cursor:pointer;
  transition:border-color .2s, box-shadow .2s;
}
.cp-ib:hover{ border-color:var(--line-2); box-shadow:0 8px 18px -14px rgba(18,60,53,.6); }
.cp-ib svg{ width:19px; height:19px; }
/* the count sits on the button corner, not over the bell (a two-digit count covered the icon) */
.cp-dot{ position:absolute; top:-6px; inset-inline-end:-6px; min-width:17px; height:17px; padding:0 4px; border-radius:99px; font-size:10.5px; font-weight:700; line-height:17px; text-align:center; color:#FFFDF8; background:var(--red); box-shadow:0 0 0 2px var(--card); }
.cp-pop{
  position:absolute; top:calc(100% + 8px); left:0; z-index:50;
  width:min(380px, calc(100vw - 32px)); max-height:min(480px, 70vh); overflow:auto;
  padding:8px; border-radius:18px; border:1px solid var(--line); background:var(--card);
  box-shadow:0 30px 60px -30px rgba(7,31,26,.45);
  animation:db-pop .2s var(--ease);
}
.cp-pop-h{ display:flex; align-items:center; justify-content:space-between; padding:8px 10px 10px; font-size:14px; font-weight:700; }
.cp-pop a, .cp-pop button.cp-pop-i{
  display:flex; align-items:flex-start; gap:10px; width:100%; padding:10px; border:0; border-radius:12px;
  font:inherit; font-size:13.5px; line-height:1.6; text-align:right; color:var(--ink); background:none; cursor:pointer;
}
.cp-pop a:hover, .cp-pop button.cp-pop-i:hover{ background:#F6F2E8; }
.cp-pop a svg, .cp-pop button.cp-pop-i svg{ width:18px; height:18px; margin-top:2px; flex:none; color:var(--gold-deep); }
.cp-pop small{ display:block; font-size:12px; color:var(--ink-3); }
.cp-pop .is-on{ font-weight:700; }
.cp-pop .is-danger{ color:var(--red); }
.cp-pop .is-danger svg{ color:var(--red); }
.cp-pop hr{ margin:6px 4px; border:0; border-top:1px solid var(--line); }
.cp-pop-empty{ padding:24px 12px; text-align:center; font-size:13.5px; color:var(--ink-3); }
.cp-wrap{ position:relative; }
.cp-av{ display:flex; align-items:center; gap:8px; height:42px; padding:0 6px 0 10px; border:1px solid var(--line); border-radius:13px; background:var(--card); cursor:pointer; font:inherit; color:var(--ink); }
.cp-av span{ display:grid; place-items:center; width:30px; height:30px; border-radius:10px; font-size:13px; font-weight:700; color:#FFFDF8; background:var(--ink); }
.cp-av svg{ width:15px; height:15px; color:var(--ink-3); }
.cp-menu-btn{ display:none; }

/* =========================================================
   PAGE PIECES
   ========================================================= */
.cp-head{ display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px 20px; margin-bottom:20px; }
.cp-head h2{ font-size:22px; font-weight:700; line-height:1.4; }
.cp-head p{ margin-top:2px; font-size:13.5px; color:var(--ink-2); }
.cp-head-acts{ display:flex; flex-wrap:wrap; gap:8px; margin-inline-start:auto; align-items:center; }
.cp-check{ display:inline-flex; align-items:center; gap:8px; min-height:42px; padding:0 4px; font-size:13.5px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.cp-check input{ width:17px; height:17px; margin:0; accent-color:var(--ink); cursor:pointer; }
.cp-card{ position:relative; padding:20px; border-radius:22px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); }
/* every .db-page block keeps the db-in transform (fill both) = its own layer, so a later block covered an open list; lift the one holding it (also while it fades out) */
.db-page > :has(.vs__dropdown-menu){ position:relative; z-index:5; }
.cp-card-h{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.cp-card-h h3{ font-size:16px; font-weight:700; }
.cp-card-h small{ font-size:12.5px; color:var(--ink-3); }
.cp-card-h .cp-card-acts{ margin-inline-start:auto; display:flex; gap:6px; }

/* =========================================================
   FORMS
   ========================================================= */
.cp-form{ display:grid; gap:20px; max-width:1080px; }
.cp-sec{ padding:20px 22px; border-radius:20px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); }
.cp-sec > h3{ font-size:15.5px; font-weight:700; margin-bottom:4px; }
.cp-sec > p{ font-size:13px; color:var(--ink-2); margin-bottom:14px; }
.cp-grid{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px 18px; margin-top:12px; }
.cp-grid .is-wide{ grid-column:1 / -1; }
.cp-form .db-fld input, .cp-form .db-fld select, .cp-form .db-fld textarea{ width:100%; font-size:14.5px; }
/* the admin login card is not a .cp-form: without a width its inputs keep their intrinsic 20-character size and push the card past a phone screen */
.cp-login-card .db-fld input{ width:100%; min-width:0; }
.cp-form .db-fld textarea{ min-height:110px; }
.req{ color:var(--red); font-weight:700; margin-inline-start:2px; }
.fld-err{ display:block; font-size:12.5px; font-weight:500; color:var(--red); }
.db-fld [aria-invalid="true"]{ border-color:var(--red) !important; }
.fld-hint{ display:block; font-size:12px; font-weight:400; color:var(--ink-3); }
.cp-seg{ display:inline-flex; flex-wrap:wrap; gap:4px; padding:4px; border-radius:13px; background:#F1EDE3; }
.cp-seg label{ position:relative; cursor:pointer; }
.cp-seg input{ position:absolute; opacity:0; pointer-events:none; }
.cp-seg span{ display:inline-flex; align-items:center; height:34px; padding:0 14px; border-radius:10px; font-size:13.5px; font-weight:500; color:var(--ink-2); }
.cp-seg input:checked + span{ color:var(--ink); background:var(--card); font-weight:600; box-shadow:0 4px 10px -8px rgba(18,60,53,.5); }
.cp-seg input:focus-visible + span{ outline:2px solid var(--gold); }
.cp-langs{ display:flex; gap:6px; margin-bottom:12px; }
.cp-langs button{ height:32px; padding:0 12px; border:1px solid var(--line); border-radius:99px; font:inherit; font-size:12.5px; color:var(--ink-2); background:var(--card); cursor:pointer; }
.cp-langs button[aria-selected="true"]{ color:#FFFDF8; background:var(--ink); border-color:var(--ink); }
.cp-langs button.is-missing::after{ content:"•"; color:var(--red); margin-inline-start:4px; }
.cp-upload{ display:flex; align-items:center; gap:14px; padding:12px; border:1.5px dashed var(--line-2); border-radius:16px; background:#FFFEFB; }
.cp-upload img{ width:72px; height:72px; border-radius:12px; object-fit:cover; background:#EFEBE2; }
.cp-upload span{ flex:1; font-size:13px; color:var(--ink-2); }
.cp-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.cp-chips label{ position:relative; cursor:pointer; }
.cp-chips input{ position:absolute; opacity:0; }
.cp-chips span{ display:inline-flex; align-items:center; height:32px; padding:0 12px; border-radius:99px; font-size:13px; border:1px solid var(--line-2); color:var(--ink-2); background:var(--card); }
.cp-chips input:checked + span{ color:var(--ink); background:var(--sage-soft); border-color:transparent; font-weight:600; }
.cp-switch{ display:flex; align-items:center; gap:10px; font-size:14px; cursor:pointer; }
.cp-switch input{ appearance:none; width:40px; height:24px; border-radius:99px; background:#D9D4C8; position:relative; cursor:pointer; transition:background .2s; flex:none; }
.cp-switch input::after{ content:""; position:absolute; top:3px; right:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:transform .2s var(--ease); box-shadow:0 1px 3px rgba(0,0,0,.2); }
.cp-switch input:checked{ background:var(--ink); }
.cp-switch input:checked::after{ transform:translateX(-16px); }
.cp-switch input:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.cp-form .db-fld .cp-switch input, .db-modal .db-fld .cp-switch input, .db-fld .cp-switch input{ width:40px; height:24px; padding:0; border:0; border-radius:99px; }
.cp-code{ width:100%; min-height:260px; padding:14px; border-radius:14px; border:1px solid var(--line-2); font:13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction:ltr; text-align:left; color:#E9E4D6; background:#16302B; tab-size:2; }
.cp-code:focus{ outline:none; box-shadow:0 0 0 4px rgba(168,199,181,.35); }
.cp-foot{ position:sticky; bottom:0; z-index:5; display:flex; align-items:center; gap:10px; padding:14px 0 4px; background:linear-gradient(180deg, rgba(247,244,236,0), var(--pg) 30%); }
.cp-foot .db-form-msg{ margin-inline-start:auto; }

/* =========================================================
   DASHBOARD
   ========================================================= */
.dsh{ display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); gap:20px; }
.dsh > *{ min-width:0; animation:db-in .6s var(--ease) both; animation-delay:calc(var(--i, 0) * 50ms); }
.dsh-hero{
  position:relative; z-index:2; grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:16px 24px;
  padding:26px 28px; border-radius:24px; color:#FFFDF8;
  background:
    radial-gradient(circle at 12% 120%, rgba(212,175,90,.28), transparent 45%),
    radial-gradient(circle at 92% -30%, rgba(168,199,181,.22), transparent 50%),
    #16473F;
  box-shadow:0 24px 50px -32px rgba(7,31,26,.8);
}
.dsh-hero-mark{ display:grid; place-items:center; width:54px; height:54px; border-radius:16px; background:rgba(255,253,248,.1); box-shadow:inset 0 0 0 1px rgba(255,253,248,.18); }
.dsh-hero-mark svg{ width:26px; height:26px; color:var(--gold); }
.dsh-hero h2{ font-size:24px; font-weight:700; line-height:1.35; }
.dsh-hero p{ font-size:14px; color:rgba(255,253,248,.72); }
.dsh-hero .cp-wrap{ margin-inline-start:auto; }
.dsh-hero .db-btn--ghost svg{ width:17px; height:17px; }

.kpi{ grid-column:span 2; display:flex; flex-direction:column; gap:12px; padding:16px 18px; border-radius:20px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); }
.kpi-top{ display:flex; align-items:center; gap:10px; }
.kpi-ico{ display:grid; place-items:center; width:40px; height:40px; border-radius:12px; flex:none; }
.kpi-ico svg{ width:20px; height:20px; }
.kpi small{ font-size:13px; color:var(--ink-2); line-height:1.4; }
.kpi b{ font-size:28px; font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; }
.kpi.t-forest .kpi-ico{ color:#FFFDF8; background:var(--ink); }
.kpi.t-sage .kpi-ico{ color:var(--ink); background:var(--sage-soft); }
.kpi.t-gold .kpi-ico{ color:var(--ad-gold-ink); background:var(--gold-soft); }
.kpi.t-cream .kpi-ico{ color:var(--ink); background:#EFE9DA; }
.kpi.t-olive .kpi-ico{ color:#4B5E35; background:#E7EBD9; }
.kpi.t-gray .kpi-ico{ color:var(--ink-2); background:#ECE9E2; }
.kpi-bar{ height:4px; border-radius:99px; background:rgba(18,60,53,.07); overflow:hidden; }
.kpi-bar i{ display:block; height:100%; width:0; border-radius:inherit; transition:width 1.2s var(--ease); }
.kpi.t-forest .kpi-bar i{ background:var(--ink); }
.kpi.t-sage .kpi-bar i{ background:var(--sage); }
.kpi.t-gold .kpi-bar i{ background:var(--gold); }
.kpi.t-cream .kpi-bar i{ background:#CDBF9C; }
.kpi.t-olive .kpi-bar i{ background:#9DAE7F; }
.kpi.t-gray .kpi-bar i{ background:#B9B3A6; }

.dsh-span8{ grid-column:span 8; } .dsh-span4{ grid-column:span 4; } .dsh-span6{ grid-column:span 6; } .dsh-span12{ grid-column:1 / -1; }
.dsh .cp-card{ display:flex; flex-direction:column; }
.dsh-chart{ position:relative; height:280px; }
.dsh-chart.is-sm{ height:220px; }
.big{ grid-column:span 4; display:flex; align-items:center; gap:16px; padding:22px; border-radius:22px; border:1px solid var(--line); box-shadow:var(--shadow); background:var(--card); }
.big-ico{ display:grid; place-items:center; width:56px; height:56px; border-radius:16px; flex:none; }
.big-ico svg{ width:26px; height:26px; }
.big small{ display:block; font-size:13px; color:var(--ink-2); }
.big b{ display:block; font-size:34px; font-weight:700; line-height:1.15; font-variant-numeric:tabular-nums; }
.big em{ display:block; font-style:normal; font-size:12.5px; color:var(--ink-3); }
.big.t-forest{ color:#FFFDF8; background:#16473F; border-color:transparent; }
.big.t-forest small, .big.t-forest em{ color:rgba(255,253,248,.7); }
.big.t-forest .big-ico{ background:rgba(255,253,248,.1); color:var(--gold); }
.big.t-gold .big-ico{ background:var(--gold-soft); color:var(--ad-gold-ink); }
.big.t-sage .big-ico{ background:var(--sage-soft); color:var(--ink); }

/* ranked list (top courses) */
.rank{ display:grid; gap:4px; margin:0; padding:0; list-style:none; counter-reset:rk; }
.rank li{ display:grid; grid-template-columns:30px minmax(0, 1fr) auto; align-items:center; gap:12px; padding:10px 6px; border-bottom:1px solid var(--line); counter-increment:rk; }
.rank li:last-child{ border-bottom:0; }
.rank li::before{ content:counter(rk); display:grid; place-items:center; width:30px; height:30px; border-radius:10px; font-size:13px; font-weight:700; background:#F1EDE3; color:var(--ink-2); }
.rank li:first-child::before{ background:var(--ink); color:var(--gold); }
.rank b{ font-size:14.5px; font-weight:600; display:block; }
.rank .db-bar{ height:6px; margin-top:6px; }
.rank .rank-n{ font-size:13px; font-weight:600; color:var(--ink-2); white-space:nowrap; }

/* =========================================================
   CHARTS (SVG, admin-kit.js)
   ========================================================= */
.ch{ position:relative; width:100%; height:100%; }
.ch svg{ display:block; width:100%; height:100%; overflow:visible; }
.ch .grid line{ stroke:rgba(18,60,53,.08); stroke-dasharray:3 4; }
.ch .axis text{ font-size:11px; fill:var(--ink-3); font-family:inherit; }
.ch .pt{ fill:var(--card); stroke-width:2; opacity:0; transition:opacity .15s; }
.ch .pt.is-on{ opacity:1; }
.ch .hit{ fill:transparent; cursor:crosshair; }
.ch .bar{ transition:opacity .15s; }
.ch .bar.is-dim{ opacity:.45; }
.ch-tip{
  position:absolute; z-index:3; pointer-events:none;
  min-width:120px; padding:8px 12px; border-radius:12px;
  font-size:12.5px; line-height:1.6; color:#FFFDF8; background:rgba(18,60,53,.94);
  box-shadow:0 14px 30px -16px rgba(7,31,26,.8); transform:translate(-50%, -115%); white-space:nowrap;
}
.ch-tip b{ display:block; font-size:14px; }
.ch-legend{ display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:12px; padding:0; list-style:none; font-size:12.5px; color:var(--ink-2); }
.ch-legend li{ display:inline-flex; align-items:center; gap:6px; }
.ch-legend i{ width:10px; height:10px; border-radius:3px; }
.donut{ display:grid; grid-template-columns:minmax(0, 170px) minmax(0, 1fr); align-items:center; gap:20px; flex:1; }
.donut-c{ position:relative; aspect-ratio:1; }
.donut-c svg{ width:100%; height:100%; transform:rotate(-90deg); }
.donut-c circle{ transition:stroke-width .2s; }
.donut-mid{ position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.donut-mid b{ font-size:28px; font-weight:700; line-height:1.1; }
.donut-mid small{ font-size:12px; color:var(--ink-3); }
.donut-l{ display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.donut-l li{ display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:10px; padding:8px 10px; border-radius:12px; background:#FBF8F1; font-size:13.5px; }
.donut-l i{ width:10px; height:10px; border-radius:3px; }
.donut-l b{ font-variant-numeric:tabular-nums; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width:1300px){ .kpi{ grid-column:span 4; } }
@media (max-width:1240px){
  .ad{ --side-w:0px; }
  .cp-side{ transform:translateX(105%); transition:transform .3s var(--ease); width:300px; box-shadow:-30px 0 60px -30px rgba(7,31,26,.4); }
  .cp-side.is-open{ transform:none; }
  .cp-menu-btn{ display:grid; }
  .dsh-span8, .dsh-span4, .dsh-span6{ grid-column:1 / -1; }
  .big{ grid-column:span 4; }
}
@media (max-width:900px){
  .ad .db-page{ padding:18px 16px 32px; }
  .cp-top{ padding:0 16px; gap:10px; }
  .cp-grid{ grid-template-columns:minmax(0, 1fr); }
  .kpi{ grid-column:span 6; }
  .big{ grid-column:1 / -1; }
  .cp-filters .db-fld{ max-width:none; }
}
@media (max-width:640px){
  .cp-top h1{ font-size:17px; }
  .cp-crumbs{ display:none; }
  .cp-av b{ display:none; }
  .donut{ grid-template-columns:minmax(0, 1fr); justify-items:center; }
  .donut-c{ width:180px; }
  .dsh-hero{ padding:20px; }
  .dsh-hero .cp-wrap{ margin-inline-start:0; }
}
.cp-scrim{ position:fixed; inset:0; z-index:35; background:rgba(7,31,26,.35); }
@media (prefers-reduced-motion:reduce){ .dsh > *{ animation:none; } }

/* the activity donut sits in a narrow column: stack it */
.dsh-span4 .donut{ grid-template-columns:minmax(0, 1fr); justify-items:center; gap:16px; }
.dsh-span4 .donut-c{ width:min(190px, 100%); }
.dsh-span4 .donut-l{ width:100%; }

/* the searchable multi-select */
.cp-pick{ position:relative; }
.cp-pick-btn{ display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; height:44px; padding:0 14px; border:1px solid var(--line-2); border-radius:14px; font:inherit; font-size:14px; color:var(--ink); background:#fff; cursor:pointer; text-align:right; }
.cp-pick-btn svg{ width:16px; height:16px; color:var(--ink-3); }
.cp-pick-pop{ left:auto; right:0; width:100%; min-width:280px; }
.cp-pick-pop > svg{ position:absolute; top:22px; right:16px; width:16px; height:16px; color:var(--ink-3); }
.cp-pick-pop input[type="search"]{ width:100%; height:40px; padding:0 34px 0 12px; border:1px solid var(--line-2); border-radius:12px; font:inherit; font-size:14px; }
.cp-pick-list{ display:grid; gap:2px; max-height:260px; overflow:auto; }
.cp-pick-i{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; cursor:pointer; }
.cp-pick-i:hover{ background:#F6F2E8; }
.cp-pick-i input{ width:17px; height:17px; accent-color:var(--ink); }
.cp-pick-i b{ display:block; font-size:13.5px; font-weight:600; }
.cp-pick-i small{ display:block; font-size:12px; color:var(--ink-3); direction:ltr; text-align:right; }

/* =========================================================
   CURRICULUM EDITOR — levels and their lessons
   ========================================================= */
.lv{ margin-bottom:16px; padding:16px 18px; border-radius:20px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); }
.lv-h{ display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.lv-n{ display:grid; place-items:center; width:36px; height:36px; border-radius:12px; font-weight:700; color:#FFFDF8; background:var(--ink); flex:none; }
.lv-h h3{ font-size:16px; font-weight:700; }
.lv-h small{ font-size:12.5px; color:var(--ink-2); }
.lv-acts{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-inline-start:auto; }
.ls{ display:grid; gap:6px; margin:14px 0 0; padding:0; list-style:none; }
.ls-r{ display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:14px; background:#FBF8F1; border:1px solid var(--line); }
.ls-n{ display:grid; place-items:center; width:28px; height:28px; border-radius:9px; font-size:12.5px; font-weight:700; color:var(--ink-2); background:#EFEBE2; flex:none; }
.ls-t{ flex:1; min-width:0; }
.ls-t b{ display:block; font-size:14px; font-weight:600; }
.ls-t small{ font-size:12px; color:var(--ink-3); }
.lv-add{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:10px; padding:10px; border:1.5px dashed var(--line-2); border-radius:14px; font:inherit; font-size:14px; font-weight:600; color:var(--ink-2); background:none; cursor:pointer; }
.lv-add:hover{ color:var(--ink); border-color:var(--gold); background:#FFFBF0; }
.lv-add svg{ width:18px; height:18px; }
@media (max-width:640px){ .lv-acts{ margin-inline-start:0; width:100%; } .ls-r{ flex-wrap:wrap; } }

/* wizard steps */
.wz{ display:flex; gap:8px; margin:0 0 18px; padding:0; list-style:none; counter-reset:wz; }
.wz li{ flex:1; display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:16px; background:var(--card); border:1px solid var(--line); font-size:14px; font-weight:600; color:var(--ink-3); }
.wz li span{ display:grid; place-items:center; width:28px; height:28px; border-radius:50%; font-size:13px; background:#EFEBE2; color:var(--ink-2); flex:none; }
.wz li span svg{ width:15px; height:15px; }
.wz li.is-on{ color:var(--ink); border-color:rgba(176,143,62,.5); background:#FFFBF0; }
.wz li.is-on span{ background:var(--ink); color:var(--gold); }
.wz li.is-done{ color:var(--ink-2); }
.wz li.is-done span{ background:var(--sage-soft); color:var(--ink); }
.ls-x{ margin-top:10px; border:1px solid var(--line); border-radius:14px; background:#FFFEFB; }
.ls-x > summary{ display:flex; align-items:center; gap:10px; padding:10px 12px; cursor:pointer; list-style:none; }
.ls-x > summary::-webkit-details-marker{ display:none; }
.ls-x > summary b{ font-size:14px; }
.ls-x > summary small{ font-size:12px; color:var(--ink-3); margin-inline-end:auto; }
.ls-x > .cp-grid{ padding:0 12px 12px; }
@media (max-width:640px){ .wz{ flex-direction:column; } }

/* certificate templates: editor beside its live preview */
.tpl{ display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); gap:20px; align-items:start; }
.tpl-prev{ position:sticky; top:calc(var(--top-h) + 16px); }
.cert-frame{ display:block; width:100%; height:420px; border:1px solid var(--line); border-radius:14px; background:#F7F4EC; }
@media (max-width:1100px){ .tpl{ grid-template-columns:minmax(0, 1fr); } .tpl-prev{ position:static; } }

/* role permissions */
.pm-g{ border:1px solid var(--line); border-radius:16px; margin-top:10px; background:#FFFEFB; }
.pm-h{ display:flex; align-items:center; gap:10px; padding:10px 12px; }
.pm-h small{ margin-inline-start:auto; font-size:12px; color:var(--ink-3); }
.pm-h .cp-act[aria-expanded="false"] svg{ transform:rotate(90deg); }
.pm-l{ padding:0 12px 12px; }
.pm-l span{ font-size:12px; font-family:ui-monospace, Menlo, Consolas, monospace; }

/* reports */
.rp-f{ padding:16px 18px; }
.rp-f .db-form-msg{ margin-top:6px; }
.pc{ display:inline-flex; align-items:center; gap:8px; }
.pc .db-bar{ width:80px; height:6px; }
.pc .db-bar i{ transition:none; }

/* zoom calendar */
.cal{ border:1px solid var(--line); border-radius:18px; overflow:hidden; background:var(--card); box-shadow:var(--shadow); }
.cal-h{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); background:#F7F3EA; border-bottom:1px solid var(--line-2); }
.cal-h span{ padding:10px; font-size:12.5px; font-weight:600; color:var(--ink-2); text-align:center; }
.cal-g{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
.cal-d{ display:flex; flex-direction:column; gap:3px; min-height:104px; padding:6px; border:0; border-inline-start:1px solid var(--line); border-bottom:1px solid var(--line); background:none; font:inherit; text-align:right; cursor:pointer; min-width:0; }
.cal-d:hover{ background:#FCFAF4; }
.cal-d.is-out{ background:#FAF8F3; color:var(--ink-3); }
.cal-n{ font-size:13px; font-weight:600; }
.cal-d.is-today .cal-n{ display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; color:#FFFDF8; background:var(--ink); }
.cal-d small{ font-size:11px; color:var(--ink-3); }
.cal-ev{ display:block; padding:2px 6px; border-radius:6px; font-size:11px; line-height:1.6; color:var(--ink); background:color-mix(in srgb, var(--c) 16%, #fff); border-inline-start:3px solid var(--c); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-list{ display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.cal-li{ display:grid; grid-template-columns:140px minmax(0, 1fr); gap:12px; padding:10px 4px; border-bottom:1px solid var(--line); }
.cal-li span{ display:flex; flex-wrap:wrap; gap:6px; }
@media (max-width:640px){ .cal-d{ min-height:64px; } .cal-ev{ font-size:0; height:6px; padding:0; } .cal-li{ grid-template-columns:minmax(0, 1fr); } }

/* ---------- الإعدادات · الترجمات ---------- */
.set-grp{ margin-bottom:26px; }
.set-grp > .x-sub{ margin-bottom:12px; }
.set-g{ display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.set-c{ display:flex; align-items:center; gap:14px; padding:16px 18px; border-radius:20px; background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); color:inherit; text-decoration:none; transition:border-color .2s, transform .2s var(--ease); }
.set-c:hover{ border-color:var(--sage); transform:translateY(-2px); }
.set-c:focus-visible{ outline:3px solid var(--sage); outline-offset:2px; }
.set-c b{ display:block; font-weight:700; font-size:15px; }
.set-c small{ display:block; margin-top:2px; font-size:12.5px; color:var(--ink-3); line-height:1.5; }
.set-c > svg:last-child{ width:16px; height:16px; margin-inline-start:auto; color:var(--ink-3); transform:rotate(90deg); flex:none; }
.set-i{ display:grid; place-items:center; width:44px; height:44px; border-radius:14px; flex:none; color:var(--ink); background:var(--sage-soft); font-size:12px; font-weight:700; }
.set-i svg{ width:20px; height:20px; }
.set-back{ margin-bottom:12px; }
.set-back svg{ transform:rotate(-90deg); }
.set-row{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:14px; }
.set-note{ margin-top:20px; padding:16px 20px; border-radius:18px; background:var(--gold-soft); border:1px solid rgba(201,162,78,.35); font-size:13.5px; line-height:1.8; }
.set-note h4{ display:flex; align-items:center; gap:8px; font-size:14.5px; margin-bottom:6px; }
.set-note h4 svg{ width:18px; height:18px; }
.set-note ul{ margin:0; padding-inline-start:20px; }
.set-note code{ padding:2px 6px; border-radius:6px; background:rgba(255,255,255,.7); word-break:break-all; }
.set-help{ margin:4px 0 14px; padding:10px 14px; border-radius:14px; background:#F6F2E8; font-size:13.5px; }
.set-help summary{ display:flex; align-items:center; gap:8px; cursor:pointer; font-weight:600; }
.set-help summary svg{ width:16px; height:16px; }
.set-help ol{ margin:10px 0 6px; padding-inline-start:22px; line-height:1.9; }
.set-help a{ color:var(--ink); font-weight:600; }
.set-color{ display:flex; gap:8px; }
.set-color input[type=color]{ width:48px; height:48px; padding:4px; border:1px solid var(--line-2); border-radius:12px; background:var(--card); flex:none; cursor:pointer; }
.set-color input:not([type]){ flex:1; min-width:0; }
.set-prev{ margin:16px 0; }
.set-prev small{ display:block; margin-bottom:6px; font-size:12.5px; color:var(--ink-3); }
.set-prev > div{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:16px; border-radius:16px; border:1px solid var(--line); }
.set-prev b{ font-size:18px; margin-inline-end:auto; }
.set-prev span{ padding:8px 16px; border-radius:99px; color:#fff; font-size:13px; font-weight:600; }
.tr-g{ display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:14px; align-items:start; }
.tr-c .cp-card-h{ flex-wrap:wrap; }
.tr-f{ list-style:none; margin:14px 0 0; padding:0; border-top:1px solid var(--line); }
.tr-f li{ display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13.5px; }
.tr-f li svg{ width:16px; height:16px; color:var(--ink-3); }
.tr-f li code{ flex:1; }
@media (max-width:640px){ .tr-g, .set-g{ grid-template-columns:1fr; } }

/* four KPIs to a row on wide screens; on smaller ones they follow .kpi */
@media (min-width:1301px){ .kpi.is-q{ grid-column:span 3; } }

/* phone: the title gets its own line under the top bar's buttons */
@media (max-width:640px){
  .cp-top{ height:auto; min-height:var(--top-h); flex-wrap:wrap; row-gap:4px; padding-top:10px; padding-bottom:10px; }
  .cp-top-t{ order:2; flex:1 1 100%; }
  .cp-top h1{ overflow-wrap:anywhere; }
  .cp-head-acts .db-btn, .cp-card-h .db-btn, .cp-foot .db-btn{ white-space:nowrap; }
}
/* uploaded curriculum files: a long name wraps, the actions drop under it */
.up-li{ flex-wrap:wrap; align-items:center; }
.up-li > span:first-child{ flex:1 1 220px; min-width:0; }
.up-li b{ overflow-wrap:anywhere; }
.up-acts{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }

/* ---------- لبيب AI ---------- */
.lb-links{ display:grid; gap:8px; }
.lb-links .db-btn{ justify-content:flex-start; width:100%; }
.lb-side{ display:grid; gap:20px; align-content:start; }
.lb-legend{ display:grid; gap:10px; margin:0; padding:0; list-style:none; font-size:13.5px; }
.lb-legend li{ display:flex; align-items:center; gap:10px; }
.lb-legend i{ width:12px; height:12px; border-radius:50%; flex:none; }
.lb-legend b{ width:12px; text-align:center; font-weight:700; color:var(--ink); }
.lb-legend .is-ok, .lb-use .db-bar i.is-ok{ background:var(--sage); }
.lb-legend .is-wait, .lb-use .db-bar i.is-wait{ background:var(--gold); }
.lb-legend .is-bad, .lb-use .db-bar i.is-bad{ background:var(--red); }
.lb-use{ display:grid; gap:6px; min-width:120px; }
.lb-use > span:first-child{ display:flex; align-items:baseline; gap:8px; font-size:13.5px; font-variant-numeric:tabular-nums; }
.lb-use small{ font-size:12px; font-weight:600; color:#2F6B4F; }
.lb-use .db-bar{ height:6px; }
.lb-tabs{ margin-bottom:16px; }
.lb-note{ margin-top:14px; padding:12px 14px; border-radius:14px; background:#FBF4E4; font-size:13.5px; line-height:1.7; }
.lb-note b{ display:block; margin-bottom:2px; font-size:13px; }
.lb-receipt{ display:grid; place-items:center; gap:6px; height:220px; margin-top:14px; border-radius:16px; background:#F6F2E8; color:var(--ink-3); font-size:13px; }
.lb-receipt svg{ width:28px; height:28px; }
.lb-break{ display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.lb-break li{ display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-radius:12px; background:#FBF8F1; font-size:14px; }
.lb-prompt{ font:13px/1.8 inherit; min-height:180px; }
.cp-card-h > div > small{ display:block; margin-top:2px; }
.lb-topup-f{ display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) auto; align-items:end; gap:14px; margin-top:12px; }
.lb-topup-f p{ align-self:center; font-size:14px; }
.lb-topup-f p b{ font-size:18px; }
@media (max-width:640px){ .lb-topup-f{ grid-template-columns:minmax(0, 1fr); } }
/* quotas: the table needs the room; the two side cards stay narrow */
.lb-main{ grid-column:span 9; min-width:0; }
.dsh > .lb-side{ grid-column:span 3; }
@media (max-width:1240px){ .lb-main, .dsh > .lb-side{ grid-column:1 / -1; } .dsh > .lb-side{ grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); } }

/* =========================================================
   THE TABLE SYSTEM — every list in the panel
   page header (title + count + one primary action) → toolbar →
   one table surface (sticky header, rows, footer) — RTL
   ========================================================= */

/* the result count beside the title */
.cp-head-t{ display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; }
.cp-count{ font-size:13.5px; font-weight:500; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.cp-count:empty{ display:none; }

/* AdminStatus — quiet pills, one set of tones everywhere */
.st-chip{ display:inline-flex; align-items:center; gap:6px; height:24px; padding:0 10px; border-radius:99px; font-size:12px; font-weight:600; line-height:1; white-space:nowrap; transition:background .2s, color .2s; }
.st-chip::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.75; flex:none; }
.st-ok{ color:#285C43; background:#E5EFE8; }
.st-wait{ color:#7A5A17; background:#F7EDD6; }
.st-off{ color:#6A665D; background:#EEEBE4; }
.st-bad{ color:#9A3D33; background:#F7E6E2; }
.st-info{ color:#2C4F47; background:#E6EEEB; }

/* ---------- AdminFilterToolbar ---------- */
.at-bar{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.at-search{ position:relative; display:flex; align-items:center; flex:1 1 300px; max-width:440px; min-width:0; }
.at-search svg{ position:absolute; right:13px; width:17px; height:17px; color:var(--ink-3); pointer-events:none; }
.at-search input{ width:100%; height:42px; padding:0 40px 0 14px; border:1px solid var(--line-2); border-radius:13px; font:inherit; font-size:14px; color:var(--ink); background:var(--card); transition:border-color .15s, box-shadow .15s; }
.at-search input::placeholder{ color:var(--ink-3); }
.at-search input:focus{ outline:none; border-color:var(--sage); box-shadow:0 0 0 4px rgba(168,199,181,.28); }
.at-sels{ display:flex; flex-wrap:wrap; gap:8px; }
.at-sel{ position:relative; display:inline-flex; align-items:center; }
.at-sel select{ appearance:none; -webkit-appearance:none; height:42px; max-width:220px; padding:0 14px 0 32px; border:1px solid var(--line-2); border-radius:13px; font:inherit; font-size:13.5px; color:var(--ink-2); background:var(--card); cursor:pointer; text-overflow:ellipsis; transition:border-color .15s, background .15s, color .15s; }
.at-sel > svg{ position:absolute; left:11px; width:14px; height:14px; color:var(--ink-3); pointer-events:none; }
.at-sel select:hover{ border-color:#CFC8B8; }
.at-sel select:focus-visible, .at-sel input:focus-visible{ outline:none; border-color:var(--sage); box-shadow:0 0 0 4px rgba(168,199,181,.28); }
.at-sel.is-on select, .at-sel.is-on input{ color:var(--ink); font-weight:600; border-color:rgba(47,107,79,.35); background:#F1F6F2; }
.at-sel.is-date{ gap:0; height:42px; padding-inline-start:12px; border:1px solid var(--line-2); border-radius:13px; background:var(--card); }
.at-sel.is-date.is-on{ border-color:rgba(47,107,79,.35); background:#F1F6F2; }
.at-sel-l{ font-size:12.5px; color:var(--ink-3); white-space:nowrap; }
.at-sel.is-date input{ height:40px; padding:0 8px; border:0; font:inherit; font-size:13.5px; color:var(--ink-2); background:none; }
.at-sel.is-date input:focus-visible{ box-shadow:none; }
.at-link{ display:inline-flex; align-items:center; gap:6px; height:42px; padding:0 6px; border:0; font:inherit; font-size:13.5px; font-weight:600; color:var(--ink-2); background:none; cursor:pointer; text-decoration:underline; text-decoration-color:transparent; text-underline-offset:4px; transition:color .15s, text-decoration-color .15s; }
.at-link:hover{ color:var(--ink); text-decoration-color:currentColor; }
.at-link svg{ width:16px; height:16px; }
.at-link i, .at-fbtn i{ display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:99px; font-size:11px; font-style:normal; font-weight:700; color:#FFFDF8; background:var(--ink); }
.at-morebtn{ text-decoration:none; }
.at-clear{ margin-inline-start:auto; color:var(--ink-3); }
.at-fbtn{ display:none; align-items:center; gap:6px; height:42px; padding:0 14px; border:1px solid var(--line-2); border-radius:13px; font:inherit; font-size:13.5px; font-weight:600; color:var(--ink); background:var(--card); cursor:pointer; }
.at-fbtn svg{ width:16px; height:16px; }
/* the contextual bar while rows are selected */
.at-bar.is-bulk{ min-height:50px; padding-block:4px; padding-inline:14px 6px; border-radius:14px; background:#F3F7F4; border:1px solid rgba(47,107,79,.18); animation:at-in .2s var(--ease); }
.at-bar.is-bulk > b{ font-size:14px; font-weight:700; }
.at-bulk{ display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--ink-2); }
.at-bar.is-bulk .at-link{ margin-inline-start:auto; }
/* filters in a sheet on phones */
.at-sheet{ display:grid; gap:10px; }
.at-sheet .at-sel, .at-sheet .at-sel select{ width:100%; max-width:none; }
.at-sheet .at-sel.is-date{ justify-content:space-between; }

/* ---------- AdminTable surface ---------- */
.at{ border:1px solid var(--line); border-radius:22px; background:var(--card); box-shadow:0 1px 2px rgba(18,60,53,.03), 0 10px 30px -24px rgba(18,60,53,.25); overflow:hidden; }
.cp-table-wrap{ position:relative; overflow:auto; max-height:calc(100vh - 230px); border:1px solid var(--line); border-radius:22px; background:var(--card); box-shadow:0 1px 2px rgba(18,60,53,.03), 0 10px 30px -24px rgba(18,60,53,.25); }
.at .cp-table-wrap{ border:0; border-radius:0; box-shadow:none; }
.cp-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:14px; }
/* header: warm tint, sticky */
.cp-table th{ position:sticky; top:0; z-index:2; height:46px; padding:0 18px; font-size:12.5px; font-weight:600; color:#4A6A60; text-align:start; white-space:nowrap; background:#F8F5EE; border-bottom:1px solid var(--line); }
.cp-table th button{ display:inline-flex; align-items:center; gap:6px; padding:4px 0; border:0; font:inherit; color:inherit; background:none; cursor:pointer; }
.cp-table th button:hover{ color:var(--ink); }
.cp-table th button:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; border-radius:6px; }
.t-sort{ display:inline-grid; place-items:center; width:16px; height:16px; }
.t-sort svg{ width:13px; height:13px; opacity:.35; transition:opacity .15s, transform .2s var(--ease); }
.cp-table th button:hover .t-sort svg{ opacity:.7; }
.t-sort.is-asc svg, .t-sort.is-desc svg{ opacity:1; color:var(--ink); }
.t-sort.is-asc svg{ transform:rotate(180deg); }
/* rows: separators only, calm hover */
.cp-table td{ height:72px; padding:10px 18px; border-bottom:1px solid #EFEBE3; vertical-align:middle; color:var(--ink); transition:background .18s; }
.cp-table tbody tr:last-child td{ border-bottom:0; }
.cp-table tbody tr:hover td{ background:#F5F9F6; }
.cp-table tbody tr.is-sel td{ background:#F0F6F2; }
.cp-table tbody tr.at-empty-row:hover td{ background:none; }
.cp-table .is-num{ font-variant-numeric:tabular-nums; color:var(--ink-2); }
.cp-table .is-muted{ color:var(--ink-2); font-size:13px; }
.cp-table .is-ltr{ direction:ltr; text-align:right; }
/* the primary entity cell */
.cp-table .t-main{ display:flex; align-items:center; gap:12px; min-width:0; }
.cp-table .t-main > span{ min-width:0; }
.cp-table .t-main b{ display:block; font-weight:600; font-size:14.5px; line-height:1.45; }
.cp-table .t-main small{ display:block; margin-top:1px; font-size:12.5px; color:var(--ink-3); line-height:1.5; }
.cp-table .t-thumb{ width:46px; height:46px; flex:none; border-radius:12px; object-fit:cover; background:#EFEBE2; box-shadow:inset 0 0 0 1px rgba(18,60,53,.06); }
.cp-table .t-av{ display:grid; place-items:center; width:42px; height:42px; flex:none; border-radius:12px; font-size:13px; font-weight:700; color:var(--ink); background:var(--sage-soft); }
.cp-table .t-check{ width:48px; padding-inline-end:0; }
.cp-table input[type="checkbox"]{ width:17px; height:17px; accent-color:var(--ink); cursor:pointer; }
.cp-table .t-acts{ width:1%; white-space:nowrap; text-align:left; }
/* a sideways-scrolling table keeps its actions in reach */
.cp-table-wrap.is-scroll .t-acts{ position:sticky; left:0; z-index:1; background:var(--card); box-shadow:8px 0 14px -12px rgba(18,60,53,.25); }
.cp-table-wrap.is-scroll th.t-acts{ z-index:3; background:#F8F5EE; }
.cp-table-wrap.is-scroll tr:hover td.t-acts{ background:#F5F9F6; }

/* ---------- row actions ---------- */
.cp-acts{ display:inline-flex; align-items:center; gap:2px; }
.cp-act{ display:inline-grid; place-items:center; width:36px; height:36px; border:0; border-radius:11px; color:var(--ink-2); background:none; cursor:pointer; transition:background .15s, color .15s; }
.cp-act:hover, .cp-act[aria-expanded="true"]{ color:var(--ink); background:#EEF3EF; }
.cp-act:focus-visible{ outline:2px solid var(--gold); outline-offset:1px; }
.cp-act svg{ width:18px; height:18px; }
.cp-act.is-danger:hover{ color:#9A3D33; background:#F7E6E2; }
/* AdminActionMenu */
.at-menu{ position:fixed; z-index:80; min-width:200px; padding:6px; border-radius:14px; background:var(--card); border:1px solid var(--line); box-shadow:0 18px 40px -18px rgba(18,60,53,.35), 0 2px 6px rgba(18,60,53,.06);
  opacity:0; transform:translateY(-4px) scale(.97); transform-origin:top left; transition:opacity .14s, transform .16s var(--ease); }
.at-menu.is-up{ transform-origin:bottom left; transform:translateY(4px) scale(.97); }
.at-menu.is-on{ opacity:1; transform:none; }
.at-menu a, .at-menu button{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border:0; border-radius:10px; font:inherit; font-size:13.5px; color:var(--ink); text-align:start; text-decoration:none; background:none; cursor:pointer; }
.at-menu a:hover, .at-menu button:hover, .at-menu a:focus-visible, .at-menu button:focus-visible{ outline:none; background:#F3F7F4; }
.at-menu svg{ width:17px; height:17px; flex:none; color:var(--ink-3); }
.at-menu .is-danger, .at-menu .is-danger svg{ color:#9A3D33; }
.at-menu .is-danger:hover, .at-menu .is-danger:focus-visible{ background:#F7E6E2; }
.at-menu hr{ margin:5px 4px; border:0; border-top:1px solid var(--line); }
/* tooltips */
.at-tip{ position:fixed; z-index:90; padding:5px 9px; border-radius:8px; font-size:12px; font-weight:500; color:#FFFDF8; background:#163F38; white-space:nowrap; pointer-events:none;
  opacity:0; transform:translate(-50%, -100%) translateY(2px); transition:opacity .15s, transform .15s; }
.at-tip.is-on{ opacity:1; transform:translate(-50%, -100%); }
.at-tip.is-below{ transform:translate(-50%, 0) translateY(-2px); }
.at-tip.is-below.is-on{ transform:translate(-50%, 0); }

/* ---------- AdminPagination ---------- */
.at-foot{ display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; min-height:58px; padding:10px 18px; border-top:1px solid var(--line); font-size:13px; color:var(--ink-2); background:#FDFCF9; }
.at-range b{ font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; }
.at-size{ position:relative; display:inline-flex; align-items:center; }
.at-size select{ appearance:none; -webkit-appearance:none; height:34px; padding:0 12px 0 28px; border:1px solid var(--line); border-radius:10px; font:inherit; font-size:12.5px; color:var(--ink-2); background:var(--card); cursor:pointer; }
.at-size svg{ position:absolute; left:9px; width:12px; height:12px; color:var(--ink-3); pointer-events:none; }
.at-pages{ display:flex; align-items:center; gap:4px; margin-inline-start:auto; }
.at-pages button{ min-width:34px; height:34px; padding:0 8px; border:0; border-radius:10px; font:inherit; font-size:13px; font-variant-numeric:tabular-nums; color:var(--ink-2); background:none; cursor:pointer; transition:background .15s, color .15s; }
.at-pages button:hover:not([disabled]):not([aria-current]){ color:var(--ink); background:#F1EDE3; }
.at-pages button[aria-current="page"]{ color:#FFFDF8; font-weight:600; background:var(--ink); }
.at-pages button[disabled]{ opacity:.35; cursor:default; }
.at-pages button:focus-visible{ outline:2px solid var(--gold); outline-offset:1px; }
.at-gap{ padding:0 4px; color:var(--ink-3); }

/* ---------- AdminEmptyState · AdminTableSkeleton ---------- */
.cp-state{ display:grid; justify-items:center; gap:6px; padding:36px 16px; text-align:center; color:var(--ink-2); font-size:13.5px; }
.cp-state svg{ width:26px; height:26px; color:var(--ink-3); }
.cp-state b{ color:var(--ink); font-size:14.5px; font-weight:600; }
.cp-state.is-err svg{ color:#9A3D33; }
.cp-state .at-link{ height:32px; }
.cp-sk td{ height:72px; }
.cp-sk .sk{ display:block; border-radius:6px; }
.cp-sk .sk-line{ height:11px; }
.cp-sk .sk-line.is-sm{ width:40%; height:9px; margin-top:7px; }
.sk-ent{ display:flex; align-items:center; gap:12px; }
.sk-ent > span:last-child{ flex:1; }
.cp-sk .sk-th{ width:46px; height:46px; border-radius:12px; flex:none; }
.cp-sk .sk-dot{ width:28px; height:28px; border-radius:9px; margin-inline-start:auto; }
.cp-sk .sk-box{ width:17px; height:17px; border-radius:5px; }

@keyframes at-in{ from{ opacity:0; transform:translateY(-3px); } }
@media (prefers-reduced-motion:reduce){ .at-menu, .at-tip, .cp-table td, .st-chip{ transition:none; } .at-bar.is-bulk{ animation:none; } }

/* tablet: the toolbar wraps; wide tables scroll sideways */
@media (max-width:1100px){
  .at-search{ max-width:none; flex-basis:100%; }
  .at-clear{ margin-inline-start:0; }
}
/* phone: filters move to a sheet, rows become cards — nothing is hidden */
@media (max-width:640px){
  .at-sels, .at-morebtn{ display:none; }
  .at-fbtn{ display:inline-flex; }
  .at-search{ flex:1 1 0; }
  .at-bar.is-bulk{ padding:8px 12px; }
  .at{ border-radius:18px; }
  .cp-table-wrap{ max-height:none; }
  .cp-table.is-cards thead{ display:none; }
  .cp-table.is-cards, .cp-table.is-cards tbody, .cp-table.is-cards tr, .cp-table.is-cards td{ display:block; width:100%; }
  .cp-table.is-cards tr{ padding:14px 16px; border-bottom:1px solid #EFEBE3; }
  .cp-table.is-cards tr:last-child{ border-bottom:0; }
  .cp-table.is-cards tbody tr:hover td{ background:none; }
  .cp-table.is-cards td{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:4px 12px; height:auto; padding:5px 0; border:0; }
  .cp-table.is-cards td::before{ content:attr(data-l); font-size:12px; font-weight:600; color:var(--ink-3); }
  .cp-table.is-cards td.t-first{ padding-bottom:10px; }
  .cp-table.is-cards td.t-first::before, .cp-table.is-cards td.t-check::before, .cp-table.is-cards td.t-acts::before{ display:none; }
  .cp-table.is-cards td.t-check{ width:auto; }
  .cp-table.is-cards td.t-acts{ justify-content:flex-end; margin-top:6px; padding-top:8px; border-top:1px dashed #EAE5DB; }
  .cp-table.is-cards .cp-sk td{ height:auto; }
  .cp-table.is-cards .cp-sk td:not(.t-first){ display:none; }
  .at-foot{ padding:10px 14px; }
  .at-pages{ margin-inline-start:0; width:100%; justify-content:center; }
}
/* the filter sheet rises from the bottom on phones */
@media (max-width:640px){
  .db-modal.is-sheet{ margin:auto 0 0; width:100%; max-width:none; border-radius:22px 22px 0 0; }
}

/* the report criteria form (a form, not a table filter) */
.cp-filters{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; }
.cp-filters .db-fld{ flex:1 1 170px; max-width:260px; font-size:12.5px; gap:4px; }
.cp-filters .db-fld.is-grow{ flex:2 1 240px; max-width:none; }
.cp-filters .db-fld input, .cp-filters .db-fld select{ height:40px; width:100%; min-width:0; font-size:14px; border-radius:12px; }
.cp-filters .cp-filters-acts{ display:flex; gap:6px; margin-inline-start:auto; }
/* a search field outside a table toolbar (pickers, the roles tree) */
.cp-search{ position:relative; }
.cp-search input{ padding-inline-start:36px !important; }
.cp-search svg{ position:absolute; bottom:11px; right:11px; width:17px; height:17px; color:var(--ink-3); pointer-events:none; }
.cp-table .t-main small[dir="ltr"]{ text-align:right; }

/* one page title: when the page has its own header, the top bar keeps the breadcrumb only */
.ad:has(.db-page .cp-head) .cp-top h1{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.ad:has(.db-page .cp-head) .cp-crumbs{ font-size:13px; }
@media (max-width:640px){ .ad:has(.db-page .cp-head) .cp-crumbs{ display:flex; } }

/* =========================================================
   TABLE SYSTEM — refined to the approved reference
   (filters in their own card · labelled lists · 72px rows ·
   people with photos · bordered ⋮ · round pagination)
   ========================================================= */
/* page header: the title, the count under it, the action beside */
.cp-head{ align-items:center; margin-bottom:22px; }
.cp-head-t{ flex-direction:column; align-items:flex-start; gap:4px; }
.cp-head h2{ font-size:26px; line-height:1.35; }
.cp-count{ font-size:15px; font-weight:500; color:var(--ink-3); }
.cp-head-acts .db-btn{ height:50px; padding:0 22px; border-radius:14px; font-size:15px; }

/* the filter card */
.at-bar.is-card{ align-items:flex-end; gap:14px; padding:18px 20px; margin-bottom:16px; border:1px solid var(--line); border-radius:18px; background:var(--card); box-shadow:0 1px 2px rgba(18,60,53,.03); }
.at-bar.is-card .at-search{ flex:1 1 280px; max-width:330px; }
.at-bar.is-card .at-search input{ height:46px; border-radius:12px; font-size:14px; }
.at-sels{ gap:14px; }
.at-sel{ display:grid; gap:7px; align-items:start; }
.at-sel-l{ font-size:13px; font-weight:600; color:var(--ink); white-space:nowrap; }
.at-sel-box{ position:relative; display:flex; align-items:center; }
.at-sel select, .at-sel input[type="date"]{ appearance:none; -webkit-appearance:none; height:46px; min-width:178px; max-width:240px; padding:0 14px 0 36px; border:1px solid var(--line-2); border-radius:12px; font:inherit; font-size:14px; font-weight:500; color:var(--ink); background:var(--card); cursor:pointer; }
.at-sel input[type="date"]{ padding:0 12px; min-width:160px; }
.at-sel-box > svg{ position:absolute; left:13px; width:15px; height:15px; color:var(--ink-2); pointer-events:none; }
.at-sel.is-on select, .at-sel.is-on input{ border-color:rgba(47,107,79,.4); background:#F2F7F3; font-weight:600; }
.at-sel.is-date{ height:auto; padding:0; border:0; background:none; }
.at-sel.is-date .at-sel-l{ font-size:13px; color:var(--ink); }
.at-bar.is-card .at-clear{ order:-1; margin-inline-start:0; height:46px; padding:0 2px; font-size:13.5px; font-weight:500; color:var(--ink-2); text-decoration:none; }
.at-bar.is-card .at-clear svg{ width:16px; height:16px; }
.at-bar.is-card .at-clear:hover:not([disabled]){ color:var(--ink); }
.at-bar.is-card .at-clear[disabled]{ opacity:.55; cursor:default; }
.at-morebtn{ display:inline-flex; align-items:center; gap:10px; height:46px; margin-inline-start:auto; padding:0 16px; border:1px solid var(--line-2); border-radius:12px; font:inherit; font-size:14px; font-weight:500; color:var(--ink); background:var(--card); cursor:pointer; transition:border-color .15s, background .15s; }
.at-morebtn:hover{ border-color:#CFC8B8; background:#FBFAF6; }
.at-morebtn svg{ width:18px; height:18px; color:var(--ink-2); }
.at-morebtn i{ display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:99px; font-size:12px; font-style:normal; font-weight:700; color:#FFFDF8; background:var(--ink); }

/* the table card */
.at{ border-radius:18px; box-shadow:0 1px 2px rgba(18,60,53,.03), 0 12px 32px -26px rgba(18,60,53,.25); }
.cp-table th{ height:56px; padding:0 20px; font-size:14px; font-weight:600; color:#33463F; background:#F9F7F2; }
.t-sort svg{ width:14px; height:14px; opacity:.55; }
.cp-table td{ height:72px; padding:10px 20px; font-size:14.5px; }
.cp-table tbody tr:hover td{ background:#EEF5F0; }
.cp-table .t-main{ gap:14px; }
.cp-table .t-thumb{ width:58px; height:52px; border-radius:10px; }
.cp-table .t-av{ width:46px; height:46px; }
.cp-table .t-main b{ font-size:15px; font-weight:700; }
.cp-table .t-main small{ font-size:13px; margin-top:3px; }
.cp-table .is-num{ color:var(--ink); }
/* people with their photo */
.t-person{ display:inline-flex; align-items:center; gap:10px; min-width:0; }
.t-person img, .t-pav{ width:40px; height:40px; flex:none; border-radius:50%; object-fit:cover; background:#EFEBE2; box-shadow:0 0 0 2px var(--card), 0 0 0 3px #EAE5DB; }
.t-pav{ display:grid; place-items:center; font-size:14px; font-weight:700; color:var(--ink); background:var(--sage-soft); }
.t-person > span:last-child{ font-size:14.5px; }
/* status pills a little roomier */
.cp-table .st-chip{ height:28px; padding:0 12px; font-size:13px; }
/* actions: icons, then the bordered ⋮ */
.cp-acts{ gap:6px; }
.cp-act{ width:38px; height:38px; color:#3E4F49; }
.cp-act svg{ width:19px; height:19px; }
.cp-act.at-dots{ width:36px; height:36px; margin-inline-start:6px; border:1px solid var(--line-2); border-radius:10px; background:var(--card); }
.cp-act.at-dots:hover, .cp-act.at-dots[aria-expanded="true"]{ border-color:#CFC8B8; background:#F6F4EE; }
.cp-act.is-danger{ color:#B4473B; }

/* footer: the range, rows per page, round pages */
.at-foot{ min-height:68px; padding:12px 20px; background:var(--card); font-size:14px; }
.at-range{ color:var(--ink-2); }
.at-range b{ font-weight:500; color:var(--ink-2); }
.at-size select{ height:42px; min-width:140px; padding:0 14px 0 34px; border:1px solid var(--line-2); border-radius:11px; font-size:14px; color:var(--ink); }
.at-size svg{ left:12px; width:14px; height:14px; color:var(--ink-2); }
.at-pages{ gap:6px; }
.at-pages button{ min-width:38px; height:38px; padding:0; border-radius:50%; font-size:14px; color:var(--ink); }
.at-pages button[aria-current="page"]{ font-weight:700; box-shadow:0 6px 14px -8px rgba(18,60,53,.6); }
.at-pages button:first-child, .at-pages button:last-child{ border:1px solid var(--line-2); font-size:18px; line-height:1; }
.at-pages button:first-child:hover:not([disabled]), .at-pages button:last-child:hover:not([disabled]){ background:#F6F4EE; }

/* tablet: the filter card wraps; the clear action sits at its end */
@media (max-width:1240px){
  .at-bar.is-card .at-search{ max-width:none; flex-basis:100%; }
  .at-bar.is-card .at-clear{ order:5; }
}
/* phone: search and «الفلاتر» in the card; the lists move to the sheet */
@media (max-width:640px){
  .cp-head{ align-items:flex-start; }
  .cp-head h2{ font-size:22px; }
  .cp-head-acts .db-btn{ height:44px; }
  .at-bar.is-card{ padding:12px; gap:8px; }
  .at-bar.is-card .at-search{ flex:1 1 0; }
  .at-bar.is-card .at-clear[disabled]{ display:none; }
  .at-sheet .at-sel select, .at-sheet .at-sel input[type="date"]{ width:100%; max-width:none; }
  .cp-table .t-thumb{ width:52px; height:48px; }
}
.lb-main .cp-table th, .lb-main .cp-table td{ padding-inline:14px; }
@media (max-width:1500px){ .lb-main, .dsh > .lb-side{ grid-column:1 / -1; } .dsh > .lb-side{ grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); } }

/* =========================================================
   تقرير الطلاب الشامل (body.rp-ov) — header · one filter bar ·
   four KPIs · countries · the student table. Scoped to this report.
   ========================================================= */
.rp-ov .cp-head{ margin-bottom:24px; }
.rp-ov .cp-head p{ font-size:14px; color:var(--ink-2); }
.rp-ov .cp-head-acts .db-btn{ height:38px; padding:0 14px; border-radius:11px; font-size:13.5px; }
.rp-ov .cp-head-acts .db-btn svg{ width:17px; height:17px; }

/* filters: one row, the action at its end */
.rp-bar{ display:block; margin-bottom:24px; }
.rp-fields{ display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; }
.rp-fields .at-sel{ flex:1 1 150px; }
.rp-fields .at-sel select, .rp-fields .at-sel input[type="date"]{ width:100%; min-width:0; max-width:none; }
/* every report's filter bar: the empty error line added a 6px row under each field and the button was 40px,
   so «عرض النتائج» sat lower than the fields — drop the empty row and give the button the fields' 46px */
.rp-fields .fld-err:empty{ display:none; }
.rp-fields > .db-btn{ height:46px; }
.rp-go{ height:46px; padding:0 20px; border-radius:12px; flex:none; }
.rp-bar .db-form-msg:empty{ display:none; }
.rp-bar .db-form-msg{ margin-top:8px; }
.rp-ftoggle{ display:none; }

/* four KPIs, one height */
.rp-kpis{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:20px; margin-bottom:24px; }
.rp-kpis > *{ animation:db-in .5s var(--ease) both; }
.rp-kpis > :nth-child(2){ animation-delay:.05s; } .rp-kpis > :nth-child(3){ animation-delay:.1s; } .rp-kpis > :nth-child(4){ animation-delay:.15s; }
.rp-kpi, .rp-dn{ display:flex; flex-direction:column; min-height:168px; padding:20px 22px; }
.rp-kpi-h{ display:flex; align-items:center; gap:10px; }
.rp-kpi-ico{ display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:12px; }
.rp-kpi-ico svg{ width:20px; height:20px; }
.rp-kpi.is-forest .rp-kpi-ico{ color:#FFFDF8; background:var(--ink); }
.rp-kpi.is-sage .rp-kpi-ico{ color:var(--ink); background:var(--sage-soft); }
.rp-kpi small{ font-size:14px; font-weight:600; color:var(--ink-2); }
.rp-kpi b{ margin-top:auto; font-size:40px; font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; color:var(--ink); }
.rp-dn h3{ font-size:14px; font-weight:600; color:var(--ink-2); margin-bottom:12px; }
.rp-dn .donut{ grid-template-columns:96px minmax(0, 1fr); gap:16px; align-items:center; flex:1; }
.rp-dn .donut-c{ width:96px; }
.rp-dn .donut-mid b{ font-size:20px; }
.rp-dn .donut-mid small{ font-size:10.5px; }
.rp-dn .donut-l{ gap:6px; }
.rp-dn .donut-l li{ padding:6px 0; background:none; border-bottom:1px solid var(--line); border-radius:0; font-size:13.5px; }
.rp-dn .donut-l li:last-child{ border-bottom:0; }
.rp-dn .donut-c circle{ animation:rp-arc .9s var(--ease) both; }
@keyframes rp-arc{ from{ stroke-dasharray:0 400; } }

/* countries: horizontal bars, one colour */
.rp-countries{ padding:20px 22px; margin-bottom:32px; }
.rp-countries .cp-card-h small{ margin-inline-start:auto; padding:4px 10px; border-radius:99px; background:#F3F0E8; font-size:12px; }
.rp-hbars{ display:grid; gap:4px; margin:0; padding:0; list-style:none; }
.rp-hbars li{ display:grid; grid-template-columns:150px minmax(0, 1fr) 44px; align-items:center; gap:14px; padding:7px 8px; border-radius:10px; transition:background .15s; }
.rp-hbars li:hover{ background:#F3F7F4; }
.rp-hb-l{ font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rp-hb-t{ position:relative; height:12px; border-radius:99px;
  background:linear-gradient(90deg, transparent calc(25% - 1px), rgba(18,60,53,.06) 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), rgba(18,60,53,.06) 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), rgba(18,60,53,.06) 75%, transparent calc(75% + 1px)), #F4F2EC; }
.rp-hb-t i{ position:absolute; inset-block:0; right:0; width:0; border-radius:99px; background:var(--ink); transition:width .9s var(--ease); transition-delay:calc(var(--i, 0) * 40ms); }
.rp-hbars li:hover .rp-hb-t i{ background:#1E5A4E; }
.rp-hbars b{ font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; text-align:left; }

/* the table section: its own heading; the page scrolls, the header sticks under the top bar */
.rp-sec-h{ display:flex; align-items:baseline; gap:12px; margin-bottom:14px; }
.rp-sec-h h2{ font-size:19px; font-weight:700; }
.rp-sec-h span{ font-size:14px; color:var(--ink-3); }
.rp-ov .at{ overflow:clip; border-radius:22px; }
.rp-ov .cp-table-wrap{ max-height:none; overflow:visible; }
.rp-ov .cp-table th{ top:var(--top-h); }
.rp-ov .cp-table tbody tr{ animation:at-in .35s var(--ease) both; }

@media (prefers-reduced-motion:reduce){ .rp-hb-t i, .rp-dn .donut-c circle, .rp-ov .cp-table tbody tr, .rp-kpis > *{ transition:none; animation:none; } }
/* tablet: KPIs 2×2, filters wrap, the table may scroll sideways */
@media (max-width:1240px){
  .rp-kpis{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .rp-fields .at-sel{ flex-basis:180px; }
  .rp-ov .cp-table-wrap{ overflow-x:auto; }
  .rp-ov .cp-table th{ top:0; }
}
/* phone: the filters fold into a drawer; KPIs stack */
@media (max-width:640px){
  .rp-ftoggle{ display:inline-flex; }
  .rp-bar .rp-fields{ display:none; margin-top:12px; }
  .rp-bar.is-open .rp-fields{ display:grid; grid-template-columns:minmax(0, 1fr); }
  .rp-go{ width:100%; justify-content:center; }
  .rp-kpis{ grid-template-columns:minmax(0, 1fr); gap:12px; }
  .rp-kpi, .rp-dn{ min-height:0; }
  .rp-kpi b{ font-size:32px; margin-top:12px; }
  .rp-hbars li{ grid-template-columns:100px minmax(0, 1fr) 32px; gap:10px; }
}
.at-sel.is-date{ gap:7px; }
.rp-dn .donut{ grid-template-columns:88px minmax(0, 1fr); gap:14px; }
.rp-dn .donut-c{ width:88px; }
.rp-dn .donut-l span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* =========================================================
   READABILITY PASS — admin tables, status pills, KPIs
   ========================================================= */
.db .cp-table th{ font-weight:600; color:var(--ink); background:#F5F2EA; border-bottom:1px solid var(--line-2); }
.db .cp-table td{ font-weight:500; color:var(--ink); border-bottom-color:rgba(46,52,40,.1); }
.db .cp-table .t-main b{ font-weight:600; }
.db .cp-table .t-main small, .db .cp-table .is-muted{ color:var(--ink-2); font-weight:500; }
.db .cp-table .is-num{ color:var(--ink); }
.db .cp-table tbody tr:hover td{ background:#EDF4EF; }
/* status pills: darker text on their soft fills */
.db .st-chip{ font-weight:600; }
.db .st-ok{ color:#1D5439; background:#E0EDE4; }
.db .st-wait{ color:#6A4C0F; background:#F5E8C8; }
.db .st-off{ color:#55514A; background:#EBE7DF; }
.db .st-bad{ color:#8C3227; background:#F6E0DA; }
.db .st-info{ color:#20453E; background:#DFEAE6; }
/* actions and filters */
.db .cp-act{ color:#2F403A; }
.db .at-sel-l, .db .at-range{ font-weight:600; color:var(--ink); }
.db .at-sel select, .db .at-search input, .db .at-size select{ font-weight:500; color:var(--ink); }
.db .at-search input::placeholder{ color:var(--ink-3); font-weight:400; }
.db .at-clear{ color:var(--ink-2); font-weight:600; }
/* cards and KPIs */
.db .kpi small, .db .rp-kpi small, .db .rp-dn h3{ font-weight:600; color:var(--ink-2); }
.db .cp-crumbs{ font-weight:500; color:var(--ink-2); }
.db .fld-hint{ font-weight:400; color:var(--ink-3); }
.db .cp-state{ color:var(--ink-2); }
.db .cp-act.is-danger{ color:#A33A2E; }


/* =========================================================
   PHONES — a row becomes a tidy card:
   · the first cell (photo + name) is the card's header
   · every other cell is one line: the label at the start,
     the value at the end, a faint rule between lines
   · the actions fill the card's width in equal buttons;
     one or two actions show their names too
   ========================================================= */
@media (max-width:640px){
  .cp-table.is-cards tr{ padding:16px; }
  .cp-table.is-cards td{
    display:grid; grid-template-columns:minmax(96px, auto) minmax(0, 1fr); align-items:center; gap:10px;
    min-height:44px; padding:6px 0; border-bottom:1px dashed #ECE7DD;
  }
  .cp-table.is-cards td{ text-align:left; }
  .cp-table.is-cards td::before{ font-size:12.5px; color:#6B7A73; text-align:right; }
  .cp-table.is-cards td > *{ justify-self:end; min-width:0; text-align:left; }
  .cp-table.is-cards td.t-first{ display:block; text-align:right; min-height:0; padding:0 0 12px; margin-bottom:4px; border-bottom:1px solid #EFEBE3; }
  .cp-table.is-cards td.t-first > *{ justify-self:normal; text-align:right; }
  .cp-table.is-cards td.t-check{ display:none; }
  .cp-table.is-cards td:nth-last-child(2):not(.t-first){ border-bottom:0; }
  .cp-table.is-cards td:empty::after{ content:"—"; justify-self:end; color:var(--ink-3); }
  .cp-table.is-cards td.t-acts:empty{ display:none; }
  .cp-table.is-cards .t-person{ flex-direction:row; }

  .cp-table.is-cards td.t-acts{ display:block; min-height:0; margin-top:10px; padding:12px 0 0; border-top:1px solid #EFEBE3; border-bottom:0; }
  .cp-table.is-cards .cp-acts{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); gap:8px; width:100%; }
  .cp-table.is-cards .cp-act{
    width:100%; height:42px; margin:0;
    border:1px solid var(--line-2); border-radius:12px; background:var(--card); color:var(--ink);
  }
  .cp-table.is-cards :is(.cp-act.is-danger, .cp-act[data-tip^="إلغاء"], .cp-act[data-tip^="حذف"]){ color:#9A3D33; border-color:#EBCFC8; background:#FDF6F4; }
  /* one or two actions: icon and name */
  .cp-table.is-cards .cp-acts:not(:has(> :nth-child(3))) .cp-act{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit; font-size:14px; font-weight:600; }
  .cp-table.is-cards .cp-acts:not(:has(> :nth-child(3))) .cp-act::after{ content:attr(data-tip); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

}

/* =========================================================
   Nuxt: phone polish (the user's review, 2026-10-24)
   ========================================================= */
@layer legacy {
@media (max-width:640px){
  /* the page's own actions: full width, one under the other */
  .cp-head-acts{ flex-direction:column; align-items:stretch; width:100%; margin-inline-start:0; }
  .cp-head-acts > :is(a, button, .cp-wrap){ width:100%; justify-content:center; }
  .cp-head-acts > .cp-wrap > :is(a, button){ width:100%; justify-content:center; }
  /* an upload with no picture yet: no empty 72px box — the text keeps the start, «رفع» the end */
  .cp-upload img[style*="hidden"]{ display:none; }
  .cp-upload span{ text-align:start; }
  /* the page numbers wrap onto a second row instead of running out of the card */
  .at-pages{ flex-wrap:wrap; row-gap:6px; }
  .at-pages button{ min-width:32px; padding:0 6px; }
  /* hints and notes under a field or a button read from the start edge */
  .db .fld-hint, .cp-card .fld-hint{ text-align:start; }
}
}
