:root {
  --bg: #eef2ef;
  --bg-2: #e4ebe5;
  --surface: #fbfdfb;
  --surface-2: #f3f7f4;
  --ink: #12241c;
  --ink-soft: #3d564a;
  --muted: #6b8176;
  --line: #d5e0d8;
  --line-strong: #b7c8bc;
  --brand: #1c5c45;
  --brand-2: #147a56;
  --brand-dark: #0d3326;
  --gold: #c4a35a;
  --gold-2: #e8d7a5;
  --teal: #1a8a7a;
  --danger: #b42318;
  --danger-bg: #fde8e6;
  --warn: #b54708;
  --warn-bg: #fef4e6;
  --ok: #027a48;
  --ok-bg: #e7f6ee;
  --info: #175cd3;
  --info-bg: #e8f1fc;
  --diesel: #c2781a;
  --petrol: #1b7a4a;
  --kero: #2b6cb0;
  --oil: #6b4c9a;
  --shadow: 0 10px 30px rgba(13, 51, 38, 0.08);
  --shadow-sm: 0 2px 8px rgba(13, 51, 38, 0.06);
  --r: 14px;
  --r-sm: 10px;
  --nav: 268px;
  --top: 64px;
  --font: "Vazirmatn", "Noto Naskh Arabic", "DM Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
[data-theme="night"] {
  --bg: #0c1612; --bg-2: #101c17; --surface: #15231d; --surface-2: #1b2c25;
  --ink: #e8f0ea; --ink-soft: #c5d4cb; --muted: #8aa396; --line: #2a4036;
  --line-strong: #3c5649; --shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
html[dir="rtl"] body { text-align: right; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; }
.mono { font-family: var(--mono); }

.app { display: grid; grid-template-columns: var(--nav) 1fr; min-height: 100vh; }
.nav {
  background: linear-gradient(180deg, #0d3326 0%, #12382c 55%, #0b241c 100%);
  color: #e8f3ec; position: sticky; top: 0; height: 100vh; overflow: auto;
  border-inline-end: 1px solid #1a4a38;
}
.nav-brand { padding: 20px 18px 12px; display: flex; gap: 12px; align-items: center; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #c4a35a, #8d6b2a);
  color: #0d3326; display: grid; place-items: center; font-weight: 800; letter-spacing: -.04em;
  box-shadow: 0 8px 16px rgba(196,163,90,.25);
}
.brand-name { font-weight: 800; font-size: 14px; line-height: 1.3; }
.brand-sub { font-size: 11px; color: #b7d0c2; }
.nav-search { margin: 8px 14px 14px; }
.nav-search input {
  width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08);
  color: #fff; border-radius: 10px; padding: 8px 10px;
}
.nav a.item, .nav button.item {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 16px);
  margin: 2px 8px; padding: 9px 10px; border: 0; background: transparent;
  color: #d5e8dc; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: 13.5px;
}
.nav a.item:hover, .nav a.item.active { background: rgba(196,163,90,.16); color: #fff; }
.nav a.item.active { outline: 1px solid rgba(196,163,90,.35); }
.nav .sec { padding: 14px 18px 6px; font-size: 10px; letter-spacing: .14em; color: #8fb09e; text-transform: uppercase; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.main { min-width: 0; }
.top {
  height: var(--top); background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.top-title { font-weight: 800; font-size: 16px; }
.top-sub { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.chip, .btn, select.sel, .icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-gold { background: var(--gold); color: #1a1406; border-color: #b4923f; font-weight: 700; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; position: relative; }
.badge {
  position: absolute; top: -4px; inset-inline-end: -4px; background: var(--danger); color: #fff;
  border-radius: 99px; font-size: 10px; min-width: 16px; height: 16px; display: grid; place-items: center;
}
.content { padding: 22px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.kpi { padding: 16px; }
.kpi .lbl { color: var(--muted); font-size: 12px; }
.kpi .val { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.03em; }
.kpi .hint { font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pad { padding: 16px; }
.hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.hd h3 { margin: 0; font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: start; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--surface-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-gold { background: #f8efd8; color: #7a5b12; }

.tank {
  --pct: 50%; --c: var(--diesel);
  height: 168px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2);
  position: relative; overflow: hidden;
}
.tank .fill {
  position: absolute; inset-inline: 0; bottom: 0; height: var(--pct);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, white), var(--c));
  transition: height .6s ease;
}
.tank .wave { position: absolute; inset-inline: -10%; height: 18px; top: -10px; background: color-mix(in srgb, var(--c) 60%, white); border-radius: 50%; opacity: .5; }
.tank .meta { position: relative; z-index: 1; padding: 12px; color: var(--ink); }
.tank .meta b { display: block; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.f input, label.f select, label.f textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; color: var(--ink); font-size: 13px;
}
[data-theme="night"] label.f input, [data-theme="night"] label.f select, [data-theme="night"] label.f textarea { background: var(--surface-2); color: var(--ink); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.search { min-width: 220px; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px 12px 40px;
  background:
    radial-gradient(1200px 500px at 10% -10%, #1c5c45 0%, transparent 50%),
    radial-gradient(900px 400px at 100% 100%, #c4a35a33 0%, transparent 40%),
    #0d3326;
  color: #fff;
}
.login-card {
  width: min(920px, calc(100% - 32px)); display: grid; grid-template-columns: 1.1fr .9fr;
  background: #fbfdfb; color: var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.login-art {
  background: linear-gradient(160deg, #0d3326, #1c5c45 55%, #c4a35a);
  color: #fff; padding: 36px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-size: 28px; margin: 0 0 8px; }
.login-form { padding: 36px; }
.hero-map { font-size: 12px; opacity: .85; line-height: 1.8; }

.modal-bg { position: fixed; inset: 0; background: rgba(8,18,14,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(760px, 100%); background: var(--surface); border-radius: 18px; border: 1px solid var(--line); max-height: 92vh; overflow: auto; }
.toast { position: fixed; bottom: 18px; inset-inline-end: 18px; background: var(--brand-dark); color: #fff; padding: 10px 14px; border-radius: 12px; z-index: 80; }
.chart { width: 100%; height: 220px; }
.alert-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.print-only { display: none; }
@media print {
  .nav, .top, .toolbar, .btn, .no-print { display: none !important; }
  .app { display: block; }
  .print-only { display: block; }
  .content { padding: 0; }
}
@media (max-width: 1100px) {
  .kpis, .grid-2, .grid-3, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-105%); width: var(--nav); }
  html[dir="rtl"] .nav { inset: 0 0 0 auto; transform: translateX(105%); }
  .nav.open { transform: none; }
}
@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; }
}
.empty { padding: 28px; text-align: center; color: var(--muted); }
.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); }
.userpill { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ava { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
