/* =========================================================
   Seyhun509 — reys və xərc uçotu
   Göy tema: tünd göy panel, səma mavisi zolaq, magistral mavisi düymələr
   ========================================================= */
:root {
  --asphalt: #0b2a55;
  --asphalt-2: #123a6f;
  --asphalt-3: #1b4a87;
  --lane: #3db5ff;
  --amber: #f2b705;
  --sign: #1565d8;
  --btn: #1565d8;
  --paper: #eef3fa;
  --surface: #ffffff;
  --ink: #0f2140;
  --muted: #5b6b85;
  --line: #d8e2ef;
  --field: #f5f8fd;
  --ok: #1d8a57;
  --bad: #c8372d;
  --warn: #b27a00;
  --radius: 10px;
  --side-w: 248px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #08111f; --surface: #0f1c31; --ink: #e6edf7; --muted: #93a6c4;
    --line: #1e3050; --field: #0b1729; --sign: #6fb1ff; --btn: #1f6fe0; --ok: #3cbf82; --bad: #ef6a5e;
    --asphalt: #0a2347; --asphalt-2: #12345f; --asphalt-3: #1a4479;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #08111f; --surface: #0f1c31; --ink: #e6edf7; --muted: #93a6c4;
  --line: #1e3050; --field: #0b1729; --sign: #6fb1ff; --btn: #1f6fe0; --ok: #3cbf82; --bad: #ef6a5e;
  --asphalt: #0a2347; --asphalt-2: #12345f; --asphalt-3: #1a4479;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--sign); }
h1, h2, h3 { font-family: var(--cond); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: .01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.35rem; margin-bottom: .9rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
code { background: var(--field); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--sign); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }

/* ---------- Tətbiq çərçivəsi ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--asphalt); color: #d6e4f7;
  display: flex; flex-direction: column; padding: 1.25rem .9rem 1rem;
  z-index: 20;
}
/* Panelin sağ kənarı boyunca yol zolağı */
.sidebar::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 3px;
  background: repeating-linear-gradient(180deg, var(--lane) 0 22px, transparent 22px 40px);
  opacity: .85;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; padding: 0 .4rem 1.4rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px; background: var(--lane); color: var(--asphalt);
  display: grid; place-items: center; font: 700 1.4rem/1 var(--cond);
}
.brand-text { font: 600 1.45rem/1 var(--cond); color: #fff; letter-spacing: .02em; }
.brand-text b { color: var(--lane); font-weight: 700; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem;
  color: #bcd0ec; text-decoration: none; border-radius: 8px; font-weight: 500;
  position: relative;
}
.side-nav a:hover { background: var(--asphalt-2); color: #fff; }
.side-nav a.active { background: var(--asphalt-3); color: #fff; }
.side-nav a.active::before {
  content: ""; position: absolute; left: -.9rem; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 3px 3px 0; background: var(--lane);
}
.count {
  margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 600;
  background: var(--lane); color: var(--asphalt); border-radius: 99px; padding: 0 .45rem; line-height: 1.5;
}
.new-trip { margin: 1.25rem .25rem 0; }
.side-foot { margin-top: auto; border-top: 1px solid var(--asphalt-3); padding-top: .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.me { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--asphalt-3); color: var(--lane);
  display: grid; place-items: center; font: 700 1.05rem/1 var(--cond); flex: none;
}
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-weight: 600; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #9fb6d8; font-size: .78rem; }
.side-tools { display: flex; gap: 2px; }
.side-tools form { margin: 0; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; color: inherit;
}
.icon-btn:hover { background: var(--asphalt-2); }

.content {
  margin-left: var(--side-w);
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem;
  max-width: calc(1180px + var(--side-w));
}

/* Mobil üst panel və alt menyu */
.mtop, .tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 1.1rem 1rem calc(96px + env(safe-area-inset-bottom)); }
  .mtop {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30; padding: .6rem 1rem;
    background: var(--asphalt); color: #fff;
    border-bottom: 3px solid transparent;
    border-image: repeating-linear-gradient(90deg, var(--lane) 0 18px, transparent 18px 32px) 3;
  }
  .mtop .brand { padding: 0; }
  .mtop .brand-mark { width: 32px; height: 32px; font-size: 1.25rem; }
  .mtop-tools { display: flex; align-items: center; gap: 2px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; padding: .2rem 0;
  }
  .tabbar a:hover, .tabbar a:focus-visible { color: var(--ink); }
  .tab-fab {
    width: 54px; height: 54px; margin: -22px auto 0; border-radius: 50%;
    background: var(--lane); color: var(--asphalt) !important;
    justify-content: center; box-shadow: 0 0 0 5px var(--surface);
  }
}

/* Mobil menyu */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-sheet {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .4rem; box-shadow: 0 18px 40px rgba(8, 30, 66, .25);
}
.menu-me { padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; display: flex; flex-direction: column; }
.menu-me small { color: var(--muted); }
.menu-sheet a, .menu-logout {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem;
  color: var(--ink); text-decoration: none; border-radius: 8px;
  background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.menu-sheet a:hover, .menu-logout:hover { background: var(--field); }
.menu-sheet form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.menu-logout { color: var(--bad); }

/* ---------- Giriş səhifələri ---------- */
body.auth { background: var(--asphalt); min-height: 100vh; overflow-x: hidden; }
.auth-road {
  position: fixed; top: -30vh; left: 58%; width: 180px; height: 160vh;
  background: var(--asphalt-2); transform: rotate(-16deg);
  border-left: 3px solid #2c5b98; border-right: 3px solid #2c5b98;
}
.auth-road::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 5px; margin-left: -2.5px;
  background: repeating-linear-gradient(180deg, var(--lane) 0 46px, transparent 46px 86px);
}
.auth-main { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth .card { width: 100%; max-width: 420px; padding: 2rem; border: 0; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); }
.auth h1 { font-size: 2.4rem; margin-bottom: .25rem; }
.center-wrap { display: contents; }

/* ---------- Səhifə başlığı ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .25rem; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: .5rem; }
.back:hover { color: var(--ink); }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem; margin-bottom: 1.25rem;
}
.card.narrow { max-width: 460px; }
.card.highlight { border-color: var(--lane); box-shadow: inset 4px 0 0 var(--lane); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card-head a { font-size: .9rem; text-decoration: none; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-between h2 { margin-bottom: .25rem; }
.row-between p { margin: 0; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }

/* ---------- Formalar ---------- */
label { display: block; font-size: .875rem; font-weight: 500; color: var(--muted); margin-bottom: .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; min-height: 44px;
  padding: .55rem .75rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sign) 22%, transparent); }
input[type="date"] { font-variant-numeric: tabular-nums; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 1rem; align-items: end; }
.grid-form .btn { margin-bottom: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.hint { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; }
.money-input { position: relative; display: block; }
.money-input input { padding-right: 2.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.money-input::after { content: "₼"; position: absolute; right: .8rem; top: calc(50% + .15rem); transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.exp-row .money-input::after { top: 50%; }
@media (min-width: 1101px) { .sum-card { position: sticky; top: 1.5rem; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.center-text { text-align: center; margin: 1.1rem 0 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.leg { display: flex; align-items: center; gap: .5rem; font: 700 1.2rem/1.2 var(--cond); margin: .25rem 0 .9rem; }
.leg .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sign); }
.leg .dot.ret { background: var(--lane); }

/* ---------- Düymələr ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.15rem; cursor: pointer; text-decoration: none;
  font: 600 1rem/1 var(--font); color: #fff; background: var(--btn);
  border: 1px solid transparent; border-radius: 8px;
}
.btn:hover { filter: brightness(1.07); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: .35rem .75rem; font-size: .875rem; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--field); filter: none; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.lane { background: var(--lane); color: var(--asphalt); }
.sidebar .btn.lane, .new-trip { background: var(--lane); color: var(--asphalt); }
form.inline, details.inline { display: inline-block; margin: 0; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
.mini-form { display: flex; gap: .4rem; margin-top: .4rem; }
.mini-form input { margin: 0; min-height: 34px; padding: .3rem .5rem; font-size: .9rem; }

/* ---------- Bildirişlər ---------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.1rem; border: 1px solid; font-weight: 500; }
.alert.success { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.alert.error { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.alert.info { border-color: var(--sign); color: var(--sign); background: color-mix(in srgb, var(--sign) 9%, var(--surface)); }
.block-link { display: block; text-decoration: none; }

/* ---------- Nişanlar ---------- */
.badge { display: inline-block; font-size: .75rem; padding: .1rem .55rem; border-radius: 99px; font-weight: 600; vertical-align: middle; }
.badge.superadmin { background: var(--lane); color: var(--asphalt); }
.badge.operator { border: 1px solid currentColor; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.off { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.soft { background: var(--field); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Nömrə nişanı ---------- */
.plate {
  display: inline-flex; align-items: stretch; height: 28px; overflow: hidden;
  background: #fff; color: #111820; border: 1.5px solid #111820; border-radius: 5px;
  font: 600 1.05rem/1 var(--cond); letter-spacing: .06em; white-space: nowrap; vertical-align: middle;
}
.plate-az {
  display: grid; place-items: center; padding: 0 4px; background: #1565d8; color: #fff;
  font-size: .62rem; letter-spacing: .04em;
}
.plate-no { display: grid; place-items: center; padding: 0 .5rem; }
.plate.big { height: 38px; font-size: 1.45rem; }
.plate.big .plate-az { font-size: .78rem; padding: 0 6px; }

/* ---------- Marşrut (kiçik yol) ---------- */
.route { display: flex; align-items: center; gap: .55rem; min-width: 0; font: 600 1.08rem/1.2 var(--cond); }
.route-pt { flex: 0 1 auto; min-width: 2.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane {
  flex: 1 1 auto; min-width: 28px; height: 7px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--lane) 0 7px, transparent 7px 13px) center / 100% 2px no-repeat, var(--asphalt);
}
.route.ret .lane { opacity: .75; }

/* ---------- Statistika ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .num { display: block; font: 700 2.1rem/1 var(--cond); }
.stat .lbl { color: var(--muted); font-size: .875rem; }

/* Mühasibat sətri: Gəlir − Xərc = Qazanc */
.ledger {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; align-items: end; gap: .5rem 1.25rem;
  background: var(--asphalt); color: #fff; border-radius: var(--radius);
  padding: 1.5rem 1.75rem 1.4rem; margin-bottom: 1.25rem; position: relative; overflow: hidden;
}
.ledger::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--lane) 0 28px, transparent 28px 50px);
}
.ledger .term small { display: block; color: #a6bddd; font-size: .9rem; margin-bottom: .2rem; }
.ledger .term b { font: 700 clamp(1.7rem, 3.2vw, 2.6rem)/1 var(--cond); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .op { font: 600 2rem/1 var(--cond); color: var(--lane); padding-bottom: .2rem; }
.ledger .term.result b { color: var(--lane); font-size: clamp(2rem, 4vw, 3.2rem); }
.ledger .term.result.loss b { color: #ff8a7f; }
.ledger .period { grid-column: 1 / -1; color: #a6bddd; font-size: .9rem; margin-bottom: .25rem; }
@media (max-width: 700px) {
  .ledger { grid-template-columns: 1fr 1fr; padding: 1.25rem 1.25rem 1.4rem; gap: .9rem 1rem; }
  .ledger .op { display: none; }
  .ledger .term b { font-size: 1.45rem; }
  .ledger .term.result { grid-column: 1 / -1; border-top: 1px solid var(--asphalt-3); padding-top: .8rem; }
  .ledger .term.result b { font-size: 2.3rem; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .stat { padding: .8rem; }
  .stat .num { font-size: 1.7rem; }
  .stat .lbl { font-size: .78rem; line-height: 1.3; display: block; }
}

/* ---------- Reys sətirləri (yol vərəqəsi) ---------- */
.trips { display: flex; flex-direction: column; }
.trip-row {
  display: grid; grid-template-columns: 92px 128px minmax(0, 1fr) auto; gap: .35rem 1.1rem; align-items: center;
  padding: .9rem .25rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.trip-row:last-child { border-bottom: 0; }
.trip-row:hover { background: var(--field); }
.trip-date { font: 600 1rem/1.15 var(--cond); }
.trip-date small { display: block; font-family: var(--font); color: var(--muted); font-size: .78rem; font-weight: 400; }
.trip-main { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.trip-sub { color: var(--muted); font-size: .85rem; }
.trip-money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip-money b { display: block; font: 700 1.2rem/1.1 var(--cond); }
.trip-money small { color: var(--muted); font-size: .8rem; }
@media (max-width: 700px) {
  .trip-row { grid-template-columns: auto 1fr; padding: .9rem .1rem; }
  .trip-date { grid-row: 1; }
  .trip-plate { grid-row: 1; justify-self: end; }
  .trip-main, .trip-money { grid-column: 1 / -1; }
  .trip-money { text-align: left; display: flex; gap: .75rem; align-items: baseline; }
}
.totals-bar {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: flex-end;
  border-top: 2px solid var(--ink); padding-top: .8rem; margin-top: .25rem;
}
.totals-bar div { text-align: right; }
.totals-bar small { display: block; color: var(--muted); font-size: .82rem; }
.totals-bar b { font: 700 1.35rem/1.1 var(--cond); font-variant-numeric: tabular-nums; }

/* ---------- Süzgəc ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .9rem; align-items: end; }
.filters .btns { display: flex; gap: .5rem; margin-bottom: .9rem; }
.filters .btns .btn { flex: 1; }

/* ---------- Siyahılar ---------- */
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; flex-wrap: wrap;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-item.inactive { opacity: .55; }
.li-main { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.li-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.li-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-start; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); font-size: .85rem; }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Cədvəl ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Xərc sətirləri ---------- */
.exp-row { display: grid; grid-template-columns: 1.1fr .8fr 1.4fr 44px; gap: .5rem; align-items: start; margin-bottom: .55rem; }
.exp-row input, .exp-row select { margin-top: 0; }
.exp-row .icon-btn { width: 44px; height: 44px; color: var(--muted); border: 1px solid var(--line); }
.exp-row .icon-btn:hover { color: var(--bad); background: var(--field); }
@media (max-width: 600px) {
  .exp-row { grid-template-columns: 1fr 1fr 44px; padding-bottom: .55rem; border-bottom: 1px dashed var(--line); }
  .exp-row .exp-note { grid-column: 1 / 3; grid-row: 2; }
}
.exp-head { display: grid; grid-template-columns: 1.1fr .8fr 1.4fr 44px; gap: .5rem; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
@media (max-width: 600px) { .exp-head { display: none; } }
.sum-line { display: flex; justify-content: space-between; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line); }
.sum-line b { font: 700 1.25rem/1 var(--cond); font-variant-numeric: tabular-nums; }
.sum-line.total { border-top: 2px solid var(--ink); }
.sum-line.total b { font-size: 1.6rem; }
.sticky-actions {
  display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap;
  padding-top: 1rem; border-top: 1px solid var(--line);
}

/* ---------- Reys səhifəsi ---------- */
.trip-hero { display: grid; gap: 1rem; }
.trip-hero .route { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.trip-hero .lane { height: 10px; background-size: 100% 3px, auto; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 0; }
.kv div { min-width: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: .1rem 0 0; font-weight: 600; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ic { margin: 0 auto .75rem; color: var(--line); }
.empty p { margin-bottom: 1rem; }

.pager { display: flex; justify-content: center; gap: .4rem; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--surface);
}
.pager .cur { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Qeyd qutusu */
label.check { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-size: .95rem; cursor: pointer; margin: .25rem 0 1rem; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--sign); }
.filters label.check { margin-bottom: 1.4rem; }
[hidden] { display: none !important; }
.auth h1 { display: flex; align-items: center; gap: .6rem; }

/* ---------- Mərhələ 3: xərclər və hesabat ---------- */
.ledger .period a { color: var(--lane); }
.ledger-4 { grid-template-columns: 1fr auto 1fr auto 1fr auto 1.2fr; }
.month-nav { display: flex; align-items: center; gap: .75rem; margin: -.5rem 0 1.25rem; }
.month-nav strong { font: 700 1.3rem/1 var(--cond); min-width: 9rem; text-align: center; }
.month-nav .icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.icon-btn.flip .ic { transform: rotate(180deg); }
.amount { font: 700 1.2rem/34px var(--cond); font-variant-numeric: tabular-nums; margin-right: .5rem; white-space: nowrap; }
.filters details.range { align-self: end; margin-bottom: .9rem; }
.filters details.range summary { width: 100%; min-height: 44px; }
.range-form { margin-top: -.5rem; }

/* Aylıq qrafik: hər sütun bir ay */
.trend { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; margin: .5rem 0 1rem; }
.tbar { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: var(--muted); }
.tcol { position: relative; display: block; width: 100%; height: 170px; }
.tcol.split::before { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; border-top: 1px solid var(--line); }
.tcol i { position: absolute; left: 18%; right: 18%; min-height: 2px; background: var(--sign); border-radius: 4px 4px 0 0; opacity: .55; }
.tbar.neg .tcol i { background: var(--bad); border-radius: 0 0 4px 4px; }
.tbar.cur .tcol i, .tbar:hover .tcol i, .tbar:focus-visible .tcol i { opacity: 1; }
.tbar.cur .tlab { color: var(--ink); font-weight: 600; }
.tlab { font-size: .78rem; }
.ttip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  width: max-content; max-width: 220px; padding: .55rem .7rem; border-radius: 8px;
  background: var(--asphalt); color: #e7ebf0; font-size: .8rem; line-height: 1.45; text-align: left;
  font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; visibility: hidden;
}
.ttip b { display: block; color: var(--lane); font-family: var(--cond); font-size: .95rem; }
.tbar:hover .ttip, .tbar:focus-visible .ttip { opacity: 1; visibility: visible; }
.tbar:first-child .ttip, .tbar:nth-child(2) .ttip { left: 0; transform: none; }
.tbar:last-child .ttip, .tbar:nth-last-child(2) .ttip { left: auto; right: 0; transform: none; }
.table-toggle summary { cursor: pointer; color: var(--sign); font-size: .9rem; }
.table-toggle[open] summary { margin-bottom: .5rem; }

/* Xərc bölgüsü */
.hbars { display: flex; flex-direction: column; gap: .85rem; margin-bottom: .75rem; }
.hbar-top { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.hbar-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--field); border-radius: 4px; margin: .3rem 0 .15rem; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--sign); border-radius: 0 4px 4px 0; }
@media (max-width: 700px) {
  .trend { gap: 2px; }
  .tcol { height: 130px; }
  .tlab { font-size: .68rem; }
}
.ledger-4 .term b { font-size: clamp(1.4rem, 2.3vw, 2.1rem); }
.ledger-4 .term.result b { font-size: clamp(1.7rem, 3vw, 2.6rem); }
@media (max-width: 1300px) and (min-width: 701px) {
  .ledger-4 { grid-template-columns: 1fr 1fr 1fr; }
  .ledger-4 .op { display: none; }
  .ledger-4 .term.result { grid-column: 1 / -1; border-top: 1px solid var(--asphalt-3); padding-top: .8rem; }
}
@media (max-width: 700px) {
  .ledger-4 { grid-template-columns: 1fr 1fr; }
  .ledger-4 .term b { font-size: 1.35rem; }
  .ledger-4 .term.result b { font-size: 2.2rem; }
}

/* ---------- Mərhələ 4: tarixçə, hesab ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1.25rem; align-items: start; }
.install-help { margin-top: .75rem; font-size: .9rem; color: var(--muted); }
.install-help p { margin: 0 0 .4rem; }
.install-help b { color: var(--ink); font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-day {
  font: 700 1.05rem/1 var(--cond); padding: 1.1rem 0 .55rem; color: var(--ink);
  border-bottom: 2px solid var(--ink); margin-bottom: .25rem;
}
.tl-day:first-child { padding-top: .5rem; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); position: relative; }
.tl-time { font: 600 .95rem/1.5 var(--cond); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-body { min-width: 0; position: relative; padding-left: .85rem; }
.tl-body::before { content: ""; position: absolute; left: 0; top: .45rem; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tl-item.add .tl-body::before { background: var(--ok); }
.tl-item.upd .tl-body::before { background: var(--lane); }
.tl-item.del .tl-body::before { background: var(--bad); }
.tl-body a { margin-left: .35rem; }
.tl-ip { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.diff { margin: .35rem 0 0; display: flex; flex-direction: column; gap: .15rem; font-size: .86rem; }
.diff div { display: flex; flex-wrap: wrap; gap: .1rem .5rem; }
.diff dt { color: var(--muted); min-width: 6.5rem; }
.diff dd { margin: 0; overflow-wrap: anywhere; }
.diff s { color: var(--bad); text-decoration-thickness: 1px; }
.diff .to { color: var(--ok); font-weight: 600; }
.diff .to::before { content: "→ "; color: var(--muted); font-weight: 400; }

/* ---------- Mərhələ 5: sənədlər, 2 addımlı giriş ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .15rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600;
  padding: .15rem .55rem .15rem .45rem; border-radius: 99px; border: 1px solid var(--line); background: var(--field);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.chip small { font-weight: 400; color: var(--muted); }
.chip.soon { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.chip.soon i { background: var(--amber); box-shadow: 0 0 0 1px var(--warn); }
.chip.expired { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.chip.expired i { background: var(--bad); }
.chip.ok small { display: none; }

.due { font-weight: 600; }
.due.expired { color: var(--bad); }
.due.soon { color: var(--warn); }
:root[data-theme="dark"] .due.soon { color: var(--amber); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .due.soon { color: var(--amber); } }
.due.ok { color: var(--ok); }
.due.none { color: var(--muted); font-weight: 400; }

.doc-group.expired { box-shadow: inset 4px 0 0 var(--bad); }
.doc-group.soon { box-shadow: inset 4px 0 0 var(--amber); }

.due-card { box-shadow: inset 4px 0 0 var(--amber); }
.due-card h2 { font-size: 1.2rem; }
.due-row {
  display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: .5rem 1rem; align-items: center;
  padding: .6rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.due-row:hover { background: var(--field); }
.due-what { color: var(--muted); }
@media (max-width: 600px) {
  .due-row { grid-template-columns: auto 1fr; }
  .due-row .due { grid-column: 1 / -1; }
}

.steps { padding-left: 1.2rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .75rem; }
.steps li { padding-left: .25rem; }
.qr { width: 200px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--line); margin: .6rem 0; }
.qr img, .qr canvas { display: block; }
.secret { display: block; font-size: 1rem; letter-spacing: .08em; margin: .3rem 0; padding: .4rem .6rem; word-break: break-all; }
input.otp { font: 600 1.6rem/1 var(--cond); letter-spacing: .3em; text-align: center; }
h2 .ic { display: inline-block; vertical-align: -3px; margin-right: .2rem; }

/* ---------- Telefon düzəlişləri (iPhone və Android) ---------- */
/* Tətbiq kimi açılanda üst panel saat/batareya zolağının altına düşməsin, düymələr toxunulsun */
@media (max-width: 900px) {
  .mtop {
    padding-top: calc(.6rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    z-index: 40;
  }
  .mtop .icon-btn { width: 44px; height: 44px; }
  .menu-sheet { max-height: calc(100vh - 120px - env(safe-area-inset-top)); overflow-y: auto; }
  .content {
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
  }
}
.auth-main { padding-top: calc(2rem + env(safe-area-inset-top)); padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }

/* Tarix sahəsi: iPhone-da kənara çıxmasın, boş görünməsin; Android-də təqvim ikonu görünsün */
input[type="date"], input[type="month"] {
  -webkit-appearance: none; appearance: none;
  min-width: 0; max-width: 100%; width: 100%;
  min-height: 44px; line-height: 1.4; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(1); }
}
/* iPhone-da 16px-dən kiçik yazı sahəyə toxunanda ekranı böyüdür — qarşısını al */
input, select, textarea { font-size: 16px; }
select { -webkit-appearance: none; appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; }
.form-grid > *, .grid-form > *, .filters > * { min-width: 0; }

/* ---------- Mərhələ 6: reys aç/bağla, valyuta, sahiblər, borclar ---------- */
.sidebar { overflow: hidden; }
.side-nav { overflow-y: auto; flex: 0 1 auto; min-height: 0; margin-right: -.4rem; padding-right: .4rem; }
.side-nav a { padding-top: .5rem; padding-bottom: .5rem; }

/* Valyuta işarəsi sahədə */
.money-input.pct::after { content: "%"; }
[data-cur="USD"] .money-input.cur::after { content: "$"; }
.money-input input { padding-right: 2.2rem; }

/* Nişanlar */
.badge.road { background: var(--lane); color: var(--asphalt); }
.card.on-road { box-shadow: inset 4px 0 0 var(--lane); }
.card.on-road h2 { margin-bottom: .25rem; }

/* Tablar (Dartıcılar / Qoşqular) */
.tabs { display: flex; align-items: center; gap: .35rem; margin: -.5rem 0 1rem; flex-wrap: wrap; }
.tabs > a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 99px;
  text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-weight: 600;
}
.tabs > a.active { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }
.tab-filter { margin-left: auto; }
.tab-filter select { margin: 0; min-width: 200px; }
@media (max-width: 600px) { .tab-filter { margin-left: 0; width: 100%; } .tab-filter select { width: 100%; } }

/* Seçim düymələri (Sabit / Km) */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); margin: 0 0 1rem; }
.seg label { margin: 0; cursor: pointer; position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: .45rem 1rem; border-radius: 7px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(8, 30, 66, .15); }
.seg input:focus-visible + span { outline: 2px solid var(--sign); }
.km-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) { .km-grid { grid-template-columns: 1fr 1fr; } .km-grid label:last-of-type { grid-column: 1 / -1; } }
.km-calc { margin: -.25rem 0 .9rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sign); }

/* Xərc sətirləri: 1-ci sətir növ, məbləğ, litr; 2-ci sətir ödəyən, qeyd */
.exp-row {
  grid-template-columns: 1.3fr 1fr .8fr 44px; padding: .6rem 0; margin: 0;
  border-bottom: 1px dashed var(--line);
}
.exp-row:first-child { padding-top: 0; }
.exp-row .exp-cat { grid-column: 1; grid-row: 1; }
.exp-row .money-input { grid-column: 2; grid-row: 1; }
.exp-row .exp-liters { grid-column: 3; grid-row: 1; visibility: hidden; }
.exp-row.is-fuel .exp-liters { visibility: visible; }
.exp-row .exp-remove { grid-column: 4; grid-row: 1; }
.exp-row .exp-paid { grid-column: 1; grid-row: 2; }
.exp-row .exp-note { grid-column: 2 / 5; grid-row: 2; }
#exp-list { margin-bottom: .75rem; }
@media (max-width: 600px) {
  .exp-row { grid-template-columns: 1fr 1fr 44px; }
  .exp-row .exp-remove { grid-column: 3; }
  .exp-row .exp-liters { grid-column: 1; grid-row: 2; display: none; }
  .exp-row.is-fuel .exp-liters { display: block; }
  .exp-row .exp-paid { grid-column: 1 / 3; grid-row: 3; }
  .exp-row.is-fuel .exp-paid { grid-column: 2 / 4; grid-row: 2; }
  .exp-row .exp-note { grid-column: 1 / 4; grid-row: 4; }
}
.permit-row { display: grid; grid-template-columns: 1fr 1fr 44px; gap: .5rem; margin-bottom: .55rem; }
.permit-row input { margin: 0; }
.permit-row .icon-btn { width: 44px; height: 44px; color: var(--muted); border: 1px solid var(--line); }

/* Açıq reysdə tez xərc yazmaq */
.quick-exp { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: .5rem; align-items: center;
  padding: .75rem; margin-bottom: .75rem; border-radius: 10px; background: var(--field); border: 1px dashed var(--line); }
.quick-exp input, .quick-exp select { margin: 0; background: var(--surface); }
.quick-exp .exp-liters { visibility: hidden; }
.quick-exp.is-fuel .exp-liters { visibility: visible; }
.quick-exp [name="note"] { grid-column: 2 / 4; }
.quick-exp .btn { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .quick-exp { grid-template-columns: 1fr 1fr; }
  .quick-exp [name="note"] { grid-column: 1 / -1; }
  .quick-exp .exp-liters { display: none; }
  .quick-exp.is-fuel .exp-liters { display: block; }
  .quick-exp .btn { grid-column: 1 / -1; }
}
.fuel-only { display: none; }
.is-fuel .fuel-only { display: block; }
.close-card { box-shadow: inset 4px 0 0 var(--lane); }
td.wrap { white-space: normal; min-width: 140px; }

/* Avans və borclar */
.bal-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .25rem;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.bal-row:last-child { border-bottom: 0; }
.bal-row:hover, .bal-row.cur { background: var(--field); }
.bal-row > span:first-child { display: flex; flex-direction: column; }
.bal-row .r { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Yanacaq */
.fuel-list { display: flex; flex-direction: column; gap: 1.1rem; }
.fuel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.fuel-head b { font: 700 1.35rem/1 var(--cond); font-variant-numeric: tabular-nums; }
.fuel-row .hbar-track { margin: .45rem 0; }

/* Hesabat: 5 hissəli sətir */
.ledger-5 { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1.2fr; }
@media (max-width: 1400px) and (min-width: 701px) {
  .ledger-5 { grid-template-columns: 1fr 1fr; }
  .ledger-5 .op { display: none; }
  .ledger-5 .term.result { grid-column: 1 / -1; border-top: 1px solid var(--asphalt-3); padding-top: .8rem; }
}

/* Operator səlahiyyətləri */
details.perms { margin-top: .5rem; }
details.perms summary { cursor: pointer; color: var(--sign); font-size: .9rem; font-weight: 600; }
details.perms form { margin-top: .6rem; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
details.perms label.check { margin: .35rem 0; font-size: .92rem; }
dl.kv { margin: 0; }

/* ---------- Səliqəli yan menyu: bölmələr, nazik sürüşdürmə ---------- */
.sidebar { padding: 1.1rem .9rem .9rem; }
.brand { padding-bottom: 1rem; }
.sidebar .new-trip { margin: 0 .25rem 1rem; flex: none; }
.side-nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  margin: 0 -.5rem; padding: 0 .5rem .5rem;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.side-nav:hover { scrollbar-color: var(--asphalt-3) transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.side-nav:hover::-webkit-scrollbar-thumb { background: var(--asphalt-3); }
.nav-group + .nav-group { margin-top: .6rem; }
.nav-label {
  padding: .5rem .75rem .25rem; font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  color: #7d90ad;
}
.side-nav a { padding: .48rem .75rem; gap: .7rem; font-size: .95rem; }
.side-nav a .ic { width: 19px; height: 19px; opacity: .85; }
.side-nav a.active .ic { opacity: 1; color: var(--lane); }
.side-foot { margin-top: .5rem; flex: none; }
a.me { text-decoration: none; color: inherit; border-radius: 8px; padding: .3rem .4rem; margin-left: -.4rem; flex: 1; min-width: 0; }
a.me:hover, a.me.active { background: var(--asphalt-2); }

/* Mobil menyu bölmələri */
.menu-sheet { max-height: calc(100vh - 110px - env(safe-area-inset-top)); overflow-y: auto; }
.menu-sheet .nav-label { color: var(--muted); padding: .7rem .7rem .2rem; border-top: 1px solid var(--line); margin-top: .3rem; }
.menu-sheet a.active { background: var(--field); font-weight: 600; }
a.menu-me { text-decoration: none; color: var(--ink); border-radius: 8px; }
a.menu-me:hover { background: var(--field); }
.side-nav a { padding: .38rem .75rem; }
.nav-label { padding: .35rem .75rem .15rem; }
.nav-group + .nav-group { margin-top: .4rem; }
.sidebar .new-trip { margin-bottom: .75rem; min-height: 40px; }
.brand { padding-bottom: .85rem; }
.me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 760px) and (min-width: 901px) {
  .side-nav a { padding: .3rem .75rem; font-size: .9rem; }
  .nav-label { padding-top: .25rem; }
}

/* ---------- Mərhələ 7: mühasib, dozvol anbarı ---------- */
.badge.acc { background: color-mix(in srgb, var(--sign) 16%, transparent); color: var(--sign); }
.ledger-5 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.1rem; }
.ledger-5 .period { flex-basis: 100%; }
.ledger-5 .term { flex: 1 1 150px; }
.ledger-5 .term.result { flex: 1 1 100%; border-top: 1px solid var(--asphalt-3); padding-top: .8rem; }
.ledger-5 .op.eq { display: none; }
@media (min-width: 701px) { .ledger-5 .op { display: block; } .ledger-5 .op.eq { display: none; } }
@media (max-width: 700px) { .ledger-5 .op { display: none; } }

.sp-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .75rem; margin-bottom: .45rem; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.sp-row .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.sp-row .icon-btn:hover { color: var(--bad); background: var(--surface); }
.sp-add { display: flex; gap: .5rem; margin: .25rem 0 .75rem; }
.sp-add select { margin: 0; flex: 1; min-width: 0; }
@media (max-width: 600px) { .sp-add { flex-direction: column; } }
details.manual-permits { margin-top: .5rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
details.manual-permits summary { cursor: pointer; color: var(--sign); font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }
td.nowrap { white-space: nowrap; }

/* =========================================================
   Mərhələ 8 — Şəbəkə zolağı, GPS izləmə, Şəbəkə statusu
   ========================================================= */
.net-bar {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + .75rem); transform: translateX(-50%);
  z-index: 3000; max-width: min(560px, calc(100vw - 2rem)); padding: .7rem 1rem .7rem 2.4rem;
  border-radius: 10px; font-weight: 600; font-size: .92rem; line-height: 1.35; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.net-bar::before { content: ""; position: absolute; left: 1rem; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #fff; }
.net-bar.off { background: var(--bad); }
.net-bar.off::before { animation: blink 1s infinite; }
.net-bar.on { background: var(--ok); }
.net-bar.shake { animation: shake .4s; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes shake { 20%, 60% { transform: translateX(calc(-50% - 8px)); } 40%, 80% { transform: translateX(calc(-50% + 8px)); } }

/* ---------- İzləmə ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.moving { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.stopped { background: var(--amber); }
.dot.offline { background: var(--bad); }
.dot.none { background: transparent; border: 2px solid var(--line); }

.track { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: stretch; }
.track .card { margin: 0; }
.track-list { display: flex; flex-direction: column; padding: .75rem; max-height: 640px; }
.track-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--muted); padding: .25rem .4rem .7rem; border-bottom: 1px solid var(--line); }
.track-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.track-items { overflow-y: auto; flex: 1; margin: .4rem -.25rem; scrollbar-width: thin; }
.track-foot { font-size: .78rem; padding: .5rem .4rem 0; border-top: 1px solid var(--line); }
.ti {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-radius: 8px; padding: .6rem .55rem; cursor: pointer;
}
.ti:hover:not(:disabled) { background: var(--field); }
.ti:disabled { cursor: default; opacity: .6; }
.ti-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ti-main b { font: 700 1.05rem/1.1 var(--cond); letter-spacing: .03em; }
.ti-main small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-main .ti-trip { color: var(--sign); }
.ti-state { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; white-space: nowrap; background: var(--field); color: var(--muted); }
.ti-state.moving { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.ti-state.stopped { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--warn); }
.ti-state.offline { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.track-map { padding: 0; overflow: hidden; min-height: 520px; position: relative; }
.map { position: absolute; inset: 0; z-index: 0; background: var(--field); }
.route-view .track-list { padding: 1.1rem; }

/* Xəritədəki maşın nişanı */
.tm { background: none; border: 0; }
.tm-dot {
  position: relative; display: block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.tm.moving .tm-dot { background: #1d8a57; }
.tm.stopped .tm-dot { background: #f2b705; }
.tm.offline .tm-dot { background: #c8372d; }
.tm.moving .tm-dot::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid #1d8a57; opacity: 0;
  animation: ping 2s infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.4); opacity: 0; } }
.tm-arrow { position: absolute; inset: -12px; }
.tm-arrow::before {
  content: ""; position: absolute; left: 50%; top: 0; margin-left: -5px;
  border: 5px solid transparent; border-bottom: 8px solid var(--asphalt); border-top: 0;
}
.tm-label {
  position: absolute; left: 50%; top: 26px; transform: translateX(-50%); white-space: nowrap;
  background: var(--asphalt); color: #fff; font: 700 .78rem/1 "Barlow Condensed", sans-serif; letter-spacing: .04em;
  padding: .22rem .4rem; border-radius: 4px; border-bottom: 2px solid var(--lane); box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.tm-stop {
  background: var(--asphalt); color: var(--lane); border: 2px solid var(--lane); border-radius: 50%;
  font: 700 .78rem/18px "Barlow Condensed", sans-serif; text-align: center;
}
.tp { font: .88rem/1.45 var(--font); min-width: 210px; }
.tp-plate { font: 700 1.15rem var(--cond); letter-spacing: .03em; }
.tp-state { font-weight: 600; margin: .15rem 0; }
.tp-state.moving { color: #1d8a57; } .tp-state.stopped { color: #b27a00; } .tp-state.offline { color: #c8372d; }
.tp-links { display: flex; justify-content: space-between; gap: .5rem; margin-top: .45rem; padding-top: .45rem; border-top: 1px solid #e0e5eb; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper { border-radius: 10px; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); } }

.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.rs-grid div { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }
.rs-grid small { display: block; color: var(--muted); font-size: .78rem; }
.rs-grid b { font: 700 1.25rem/1.15 var(--cond); white-space: nowrap; }
.route-view h3 { font-size: 1rem; margin: .5rem 0; }
.stops { padding-left: 1.3rem; margin: 0 0 1rem; }
.stops li { padding: .2rem 0; }

.gps-code { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.gps-code code, code.wrap { font-size: .85rem; word-break: break-all; }
.gps-howto h3 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; }
.gps-howto ol { padding-left: 1.2rem; margin: 0; }
.gps-howto li { margin: .25rem 0; }

@media (max-width: 900px) {
  .track { grid-template-columns: 1fr; }
  .track-list { max-height: none; order: 2; }
  .track-items { max-height: 340px; }
  .track-map { min-height: 60vh; order: 1; }
}

/* ---------- Şəbəkə statusu ---------- */
.status-hero {
  display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem 1.3rem; margin-bottom: 1.25rem;
  background: var(--asphalt); color: #fff; border-radius: var(--radius); position: relative; overflow: hidden;
}
.status-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: repeating-linear-gradient(90deg, var(--lane) 0 28px, transparent 28px 46px); opacity: .8; }
.status-hero b { display: block; font: 700 1.6rem/1.1 var(--cond); letter-spacing: .01em; }
.status-hero small { color: #bcd0ec; }
.sh-light { display: flex; flex-direction: column; gap: 5px; background: #061a36; padding: 7px; border-radius: 10px; flex: none; }
.sh-light i { width: 16px; height: 16px; border-radius: 50%; background: #163259; }
.status-hero.bad  .sh-light i:nth-child(1) { background: #ef4b3f; box-shadow: 0 0 12px #ef4b3f; }
.status-hero.warn .sh-light i:nth-child(2) { background: #f2b705; box-shadow: 0 0 12px #f2b705; }
.status-hero.ok   .sh-light i:nth-child(3) { background: #33c47f; box-shadow: 0 0 12px #33c47f; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: start; }
.status-grid .card { margin: 0; }
.status-card h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; }
.status-card h2 .ic { color: var(--sign); }
.chk { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line); }
.chk:first-of-type { border-top: 0; }
.chk .dot { margin-top: .4rem; }
.chk > div { min-width: 0; flex: 1; }
.chk b { display: block; font-weight: 600; font-size: .95rem; }
.chk small { display: block; }
.chk .cv { color: var(--ink); font-size: .9rem; overflow-wrap: anywhere; }
.chk .hint { color: var(--muted); font-size: .8rem; margin-top: .15rem; overflow-wrap: anywhere; }
.chk.ok .dot { background: var(--ok); }
.chk.warn .dot { background: var(--amber); box-shadow: 0 0 0 1px var(--warn); }
.chk.bad .dot { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.chk.bad .cv { color: var(--bad); font-weight: 600; }
.chk.info .dot { background: var(--sign); opacity: .55; }
.chk.wait .dot { background: var(--line); }
.spin { display: inline-block; width: .8em; height: .8em; border: 2px solid var(--line); border-top-color: var(--sign); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .status-grid { grid-template-columns: 1fr; }
  .status-hero b { font-size: 1.3rem; }
}

/* Km reysi və ümumi: sütun içində cədvəl səhifəni genişləndirməsin */
.cols > * { min-width: 0; }
.hint.neg { color: var(--bad); }
.km-grid .hint { margin-bottom: .9rem; }
.ledger .term .usd { display: block; margin-top: .35rem; font: 600 1.15rem/1 var(--cond); font-style: normal; color: #bcd0ec; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .term.result .usd { color: var(--lane); opacity: .8; font-size: 1.35rem; }
.ledger .term.result.loss .usd { color: #ff8a7f; }
.ledger .usd-note { white-space: nowrap; }

/* ---------- Təhlükəsizlik: giriş bloku və geri sayım ---------- */
.lock-box { display: flex; gap: 1rem; align-items: center; padding: 1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); }
.lock-box strong { display: block; color: var(--bad); font-size: 1.05rem; }
.lock-box p { margin: .2rem 0 0; font-size: .88rem; color: var(--muted); }
.lock-ring { position: relative; width: 92px; height: 92px; flex: none; }
.lock-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lock-ring circle { fill: none; stroke-width: 9; }
.lock-ring .lr-bg { stroke: var(--line); }
.lock-ring .lr-fg { stroke: var(--bad); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: calc(326.73 * (1 - var(--p, 1))); transition: stroke-dashoffset .25s linear; }
.lock-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.6rem/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--bad); }
.lock-box.done { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.lock-box.done strong, .lock-box.done .lock-ring b { color: var(--ok); }
#login-form.locked { opacity: .5; }
.countdown { font: 700 1.25rem/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--bad); padding: .35rem .6rem; border-radius: 8px;
  background: color-mix(in srgb, var(--bad) 10%, transparent); align-self: center; min-width: 4.2em; text-align: center; }
.countdown.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.block-item .li-actions { align-items: center; }
.stat-alert { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.stat-alert .num { color: var(--bad); }
.sec-list { margin: 0; padding-left: 1.1rem; }
.sec-list li { margin: .35rem 0; }
@media (max-width: 420px) { .lock-box { flex-direction: column; text-align: center; } }

/* ---------- Dollar + manat, razılaşma, ən çox xərc ---------- */
small.azn { display: block; font-weight: 400; font-size: .78em; color: var(--muted); white-space: nowrap; }
.totals-bar small.azn { font-size: .8rem; }
.seg-label { margin: 1rem 0 .4rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.seg.seg-3 { flex-wrap: wrap; max-width: 100%; }
.seg.seg-3 label { flex: 1 1 auto; }
.top-spend { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.top-spend > div { padding: .75rem .9rem; border-radius: 8px; background: color-mix(in srgb, var(--bad) 7%, var(--field)); border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--line)); }
.top-spend small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.top-spend b { display: block; font: 700 1.25rem/1.2 var(--cond); margin: .15rem 0; }
.top-spend span { font-size: .88rem; }
.top-spend span small.azn { display: inline; font-size: .85em; margin-left: .25rem; }

/* ---------- Sənəd şəkilləri ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.att { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--field); display: flex; flex-direction: column; }
.att-thumb { display: block; aspect-ratio: 4 / 3; background: #0d2347; overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.att-thumb:hover img { transform: scale(1.04); }
.att-pdf { display: grid; place-items: center; align-content: center; gap: .3rem; height: 100%; color: #fff; font: 700 1rem var(--cond); letter-spacing: .08em; }
.att figcaption { padding: .55rem .7rem .65rem; display: flex; flex-direction: column; gap: .1rem; font-size: .88rem; }
.att figcaption b { font-size: .92rem; }
.att-actions { display: flex; gap: .9rem; margin-top: .3rem; font-size: .85rem; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--sign); cursor: pointer; text-decoration: underline; min-height: 0; }
.link-btn.neg { color: var(--bad); }
.att-upload { border-top: 1px dashed var(--line); padding-top: 1rem; }
.att-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.2rem; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; cursor: pointer; }
.att-pick:hover { border-color: var(--sign); }
.att-pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; }
.att-pick span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--sign); }
.bp-grid { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .75rem; margin-top: .5rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bulk-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
td input[type="checkbox"], th input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; }

/* Dozvolun satış qiyməti (reys formasında) */
.permit-row { grid-template-columns: 1fr 1fr 8.5rem 44px; }
.permit-row .money-input::after, .sp-price .money-input::after { top: 50%; }
.sp-row > span:first-of-type { flex: 1; min-width: 0; }
.sp-row .sp-cost { display: block; margin-top: .1rem; }
.sp-price { flex: 0 0 9.5rem; margin: 0; }
.sp-price input { margin: 0; min-height: 40px; }
.sp-price input.suggested { background: color-mix(in srgb, var(--lane) 16%, var(--field)); }
@media (max-width: 600px) {
  .permit-row { grid-template-columns: 1fr 1fr 44px; }
  .permit-row .money-input { grid-column: 1 / 3; grid-row: 2; }
  .permit-row .icon-btn { grid-row: 1 / 3; grid-column: 3; height: auto; }
  .sp-row { flex-wrap: wrap; }
  .sp-row > span:first-of-type { flex-basis: calc(100% - 3rem); }
  .sp-price { flex: 1 1 auto; order: 3; }
}

/* Avans və borclar: pul verdim / geri aldım */
.led-dir { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.led-dir label { margin: 0; position: relative; }
.led-dir input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.led-dir span { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; border: 2px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; text-align: center; padding: .4rem; }
.led-dir input:checked + span.give { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.led-dir input:checked + span.take { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.led-dir input:focus-visible + span { outline: 3px solid var(--focus, #1565d8); outline-offset: 2px; }
.repay-box { border: 1px dashed var(--line); border-radius: 12px; padding: .9rem 1rem; margin: 0 0 1rem; background: var(--field); }
.repay-box h3 { margin: 0 0 .6rem; font-size: 1rem; }
.repay-box .form-grid { margin-bottom: .6rem; }

/* Sürücüyə ödəniş */
.pay-card .card-head { gap: .75rem; flex-wrap: wrap; }
.pay-state { font-weight: 700; font-size: .85rem; padding: .25rem .75rem; border-radius: 99px; white-space: nowrap; }
.pay-state.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pay-state.warn { color: #9a6700; background: color-mix(in srgb, #f2b705 22%, transparent); }
.pay-state.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.pay-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .25rem 0 1rem; }
.pay-sum > div { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; background: var(--field); min-width: 0; }
.pay-sum small { display: block; color: var(--muted); font-size: .8rem; }
.pay-sum b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pay-sum .due { border-color: var(--bad); }
.pay-sum .due b { color: var(--bad); }
.pay-sum .done b { color: var(--ok); }
.pay-form, .sign-later { border-top: 1px dashed var(--line); padding-top: 1rem; margin-top: .5rem; }
.pay-form .btn { margin-right: .5rem; }
.sig-pad { position: relative; margin: .25rem 0 1rem; }
.sig-pad canvas { display: block; width: 100%; height: 170px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-pad.signed canvas { border-style: solid; border-color: var(--ok); }
.sig-pad .sig-clear { position: absolute; top: .5rem; right: .5rem; background: #fff; }
.sig-pad .sig-hint { position: absolute; left: 1rem; bottom: .6rem; color: #8496b2; font-size: .85rem; pointer-events: none; }
.sig-pad.signed .sig-hint { display: none; }
.sig-thumb { height: 34px; max-width: 110px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.pay-actions { margin: 1rem 0 0; }
@media (max-width: 600px) { .pay-sum { grid-template-columns: 1fr; } }
.bal-row small.owed { display: block; color: var(--bad); font-weight: 600; font-size: .8rem; }
.owed-card { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* SEO paneli */
.seo-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; }
.seo-top .card { margin: 0; }
.seo-score { display: flex; gap: 1.5rem; align-items: flex-start; }
.seo-score h2 { margin-top: 0; }
.ring { --p: 0; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79%), conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); }
.ring b { font: 700 2rem/1 "Barlow Condensed", sans-serif; }
.ring small { color: var(--muted); }
.seo-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .55rem 1.25rem; }
.seo-checks li { display: flex; gap: .55rem; align-items: flex-start; }
.seo-checks li i { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: .3rem; background: var(--ok); }
.seo-checks li.warn i { background: #f2b705; }
.seo-checks li.bad i { background: var(--bad); }
.seo-checks b { display: block; font-weight: 600; font-size: .92rem; }
.seo-checks small { color: var(--muted); font-size: .8rem; }
.seo-links { display: flex; flex-direction: column; gap: .45rem; }
.seo-links h2 { margin-top: 0; }
.seo-links a { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.count-hint { float: right; font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-hint.ok { color: var(--ok); } .count-hint.warn { color: #9a6700; } .count-hint.bad { color: var(--bad); }
.serp { margin-top: .5rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #202124; font-family: Arial, sans-serif; }
.serp > small { display: block; margin-bottom: .6rem; font-family: "Barlow", sans-serif; }
.serp-site { display: flex; align-items: center; gap: .6rem; }
.serp-fav { width: 28px; height: 28px; border-radius: 50%; background: var(--lane); color: var(--asphalt); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.serp-site b { display: block; font-weight: 400; font-size: .9rem; color: #202124; }
.serp-site cite { font-style: normal; font-size: .78rem; color: #4d5156; }
.serp-title { color: #1a0dab; font-size: 1.25rem; line-height: 1.3; margin: .35rem 0 .2rem; }
.serp-desc { color: #4d5156; font-size: .88rem; line-height: 1.55; }
.og-card { margin-top: .5rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--field); max-width: 520px; }
.og-img { aspect-ratio: 1200 / 630; background: var(--line) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.og-body { padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.og-body small { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; }
.og-body b { font-size: 1rem; }
.og-body span { color: var(--muted); font-size: .86rem; }
textarea.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85rem; }
@media (max-width: 900px) { .seo-top { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .seo-score { flex-direction: column; align-items: center; } }
.sum-sub { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: .1rem 0 .55rem 1rem; color: var(--muted); font-size: .82rem; border-bottom: 1px dashed var(--line); }
.sum-sub b { color: var(--ink); font-weight: 600; }

/* Dozvol nömrələri */
.num-input { margin: 0; min-height: 36px; padding: .35rem .55rem; font-variant-numeric: tabular-nums; max-width: 11rem; }
.num-input.missing { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--field)); }
.num-gen { display: grid; grid-template-columns: 1fr 6rem auto; gap: .5rem; align-items: end; }
.num-gen label { margin: 0; }
.num-gen .btn { min-height: 44px; }
.lbl-like { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.num-picks { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 180px; overflow: auto; padding: .1rem; margin-bottom: .6rem; }
.num-picks .pick { margin: 0; display: inline-flex; }
.num-picks .pick input { position: absolute; opacity: 0; pointer-events: none; }
.num-picks .pick span { padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 99px; font-size: .88rem; cursor: pointer; font-variant-numeric: tabular-nums; background: var(--field); }
.num-picks .pick input:checked + span { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
.num-picks .pick input:focus-visible + span { outline: 3px solid var(--sign); outline-offset: 2px; }
.buyer-kind { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.buyer-kind label { margin: 0; position: relative; }
.buyer-kind input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.buyer-kind span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 2px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .9rem; text-align: center; padding: .3rem; cursor: pointer; }
.buyer-kind input:checked + span { border-color: var(--sign); color: var(--sign); background: color-mix(in srgb, var(--sign) 10%, transparent); }
@media (max-width: 600px) { .num-gen { grid-template-columns: 1fr 5rem; } .num-gen .btn { grid-column: 1 / -1; } }
code.wrap { white-space: normal; word-break: break-all; }
.gs-select { min-width: 13rem; width: 100%; margin: 0; }

/* Avanslar (bir neçə sətir) */
.adv-box { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem .5rem; margin: .25rem 0 1rem; background: var(--field); }
.adv-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .55rem; font-size: .92rem; }
.adv-head span { color: var(--muted); }
.adv-row { display: grid; grid-template-columns: 9.5rem 9rem 1fr 44px; gap: .5rem; margin-bottom: .5rem; }
.adv-row input { margin: 0; }
.adv-row .money-input::after { top: 50%; }
.adv-row .icon-btn { width: 44px; height: 44px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.adv-row .icon-btn:hover { color: var(--bad); }
.adv-box #adv-add { margin-bottom: .35rem; }
@media (max-width: 600px) {
  .adv-row { grid-template-columns: 1fr 1fr 44px; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); }
  .adv-row input[name="adv_note[]"] { grid-column: 1 / 3; grid-row: 2; }
  .adv-row .icon-btn { grid-column: 3; grid-row: 1; }
}
/* Yol xərci sətirində tarix */
.exp-row .exp-date { grid-column: 2; grid-row: 2; margin: 0; }
.exp-row .exp-note { grid-column: 3 / 5; grid-row: 2; }
@media (max-width: 600px) {
  .exp-row .exp-date { grid-column: 1 / 4; grid-row: 4; }
  .exp-row .exp-note { grid-column: 1 / 4; grid-row: 5; }
}
.quick-exp input[type="date"] { max-width: 10rem; }

/* Monitorinq */
.mon-hero { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border-radius: 16px; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.mon-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: repeating-linear-gradient(90deg, var(--lane) 0 18px, transparent 18px 30px); }
.mon-hero h2 { margin: 0; font-size: 1.35rem; }
.mon-hero p { margin: .15rem 0 0; color: var(--muted); }
.mon-big { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: var(--ok); }
.mon-big svg { width: 28px; height: 28px; }
.mon-hero.degraded .mon-big { background: #d99a00; }
.mon-hero.down .mon-big { background: var(--bad); }
.mon-hero.ok .mon-big { animation: mon-beat 2.4s ease-in-out infinite; }
@keyframes mon-beat { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ok) 0%, transparent); } 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 35%, transparent); } }
.mon-tl { display: grid; grid-template-columns: repeat(96, minmax(0, 1fr)); gap: 2px; height: 38px; }
.mon-tl span { border-radius: 2px; background: var(--line); }
.mon-tl span.ok { background: var(--ok); }
.mon-tl span.degraded { background: #e0a800; }
.mon-tl span.down { background: var(--bad); }
.mon-tl span:hover { opacity: .7; }
.mon-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.mon-sub { margin: 1.1rem 0 .4rem; font-size: 1rem; }
.mon-chart { width: 100%; height: 120px; display: block; }
.mon-chart .line { fill: none; stroke: var(--sign); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mon-chart .base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mon-check, .mon-inc { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--line); }
.mon-inc { grid-template-columns: 7.5rem minmax(0, 1fr); }
.mon-check:first-of-type, .mon-inc:first-of-type { border-top: 0; }
.mon-check b, .mon-inc b { display: block; font-weight: 600; }
.mon-check small, .mon-inc small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.mon-val { font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums; max-width: 14rem; }
.mon-pill { display: inline-block; text-align: center; padding: .2rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.mon-pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.mon-pill.degraded { color: #9a6700; background: color-mix(in srgb, #f2b705 24%, transparent); }
.mon-pill.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.mon-pill.skip { color: var(--muted); background: var(--field); }
.mon-inc.open b { color: var(--bad); }
.mon-help { margin: -.25rem 0 .9rem; }
.mon-help summary { cursor: pointer; color: var(--sign); font-weight: 600; font-size: .9rem; }
.mon-help ol { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .9rem; color: var(--muted); }
.mon-help li { margin: .25rem 0; }
.mon-log summary { cursor: pointer; }
.mon-log pre { margin: .75rem 0 0; padding: .75rem; background: var(--field); border-radius: 10px; overflow: auto; font-size: .75rem; line-height: 1.45; max-height: 320px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 600px) {
  .mon-tl { grid-template-columns: repeat(48, minmax(0, 1fr)); height: 30px; }
  .mon-tl span:nth-child(odd) { display: none; }
  .mon-check { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .mon-check .mon-val { grid-column: 2; text-align: left; }
  .mon-inc { grid-template-columns: 6.5rem minmax(0, 1fr); }
}
.stat { min-width: 0; }
.stat .lbl { overflow-wrap: anywhere; }
@media (max-width: 420px) { .stat .num { font-size: 1.5rem; } .stat { padding: .85rem .9rem; } }

/* Barmaq izi ilə giriş */
.or-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 .75rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-btn { gap: .55rem; min-height: 50px; font-weight: 600; }
.passkey-btn svg { color: var(--sign); }
.passkey-msg { margin: .5rem 0 0; min-height: 1.2em; font-size: .9rem; color: var(--muted); text-align: center; }
.passkey-msg.ok { color: var(--ok); }
.passkey-msg.err { color: var(--bad); }
#passkeys .passkey-msg { text-align: left; }
.pk-list { margin: .75rem 0 1rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pk-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; }
.pk-item + .pk-item { border-top: 1px solid var(--line); }
.pk-item > div { flex: 1; min-width: 0; }
.pk-item b { display: block; }
.pk-item small { color: var(--muted); }
.pk-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--sign) 12%, transparent); color: var(--sign); flex: none; }

/* Qayıdış yükünü reysi bağlamadan təsdiqləmək */
.ret-confirm { display: grid; gap: .5rem; padding: .85rem; border: 1px dashed color-mix(in srgb, var(--lane) 60%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--lane) 7%, var(--surface)); }
.ret-confirm .hint { margin: 0; }
.ret-ok b { white-space: nowrap; }
.ret-ok { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--ok); font-weight: 600; }
.ret-del { justify-self: start; color: var(--bad); }

/* Pul xanasının yanında valyuta düyməsi (₼ / $) */
.money-input.has-sw::after { display: none; }
.money-input.has-sw input { padding-right: 2.9rem; }
.cur-sw {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  min-width: 2.1rem; height: 1.9rem; padding: 0 .45rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: 700 .95rem/1 var(--font); cursor: pointer; transition: background .15s, color .15s;
}
.cur-sw:hover { color: var(--ink); border-color: var(--sign); }
.cur-sw.alt { background: var(--lane); border-color: var(--lane); color: var(--asphalt); }
.cur-sw:focus-visible { outline: 2px solid var(--sign); outline-offset: 1px; }
.cur-tip {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  padding: .35rem .55rem; border-radius: 6px; font-size: .8rem; line-height: 1.3; text-align: left;
  background: var(--asphalt); color: #fff; box-shadow: 0 6px 16px rgba(8, 30, 66, .25); pointer-events: none;
}
.cur-tip.ok { background: var(--ok); }

/* WhatsApp bildirişləri */
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1ebe5a; }
.nt-card .card-head h2 { display: flex; align-items: center; gap: .45rem; }
.nt-card .card-head h2 svg { color: #25d366; }
.tabs-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.seg-inline { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.seg-inline a { padding: .4rem .75rem; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg-inline a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(8, 30, 66, .12); }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.nt-item:first-child { border-top: 0; }
.nt-item.is-sent { opacity: .78; }
.nt-main { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; min-width: 0; }
.nt-who { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .15rem .45rem; border-radius: 5px;
          background: color-mix(in srgb, var(--sign) 14%, var(--surface)); color: var(--sign); }
.nt-who.owner { background: color-mix(in srgb, var(--amber) 20%, var(--surface)); color: var(--warn, #9a6700); }
.nt-title { color: var(--ink); }
.nt-ctx, .nt-phone { color: var(--muted); font-size: .85rem; }
.nt-warn { flex-basis: 100%; color: var(--warn, #9a6700); font-size: .82rem; }
.nt-sent { display: inline-flex; align-items: center; gap: .25rem; color: var(--ok); font-size: .82rem; font-weight: 600; }
.nt-prev { flex-basis: 100%; }
.nt-prev summary { cursor: pointer; color: var(--sign); font-size: .85rem; }
.nt-prev pre { white-space: pre-wrap; word-break: break-word; margin: .4rem 0 0; padding: .7rem .8rem; border-radius: 10px;
               background: color-mix(in srgb, #25d366 9%, var(--field)); border: 1px solid var(--line); font: .88rem/1.45 var(--font); color: var(--ink); }
.nt-act { flex: none; }
.nt-list.compact .nt-item { padding: .65rem 0; }
@media (max-width: 560px) { .nt-item { flex-direction: column; } .nt-act { align-self: stretch; } .nt-act .btn { width: 100%; justify-content: center; } }
.nt-mode { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .4rem; padding: .35rem .7rem; border-radius: 8px;
           background: var(--field); border: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.nt-mode.on { background: color-mix(in srgb, #25d366 10%, var(--surface)); border-color: color-mix(in srgb, #25d366 40%, var(--line)); color: var(--ink); }
.nt-mode svg { color: #25d366; }
.nt-fail { flex-basis: 100%; color: var(--bad); font-size: .82rem; }
.nt-prov { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.nt-opt { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.nt-opt:has(input:checked) { border-color: #25d366; box-shadow: 0 0 0 2px color-mix(in srgb, #25d366 30%, transparent); }
.nt-opt input { margin-top: .2rem; }
.nt-opt span { display: grid; gap: .2rem; }
.nt-opt small { color: var(--muted); line-height: 1.35; }
.nt-fs { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; }
.nt-fs legend { font-weight: 700; padding: 0 .35rem; }
.nt-auto { margin: .25rem 0; font-weight: 600; }
.nt-settings > label:not(.check) { display: block; max-width: 420px; margin-top: .75rem; }
.form-actions { margin-top: .9rem; }
.nt-test { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.nt-test label { flex: 1 1 220px; max-width: 320px; }

/* Kabinetlər: sürücü xərcləri və giriş */
.kx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.kx-item { display: grid; grid-template-columns: 110px 1fr; gap: .9rem; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
.kx-photo { display: block; width: 110px; height: 140px; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.kx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kx-photo.none { display: grid; place-items: center; font-size: .8rem; color: var(--muted); text-align: center; }
.kx-body { min-width: 0; display: grid; gap: .25rem; align-content: start; }
.kx-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.kx-amt { font-size: 1.15rem; font-weight: 700; color: var(--sign); }
.kx-note { font-style: italic; color: var(--muted); }
.kx-act { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; margin-top: .4rem; }
.kx-act form { display: flex; flex-wrap: wrap; align-items: end; gap: .4rem; margin: 0; }
.kx-act label { margin: 0; }
.kx-amt-in input { width: 120px; }
.kx-no { flex: 1 1 280px; flex-wrap: nowrap !important; }
.kx-no input { flex: 1; min-width: 0; }
.kx-hist { margin-top: 1rem; }
.kx-btns { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.kx-btns form { margin: 0; }
.trk-card .trk-url { display: flex; gap: .4rem; align-items: center; }
.trk-card .trk-url input { flex: 1; min-width: 0; font-size: .85rem; }
.trk-card .trk-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
@media (max-width: 600px) { .kx-item { grid-template-columns: 1fr; } .kx-photo { width: 100%; height: 200px; } }
.kx-notice { display: flex; gap: .6rem; align-items: center; text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.kx-notice u { color: var(--sign); }

/* Sahibin borcu: əsas və təmir ayrıca */
.debt-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 .8rem; }
.debt-box { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; background: var(--surface); }
.debt-box small { color: var(--muted); }
.debt-box b { font-variant-numeric: tabular-nums; }
.debt-box.cur { border-color: var(--sign); box-shadow: 0 0 0 1px var(--sign) inset; }

/* Təmir: zapçast sətirləri */
.parts { display: flex; flex-direction: column; gap: .45rem; margin: .4rem 0 .6rem; }
.part-row { display: grid; grid-template-columns: 1fr 70px 110px 36px; gap: .4rem; align-items: center; }
.part-row input { min-width: 0; }
.part-head { font-size: .8rem; color: var(--muted); }
.part-head span:last-child { visibility: hidden; }
.rep-total { display: flex; justify-content: space-between; padding: .6rem .2rem; border-top: 1px dashed var(--line); font-weight: 600; }
.rep-parts-list { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }
.km-badge { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .part-row { grid-template-columns: 1fr 56px 90px 32px; }
  .debt-split { grid-template-columns: 1fr 1fr; }
  .debt-split .debt-box:last-child { grid-column: 1 / -1; }
}
