/* Araç Kiralama Takip — yönetim ekranı. Mobil önce; açık ve koyu tema; yazdırma stili en altta. */
:root {
  --bg: #f4f6f9; --card: #ffffff; --text: #1a2230; --muted: #5a6879; --line: #dbe1e8;
  --brand: #0a5fb4; --brand-text: #ffffff; --brand-soft: #e4effa;
  --ok: #17703f; --ok-soft: #e3f4ea; --warn: #8a5300; --warn-soft: #fff1d6; --bad: #b3261e; --bad-soft: #fde8e6; --info: #0a5fb4;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 30, 50, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1620; --card: #17212e; --text: #e6ebf2; --muted: #9fb0c3; --line: #2a3a4d;
    --brand: #5ea7f0; --brand-text: #08121f; --brand-soft: #16304b;
    --ok: #62d195; --ok-soft: #12301f; --warn: #f2b45a; --warn-soft: #3a2a0c; --bad: #ff8f86; --bad-soft: #3d1613; --info: #7fb8f5;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; padding-bottom: 48px; }

/* top bar and navigation */
.demo-note { background: var(--warn-soft); color: var(--warn); font-size: .875rem; padding: 8px 0; border-bottom: 1px solid var(--line); }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav form { display: contents; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; min-height: 44px; padding: 0 12px; cursor: pointer; }

/* blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.tiles { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); }
.tile b { display: block; font-size: 1.7rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .875rem; }
.tile.alert { border-color: var(--bad); }
.tile.alert b { color: var(--bad); }
.head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.head h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* messages */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; border: 1px solid transparent; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.flash-error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.flash-warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--brand-soft); color: var(--text); border: 1px solid var(--line); margin-bottom: 12px; font-size: .9375rem; }
.notice:empty { display: none; }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: var(--bad); }
.badge, .pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8125rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-info, .pill-muted { background: var(--brand-soft); color: var(--info); }
.badge-warn, .pill-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok, .pill-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: var(--line); color: var(--muted); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }

/* forms */
label { display: block; font-weight: 600; margin: 0 0 4px; font-size: .9375rem; }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; height: 22px; padding: 0; vertical-align: middle; }
input[type="file"] { padding: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin-bottom: 8px; }
.check label, label.check { margin: 0; font-weight: 400; }
.hint { color: var(--muted); font-size: .875rem; margin-top: 2px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 10px 12px; }
legend { font-weight: 600; padding: 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.danger { border-color: var(--bad); background: transparent; color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .875rem; }
form.inline { display: inline; }

/* lists and tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8125rem; color: var(--muted); font-weight: 600; text-transform: none; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.item-title { font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.empty { color: var(--muted); padding: 8px 0; }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }

/* calendar */
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.cal { min-width: 880px; table-layout: fixed; }
.cal th, .cal td { padding: 4px; border: 1px solid var(--line); text-align: center; font-size: .8125rem; }
.cal th:first-child, .cal td:first-child { position: sticky; left: 0; background: var(--card); width: 140px; text-align: left; z-index: 1; }
.cal .today { background: var(--brand-soft); }
.cal td { height: 54px; vertical-align: middle; padding: 2px; }
.cal a.bar { display: block; border-radius: 6px; padding: 3px 4px; text-decoration: none; font-size: .75rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.bar-rezerve { background: var(--brand-soft); color: var(--info); border: 1px solid var(--info); }
.bar-teslim { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.bar-iade { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }

/* login */
.login-box { max-width: 420px; margin: 8vh auto; padding: 0 16px; }

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .wide { grid-column: 1 / -1; }
}

/* narrow screens: a table becomes a stack of cards */
@media (max-width: 639px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 4px; }
  table.stack td { border: 0; padding: 4px 10px; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8125rem; }
}

/* printed documents */
.doc { background: #fff; color: #000; max-width: 800px; margin: 0 auto; padding: 24px; font-size: 14px; }
.doc h1 { font-size: 1.4rem; text-align: center; margin: 8px 0 16px; }
.doc table th { color: #333; width: 34%; background: #f3f3f3; }
.doc table th, .doc table td { border: 1px solid #999; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.doc .sign div { border-top: 1px solid #000; padding-top: 6px; text-align: center; }
.doc .head-line { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; }
.toolbar { max-width: 800px; margin: 16px auto; padding: 0 16px; display: flex; gap: 8px; }
@media print {
  body { background: #fff; }
  .toolbar, .topbar, .demo-note, .no-print { display: none !important; }
  .doc { padding: 0; max-width: none; }
}

/* Örnek verili demo ana ekranındaki fotoğraflı üst alan (yalnız demo kipinde; telifsiz foto, assets/foto/KAYNAKLAR.md) */
.photo-band { position: relative; overflow: hidden; background: #14202e; color: #fff; border-radius: var(--radius); margin-bottom: 16px; min-height: 150px; display: flex; align-items: flex-end; }
.photo-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-band::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(14,24,38,.88) 0%, rgba(14,24,38,.55) 55%, rgba(14,24,38,.15) 100%); }
.photo-band .in { position: relative; z-index: 2; padding: 18px 20px; }
.photo-band .t { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.photo-band .s { display: block; margin-top: 4px; color: #dfe7f0; font-size: .95rem; }
@media (max-width: 600px) { .photo-band { min-height: 120px; } .photo-band .t { font-size: 1.15rem; } }
@media print { .photo-band { display: none !important; } }

/* 1.1.3: customer import (Excel / CSV / pasted table) */
.help summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.help[open] summary { margin-bottom: 6px; }
.import-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.import-table { min-width: 640px; font-size: .9375rem; }
.import-table th { white-space: nowrap; }
.import-table input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; }
.import-table tr.import-error td { background: var(--bad-soft); }
.import-table tr.import-exists td, .import-table tr.import-dup td { color: var(--muted); }
.import-counts .pill { font-size: 1rem; padding: 4px 12px; }

/* ---- 1.2.0: kurulum rehberi, telefona ekle, QR sayfası, servis dışı çubuğu ---- */
.setupbar { background: var(--brand-soft); border-bottom: 1px solid var(--line); padding: .5rem 0; }
.setupbar a { display: block; text-decoration: none; margin-bottom: .35rem; padding: .35rem 0; }
.progress { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .35rem 0; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.a2hs { background: var(--warn-soft); border-bottom: 1px solid var(--warn); padding: .6rem 0; }
.a2hs[hidden], #closure_times[hidden], #iosSteps[hidden], #inappHelp[hidden], #a2hsSteps[hidden], #a2hsInapp[hidden] { display: none; }
.a2hs ol { margin: .5rem 0 0 1.2rem; }
.step.next { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.step .actions { margin-top: .5rem; }
.demo-box { background: var(--brand-soft); }
.demo-note a { color: inherit; font-weight: 600; }
.poster { border: 3px solid var(--text); border-radius: 16px; padding: 2rem 1rem; text-align: center; margin: 1rem 0; }
.poster h3 { font-size: 1.8rem; margin: 0 0 .5rem; }
.posterlink { font-size: 1.1rem; font-weight: 800; word-break: break-all; }
.posterqr { display: flex; justify-content: center; margin: 1rem 0; }
.posterqr svg { width: 240px; height: 240px; max-width: 100%; }
.card.big { font-size: 1.1rem; }
.btn.full { display: flex; width: 100%; margin-bottom: .6rem; }
#installLink { width: 100%; }
.bar-kapali { background: var(--line); color: var(--muted); border: 1px dashed var(--muted); }
.list form.inline { margin-left: 8px; }
@media print {
  .topbar, .setupbar, .a2hs, .demo-note { display: none !important; }
  body.print-qr main > :not(.print-card) { display: none !important; }
  body.print-qr .print-card h2, body.print-qr .print-card > p.small, body.print-qr .print-card .btn { display: none !important; }
  .posterqr svg { width: 9cm; height: 9cm; }
  body { background: #fff; }
}

/* ---- 1.3.0: kiracı sayfaları (girişsiz, büyük yazı, telefonda sade) ---- */
.pubwrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.pubhead { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 0; }
body.pub main.pubwrap { padding-top: 16px; padding-bottom: 48px; font-size: 1.0625rem; }
.pub h1 { font-size: 1.6rem; }
.pub .lead { font-size: 1.1rem; color: var(--muted); }
.pub .car h3 { margin-top: 0; font-size: 1.25rem; }
.pub .car .total { font-size: 1.1rem; }
.pub .state-ok { color: var(--ok); }
.pub .state-bad { color: var(--bad); }
.pub .state-warn { color: var(--warn); }
.pub input, .pub select, .pub textarea { min-height: 50px; font-size: 1.0625rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media print {
  body.print-qr.print-book main > .print-card:not(.print-tenant) { display: none !important; }
  body.print-qr:not(.print-book) .print-tenant { display: none !important; }
  body.print-qr.print-book main > .print-tenant { display: block !important; }
}

/* 1.4.0: amounts table (rent, extra services, discount, VAT, total), length-band rows, contract and receipt */
table.amounts { margin: 6px 0; }
table.amounts td { padding: 6px 4px; }
table.amounts td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.amounts tr.sub td { color: var(--muted); border-bottom: 0; padding-top: 2px; padding-bottom: 2px; }
table.amounts tr.total td { font-weight: 700; font-size: 1.05em; border-top: 2px solid var(--line); border-bottom: 0; }
.band-row { grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.doc.contract h2 { font-size: 1.05rem; text-align: left; margin: 14px 0 4px; }
.doc.contract p { margin: 0 0 8px; line-height: 1.45; }
.doc table.amounts td { border: 0; border-bottom: 1px solid #ccc; background: transparent; }
.doc table.amounts tr.total td { border-top: 2px solid #000; }
.doc h2 { font-size: 1.05rem; margin: 14px 0 4px; }

/* 1.4.3: demo araçlarının örnek fotoğrafı (yalnız demo kipinde; View::carImage). */
.car-photo { display: block; max-width: 100%; height: auto; object-fit: cover; border-radius: 10px; background: #e6e9ee; }
.car-photo.wide { width: 100%; aspect-ratio: 4 / 3; max-height: 260px; margin: 0 0 10px; }
.card.has-photo { display: flex; gap: 14px; align-items: flex-start; }
.card.has-photo .car-photo.thumb { width: 132px; height: 99px; flex: 0 0 auto; }
.card.has-photo .vcard-body { flex: 1 1 auto; min-width: 0; }
@media (max-width: 520px) { .card.has-photo { flex-direction: column; } .card.has-photo .car-photo.thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 220px; } }
