/* ==========================================================================
   واجهة لوحة التحكم — الألوان مأخوذة من شعار ماكرون (أزرق بحري + فيروزي)
   ========================================================================== */
:root {
  --bg: #f1f6f8;
  --surface: #ffffff;
  --ink: #10303d;
  --soft: #4f6b78;
  --mute: #7d949f;
  --line: #d9e4e9;
  --line-2: #e9f0f3;
  --tint: #f5f9fa;

  --brand: #0f6f8f;
  --brand-dark: #0b566f;
  --brand-soft: #e3f1f5;
  --teal: #3cbcae;
  --sea: #0d4458;

  --ok: #17703f;
  --ok-soft: #e2f3ea;
  --bad: #b3261e;
  --bad-soft: #fdecea;

  --chart-1: #0f78b0; /* محصّل */
  --chart-2: #3cbcae; /* غير محصّل */

  --r-ctl: 10px;
  --r-card: 16px;
  --r-hero: 22px;
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plex Arabic", Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
p { margin: 0; }
.ic { flex: none; width: 20px; height: 20px; }
.muted { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sar { font-family: "Riyal"; font-size: .82em; color: var(--mute); font-weight: 400; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- الهيكل: قائمة جانبية + محتوى ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  flex: none; width: var(--side-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 22px 14px 16px;
  overflow-y: auto;
}
.side-brand { display: block; text-align: center; padding: 4px 8px 20px; color: var(--ink); }
.side-brand:hover { text-decoration: none; }
.side-brand img { display: block; max-width: 150px; max-height: 96px; margin: 0 auto 6px; object-fit: contain; }
.side-brand strong { display: block; font-size: 19px; font-weight: 600; margin-bottom: 2px; }
.side-brand small { font-size: 12.5px; color: var(--mute); }
.side-nav { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.side-nav a, .side-link, .side-foot .lang {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px;
  border: 0; border-radius: var(--r-ctl); background: none;
  color: var(--soft); font: inherit; font-size: 15px; text-align: start; cursor: pointer;
}
.side-nav a:hover, .side-link:hover, .side-foot .lang:hover { background: var(--tint); color: var(--ink); text-decoration: none; }
.side-nav a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
[dir=rtl] .side-nav a.on { box-shadow: inset -3px 0 0 var(--teal); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 28px 64px; }
.content.wide { max-width: 1480px; }

.mbar { display: none; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.mbar-brand { font-weight: 600; color: var(--ink); }
.scrim { display: none; }

.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h .sub { color: var(--mute); font-size: 13.5px; margin-top: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; margin-bottom: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card > h2 { margin-bottom: 16px; }
.more { font-size: 14px; font-weight: 500; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--tint); text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.light { background: #fff; border-color: #fff; color: var(--sea); font-weight: 600; }
.btn.light:hover { background: #e9f6f8; }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.btn.off { opacity: .45; cursor: default; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 9px; background: none; color: var(--soft); cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* ---------- حقول ---------- */
label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--mute); }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=url], input[type=search], textarea, select {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid #c6d4db; border-radius: var(--r-ctl);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 15px;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
input[dir=ltr], textarea[dir=ltr] { text-align: left; }
.hint { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* اختيار من خيارين (حالة الدفع) */
.choice { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--tint); }
.choice label { margin: 0; position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 16px; border-radius: 8px; font-size: 14px; color: var(--soft); }
.choice input:checked + span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(13, 68, 88, .16); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- تنبيهات ---------- */
.note { padding: 12px 16px; border-radius: var(--r-ctl); margin-bottom: 18px; font-size: 14.5px; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note ul { margin: 0; padding-inline-start: 18px; }

/* ---------- شارة الحالة ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-paid { background: var(--ok-soft); color: var(--ok); }
.st-due { background: var(--brand-soft); color: var(--brand-dark); }
.st-overdue { background: var(--bad-soft); color: var(--bad); }
.due { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--soft); white-space: nowrap; }
.due .ic { width: 17px; height: 17px; }
.due-overdue { color: var(--bad); font-weight: 500; }
.due-paid { color: var(--mute); }
.due-paid .ic { color: var(--ok); }

/* ---------- الجداول ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th {
  text-align: start; font-weight: 500; font-size: 13px; color: var(--soft);
  padding: 12px 16px; background: var(--tint); border-block: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr[data-href]:hover { background: var(--tint); }
.tbl .end { text-align: end; }
.tbl .amount b { font-weight: 600; }
.tbl .cust { min-width: 150px; }
.tbl .act { width: 52px; text-align: end; padding-block: 6px; }
.tbl tfoot td { padding: 13px 16px; background: var(--tint); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--soft); }
.tbl tfoot td.num { color: var(--ink); }
.tbl.compact th, .tbl.compact td { padding: 8px 12px; font-size: 13.5px; }
.row-link { font-weight: 500; }

/* ---------- صفحة الفواتير ---------- */
.card.list { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin: 0; }
.search-box { flex: 1 1 240px; max-width: 360px; position: relative; margin: 0; color: var(--mute); }
.search-box .ic { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; pointer-events: none; }
.search-box input { padding-inline-start: 40px; background: var(--tint); border-color: transparent; }
.search-box input:focus { background: #fff; }
.pick { position: relative; margin: 0; color: var(--soft); }
.pick .ic { position: absolute; inset-inline-start: 11px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; pointer-events: none; }
.pick select { width: auto; padding-inline: 36px 30px; font-size: 14px; font-weight: 500; color: var(--ink); border-color: var(--line); cursor: pointer; }
.seg { display: inline-flex; padding: 3px; margin-inline-start: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--tint); }
.seg a { display: flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 8px; font-size: 13.5px; color: var(--soft); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(13, 68, 88, .16); }
.seg .ic { width: 17px; height: 17px; }

.mode-table .as-cards { display: none; }
.mode-cards .as-table { display: none; }
.inv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; padding: 4px 16px 18px; }
.inv-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; border-top: 3px solid var(--line); }
.st-edge-paid { border-top-color: #57b98a; }
.st-edge-due { border-top-color: var(--teal); }
.st-edge-overdue { border-top-color: #d9534a; }
.inv-card header { display: flex; align-items: center; gap: 10px; }
.inv-card header .badge { margin-inline-start: auto; }
.inv-card-cust { margin-top: 10px; font-weight: 500; }
.inv-card-amt { margin-top: 2px; font-size: 22px; font-variant-numeric: tabular-nums; }
.inv-card-amt b { font-weight: 600; }
.inv-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line-2); font-size: 14px; }

/* قائمة الإجراءات ⋮ */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--line-2); color: var(--ink); }
.menu-pop {
  position: fixed; z-index: 60; min-width: 200px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(13, 68, 88, .18);
  text-align: start;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
  border: 0; border-radius: 8px; background: none; color: var(--ink);
  font: inherit; font-size: 14.5px; text-align: start; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--tint); text-decoration: none; }
.menu-pop .ic { width: 18px; height: 18px; color: var(--soft); }
.menu-pop form { margin: 0; }
.menu-pop .danger, .menu-pop .danger .ic { color: var(--bad); }
.menu-pop .danger:hover { background: var(--bad-soft); }

.empty { text-align: center; padding: 56px 20px; }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--soft); margin-bottom: 18px; }
.empty-art { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }
.empty-art .ic { width: 30px; height: 30px; }

/* ---------- الشاشة الرئيسية ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--sea); color: #fff;
  border-radius: var(--r-hero); margin-bottom: 18px;
}
.waves { position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 62%; z-index: -1; }
.hero-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; padding: 30px 34px 34px; }
.hero-date { font-size: 14px; color: #b9dbe4; margin-bottom: 14px; }
.hero-label { font-size: 17px; font-weight: 500; color: #e3f3f6; }
.hero-figure { font-size: clamp(40px, 5.6vw, 60px); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 2px 0 8px; }
.hero-figure .sar { color: #a9d7e0; font-size: .5em; }
.hero-welcome { font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; margin-bottom: 8px; }
.hero-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: #dff0f4; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 99px; background: #fff; color: var(--bad); font-size: 13.5px; font-weight: 600; }
.hero-chip .ic { width: 16px; height: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px 16px; }
.kpi-ic { position: absolute; inset-inline-end: 16px; top: 16px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; }
.c-blue { background: var(--brand-soft); color: var(--brand); }
.c-teal { background: #dff5f2; color: #17877b; }
.c-red { background: var(--bad-soft); color: var(--bad); }
.c-green { background: var(--ok-soft); color: var(--ok); }
.c-ink { background: var(--line-2); color: var(--soft); }
.kpi-label { font-size: 14px; color: var(--soft); padding-inline-end: 46px; }
.kpi-value { font-size: 27px; font-weight: 600; line-height: 1.3; margin: 6px 0 6px; white-space: nowrap; }
.kpi-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--mute); min-height: 22px; }
.delta { font-weight: 600; direction: ltr; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.meter { flex: 1 1 60px; max-width: 110px; height: 6px; border-radius: 99px; background: #cfeeea; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: #17877b; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-grid .card { margin: 0; }
.dash-grid .recent { grid-column: 1 / -1; padding-bottom: 8px; }
.recent .tbl td:first-child { padding-inline-start: 0; }
.recent .tbl td:last-child { padding-inline-end: 0; }

/* رسم الأعمدة الشهري */
.legend { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-c { background: var(--chart-1); }
.sw-o { background: var(--chart-2); }
.chart { display: flex; gap: 10px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 220px; font-size: 12px; color: var(--mute); text-align: end; font-variant-numeric: tabular-nums; }
.chart-y span { line-height: 1; translate: 0 -50%; }
.chart-y span:last-child { translate: 0 50%; }
.chart-plot { position: relative; flex: 1; min-width: 0; }
.chart-grid { position: absolute; inset-inline: 0; top: 0; height: 220px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid i { display: block; height: 1px; background: var(--line-2); }
.chart-grid i:last-child { background: var(--line); }
.chart-cols { position: relative; display: flex; }
.col { flex: 1; min-width: 0; text-align: center; border-radius: 8px; }
.col-plot { position: relative; height: 220px; display: flex; align-items: flex-end; justify-content: center; }
.col-stack { width: 60%; max-width: 24px; min-height: 3px; display: flex; flex-direction: column-reverse; gap: 2px; transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.col-stack .bar { display: block; flex: 1 1 0; min-height: 2px; }
.col-stack .bar:last-child { border-radius: 4px 4px 0 0; }
.bar-c { background: var(--chart-1); }
.bar-o { background: var(--chart-2); }
.col:hover .col-plot, .col:focus-visible .col-plot { background: linear-gradient(var(--tint), var(--tint)) center / 100% 100% no-repeat; }
.col-x { padding-top: 8px; font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.col-tip {
  display: none; position: absolute; z-index: 5; inset-inline-start: 50%; translate: -50% 0;
  min-width: 168px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 12.5px; text-align: start; line-height: 1.5;
  box-shadow: 0 8px 20px rgba(13, 68, 88, .25); pointer-events: none;
}
[dir=rtl] .col-tip { translate: 50% 0; }
.col:nth-child(-n+2) .col-tip { inset-inline-start: 0; translate: 0 0; }
.col:nth-last-child(-n+2) .col-tip { inset-inline-start: auto; inset-inline-end: 0; translate: 0 0; }
.col:hover .col-tip, .col:focus-visible .col-tip { display: block; }
.col-tip strong { display: block; font-weight: 600; margin-bottom: 4px; }
.col-tip span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.col-tip b { margin-inline-start: auto; padding-inline-start: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-tip .tip-total { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .2); }
.chart-data { margin-top: 16px; font-size: 13.5px; }
.chart-data summary { cursor: pointer; color: var(--brand); font-weight: 500; width: fit-content; }
.chart-data .tbl-wrap { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 10px; }
@keyframes grow { from { transform: scaleY(0); } }

/* أكبر العملاء */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.rank-top a { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { margin: 7px 0 4px; height: 8px; }
.rank-bar span { display: block; height: 100%; min-width: 4px; background: var(--chart-1); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.rank-sub { font-size: 12.5px; color: var(--mute); }

/* ---------- محرر الفاتورة ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
.editor .card h2 { margin-bottom: 16px; }
.preview { position: sticky; top: 16px; }
.preview-h { font-size: 13.5px; color: var(--mute); margin-bottom: 8px; }
#preview-stage { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.items-h, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 116px 104px 36px; gap: 8px; align-items: center; }
.items-h { font-size: 12.5px; color: var(--soft); font-weight: 500; margin-bottom: 6px; }
.items-h .end { text-align: end; }
.item-row { margin-bottom: 8px; }
.item-total { font-variant-numeric: tabular-nums; font-size: 14.5px; text-align: end; }
.item-del { width: 36px; height: 36px; border-radius: 9px; border: 0; background: none; color: var(--mute); font-size: 20px; line-height: 1; cursor: pointer; }
.item-del:hover { background: var(--bad-soft); color: var(--bad); }

/* ---------- بيانات الشركة ---------- */
.logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-box { width: 160px; height: 104px; flex: none; display: grid; place-items: center; border: 1px dashed #b9cad2; border-radius: 12px; background: var(--tint); color: var(--mute); font-size: 13px; }
.logo-box img { max-width: 138px; max-height: 86px; object-fit: contain; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; font-size: 13.5px; margin: 10px 0 0; }
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }

/* ---------- صفحات الدخول ---------- */
.auth-body { background: var(--bg); }
.auth-art { position: fixed; inset: 0 0 auto; height: 44vh; min-height: 260px; background: var(--sea); overflow: hidden; }
.auth-art .waves { height: 70%; z-index: 0; }
.auth { position: relative; max-width: 420px; margin: 0 auto; padding: 9vh 20px 40px; }
.auth-brand { text-align: center; margin-bottom: 18px; color: #fff; }
.auth-brand img { max-width: 170px; max-height: 110px; padding: 12px 18px; background: #fff; border-radius: 18px; object-fit: contain; }
.auth-brand strong { font-size: 24px; font-weight: 600; }
.auth .card { padding: 28px; border-radius: 20px; box-shadow: 0 18px 44px rgba(13, 68, 88, .16); }
.auth h1 { font-size: 21px; margin-bottom: 4px; }
.auth .sub { color: var(--soft); font-size: 14.5px; margin: 0 0 20px; }
.auth .field { margin-bottom: 14px; }
.auth .btn { width: 100%; margin-top: 6px; }
.auth-lang { text-align: center; margin: 16px 0 0; font-size: 14px; }

/* ---------- الشاشات الأصغر ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .mbar { display: flex; }
  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; height: auto;
    translate: -105% 0; transition: translate .22s ease; box-shadow: 0 0 40px rgba(13, 68, 88, .22);
  }
  [dir=rtl] .side { translate: 105% 0; }
  .side-open .side { translate: 0 0; }
  .side-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(13, 48, 61, .42); }
  .content { padding: 20px 16px 56px; }
}
@media (max-width: 760px) {
  .list .as-table { display: none; }
  .list .as-cards { display: grid; }
  .seg { display: none; }
  .search-box { max-width: none; flex-basis: 100%; }
  .pick { flex: 1 1 auto; }
  .pick select { width: 100%; }
  .hero-in { padding: 24px 20px 28px; }
  .chart-cols .col:nth-child(-n+6) { display: none; }
  .hide-sm { display: none; }
  .grid, .grid.three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .items-h { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 36px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
  .item-row .item-desc { grid-column: 1 / -1; }
  .item-total { grid-column: 1 / 3; grid-row: 3; text-align: start; }
  .item-row .item-del { grid-row: 2; grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .col-stack { animation: none; }
  .side { transition: none; }
}
