/* Office screens (Kayıtlar, Araçlar). Builds on style.css tokens. */
body.office { background: var(--page); }
body.office .top { background: var(--surface); position: sticky; top: 0; z-index: 5; }
.onav { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.onav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.onav a:hover { background: var(--soft); color: var(--navy-ink); }
.onav a[aria-current="page"] { background: var(--navy); color: #fff; }
.omain { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; }
.ohead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ohead h1 { margin: 0; color: var(--navy-ink); font-size: 28px; }
.ohead .sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
/* Panel: eight figures in two even rows (four on a phone in two columns). */
.tiles.t8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .tiles.t8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; text-align: left; font: inherit; cursor: pointer; }
.tile:hover { border-color: var(--navy-line); }
.tile .v { font-size: 28px; font-weight: 700; color: var(--navy-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile.warn .v { color: var(--warn-ink); }
.tile.bad .v { color: var(--red-ink); }
.tile.good .v { color: var(--ok); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search { flex: 1 1 280px; font: inherit; font-size: 15px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.search:focus, .toolbar select:focus { outline: none; border-color: var(--navy-line); box-shadow: 0 0 0 3px rgba(33,40,86,0.12); }
.toolbar select { font: inherit; font-size: 15px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 220px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip b { color: var(--muted); font-weight: 600; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy-line); color: #fff; }
.chip[aria-pressed="true"] b { color: var(--on-navy-muted); }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }

.wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.otable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.otable th, .otable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.otable th { color: var(--navy-ink); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; background: var(--soft); position: sticky; top: 0; cursor: default; }
.otable th[data-sort] { cursor: pointer; }
.otable th[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
.otable th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.otable tbody tr { cursor: pointer; }
.otable tbody tr:hover { background: var(--hover); }
.otable tbody tr:last-child td { border-bottom: 0; }
.otable .code { font-weight: 700; color: var(--navy-ink); }
.otable .sc { color: var(--muted); font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.otable .dim { color: var(--muted); }
.otable .n { font-variant-numeric: tabular-nums; }
.otable td.wrapc { white-space: normal; min-width: 140px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; margin: 1px 3px 1px 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--err-bg); color: var(--red-ink); }
.badge.grey { background: var(--soft); color: var(--muted); }
.badge.navy { background: var(--navy-bg); color: var(--navy-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--ok); } .dot.mid { background: #e0a100; } .dot.off { background: var(--placeholder); }
.foot { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 28px 12px; text-align: center; }

.scrim { position: fixed; inset: 0; background: rgba(20,23,43,0.35); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 10; box-shadow: -12px 0 32px rgba(20,23,43,0.18); overflow-y: auto; }
.drawer-in { padding: 0 0 32px; }
.dhead { background: var(--navy); color: #fff; padding: 18px 20px 16px; position: sticky; top: 0; }
.dhead .x { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.14); color: #fff; border: 0; border-radius: 10px; width: 36px; height: 36px; font-size: 20px; cursor: pointer; }
.dhead .code { font-size: 32px; font-weight: 700; line-height: 1.1; }
.dhead .meta { color: var(--on-navy-muted); margin-top: 2px; }
.dhead .tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.dhead .tags .badge { background: rgba(255,255,255,0.16); color: #fff; }
.dsec { padding: 16px 20px 0; }
.dsec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--navy-ink); margin: 0 0 8px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.kv div { min-width: 0; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 600; overflow-wrap: anywhere; }
.docs { display: grid; gap: 6px; }
.doc { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.doc .d { color: var(--muted); font-size: 13px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.abtn { font: inherit; font-size: 14px; font-weight: 700; padding: 9px 14px; border-radius: 10px; border: 2px solid var(--navy-line); background: var(--surface); color: var(--navy-ink); text-decoration: none; }
.abtn.primary { background: var(--navy); color: #fff; }
.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini th, .mini td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.mini th { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.mini td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sum { display: flex; gap: 10px; margin-bottom: 8px; }
.sum div { flex: 1; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.sum .v { font-size: 20px; font-weight: 700; color: var(--navy-ink); font-variant-numeric: tabular-nums; }
.sum .l { font-size: 12px; color: var(--muted); }
.note-box { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* Vehicle pictures: representative, one per model group (public/vehicle-images.js) */
.pic { display: block; object-fit: cover; background: var(--soft); border-radius: 10px; }
.pic.sm { width: 64px; height: 48px; border-radius: 8px; flex: none; }
.pic.none { background: var(--soft); }
.tcell { display: flex; align-items: center; gap: 10px; }
.otable td:has(.tcell) { padding-top: 6px; padding-bottom: 6px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px; border: 0; background: transparent; color: var(--ink); cursor: pointer; min-height: 40px; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cards[hidden], .wrap[hidden] { display: none; }
.cards .empty { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 0; }
.vcard { display: flex; flex-direction: column; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0; overflow: hidden; cursor: pointer; min-width: 0; }
.vcard:hover, .vcard:focus-visible { border-color: var(--navy-line); outline: none; box-shadow: 0 0 0 3px rgba(33,40,86,0.12); }
.vcard .pic { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
.vc-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
.vc-top { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vc-top .code { font-size: 18px; font-weight: 700; color: var(--navy-ink); }
.vc-top .sc { color: var(--muted); font-size: 12px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.vc-top .badge { margin-left: auto; }
.vc-type { font-weight: 700; font-size: 15px; }
.vc-model { font-size: 14px; }
.vc-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.vc-docs { margin-top: 4px; }
.vcard .dim { color: var(--muted); }
.dpic { margin: 0; }
.dpic img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.dpic figcaption { padding: 8px 20px 0; font-size: 13px; color: var(--muted); }
.dpic figcaption b { color: var(--ink); }
.legal-link { color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vc-body { padding: 8px 10px 10px; }
  .vc-top .code { font-size: 16px; }
  .vc-type { font-size: 14px; }
  .pic.sm { width: 48px; height: 36px; }
  .omain { padding: 14px 12px 32px; }
  .onav { margin-left: 8px; }
  .onav a { padding: 6px 8px; font-size: 14px; }
  .appname { display: none; }
}

/* ---------- shared menu, sign-in ---------- */
html { color-scheme: light dark; }
html.auth-wait body.office > main, html.auth-wait .onav, html.auth-wait .signout, html.auth-wait .theme-slot, html.auth-wait .office-foot { visibility: hidden; }
/* yönetici şifresi window */
.admin-dlg { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.admin-dlg::backdrop { background: rgba(20,23,43,0.45); }
.admin-dlg form { padding: 20px; }
.admin-dlg h2 { margin: 0 0 4px; color: var(--navy-ink); font-size: 20px; }
.admin-dlg .dsub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.admin-dlg input { width: 100%; font: inherit; font-size: 18px; padding: 10px 84px 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.admin-dlg input:focus { outline: none; border-color: var(--navy-line); }
.admin-dlg .dact { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.admin-dlg .dact button { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 2px solid var(--navy-line); background: var(--surface); color: var(--navy-ink); }
.admin-dlg .dact button.primary { background: var(--navy); color: #fff; }
.reports { list-style: none; margin: 0; padding: 0; }
.reports li { padding: 10px 0; border-top: 1px solid var(--line); }
.reports li:first-child { border-top: 0; }
.reports .rhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; color: var(--muted); }
.reports .rhead b { color: var(--ink); font-size: 14px; }
.reports .rhead .badge, .reports .rbtn { margin-left: auto; }
.reports .rbtn { padding: 5px 10px; font-size: 13px; cursor: pointer; }
.reports p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reports li.rdone p { color: var(--muted); }
/* photos and voice notes */
.mitem { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin: 2px 6px 2px 0; }
.mitem.audio { display: flex; margin-right: 0; }
.mdel { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--red-ink); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.mitem.photo .mdel { position: absolute; top: -6px; right: -6px; box-shadow: 0 1px 3px rgba(20,23,43,0.25); }
.mitem.audio .mdel { margin-left: 4px; flex: none; }
.mdel:hover { background: var(--err-bg); }
.mthumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--soft); width: 52px; height: 52px; cursor: zoom-in; margin: 2px 4px 2px 0; vertical-align: middle; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s ease; }
.mthumb img.ready { opacity: 1; }
.mthumb.big { width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; }
.maudio { height: 36px; max-width: 260px; width: 100%; min-width: 200px; vertical-align: middle; margin: 2px 0; }
.mcell { margin-top: 4px; }
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(10,12,24,0.9); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.viewer .vdl { position: absolute; top: 14px; right: 14px; background: #fff; color: #212856; font-weight: 700; text-decoration: none; border-radius: 10px; padding: 8px 14px; }
.mhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.mhead h2 { margin: 0 !important; }
.mhead .abtn { padding: 6px 12px; font-size: 13px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mcard .mh { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.mcard .mh b { color: var(--navy-ink); font-size: 15px; }
.mcard .mtag { font-size: 12px; }
.mcard .maudio { max-width: none; }
.mrecent { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mrecent .mi { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.mrecent .mthumb { width: 84px; height: 84px; }
.mrecent .maudio { width: 230px; }
.mcard a { color: var(--navy-ink); }
.office-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 16px 26px; }
.office-foot a { color: var(--muted); }
.signout { font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: none; border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.signout:hover { color: var(--navy-ink); border-color: var(--navy-line); }
body.signin-page .onav, body.signin-page .signout { display: none; }
body.office .top .hb-right { margin-left: 12px; }
main.signin { display: flex; align-items: center; justify-content: center; padding: 24px 16px; max-width: none; }
.signin-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; text-align: center; border-top: 6px solid var(--navy-line); }
.signin-card img { width: 140px; display: block; margin: 0 auto 8px; }
.signin-card h1 { color: var(--navy-ink); font-size: 24px; margin: 8px 0 18px; }
.signin-card label { display: block; text-align: left; font-weight: 700; color: var(--navy-ink); margin-bottom: 6px; }
.signin-card input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.signin-card input:focus { outline: none; border-color: var(--navy-line); }
.signin-card .btn { margin-top: 14px; }
.signin-card a { display: inline-block; margin-top: 14px; color: var(--navy-ink); font-weight: 700; }
.signin-err { color: var(--red-ink); font-weight: 700; margin: 8px 0 0; text-align: left; }
.kwrap { position: relative; }
.signin-card .kwrap input { padding-right: 84px; }
.kshow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 14px; font-weight: 600; color: var(--navy-ink); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.kshow:hover { background: var(--soft); }
.signin-warn { color: var(--warn-ink); background: var(--warn-bg); border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 600; margin: 8px 0 0; text-align: left; }
.signin-hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------- panel ---------- */
a.tile { text-decoration: none; display: block; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--navy-ink); margin: 0 0 10px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .bar path { fill: var(--chart-bar); }
.chart .bar path.today { fill: var(--red); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover .hit { fill: rgba(33,40,86,0.05); }
.chsum { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.chsum b { color: var(--ink); }
.tip { position: fixed; z-index: 20; background: #14172b; color: #fff; font-size: 13px; padding: 5px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li + li { border-top: 1px solid var(--line); }
.alerts a { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 0; text-decoration: none; color: var(--ink); }
.alerts a:hover b { text-decoration: underline; }
.alerts .badge { grid-row: span 2; align-self: start; margin-top: 2px; }
.alerts .d { color: var(--muted); font-size: 13px; grid-column: 2; }
.none { color: var(--muted); margin: 4px 0; }
.mnote { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.mwrap { overflow-x: auto; }
.mwrap a { color: var(--navy-ink); text-decoration: none; }
.mwrap a:hover { text-decoration: underline; }
.mwrap small { color: var(--muted); }
.qrcard { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.qrcard p { margin: 0; color: var(--muted); }
@media (max-width: 860px) {
  .pgrid { grid-template-columns: 1fr; }
  .qrcard { flex-direction: column; align-items: stretch; }
  .qrcard .abtn { text-align: center; }
  .onav { overflow-x: auto; }
  .signout { padding: 6px 8px; font-size: 13px; }
}
body.office .chip { min-height: 0; }
.ohead .abtn { white-space: nowrap; }
@media (max-width: 720px) {
  .ohead { align-items: flex-start; }
  .ohead .abtn { padding: 7px 10px; font-size: 13px; }
  body.office .top { flex-wrap: wrap; row-gap: 6px; }
  body.office .top img { height: 44px; }
  .onav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .onav a { white-space: nowrap; }
  .signout { margin-left: auto; }
}

/* ---------- moving between office tabs ---------- */
/* Same-site page changes cross-fade; the top menu is one element across pages, so it stays still. */
@view-transition { navigation: auto; }
body.office .top { view-transition-name: office-top; }
::view-transition-group(office-top) { animation: none; }
::view-transition-old(office-top), ::view-transition-new(office-top) { animation: none; }
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .24s ease-out both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }
/* Content fades in once the page has its data; the frame around it does not move. */
body.office > main { animation: office-in .28s ease-out both; }
@keyframes office-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), body.office > main { animation: none; }
}

/* ---------- Panel colour: one accent per measure, within the brand's navy and red ---------- */
:root {
  --ac-navy: #212856; --ac-navy-bg: #e8eaf4;
  --ac-blue: #1f5fae; --ac-blue-bg: #e4eefa;
  --ac-green: #1f7a45; --ac-green-bg: #e3f3e9;
  --ac-indigo: #4450a8; --ac-indigo-bg: #e9ebf8;
  --ac-teal: #0f7a7a; --ac-teal-bg: #dff2f1;
  --ac-amber: #a76300; --ac-amber-bg: #fbf0dc;
  --ac-red: #b0242b; --ac-red-bg: #fbe6e7;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ac-navy: #aeb6f0; --ac-navy-bg: #252c55;
  --ac-blue: #7db3f2; --ac-blue-bg: #17304f;
  --ac-green: #6fd39a; --ac-green-bg: #143524;
  --ac-indigo: #9aa4f5; --ac-indigo-bg: #262c5c;
  --ac-teal: #5fd0c8; --ac-teal-bg: #113a3a;
  --ac-amber: #f3c065; --ac-amber-bg: #3a2c0e;
  --ac-red: #ff8a90; --ac-red-bg: #3e161b;
} }
:root[data-theme="dark"] {
  --ac-navy: #aeb6f0; --ac-navy-bg: #252c55;
  --ac-blue: #7db3f2; --ac-blue-bg: #17304f;
  --ac-green: #6fd39a; --ac-green-bg: #143524;
  --ac-indigo: #9aa4f5; --ac-indigo-bg: #262c5c;
  --ac-teal: #5fd0c8; --ac-teal-bg: #113a3a;
  --ac-amber: #f3c065; --ac-amber-bg: #3a2c0e;
  --ac-red: #ff8a90; --ac-red-bg: #3e161b;
}
.ptile { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-left: 4px solid var(--acc, var(--line)); }
.ptile .ti { grid-row: span 2; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--acc); background: var(--acc-bg); }
.ptile .v { color: var(--acc); }
.ptile .l { color: var(--muted); font-weight: 500; }
.ptile.zero .v { color: var(--muted); opacity: .75; }
.ptile.zero .ti { opacity: .7; }
.ac-navy { --acc: var(--ac-navy); --acc-bg: var(--ac-navy-bg); }
.ac-blue { --acc: var(--ac-blue); --acc-bg: var(--ac-blue-bg); }
.ac-green { --acc: var(--ac-green); --acc-bg: var(--ac-green-bg); }
.ac-indigo { --acc: var(--ac-indigo); --acc-bg: var(--ac-indigo-bg); }
.ac-teal { --acc: var(--ac-teal); --acc-bg: var(--ac-teal-bg); }
.ac-amber { --acc: var(--ac-amber); --acc-bg: var(--ac-amber-bg); }
.ac-red { --acc: var(--ac-red); --acc-bg: var(--ac-red-bg); }
.ac-red.ptile:not(.zero) { background: linear-gradient(90deg, var(--ac-red-bg), var(--surface) 70%); }
/* Section headings: a coloured marker and stronger ink. */
.card.c-hours { --acc: var(--ac-indigo); } .card.c-km { --acc: var(--ac-teal); } .card.c-alert { --acc: var(--ac-red); }
.card.c-site { --acc: var(--ac-blue); } .card.c-report { --acc: var(--ac-amber); }
.card[class*="c-"] > h2 { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13.5px; }
.card[class*="c-"] > h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--acc); flex: none; }
.chart[data-c="hours"] .bar path { fill: var(--ac-indigo); }
.chart[data-c="km"] .bar path { fill: var(--ac-teal); }
.chart[data-c] .bar path.today { fill: var(--red); }
.chart .bar:hover path { filter: brightness(1.12); }
/* Acil / Uyarı: tinted rows so they stand out from the rest of the card. */
.alerts li { border-radius: 10px; }
.alerts li + li { border-top: 0; margin-top: 8px; }
.alerts li:has(.badge.bad), .alerts li:has(.badge.red) { background: var(--ac-red-bg); border-left: 3px solid var(--ac-red); }
.alerts li:has(.badge.warn), .alerts li:has(.badge.amber) { background: var(--ac-amber-bg); border-left: 3px solid var(--ac-amber); }
.alerts li a { padding: 10px 12px; }
.alerts .badge { min-width: 54px; text-align: center; }
a.tile.ptile { display: grid; }
.ptile:hover { border-left-color: var(--acc); }

/* ---------- Panel, easier to read ---------- */
.tiles.p4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .tiles.p4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ptile .v { font-size: 30px; }
.ptile .l { font-size: 14px; }
.card[class*="c-"] > h2 { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.card.c-site { margin-bottom: 16px; }
.alerts .ok-line { display: flex; align-items: center; gap: 8px; color: var(--ok-ink); font-weight: 600; padding: 6px 0; }
.alerts .ok-line::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); font-size: 13px; }

/* ---------- İstekler badge on the menu ---------- */
.onav a { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.nbadge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.nbadge[hidden] { display: none; }
.onav a[aria-current="page"] .nbadge { background: #fff; color: var(--red-ink); }
.mini .dim { color: var(--muted); font-weight: 400; font-size: 12px; }

/* Five menu items do not fit a phone: the menu scrolls sideways instead of pushing the page wider. */
@media (max-width: 720px) {
  .onav { overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .onav::-webkit-scrollbar { display: none; }
  .onav a { flex: none; }
}

/* ---------- design review fixes (26.11.2026): layout and colour only ---------- */
/* Number columns: the heading sits over its numbers. */
.mini th.n { text-align: right; }
/* Measures stay within navy and blue; red is kept for errors and urgent items. */
.ac-teal { --acc: var(--ac-blue); --acc-bg: var(--ac-blue-bg); }
.card.c-km { --acc: var(--ac-blue); }
.card.c-site { --acc: var(--ac-navy); }
.chart[data-c="km"] .bar path { fill: var(--ac-blue); }
/* Today's bar: the same colour at full strength, the days before a little lighter. */
.chart[data-c] .bar path { opacity: .6; }
.chart[data-c="hours"] .bar path.today { fill: var(--ac-indigo); opacity: 1; }
.chart[data-c="km"] .bar path.today { fill: var(--ac-blue); opacity: 1; }
#listWrap:focus-visible { outline: 2px solid var(--navy-line); outline-offset: 2px; }
/* Room for the scrollbar is kept on every office page, long or short, so the menu and the page
   do not move sideways when switching tabs (Windows shows a scrollbar only on long pages). */
html:has(body.office) { scrollbar-gutter: stable; }

/* Very narrow phones (320 px): small tables on the Panel fit without sideways scrolling. */
@media (max-width: 360px) {
  .mini th, .mini td { padding: 6px 4px; font-size: 13px; }
  .mini th { font-size: 10px; }
  .tiles.p4, .tiles.t8 { grid-template-columns: minmax(0, 1fr); }
  #sites { overflow-x: auto; }
}

/* Meter photos (start and end reading): thumbnail with a small caption underneath. */
.mitem.meter { flex-direction: column; align-items: flex-start; gap: 2px; }
.mitem.meter .mthumb { border-color: var(--navy-ink); }
.mcap { font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.mitem.meter .mdel { right: auto; left: 40px; }
/* Each menu tab has a fixed width, so the tabs never move: not while the font loads, not when the
   İstekler count appears, not between pages. The text sits in the middle of its tab. */
@media (min-width: 1000px) {
  .onav { gap: 2px; }
  .onav a { justify-content: center; min-width: 88px; padding-left: 10px; padding-right: 10px; box-sizing: border-box; }
  .onav a[href="/istekler"] { min-width: 120px; }
  .onav a[href="/etiket"] { min-width: 108px; }
}
/* The logo takes its width from the first paint, before the picture has loaded, so the menu next to it never jumps. */
body.office .top .brand img { aspect-ratio: 981 / 657; width: auto; }
.onav a, .signout { white-space: nowrap; }

/* Form dialogs on the Araçlar page (Aktifleştir, Düzenle, Araç ekle). */
.fdlg { background: var(--surface); color: var(--ink); border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.fdlg::backdrop { background: rgba(20,23,43,0.45); }
.fdlg form { padding: 20px; }
.fdlg h2 { margin: 0 0 4px; color: var(--navy-ink); font-size: 20px; }
.fdlg .dsub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.fdlg .fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fdlg label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--navy-ink); }
.fdlg label.wide { grid-column: 1 / -1; }
.fdlg input, .fdlg textarea, .fdlg select { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface); padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; }
.fdlg input:focus, .fdlg textarea:focus, .fdlg select:focus { outline: none; border-color: var(--navy-line); }
.fdlg .derr { color: var(--red-ink); font-weight: 700; min-height: 20px; margin: 8px 0 0; }
.fdlg .dact { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.fdlg .dact button { font: inherit; font-weight: 700; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 2px solid var(--navy-line); background: var(--surface); color: var(--navy-ink); }
.fdlg .dact button.primary { background: var(--navy); color: #fff; }
@media (max-width: 560px) { .fdlg .fgrid { grid-template-columns: 1fr; } }

/* Takip (Aktifleştir) box in the vehicle drawer. */
.trackbox { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.trackbox p { margin: 0; font-size: 14px; }
.trackbox .acts { margin-top: 2px; }
.ahist { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.ahist li { margin: 3px 0; }

/* Panel: vehicles that are expected to send a record today and have not. */
.c-missing .mhead2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.c-missing .mhead2 h2 { margin: 0; }
.c-missing .msum { color: var(--muted); font-size: 14px; }
.c-missing { margin-bottom: 16px; }
.c-missing .mwrap { overflow-x: auto; margin-top: 10px; }
.c-missing .mini { min-width: 620px; }
.c-missing .mini a { color: var(--navy-ink); font-weight: 700; }
