/* ==========================================================
   معرض الشامخ لتجارة السيارات — واجهة داكنة ذهبية RTL
   ========================================================== */

:root {
  --bg:          #0a0a0c;
  --bg-2:        #0e0e11;
  --panel:       #141417;
  --panel-2:     #191920;
  --panel-3:     #1f1f27;
  --line:        #26262d;
  --line-soft:   #1e1e24;

  --gold:        #d9b45b;
  --gold-2:      #b9862d;
  --gold-soft:   rgba(217, 180, 91, .14);
  --gold-line:   rgba(217, 180, 91, .32);

  --txt:         #eceae7;
  --txt-2:       #b6b4b0;
  --muted:       #85858e;

  --ok:          #3fbf7f;
  --warn:        #e3b341;
  --danger:      #ef5f5f;
  --info:        #58a6ff;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;

  --topbar-h: 84px;
  --side-w:   244px;

  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --t: .18s cubic-bezier(.4,0,.2,1);

  color-scheme: dark;
}

* { box-sizing: border-box; }
*::selection { background: var(--gold); color: #16130a; }

html, body { height: 100%; overflow-x: clip; }

body {
  margin: 0;
  max-width: 100vw;
  background:
    radial-gradient(1200px 520px at 78% -220px, rgba(217,180,91,.10), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: "Thmanyah Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 10px; }
.ico { flex: 0 0 auto; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a45; }

/* ==========================  الهيكل  ========================== */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(16,16,19,.98), rgba(11,11,13,.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand-logo {
  height: calc(var(--topbar-h) - 14px); width: auto; display: block;
  filter: drop-shadow(0 3px 10px rgba(217,180,91,.18));
  transition: filter var(--t), transform var(--t);
}
.brand:hover .brand-logo { filter: drop-shadow(0 4px 14px rgba(217,180,91,.34)); transform: translateY(-1px); }

.global-search {
  position: relative; flex: 1 1 420px; max-width: 520px; margin-inline: auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 16px; height: 42px;
  transition: border-color var(--t), box-shadow var(--t);
}
.global-search:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
.global-search > .ico { color: var(--muted); }
.global-search input {
  flex: 1; background: none; border: 0; outline: none; font-size: 14px; min-width: 0;
}
.global-search input::placeholder { color: #6c6c75; }

.search-drop {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 90;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; max-height: 65vh; overflow-y: auto;
}
.sd-group { padding: 7px 14px 4px; font-size: 11px; color: var(--gold); letter-spacing: .05em; }
.sd-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-soft); transition: background var(--t); }
.sd-item:hover, .sd-item.hl { background: var(--panel-2); }
.sd-item b { font-weight: 500; font-size: 14px; }
.sd-item em { font-style: normal; color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.sd-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

.topbar-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; color: var(--txt-2); transition: var(--t);
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-line); background: var(--panel-3); }

.dot-count {
  position: absolute; top: -5px; inset-inline-end: -5px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 20px; display: grid; place-items: center; border: 2px solid var(--bg-2);
}

.clock { text-align: center; line-height: 1.2; padding-inline-start: 4px; }
.clock b  { display: block; font-size: 15px; color: var(--gold); }
.clock em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }

/* التنبيهات */
.notif { position: relative; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0; width: min(370px, 92vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); z-index: 95; overflow: hidden;
}
.notif-head { padding: 12px 15px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.notif-head span { color: var(--gold); }
.notif-list { max-height: 62vh; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); transition: background var(--t); }
.notif-item:hover { background: var(--panel-2); }
.ni-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.notif-item.danger .ni-ico { background: rgba(239,95,95,.14); color: var(--danger); }
.notif-item.warn   .ni-ico { background: rgba(227,179,65,.14); color: var(--warn); }
.notif-item.ok     .ni-ico { background: rgba(63,191,127,.14); color: var(--ok); }
.notif-item.muted  .ni-ico { background: var(--panel-3); color: var(--muted); }
.ni-body { display: grid; gap: 2px; min-width: 0; }
.ni-body b  { font-size: 13.5px; font-weight: 600; }
.ni-body em { font-style: normal; font-size: 12px; color: var(--muted); }
.notif-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* الشريط الجانبي */
.shell { flex: 1; display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--side-w); flex: 0 0 var(--side-w);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel), #0f0f12);
  border-inline-start: 1px solid var(--line);
  padding: 14px 12px; gap: 10px;
}
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10.5px 13px; border-radius: 11px;
  color: var(--txt-2); font-size: 14.5px; font-weight: 500;
  transition: var(--t); position: relative;
}
.nav-item:hover { background: var(--panel-2); color: var(--txt); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(217,180,91,.05), var(--gold-soft));
  color: var(--gold); font-weight: 700;
}
.nav-item.active::after {
  content: ""; position: absolute; inset-inline-end: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 4px; background: linear-gradient(var(--gold), var(--gold-2));
}
.nav-item.logout { margin-top: 6px; color: #d98080; }
.nav-item.logout:hover { background: rgba(239,95,95,.10); color: #ff9c9c; }

.side-banner {
  position: relative; display: block; margin-top: auto;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #0b0b0d;
  transition: border-color var(--t), box-shadow var(--t);
}
.side-banner img { display: block; width: 100%; height: auto; opacity: .92; transition: opacity var(--t); }
.side-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,14,17,.35), rgba(14,14,17,0) 45%, rgba(14,14,17,.45));
}
.side-banner:hover { border-color: var(--gold-line); box-shadow: 0 8px 26px rgba(217,180,91,.14); }
.side-banner:hover img { opacity: 1; }

.side-foot { border-top: 1px solid var(--line); padding-top: 10px; text-align: center; }
.side-user { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--txt-2); margin-bottom: 3px; }
.side-foot small { color: #5f5f68; font-size: 10.5px; }

.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* المحتوى */
.content { flex: 1; min-width: 0; padding: 20px 22px 40px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 {
  font-size: 22px; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.page-head h1::before {
  content: ""; width: 4px; height: 22px; border-radius: 4px;
  background: linear-gradient(var(--gold), var(--gold-2));
}
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ==========================  عناصر  ========================== */

.card {
  background: linear-gradient(180deg, var(--panel), #101013);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 16px;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 13px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card.pad0 > .card-head { padding: 15px 18px; margin: 0; }
.card-head h2, .card-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ico, .card-head h3 .ico { color: var(--gold); }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* بطاقات الإحصاء */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
@media (min-width: 720px)  { .stats { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1080px) { .stats { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel), #101013);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; transition: var(--t);
}
.stat:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.stat::before {
  content: ""; position: absolute; inset-inline-end: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .06;
}
.stat .s-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stat .s-title { font-size: 12.5px; color: var(--txt-2); font-weight: 500; }
.stat .s-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: currentColor; }
.stat .s-ico .ico { color: #0d0d10; }
.stat .s-val { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; color: var(--txt); }
.stat .s-unit { font-size: 11.5px; color: var(--muted); }
.stat.c-gold   { color: var(--gold); }
.stat.c-ok     { color: var(--ok); }
.stat.c-warn   { color: var(--warn); }
.stat.c-danger { color: var(--danger); }
.stat.c-info   { color: var(--info); }
.stat .s-val.tone { color: currentColor; }

/* أزرار */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9.5px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--t); white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #34343d; }
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #17130a; border-color: transparent; font-weight: 700;
  box-shadow: 0 4px 14px rgba(217,180,91,.20);
}
.btn-gold:hover { filter: brightness(1.07); background: linear-gradient(180deg, var(--gold), var(--gold-2)); }
.btn-ok     { background: rgba(63,191,127,.13); border-color: rgba(63,191,127,.35); color: #7fe0ad; }
.btn-danger { background: rgba(239,95,95,.11); border-color: rgba(239,95,95,.32); color: #ff9c9c; }
.btn-ghost  { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* شارات */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.ok     { background: rgba(63,191,127,.13);  color: #6fdda6; border-color: rgba(63,191,127,.28); }
.badge.warn   { background: rgba(227,179,65,.13);  color: #f0cd76; border-color: rgba(227,179,65,.28); }
.badge.danger { background: rgba(239,95,95,.13);   color: #ff9494; border-color: rgba(239,95,95,.28); }
.badge.info   { background: rgba(88,166,255,.13);  color: #8cc4ff; border-color: rgba(88,166,255,.28); }
.badge.gold   { background: var(--gold-soft);      color: var(--gold); border-color: var(--gold-line); }
.badge.muted  { background: var(--panel-3);        color: var(--muted); border-color: var(--line); }

/* تنبيهات الصفحة */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border-radius: var(--r); margin-bottom: 14px;
  font-size: 14px; border: 1px solid;
  animation: slideDown .25s ease;
}
.alert.success { background: rgba(63,191,127,.09); border-color: rgba(63,191,127,.3); color: #8fe3b8; }
.alert.error   { background: rgba(239,95,95,.09);  border-color: rgba(239,95,95,.3);  color: #ffa5a5; }
.alert.info    { background: rgba(88,166,255,.09); border-color: rgba(88,166,255,.3); color: #9fcbff; }
.alert-x { margin-inline-start: auto; background: none; border: 0; cursor: pointer; opacity: .6; display: grid; }
.alert-x:hover { opacity: 1; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } }

/* ==========================  الجداول  ========================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.tbl th {
  text-align: start; padding: 11px 13px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: var(--panel-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background var(--t); }
table.tbl tbody tr:hover { background: rgba(255,255,255,.022); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-danger { background: rgba(239,95,95,.055); }
.row-warn   { background: rgba(227,179,65,.05); }
.row-ok     { background: rgba(63,191,127,.04); }

.thumb {
  width: 46px; height: 34px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--panel-2);
}
.thumb.ph { display: grid; place-items: center; color: #4a4a54; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { color: #35353e; margin: 0 auto 10px; }
.empty h3 { font-size: 16px; color: var(--txt-2); margin-bottom: 5px; }
.empty p { font-size: 13.5px; }

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 13.5px; transition: var(--t);
}
.pager a:hover { border-color: var(--gold-line); color: var(--gold); }
.pager .cur { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #17130a; border-color: transparent; font-weight: 700; }
.pager .dis { opacity: .4; }

/* ==========================  النماذج  ========================== */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; color: var(--txt-2); font-weight: 500; }
.field > label .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--muted); }

.inp, select.inp, textarea.inp {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 14.5px;
  outline: none; transition: var(--t); min-width: 0;
}
textarea.inp { resize: vertical; min-height: 92px; line-height: 1.7; }
.inp:hover { border-color: #33333c; }
.inp:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); background: var(--panel-3); }
.inp::placeholder { color: #62626b; }
.inp[readonly] { opacity: .75; cursor: default; }
select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2385858e' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: left 12px center; padding-inline-start: 34px;
}
input[type="date"].inp::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}

.section-title {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 700; color: var(--gold);
  margin-top: 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.section-title:first-child { margin-top: 0; }

/* رفع الملفات */
.uploader { display: grid; gap: 8px; }
.drop {
  position: relative; display: grid; place-items: center; gap: 7px;
  min-height: 116px; padding: 14px; text-align: center;
  border: 1.5px dashed #34343d; border-radius: var(--r);
  background: var(--panel-2); cursor: pointer; transition: var(--t); overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--gold-line); background: var(--panel-3); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ico { color: var(--gold); }
.drop b { font-size: 13px; font-weight: 500; }
.drop small { font-size: 11px; color: var(--muted); }
.drop img.prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop.has-file b, .drop.has-file small, .drop.has-file .ico { position: relative; z-index: 2; }
.drop.has-file::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 1; }
.file-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.file-row a { color: var(--gold); display: inline-flex; align-items: center; gap: 5px; }
.file-row label { display: inline-flex; align-items: center; gap: 5px; color: #d98080; cursor: pointer; margin-inline-start: auto; }

/* بحث منسدل داخل النماذج */
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 5px); inset-inline: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); max-height: 260px; overflow-y: auto;
}
.combo-list div { padding: 9px 13px; cursor: pointer; font-size: 14px; border-top: 1px solid var(--line-soft); }
.combo-list div:first-child { border-top: 0; }
.combo-list div:hover, .combo-list div.hl { background: var(--panel-2); color: var(--gold); }

/* أدوات التصفية */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.toolbar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 1; }
.toolbar .inp { max-width: 260px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt-2); transition: var(--t);
}
.chip:hover { border-color: var(--gold-line); color: var(--gold); }
.chip.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); font-weight: 600; }

/* ==========================  تفاصيل  ========================== */

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 2px 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv dt, .kv .k { color: var(--muted); font-size: 13px; }
.kv .v { font-weight: 500; text-align: end; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
.media {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel-2);
}
.media .m-img { aspect-ratio: 4/3; background: #0d0d10; display: grid; place-items: center; overflow: hidden; }
.media .m-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.media:hover .m-img img { transform: scale(1.04); }
.media .m-cap { padding: 8px 11px; font-size: 12.5px; color: var(--txt-2); display: flex; justify-content: space-between; gap: 8px; }
.media .m-cap a { color: var(--gold); }

.hero {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 18px; align-items: start;
}
.hero-img { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--panel-2); display: grid; place-items: center; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

.progress { height: 9px; border-radius: 99px; background: var(--panel-3); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .5s ease; }
.progress.ok > i { background: linear-gradient(90deg, #2e9e68, var(--ok)); }

.timeline-note { font-size: 13px; color: var(--muted); }

.mini-list { display: grid; gap: 8px; }
.mini-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2);
  transition: var(--t); font-size: 13.5px;
}
.mini-item:hover { border-color: var(--gold-line); }
.mini-item .mi-main { display: grid; min-width: 0; }
.mini-item .mi-main b { font-weight: 600; font-size: 13.5px; }
.mini-item .mi-main small { color: var(--muted); font-size: 11.5px; }
.mini-item .mi-end { margin-inline-start: auto; text-align: end; }

/* الرسم البياني البسيط */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bars .bar i {
  display: block; width: 100%; max-width: 40px; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--gold), rgba(185,134,45,.35));
  transition: height .5s ease; min-height: 3px;
}
.bars .bar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars .bar em { font-size: 10.5px; color: var(--txt-2); font-style: normal; }

.donut { display: grid; place-items: center; gap: 12px; }
.donut svg { transform: rotate(-90deg); }
.legend { display: grid; gap: 7px; width: 100%; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { margin-inline-start: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==========================  تسجيل الدخول  ========================== */

.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 22px;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(217,180,91,.14), transparent 62%),
    var(--bg);
}
.login-card {
  width: min(410px, 100%); background: linear-gradient(180deg, var(--panel), #0f0f13);
  border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img {
  width: min(240px, 78%); height: auto; margin: 0 auto;
  filter: drop-shadow(0 10px 26px rgba(217,180,91,.20));
}
.login-logo p { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.login-card .field { margin-bottom: 14px; }
.login-foot { text-align: center; color: #5c5c65; font-size: 11.5px; margin-top: 18px; }

/* ==========================  الطباعة  ========================== */

.print-sheet {
  background: #fff; color: #111; border-radius: 8px; padding: 34px 38px;
  max-width: 860px; margin: 0 auto; font-size: 14px; line-height: 1.9;
}
.print-sheet h2, .print-sheet h3 { color: #0f0f0f; }
.print-sheet .ps-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #c9a227; padding-bottom: 14px; margin-bottom: 18px; gap: 16px; }
.print-sheet .ps-brand { display: flex; align-items: center; gap: 14px; }
.print-sheet .ps-logo { width: 96px; height: auto; flex: 0 0 auto; border-radius: 10px; }
.print-sheet .ps-title { font-family: "Thmanyah Serif Display", serif; font-size: 26px; font-weight: 900; color: #a8801f; }
.print-sheet .ps-meta { text-align: end; font-size: 12.5px; color: #555; }
.print-sheet table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13px; }
.print-sheet table th, .print-sheet table td { border: 1px solid #ccc; padding: 7px 10px; text-align: start; }
.print-sheet table th { background: #f4efe1; color: #4a3d13; font-weight: 700; }
.print-sheet .ps-sec { margin-top: 18px; }
.print-sheet .ps-sec > h3 { font-size: 15px; background: #f4efe1; color: #4a3d13; padding: 6px 11px; border-inline-start: 4px solid #c9a227; }
.print-sheet .ps-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 46px; text-align: center; font-size: 13px; }
.print-sheet .ps-sign > div { flex: 1; border-top: 1px solid #999; padding-top: 7px; }
.print-sheet .ps-terms { font-size: 12.5px; white-space: pre-line; line-height: 1.95; }

@media print {
  .topbar, .sidebar, .page-head, .page-actions, .no-print, .alert, .scrim { display: none !important; }
  body { background: #fff !important; }
  .content { padding: 0 !important; }
  .print-sheet { border: 0; box-shadow: none; max-width: 100%; padding: 0; }
  .card { border: 0; background: #fff; }
  .print-sheet .ps-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 12mm; }
}

/* ==========================  الاستجابة  ========================== */

.only-mobile { display: none; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 66px; }
  .only-mobile { display: grid; }
  .clock { display: none; }
  .content { padding: 16px 14px 34px; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; right: 0; left: auto;
    height: 100vh; z-index: 80; width: 268px; flex-basis: 268px;
    transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: -12px 0 40px rgba(0,0,0,.5); padding-top: 18px;
    border-inline-start: 0; border-inline-end: 1px solid var(--line);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .global-search { flex-basis: 100%; max-width: none; }
  .g-3, .g-2, .g-side { grid-template-columns: 1fr; }
}

/* إخفاء بانر الشريط الجانبي على الشاشات القصيرة حتى لا تُزاحم القائمة */
@media (max-height: 740px) and (min-width: 901px) {
  .side-banner { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { gap: 9px; padding: 0 12px; }
  .global-search { order: 5; position: fixed; top: var(--topbar-h); inset-inline: 12px; width: auto; z-index: 55; display: none; }
  body.search-open .global-search { display: flex; }
  .app { padding-top: 0; }
  .page-head h1 { font-size: 19px; }
  .g-4 { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .s-val { font-size: 21px; }
  .card { padding: 14px; border-radius: var(--r); }
  .toolbar .inp { max-width: none; flex: 1 1 150px; }
  .toolbar form > .btn { flex: 0 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }
  .print-sheet { padding: 18px 16px; }

  /* جداول متجاوبة: تتحول إلى بطاقات */
  table.tbl.stack { min-width: 0; }
  table.tbl.stack thead { display: none; }
  table.tbl.stack tbody tr {
    display: grid; gap: 4px; padding: 12px 13px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--panel-2);
  }
  table.tbl.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.tbl.stack td::before {
    content: attr(data-l); color: var(--muted); font-size: 12.5px; flex: 0 0 auto;
  }
  table.tbl.stack td.actions { justify-content: flex-start; padding-top: 9px; margin-top: 5px; border-top: 1px solid var(--line); }
  table.tbl.stack td.actions::before { display: none; }
  table.tbl.stack td:empty { display: none; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
}

/* حركات لطيفة */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
