/* ==========================================================================
   Oto Servis Takip — tasarım sistemi
   Mobil öncelikli. Min. dokunma alanı 44-48px. Yatay kaydırma yok.
   ========================================================================== */

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --border: #e3e7ef;
  --border-strong: #cdd3df;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --primary: #2e37a4;
  --primary-hover: #252c8c;
  --primary-press: #1e2475;
  --primary-soft: #eceefb;
  --primary-soft-2: #dfe2f7;
  --ring: 0 0 0 4px rgba(46, 55, 164, .18);

  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #b45309;
  --warning-soft: #fdf1df;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #0369a1;
  --info-soft: #e3f1f9;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);

  --sidebar-w: 264px;
  --topbar-h: 60px;
  --bottomnav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(46, 55, 164, .45); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 30px; height: 30px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 420px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* Grid öğeleri içeriklerinin min genişliğine göre büyümesin (mobilde yatay taşmayı önler) */
.home-grid > *, .form-layout > *, .detail-grid > *, .form-col > *, .grid-2 > *, .quick-grid > *, .stat-row > *, .stats-grid > * { min-width: 0; }

/* ------------------------------------------------------------------ Kabuk */

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; min-width: 0; }
.topbar-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title { display: none; font-size: 18px; font-weight: 700; }
.topbar-search { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 10px rgba(46, 55, 164, .3);
}
.brand-logo .ic { width: 20px; height: 20px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  border: 0;
}
.avatar-btn { padding: 0; }
.avatar-xs { width: 26px; height: 26px; font-size: 11px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-weight: 700; flex: none; }

.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px var(--gutter) calc(var(--bottomnav-h) + var(--safe-b) + 24px);
  min-width: 0;
}
body.no-bottomnav .main { padding-bottom: calc(110px + var(--safe-b)); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  height: calc(var(--bottomnav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, .05);
}
body.no-bottomnav .bottom-nav { display: none; }
.bottom-nav a, .bottom-nav button {
  height: var(--bottomnav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; padding: 0 2px;
  color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.bottom-nav .ic { width: 24px; height: 24px; }
.bottom-nav .active { color: var(--primary); }
.bottom-nav .bn-fab .fab {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 18px rgba(46, 55, 164, .38);
}
.bottom-nav .bn-fab .fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.bottom-nav .bn-fab { color: var(--text-2); }

.offline-bar {
  display: none;
  position: sticky; top: var(--topbar-h); z-index: 25;
  padding: 8px var(--gutter);
  background: #fff4e5; color: #92400e; border-bottom: 1px solid #fcd9a8;
  font-size: 14px; font-weight: 600;
  align-items: center; gap: 8px;
}
body.is-offline .offline-bar { display: flex; }

.topbar-progress {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 3px; width: 0; background: var(--primary);
  transition: width .25s ease, opacity .3s ease; opacity: 0;
}
.topbar-progress.run { opacity: 1; width: 70%; transition: width 6s cubic-bezier(.1, .7, .2, 1); }
.topbar-progress.done { opacity: 0; width: 100%; transition: width .2s ease, opacity .4s ease .15s; }

/* Masaüstü */
@media (min-width: 1024px) {
  :root { --gutter: 28px; --topbar-h: 68px; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; z-index: 35;
    width: var(--sidebar-w);
    background: #fff; border-right: 1px solid var(--border);
    padding: 18px 14px;
  }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: var(--text); }
  .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .brand-text strong { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-text small { color: var(--muted); font-size: 12.5px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
  .side-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
  .side-nav a {
    display: flex; align-items: center; gap: 12px;
    height: 46px; padding: 0 12px; border-radius: 10px;
    color: var(--text-2); font-weight: 600; font-size: 15px;
  }
  .side-nav a:hover { background: var(--surface-2); color: var(--text); }
  .side-nav a.active { background: var(--primary-soft); color: var(--primary); }
  .side-nav a.active .ic { color: var(--primary); }
  .side-nav .ic { color: var(--muted); }
  .side-user {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  }
  .side-user .who { min-width: 0; flex: 1; line-height: 1.25; }
  .side-user .who strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user .who span { font-size: 12.5px; color: var(--muted); }

  .topbar { margin-left: var(--sidebar-w); padding: 0 var(--gutter); }
  .topbar-brand { display: none; }
  .topbar-title { display: block; }
  .topbar-search { display: block; position: relative; width: min(440px, 40vw); margin-left: 24px; }
  .offline-bar { margin-left: var(--sidebar-w); }
  .main { margin-left: var(--sidebar-w); width: auto; max-width: none; padding: 24px var(--gutter) 48px; }
  .main > .page { max-width: 1180px; margin: 0 auto; }
  body.no-bottomnav .main { padding-bottom: 48px; }
  .bottom-nav { display: none; }
  .hide-desktop { display: none !important; }
}
@media (max-width: 1023.98px) {
  .hide-mobile { display: none !important; }
}

/* ------------------------------------------------------------------ Menü sayfası (mobil) */

.sheet { position: fixed; inset: 0; z-index: 80; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); animation: fade .2s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(16px + var(--safe-b));
  animation: slideup .22s ease;
}
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sheet-user strong { display: block; }
.sheet-list a, .sheet-list button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 54px; padding: 0 8px; border: 0; background: none;
  color: var(--text); font-weight: 600; font-size: 16px; text-align: left; border-radius: 10px;
}
.sheet-list a:active, .sheet-list button:active { background: var(--surface-2); }
.sheet-list .ic { color: var(--muted); }
.sheet-list .danger, .sheet-list .danger .ic { color: var(--danger); }
.sheet-sep { height: 1px; background: var(--border); margin: 6px 0; }
@media (min-width: 1024px) {
  .sheet-panel { left: auto; right: 24px; bottom: auto; top: 72px; width: 320px; border-radius: 16px; box-shadow: var(--shadow-lg); }
  .sheet-backdrop { background: transparent; }
  .sheet-grip { display: none; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* ------------------------------------------------------------------ Sayfa başlığı */

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
.page-head h1 { font-size: 22px; font-weight: 800; min-width: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
@media (min-width: 1024px) { .page-head h1 { font-size: 26px; } }

.back {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border); color: var(--text);
}

.section-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 24px 0 12px; }
.section-title .ic { color: var(--primary); }
.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px;
  border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 700;
}

/* ------------------------------------------------------------------ Kart */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card + .card { margin-top: 14px; }
.card-pad { padding: 16px; }
@media (min-width: 768px) { .card-pad { padding: 20px 22px; } }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 700; }
.card-head h2 .ic { color: var(--primary); }
.card-head .link { margin-left: auto; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 2px; padding: 8px 0; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; margin: 0 auto 8px; color: var(--faint); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }

/* ------------------------------------------------------------------ Butonlar */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15.5px; line-height: 1.1;
  white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: scale(.985); }
.btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14.5px; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 22px; font-size: 16.5px; border-radius: 14px; }
.btn-xl { min-height: 60px; font-size: 18px; letter-spacing: .02em; border-radius: 16px; }
.btn-block { display: flex; width: 100%; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(46, 55, 164, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-press); }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: #fff; color: var(--danger); border-color: #f5c2c2; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn-dashed { background: var(--surface-2); border: 1.5px dashed var(--border-strong); color: var(--primary); }
.btn-dashed:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Form */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field, .grid-2 + .field, .field + .grid-2, .grid-2 + .grid-2 { margin-top: 14px; }
.label, .field > label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.label .opt, .field > label .opt { font-weight: 500; color: var(--faint); }

.input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: #fff; border: 1.5px solid var(--border-strong); border-radius: 12px;
  font-size: 17px; line-height: 1.35;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input-lg { min-height: 58px; font-size: 20px; font-weight: 600; }
textarea.input { resize: vertical; min-height: 110px; }
.textarea-lg { min-height: 150px; font-size: 17px; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
.help { font-size: 13.5px; color: var(--muted); }
.error { font-size: 14px; font-weight: 600; color: var(--danger); }
.error:empty { display: none; }

.form-card { padding: 16px; }
@media (min-width: 768px) { .form-card { padding: 20px 22px; } }
.form-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); }
.form-title .ic { color: var(--primary); }
.form-title .muted { margin-left: auto; text-transform: none; font-weight: 600; letter-spacing: 0; }
.form-sub { font-size: 15px; font-weight: 700; margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }

.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }

.form-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(16, 24, 40, .08);
  display: flex; gap: 10px;
}
.form-actions .btn { flex: 1; }
@media (min-width: 1024px) {
  .form-actions {
    position: sticky; bottom: 16px; margin-top: 18px;
    border: 1px solid var(--border); border-radius: 16px;
    padding: 12px;
  }
}

.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.inline-actions .btn { flex: 1 1 200px; }

details.more { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 6px; }
details.more > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; min-height: 46px;
  font-weight: 700; color: var(--primary);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .ic { transition: transform .15s; }
details.more[open] > summary .ic { transform: rotate(180deg); }

/* Segment (durum seçimi) */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; background: var(--surface-3); border-radius: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 48px; padding: 4px 6px; border-radius: 10px;
  font-weight: 700; font-size: 14.5px; color: var(--muted); cursor: pointer; line-height: 1.15;
}
.seg input:checked + span { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg input:checked + span.s1 { color: var(--warning); }
.seg input:checked + span.s2 { color: var(--success); }
.seg input:checked + span.s3 { color: var(--info); }
.seg input:focus-visible + span { outline: 3px solid rgba(46, 55, 164, .45); }

/* ------------------------------------------------------------------ Chip */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--border-strong);
  background: #fff; color: var(--text-2);
  font-weight: 600; font-size: 15px; cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:has(input:checked) .avatar-xs { background: rgba(255, 255, 255, .22); color: #fff; }
.chip:has(input:focus-visible) { outline: 3px solid rgba(46, 55, 164, .45); outline-offset: 2px; }
.chip-user { padding-left: 8px; }
.chip-suggest { border-style: dashed; background: var(--surface-2); color: var(--text-2); font-size: 14.5px; }
.chip-suggest:hover { border-color: var(--primary); color: var(--primary); }
.chip-suggest.added { border-style: solid; border-color: var(--success); color: var(--success); background: var(--success-soft); }
.chip-link { text-decoration: none; }
.chip-link.active { background: var(--text); border-color: var(--text); color: #fff; }
.chip-link .count { background: rgba(0, 0, 0, .06); height: 22px; min-width: 22px; font-size: 12.5px; }
.chip-link.active .count { background: rgba(255, 255, 255, .2); color: #fff; }
/* Hızlı ekle önerileri: 2 satır, yatay kaydırılabilir şerit */
.suggest-strip {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); gap: 8px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  margin: 0 -16px; padding: 2px 16px 4px;
  justify-content: start;
}
.suggest-strip::-webkit-scrollbar { display: none; }
.suggest-strip .chip { white-space: nowrap; }
@media (min-width: 768px) { .suggest-strip { margin: 0 -22px; padding: 2px 22px 4px; } }
@media (min-width: 1024px) { .suggest-strip { display: flex; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.suggest-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 8px; }

.scroll-x { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter); }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex: none; }

/* ------------------------------------------------------------------ Rozetler */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.badge .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 600; }

/* Türk plakası */
.plate {
  display: inline-flex; align-items: stretch; flex: none;
  height: 30px; border: 2px solid #111; border-radius: 6px; overflow: hidden;
  background: #fff; color: #111; font-weight: 800; letter-spacing: .04em;
  font-family: "Inter", "Arial Narrow", Arial, sans-serif;
}
.plate-tr {
  display: grid; place-items: end center;
  width: 16px; padding-bottom: 2px;
  background: #1f4fb8; color: #fff; font-size: 7.5px; letter-spacing: 0; font-weight: 700;
}
.plate-no { display: grid; place-items: center; padding: 0 8px; font-size: 15px; white-space: nowrap; }
.plate-sm { height: 26px; border-width: 1.5px; }
.plate-sm .plate-no { font-size: 13.5px; padding: 0 6px; }
.plate-sm .plate-tr { width: 13px; font-size: 6.5px; }
.plate-md { height: 36px; }
.plate-md .plate-no { font-size: 18px; padding: 0 10px; }
.plate-md .plate-tr { width: 19px; font-size: 8.5px; }
.plate-lg { height: 46px; border-width: 2.5px; border-radius: 8px; }
.plate-lg .plate-no { font-size: 24px; padding: 0 14px; }
.plate-lg .plate-tr { width: 24px; font-size: 10px; padding-bottom: 4px; }

/* ------------------------------------------------------------------ Ana ekran */

.hero-search { padding: 18px 16px 16px; }
@media (min-width: 768px) { .hero-search { padding: 24px; } }
.hero-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.hint { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.plate-search { display: flex; gap: 10px; }
.plate-input {
  position: relative; flex: 1; min-width: 0;
  display: flex; align-items: stretch;
  height: 64px; border: 2.5px solid #111; border-radius: 12px; overflow: hidden;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
.plate-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.plate-input .plate-tr { width: 30px; font-size: 11px; padding-bottom: 7px; }
.plate-input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 0 44px 0 14px;
  font-size: clamp(20px, 6.2vw, 26px); font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.plate-input input::placeholder { color: #c3c8d4; font-weight: 700; }
.plate-input input::-webkit-search-cancel-button { display: none; }
.plate-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--muted);
  display: grid; place-items: center;
}
.btn-search { min-height: 64px; padding: 0 18px; border-radius: 12px; }
@media (max-width: 479.98px) {
  .btn-search span { display: none; }
  .btn-search { width: 64px; padding: 0; }
  .btn-search .ic { width: 26px; height: 26px; }
}

.search-results:not(:empty) { margin-top: 12px; }
.result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; min-height: 64px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text);
}
.result + .result { margin-top: 8px; }
.result:hover { border-color: var(--primary); }
.result.exact { border: 2px solid var(--primary); background: var(--primary-soft); }
.result .r-main { flex: 1; min-width: 0; }
.result .r-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-sub { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .chev { color: var(--faint); }
.result.exact .chev { color: var(--primary); }
.searching { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 10px 4px; }

.not-found {
  border: 2px dashed var(--border-strong); border-radius: 14px; padding: 18px 16px; text-align: center; background: var(--surface-2);
}
.not-found p { font-weight: 700; margin-bottom: 12px; }
.not-found .plate { margin: 0 auto 12px; }

.quick-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 14px 0; }
.quick {
  display: flex; align-items: center; gap: 12px;
  min-height: 76px; padding: 14px;
  border-radius: var(--radius); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  color: var(--text); font-weight: 800; font-size: clamp(13px, 3.8vw, 14.5px); letter-spacing: .01em; line-height: 1.2;
}
.quick .qi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.quick .qi .ic { width: 24px; height: 24px; }
.quick:active { transform: scale(.99); }
.quick > span:last-child, .quick { overflow-wrap: anywhere; min-width: 0; }
/* İkincil kutucuklar: ikon üstte, yazı altta → "PERSONELLER" gibi uzun kelimeler dar kutuda taşmaz */
.quick:not(.quick-primary) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; min-height: 96px; }
.quick:not(.quick-primary) .qi { width: 40px; height: 40px; }
.quick-primary { grid-column: 1 / -1; min-height: 84px; background: var(--primary); border-color: var(--primary); color: #fff; font-size: 18px; box-shadow: 0 8px 20px rgba(46, 55, 164, .28); }
.quick-primary .qi { background: rgba(255, 255, 255, .18); color: #fff; width: 52px; height: 52px; border-radius: 14px; }
.quick-primary .qi .ic { width: 30px; height: 30px; stroke-width: 2.4; }
@media (min-width: 768px) {
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-primary { grid-column: span 2; }
}

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0;
}
.stat strong { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat span.lbl { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: none; place-items: center; flex: none; }
.si-warning { background: var(--warning-soft); color: var(--warning); }
.si-primary { background: var(--primary-soft); color: var(--primary); }
.si-success { background: var(--success-soft); color: var(--success); }
.si-info { background: var(--info-soft); color: var(--info); }
@media (min-width: 640px) {
  .stat { padding: 16px; }
  .stat-icon { display: grid; }
  .stat strong { font-size: 26px; }
  .stat span.lbl { font-size: 13.5px; }
}

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1024px) {
  .home-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .home-grid .card + .card { margin-top: 0; }
}

/* ------------------------------------------------------------------ Liste satırları */

.list > * + * { border-top: 1px solid var(--border); }
.list-card .row-item, .list-card .day-head, .list-card .load-more-wrap { border-top: 1px solid var(--border); }
.list-card > :first-child, .list-card .card-head + *, .list > :first-child { border-top: 0; }
.row-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; color: var(--text); min-width: 0;
  transition: background .12s;
}
.row-item:hover { background: var(--surface-2); }
.row-item:active { background: var(--surface-3); }
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-summary { margin-top: 6px; font-size: 15px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-summary .more { color: var(--muted); font-weight: 600; }
.row-meta { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; color: var(--muted); }
.row-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.row-meta .ic { width: 15px; height: 15px; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.row-time { font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

.day-head {
  position: sticky; top: var(--topbar-h); z-index: 5;
  padding: 10px 16px; background: var(--surface-2);
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.list-card { overflow: clip; }
.load-more-wrap { padding: 12px 16px; border-top: 1px solid var(--border); }

.search-bar { position: relative; margin-bottom: 14px; }
.vehicle-filter .search-bar { margin-bottom: 10px; }
/* Müşteri raporu kartı: dar ekranda buton yazıları kesilmesin */
.report-card .photo-actions { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.report-card .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 0 12px; }
.report-card .btn-ghost { color: #15803d; min-height: 48px; }
.filter-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.date-range { margin-bottom: 14px; }
.date-range .field { margin-top: 0; }
.search-bar .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-bar .input { padding-left: 46px; }

/* ------------------------------------------------------------------ Araç / kayıt detay */

.vehicle-hero { padding: 18px 16px; }
@media (min-width: 768px) { .vehicle-hero { padding: 22px 24px; } }
.vh-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vh-title h1 { font-size: 21px; font-weight: 800; }
.vh-title .muted { font-size: 14.5px; }

.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; margin-top: 16px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fact { background: #fff; padding: 10px 12px; min-width: 0; }
.fact span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fact strong, .fact a { display: block; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.note-box {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 15px;
}
.note-box .ic { color: #d97706; margin-top: 2px; }

.hero-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.hero-actions .btn-primary { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .hero-actions { display: flex; }
  .hero-actions .btn-primary { flex: 1; }
}

/* Zaman çizelgesi */
.timeline { position: relative; }
.tl-item { position: relative; overflow: hidden; }
.tl-item.is-last { border-color: var(--primary-soft-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.tl-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); background: var(--surface-2);
}
.tl-date { font-weight: 800; font-size: 16.5px; }
.tl-km { font-size: 14px; color: var(--muted); font-weight: 600; }
.tl-head .badge { margin-left: auto; }
.tl-last { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--primary); text-transform: uppercase; }
.tl-body { padding: 14px 16px; display: grid; gap: 14px; }
.tl-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.bullets { list-style: none; }
.bullets li { position: relative; padding-left: 16px; }
.bullets li + li { margin-top: 3px; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.bullets .part-meta { color: var(--muted); }
.tl-next { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--info); font-weight: 600; }
.tl-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); }
.tl-foot a { margin-left: auto; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; padding: 6px 0; }
@media (min-width: 768px) { .tl-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tl-body .span-all { grid-column: 1 / -1; } }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb {
  position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--border); flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-del {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(17, 24, 39, .72); color: #fff; display: grid; place-items: center;
}
.thumb-del .ic { width: 16px; height: 16px; }
@media (min-width: 768px) { .thumb { width: 104px; height: 104px; } }

.status-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.status-steps form { display: contents; }
.step {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 68px; padding: 8px 4px; border-radius: 12px;
  border: 1.5px solid var(--border-strong); background: #fff; color: var(--muted);
  font-weight: 700; font-size: 14px; line-height: 1.15; text-align: center;
}
.step .ic { width: 22px; height: 22px; }
.step.on.s1 { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.step.on.s2 { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.step.on.s3 { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.step.on { pointer-events: none; }

.kv { display: grid; grid-template-columns: 1fr; gap: 12px; }
.kv > div span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kv > div strong { font-weight: 700; }
@media (min-width: 560px) { .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.detail-grid .card + .card { margin-top: 0; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* Değişiklik geçmişi: okunur zaman akışı */
.audit-list { font-size: 15px; }
.audit-item { display: flex; gap: 12px; padding: 14px 16px; min-width: 0; }
.audit-item + .audit-item { border-top: 1px solid var(--border); }
.audit-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
  background: var(--surface-3); color: var(--text-2);
}
.audit-avatar.tone-success { background: var(--success-soft); color: var(--success); }
.audit-avatar.tone-danger { background: var(--danger-soft); color: var(--danger); }
.audit-avatar.tone-primary { background: var(--primary-soft); color: var(--primary); }
.audit-main { flex: 1; min-width: 0; }
.audit-title { line-height: 1.35; overflow-wrap: anywhere; }
.audit-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 4px 2px; background: var(--faint); vertical-align: middle; }
.audit-dot.tone-success { background: var(--success); }
.audit-dot.tone-danger { background: var(--danger); }
.audit-dot.tone-primary { background: var(--primary); }
.audit-lines { list-style: none; margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; font-size: 14px; color: var(--text-2); }
.audit-lines li { overflow-wrap: anywhere; }
.audit-lines li + li { margin-top: 3px; }
.audit-lines .al-label { font-weight: 700; color: var(--text); }
.audit-lines .al-label::after { content: ":"; }
.audit-lines del { color: var(--danger); text-decoration-color: rgba(220, 38, 38, .5); }
.audit-lines b { color: var(--success); }
.audit-lines .al-arrow { color: var(--faint); }
.audit-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.audit-meta a { font-weight: 700; }

/* ------------------------------------------------------------------ Servis formu */

.form-header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; }
.form-header .fh-main { min-width: 0; flex: 1; }
.form-header strong { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-header small { display: block; color: var(--muted); font-size: 13.5px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.form-layout .card + .card { margin-top: 0; }
@media (min-width: 1024px) {
  .form-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .form-col { display: grid; gap: 14px; }
}

.draft-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--info-soft); color: var(--info); font-weight: 600; font-size: 14.5px;
}
.draft-banner button { margin-left: auto; background: none; border: 0; color: var(--info); font-weight: 800; text-decoration: underline; min-height: 40px; }

.parts { display: grid; gap: 10px; }
.parts:not(:empty) { margin-bottom: 12px; }
.part {
  position: relative; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  animation: pop .15s ease;
}
.part-no { position: absolute; top: -9px; left: 12px; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.part-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.part-grid .p-name { grid-column: 1 / -1; width: calc(100% - 50px); }
/* "Diğer" seçilince parça seçiminin hemen altında açılan yazma kutusu */
.part-grid { grid-auto-flow: row dense; }
.part-grid .p-name { order: 1; }
.part-grid .p-other { order: 2; grid-column: 1 / -1; border-color: var(--primary); background: var(--primary-soft); }
.part-grid .p-other:not([hidden]) { animation: pop .15s ease; }
.part-grid > :not(.p-name):not(.p-other) { order: 3; }
select.p-name { font-weight: 600; }
.part-grid .p-qty { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
.part .input { min-height: 48px; font-size: 16px; padding: 10px 12px; }
.part .p-qty .input { padding: 10px 8px; text-align: center; }
.part .p-qty select.input { text-align: left; padding: 10px 24px 10px 8px; background-position: right 4px center; font-size: 15px; }
.part-del {
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 48px; border-radius: 10px; border: 0; background: transparent; color: var(--danger);
  display: grid; place-items: center;
}
.part-more { margin-top: 6px; }
.part-more > summary { min-height: 36px; font-size: 14px; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; }
.part-more > summary::-webkit-details-marker { display: none; }
.part-more .part-grid { margin-top: 6px; }
@media (min-width: 640px) {
  .part-grid { grid-template-columns: 2fr 1.3fr 1.2fr; }
  .part-grid .p-name { grid-column: auto; width: 100%; }
  .part { padding-right: 60px; }
}

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-grid:not(:empty) { margin-bottom: 12px; }
.photo-grid .thumb { width: 100%; height: auto; aspect-ratio: 1; }
.photo-grid .thumb.is-removed { display: none; }
.photo-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.photo-actions .btn { cursor: pointer; padding: 0 10px; }
.photo-actions.is-full { display: none; }
.processing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: var(--primary); }

/* ------------------------------------------------------------------ Tablo / rapor */

.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi { padding: 16px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi .kpi-top span { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.kpi strong { font-size: 28px; font-weight: 800; line-height: 1; }
.stats-grid .card + .card { margin-top: 0; }

.bar-list { padding: 6px 16px 14px; }
.bar-row { padding: 10px 0; }
.bar-row + .bar-row { border-top: 1px solid var(--border); }
.bar-top { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bar-top .num { margin-left: auto; font-weight: 800; }
.bar-top .sub { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.alt > i { background: #7c83d6; }

.user-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.user-card .u-main { flex: 1; min-width: 0; }
.user-card .u-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .u-main span { font-size: 13.5px; color: var(--muted); }
.user-card.is-inactive { opacity: .6; }
.user-card .u-actions { display: flex; gap: 6px; flex: none; }

/* ------------------------------------------------------------------ Toast / modal / lightbox */

.toasts {
  position: fixed; z-index: 120; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 440px; padding: 14px 16px; border-radius: 14px;
  background: #111827; color: #fff; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 15.5px;
  animation: toastin .22s ease;
}
.toast .ic { flex: none; }
.toast.success { background: #166534; }
.toast.error { background: #b91c1c; }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: all .25s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px); } }

.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: end center; padding: 12px; }
@media (min-width: 640px) { .modal { place-items: center; } }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .5); animation: fade .15s ease; }
.modal-panel {
  position: relative; width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px; padding: 22px 18px calc(18px + var(--safe-b));
  box-shadow: var(--shadow-lg); animation: pop .15s ease;
}
.modal-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; background: var(--danger-soft); color: var(--danger); }
.modal-icon.info { background: var(--primary-soft); color: var(--primary); }
.modal-panel h3 { font-size: 19px; font-weight: 800; }
.modal-panel p { color: var(--text-2); margin-top: 6px; }
.modal-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 20px; }

.lightbox { position: fixed; inset: 0; z-index: 130; background: #000; display: flex; align-items: center; justify-content: center; touch-action: pan-y; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center;
}
.lb-btn .ic { width: 26px; height: 26px; }
.lb-close { top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(var(--safe-b) + 18px); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .8); font-weight: 600; }

/* ------------------------------------------------------------------ Giriş */

.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px calc(24px + var(--safe-b));
  background:
    radial-gradient(1200px 500px at 50% -10%, #dfe3fb 0%, transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 28px 20px; }
@media (min-width: 480px) { .auth-card { padding: 34px 32px; } }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 24px; }
.auth-brand .brand-logo { width: 60px; height: 60px; border-radius: 18px; }
.auth-brand .brand-logo .ic { width: 30px; height: 30px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; }
.auth-brand p { color: var(--muted); font-size: 15px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 56px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.auth-foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 18px; }

/* ------------------------------------------------------------------ Hata sayfaları */

.state-page { text-align: center; padding: 48px 16px; }
.state-page .state-icon { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.state-page .state-icon .ic { width: 34px; height: 34px; }
.state-page h1 { font-size: 22px; font-weight: 800; }
.state-page p { color: var(--muted); margin: 8px auto 20px; max-width: 420px; }
.state-page pre { text-align: left; font-size: 12px; overflow: auto; background: #111827; color: #e5e7eb; padding: 12px; border-radius: 10px; max-height: 320px; }

/* Sayfa geçiş animasyonu */
.page { animation: pagein .18s ease; }
@keyframes pagein { from { opacity: .4; transform: translateY(4px); } }

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