:root {
  --bg: #f3f5f8;
  --card: #fff;
  --text: #1d2733;
  --muted: #6b7785;
  --border: #dde3ea;
  --primary: #1f4e79;
  --out: #c0392b;
  --in: #1e8449;
  --danger: #b03a2e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171d;
    --card: #1b222b;
    --text: #e6ebf0;
    --muted: #93a0ad;
    --border: #2c3642;
    --primary: #4d8fd1;
    --out: #e06456;
    --in: #4cc07d;
    --danger: #e06456;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--primary); }
h1 { font-size: 1.35rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 620px; margin-inline: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

label { display: block; margin-bottom: 12px; font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
input[type=checkbox] { width: auto; margin: 0; }
input[type=file] { padding: 8px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 12px; padding: 10px 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.out { background: var(--out); border-color: var(--out); color: #fff; }
.btn.in { background: var(--in); border-color: var(--in); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.actions-big { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.btn.big { padding: 20px; font-size: 1.15rem; font-weight: 700; text-align: center; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form-actions form { display: inline; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: .9rem; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: rgba(30,132,73,.1); border-color: var(--in); }
.alert.err { background: rgba(192,57,43,.1); border-color: var(--out); }
.alert.warn { background: rgba(212,140,20,.12); border-color: #d48c14; }
.alert.info { background: rgba(47,111,176,.1); border-color: #2f6fb0; font-size: .92em; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .85rem; background: var(--bg); border: 1px solid var(--border); }
.badge.out { background: var(--out); color: #fff; border-color: var(--out); }
.badge.in { background: var(--in); color: #fff; border-color: var(--in); }
.badge.admin { background: var(--primary); color: #fff; border-color: var(--primary); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }

/* الجداول تتحول إلى بطاقات على الموبايل */
@media (max-width: 720px) {
  .actions-big { grid-template-columns: 1fr; }
  .stat b { font-size: 1.4rem; }
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 6px 10px; }
  td { border: 0; padding: 4px 0; white-space: normal; display: flex; justify-content: space-between; gap: 10px; }
  td[data-label]::before { content: attr(data-label); color: var(--muted); }
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input, .filters select { width: auto; margin: 0; flex: 1 1 140px; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pager a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.preview, .photo { max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 12px; }
code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }

/* v2 */
tr.inactive td { opacity: .55; }
tr.overdue td { background: rgba(192,57,43,.08); }
.text-danger { color: var(--danger); }
.inline-form { display: inline; }
.push-end { margin-inline-start: auto; }
td.wrap { white-space: normal; }
.quick-links { margin: -6px 0 16px; text-align: center; }
.alerts ul { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; border-inline-start: 4px solid; }
.alerts li a { color: inherit; text-decoration: none; display: block; }
.alerts li.warn { background: rgba(212,140,20,.12); border-color: #d48c14; }
.alerts li.danger { background: rgba(192,57,43,.1); border-color: var(--danger); }
.bar-cell { width: 25%; }
.bar { display: block; height: 10px; border-radius: 5px; background: var(--primary); min-width: 2px; }
.badge.act-create { background: var(--in); color: #fff; border-color: var(--in); }
.badge.act-delete { background: var(--danger); color: #fff; border-color: var(--danger); }
.badge.act-update { background: #d48c14; color: #fff; border-color: #d48c14; }
.print-only { display: none; }
@media (max-width: 720px) {
  .bar-cell { display: none !important; }
}
@media print {
  .topbar, .no-print, .form-actions, .pager { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
  .container { max-width: none; padding: 0; }
  table thead { display: table-header-group !important; }
  table { display: table !important; } tbody { display: table-row-group !important; }
  tr { display: table-row !important; border: 0 !important; } td { display: table-cell !important; }
  td[data-label]::before { content: none !important; }
}

/* v3: استيراد الوقود */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.steps { padding-inline-start: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 4px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.text-ok { color: var(--in) !important; }
tr.st-err td { background: rgba(192,57,43,.06); }
tr.st-dup td { opacity: .6; }
.badge.small { font-size: .75rem; padding: 0 6px; }
.preview-table { max-height: 60vh; overflow: auto; margin-bottom: 8px; }
@media (max-width: 720px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }

/* v4: الرسوم والتقارير والميزات الإضافية */
.chart-wrap { width: 100%; overflow-x: auto; }
svg.chart { width: 100%; height: auto; display: block; margin-inline: auto; direction: ltr; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; margin-bottom: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.chart-unit { text-align: start; }
.mt { margin-top: 1.4rem; }
table.matrix td, table.matrix th { text-align: center; }
table.matrix td:first-child, table.matrix th:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--card); }
td.heat { background: rgba(47,111,176, calc(var(--a) * .45)); }
tr.total-row td { font-weight: 700; border-top: 2px solid var(--border); }
.cat-bars { margin: 0 0 14px; }
.cat-bars div { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 4px; }
.cat-bars b { text-align: end; }
.import-types { display: grid; gap: 10px; margin-bottom: 12px; }
.import-type { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); }
.import-type:hover { border-color: var(--primary); }
.import-type b { display: block; margin-bottom: 2px; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.report-tabs a { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); text-decoration: none; background: var(--card); }
.report-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.qr { display: inline-block; padding: 10px; background: #fff; border-radius: 8px; }
.qr img, .qr canvas { display: block; }
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qr-label { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card); break-inside: avoid; }
.qr-name { font-size: 1.1rem; font-weight: 700; }
@media (max-width: 720px) {
  table.matrix thead { display: table-header-group; }
  table.matrix { display: table; } table.matrix tbody { display: table-row-group; } table.matrix tr { display: table-row; border: 0; padding: 0; }
  table.matrix { width: auto; min-width: 100%; } table.matrix td { display: table-cell; width: auto; white-space: nowrap; padding: 6px 8px; border-bottom: 1px solid var(--border); } table.matrix td[data-label]::before { content: none; }
  .cat-bars div { grid-template-columns: 100px 1fr 70px; }
}
@media print { .qr-label { border-color: #999; } .qr-sheet { grid-template-columns: repeat(3, 1fr); } }
tr.row-warn td { background: rgba(212,140,20,.10); }
.app-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 12px 26px; }
.app-footer a { color: inherit; }
@media (max-width: 720px) { .stat { min-width: 0; } .stat b { font-size: clamp(.95rem, 4.6vw, 1.4rem); } .stat span { overflow-wrap: anywhere; } }
.req-code code { display: inline-block; font-size: 1.15rem; letter-spacing: 1px; padding: 8px 14px; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; user-select: all; }

.reason { margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: rgba(212,140,20,.12); font-size: .9em; }
.edit-reason textarea { border-color: #d48c14; }
.edit-history { list-style: none; margin: 0; padding: 0; }
.edit-history li { padding: 8px 0; border-bottom: 1px solid var(--border); }

/* v6: القائمة الجانبية (يمين في العربي، شمال في الإنجليزي) */
:root { --nav-w: 250px; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar .brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 1.1rem; margin-inline-end: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; font-size: 1.3rem; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
.lang-btn { color: #fff; text-decoration: none; font-weight: 700; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; padding: 3px 12px; font-size: .9rem; }
.sidenav {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--nav-w); z-index: 40;
  background: var(--card); border-inline-end: 1px solid var(--border); overflow-y: auto;
  transform: translateX(100%); transition: transform .25s ease; padding-bottom: 20px;
}
[dir=ltr] .sidenav { transform: translateX(-100%); }
body.nav-open .sidenav { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
.sidenav-user { display: flex; gap: 10px; align-items: center; padding: 18px 16px; background: linear-gradient(135deg, var(--primary), #2f6fb0); color: #fff; }
.sidenav-user b, .sidenav-user small { display: block; line-height: 1.3; }
.sidenav-user small { opacity: .8; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.sidenav nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.sidenav nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.sidenav nav a i { font-style: normal; width: 26px; text-align: center; }
.sidenav nav a:hover { background: var(--bg); }
.sidenav nav a.active { background: var(--primary); color: #fff; }
.sidenav nav a.logout { color: var(--danger); margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; }
@media (min-width: 1000px) {
  body.has-nav .sidenav { transform: none; top: 0; }
  body.has-nav .topbar, body.has-nav main.container, body.has-nav .app-footer { margin-inline-start: var(--nav-w); }
  body.has-nav .menu-btn, body.has-nav .nav-backdrop { display: none; }
}

/* الرئيسية: أيقونات */
.hello h1 { margin: 4px 0 0; font-size: 1.3rem; }
.hello p { margin: 0 0 14px; }
.btn.big { display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn.big span { font-size: 1.5rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
  --c: var(--primary); position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 16px; border-radius: 18px; border: 0; cursor: pointer; text-decoration: none; text-align: start; font: inherit;
  color: #fff; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .15s ease, box-shadow .15s;
  min-height: 128px; overflow: hidden;
}
.tile:active { transform: scale(.97); }
.tile:hover { transform: translateY(-2px); }
.tile::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); inset-inline-end: -40px; top: -40px; }
.tile-ico { font-size: 1.7rem; line-height: 1; margin-bottom: 6px; }
.tile b { font-size: 1.9rem; line-height: 1.1; font-weight: 800; }
.tile span:not(.tile-ico) { font-weight: 600; opacity: .95; }
.tile em { font-style: normal; font-size: .78rem; background: rgba(255,255,255,.25); border-radius: 99px; padding: 1px 9px; margin-top: 4px; }
.tile em.soft { background: rgba(0,0,0,.15); }
.t-red { --c: #d64541; } .t-amber { --c: #e08e0b; } .t-green { --c: #27ae60; } .t-blue { --c: #2f6fb0; } .t-purple { --c: #8e5bb5; }
.t-teal { --c: #16a085; } .t-indigo { --c: #3f51b5; } .t-orange { --c: #e67e22; } .t-gray { --c: #5d6d7e; }
.tile.pulse::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(214,69,65,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(214,69,65,0); } 100% { box-shadow: 0 0 0 0 rgba(214,69,65,0); } }

/* النوافذ: من تحت على الموبايل، وفي النص على الكمبيوتر */
dialog.sheet {
  border: 0; padding: 0 16px 18px; width: min(640px, 100%); max-height: 85vh; overflow-y: auto;
  border-radius: 20px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog.sheet::backdrop { background: rgba(10,20,30,.5); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 720px) {
  dialog.sheet { margin: auto 0 0; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
.sheet-head { position: sticky; top: 0; background: var(--card); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 10px; z-index: 1; }
.sheet-head h2 { margin: 0; }
.sheet-x { border: 0; background: var(--bg); color: var(--text); width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; cursor: pointer; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none; }
.li-item.late { background: rgba(214,69,65,.12); }
.li-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.li-ico.out { background: var(--out); } .li-ico.in { background: var(--in); }
.li-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.li-main b, .li-main small, .li-side small { display: block; line-height: 1.35; }
.li-main small, .li-side small { color: var(--muted); }
.li-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-side { text-align: end; font-weight: 700; font-size: .9rem; }
.alerts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alerts-list li a { display: block; padding: 10px 12px; border-radius: 12px; color: inherit; text-decoration: none; border-inline-start: 4px solid; }
.alerts-list li.warn a { background: rgba(212,140,20,.12); border-color: #d48c14; }
.alerts-list li.danger a { background: rgba(192,57,43,.12); border-color: var(--danger); }

/* لوحة المالك */
.dash-head h1 { margin-bottom: 2px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips a { flex: none; padding: 7px 16px; border-radius: 99px; background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; }
.chips a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fleet { display: flex; align-items: center; gap: 20px; border-radius: 18px; }
.donut { --p: 0; width: 120px; height: 120px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--out) calc(var(--p) * 1%), var(--in) 0); }
.donut > div { width: 84px; height: 84px; border-radius: 50%; background: var(--card); display: grid; place-items: center; align-content: center; text-align: center; }
.donut b { font-size: 1.6rem; line-height: 1; } .donut small { color: var(--muted); }
.fleet-info { flex: 1; min-width: 0; } .fleet-info h2 { margin-bottom: 6px; }
.fleet-row { display: flex; align-items: center; gap: 8px; } .fleet-row b { margin-inline-start: auto; }
.fleet-row.late { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .dot.out { background: var(--out); } .dot.in { background: var(--in); } .dot.late { background: #e08e0b; }
.fleet-alerts { display: block; margin-top: 8px; padding: 6px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.fleet-alerts.red { background: rgba(214,69,65,.14); color: var(--danger); } .fleet-alerts.amber { background: rgba(224,142,11,.15); color: #b8730a; } .fleet-alerts.green { background: rgba(39,174,96,.14); color: var(--in); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { --c: var(--primary); position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.kpi::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--c); }
.kpi-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: color-mix(in srgb, var(--c) 15%, transparent); margin-bottom: 4px; }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi b { font-size: 1.5rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.k-blue { --c: #2f6fb0; } .k-purple { --c: #8e5bb5; } .k-orange { --c: #e67e22; } .k-teal { --c: #16a085; } .k-red { --c: #d64541; } .k-indigo { --c: #3f51b5; } .k-green { --c: #27ae60; } .k-gray { --c: #5d6d7e; }
.delta { align-self: flex-start; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: 0 8px; }
.delta.good { background: rgba(39,174,96,.15); color: var(--in); } .delta.bad { background: rgba(214,69,65,.14); color: var(--danger); }
.delta.flat, .delta.new { background: var(--bg); color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.dash .card { border-radius: 18px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.hbar-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; animation: grow .8s ease; transform-origin: inline-start; }
@keyframes grow { from { width: 0 !important; } }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 3px 12px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .88rem; }
.center { text-align: center; }
@media (max-width: 720px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 1.25rem; }
  .dash-grid { grid-template-columns: 1fr; }
  .fleet { gap: 14px; padding: 14px; } .donut { width: 100px; height: 100px; } .donut > div { width: 70px; height: 70px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 116px; padding: 14px; }
}

/* صفحة الدخول */
body.login-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #0d1b2a; overflow-x: hidden; }
body.login-page main.container { flex: 1; display: grid; place-items: center; width: 100%; position: relative; z-index: 2; }
body.login-page .app-footer { color: rgba(255,255,255,.6); position: relative; z-index: 2; }
.login-scene { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(160deg, #0d1b2a 0%, #1f4e79 55%, #2f6fb0 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 14s ease-in-out infinite alternate; }
.b1 { width: 380px; height: 380px; background: #4d8fd1; top: -100px; inset-inline-start: -80px; }
.b2 { width: 320px; height: 320px; background: #16a085; bottom: 10%; inset-inline-end: -90px; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: #8e5bb5; top: 40%; left: 40%; animation-delay: -9s; opacity: .35; }
@keyframes float { to { transform: translate(40px, 60px) scale(1.15); } }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: #1a2430; border-top: 3px solid #2e3d4d; }
.lane { position: absolute; top: 50%; left: 0; width: 200%; height: 4px; margin-top: -2px; background: repeating-linear-gradient(90deg, #f5c518 0 40px, transparent 40px 80px); animation: lane 1.2s linear infinite; }
@keyframes lane { to { transform: translateX(-80px); } }
.car { position: absolute; bottom: 44px; font-size: 2.6rem; left: -80px; animation: drive 9s linear infinite; transform: scaleX(-1); }
.car.c2 { bottom: 8px; animation-duration: 12s; animation-delay: -4s; font-size: 2.2rem; }
.car.c3 { bottom: 44px; animation-duration: 15s; animation-delay: -10s; font-size: 2.4rem; }
@keyframes drive { to { left: calc(100% + 80px); } }
.lang-float { position: fixed; top: 14px; inset-inline-end: 14px; z-index: 3; color: #fff; text-decoration: none; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 6px 14px; border-radius: 99px; backdrop-filter: blur(6px); font-weight: 600; }
.login-card {
  width: min(400px, 100%); margin: 40px 0 110px; padding: 30px 26px 22px; border-radius: 24px; text-align: center; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: up .6s ease;
}
.login-logo { width: 78px; height: 78px; margin: -70px auto 10px; border-radius: 22px; background: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.login-logo img { width: 62px; height: 62px; border-radius: 16px; }
.login-card h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.login-sub { margin: 2px 0 18px; opacity: .8; font-size: .92rem; }
.login-card .field { position: relative; margin-bottom: 12px; font-weight: 400; }
.login-card .field > span { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); }
.login-card .field input { margin: 0; padding: 14px 16px; padding-inline-start: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.92); color: #1d2733; font-size: 1rem; }
.login-card .field input:focus { outline: 3px solid rgba(245,197,24,.6); }
.login-card .eye { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 1.1rem; opacity: .6; }
.login-go { padding: 14px; border-radius: 14px; font-size: 1.1rem; font-weight: 800; background: linear-gradient(135deg, #f5c518, #e67e22) !important; border: 0 !important; color: #1d2733 !important; box-shadow: 0 10px 24px rgba(230,126,34,.4); margin-top: 4px; }
.login-go span { display: inline-block; transition: transform .2s; } .login-go:hover span { transform: translateX(-4px); } [dir=ltr] .login-go:hover span { transform: translateX(4px); }
.login-forgot a { color: rgba(255,255,255,.85); font-size: .88rem; }
.login-card .alert.err { background: rgba(214,69,65,.25); border-color: rgba(255,120,110,.6); color: #fff; }
@media (prefers-reduced-motion: reduce) { .blob, .lane, .car, .tile.pulse::before { animation: none; } }
body.login-page .app-footer { padding-bottom: 104px; }
.app-footer.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.app-footer .powered-by { height: 24px; width: auto; display: block; opacity: .85; }
.app-footer.brand a:hover .powered-by { opacity: 1; }
.app-footer .site-link { font-weight: 700; font-size: .9rem; text-decoration: none; color: var(--primary); padding: 2px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--card); }
body.login-page .app-footer .site-link { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.demo-box { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 0 0 16px; padding: 12px; border-radius: 14px; background: rgba(245,197,24,.18); border: 1px dashed rgba(245,197,24,.7); font-size: .92rem; }
.demo-box code { background: rgba(255,255,255,.9); color: #1d2733; font-weight: 700; }
.demo-box .btn { background: #fff; color: #1d2733; border: 0; font-weight: 700; }
.product-name { display: inline-flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.product-name b { font-size: 1.05rem; font-weight: 800; letter-spacing: .5px; background: linear-gradient(135deg, #f5c518, #e67e22); -webkit-background-clip: text; background-clip: text; color: transparent; }
.product-name span { font-size: .78rem; opacity: .75; }
