/* ═══════════════════════════════════════════════════════
   Brostech Oto Servis — Arayüz
   Sol menülü, tam genişlik yönetim paneli düzeni
   ═══════════════════════════════════════════════════════ */

:root {
  color-scheme: light dark;

  --bg:         #eef2f7;
  --panel:      #ffffff;
  --panel-2:    #f6f8fb;
  --panel-3:    #eff3f8;
  --border:     #e3e9f0;
  --border-2:   #d5dee8;

  --text:       #0d1726;
  --text-soft:  #64748b;
  --text-dim:   #94a3b8;

  --sidebar-bg:   #101c30;
  --sidebar-bg-2: #16253d;
  --sidebar-text: #9db0c9;
  --sidebar-active: #ffffff;

  --accent:     #2f6bff;
  --accent-2:   #16b1d9;
  --accent-soft:rgba(47, 107, 255, .10);

  --ok:         #0f9d6e;
  --warn:       #e08600;
  --danger:     #e03b3b;
  --info:       #0f8fb5;

  --r:          12px;
  --r-sm:       8px;
  --sh-1:  0 1px 2px rgba(13, 23, 38, .05), 0 1px 3px rgba(13, 23, 38, .04);
  --sh-2:  0 2px 6px rgba(13, 23, 38, .07), 0 8px 24px rgba(13, 23, 38, .06);
  --sh-3:  0 18px 50px rgba(13, 23, 38, .22);

  --sidebar-w: 214px;
  --header-h:  52px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0a1120;
    --panel:     #111b2d;
    --panel-2:   #16233a;
    --panel-3:   #1b2b45;
    --border:    #223250;
    --border-2:  #2c4062;

    --text:      #e8eef8;
    --text-soft: #92a5c0;
    --text-dim:  #6f83a1;

    --sidebar-bg:   #0a1424;
    --sidebar-bg-2: #0f1e33;

    --accent-soft: rgba(47, 107, 255, .18);
    --sh-1: 0 1px 2px rgba(0,0,0,.35);
    --sh-2: 0 2px 8px rgba(0,0,0,.4);
    --sh-3: 0 18px 50px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: content-box; }

/* ── Yardımcılar ──────────────────────────────────────── */
.hidden   { display: none !important; }
.row      { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer   { flex: 1; }
.right    { text-align: right; }
.center   { text-align: center; }
.muted    { color: var(--text-soft); }
.small    { font-size: 12px; }
.mono     { font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.nowrap   { white-space: nowrap; }
.strong   { font-weight: 650; }

/* ═══════════════════════════════════════════════════════
   GİRİŞ EKRANI — iki panelli
   ═══════════════════════════════════════════════════════ */

#login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }

.login-brand {
  position: relative;
  background:
    radial-gradient(900px 500px at 15% 10%,  rgba(47,107,255,.38), transparent 62%),
    radial-gradient(700px 460px at 90% 90%,  rgba(22,177,217,.30), transparent 60%),
    linear-gradient(160deg, #0d1930 0%, #142949 100%);
  color: #fff;
  padding: 46px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}

/* ince ızgara dokusu */
.login-brand::after {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000, transparent 78%);
}

.login-brand > * { position: relative; z-index: 1; }

.login-brand .lead   { font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.7px; max-width: 12ch; }
.login-brand .sub    { color: rgba(255,255,255,.72); margin-top: 12px; max-width: 42ch; font-size: 13px; }

.brand-mark { display: flex; align-items: center; gap: 13px; }
.brand-mark .nm  { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.brand-mark .tag { font-size: 11.5px; color: rgba(255,255,255,.6); }

.login-feats { display: flex; flex-direction: column; gap: 13px; margin-top: 34px; }
.login-feats div { display: flex; align-items: flex-start; gap: 10px; color: rgba(255,255,255,.85); font-size: 12.5px; }
.login-feats .tick {
  flex: none; width: 21px; height: 21px; border-radius: 50%; margin-top: 1px;
  background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 11px;
}

.login-pane { display: grid; place-items: center; padding: 32px; background: var(--panel); }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.5px; }

@media (max-width: 900px) {
  #login-screen { grid-template-columns: 1fr; }
  .login-brand  { display: none; }
}

/* ═══════════════════════════════════════════════════════
   UYGULAMA KABUĞU
   ═══════════════════════════════════════════════════════ */

#app-screen { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ── Sol menü ─────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 16px 12px;
  z-index: 50;
}

.sidebar .head { padding: 8px 10px 22px; }
.sidebar .head .nm {
  color: #fff; font-weight: 800; font-size: 24px;
  letter-spacing: -.6px; line-height: 1.05;
}
.sidebar .head .tag {
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  color: var(--sidebar-text); opacity: .8; margin-top: 3px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.sidebar nav .grp {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: rgba(157,176,201,.5); font-weight: 700;
  padding: 15px 10px 6px;
}

.sidebar nav button {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--sidebar-text); font: inherit; font-size: 12.5px; font-weight: 550;
  cursor: pointer; text-align: left;
  transition: background .14s, color .14s;
}
.sidebar nav button svg { flex: none; width: 16px; height: 16px; opacity: .85; }
.sidebar nav button:hover { background: rgba(255,255,255,.07); color: #dce6f4; }

.sidebar nav button.active {
  background: linear-gradient(90deg, rgba(47,107,255,.30), rgba(47,107,255,.10));
  color: var(--sidebar-active);
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar nav button.active svg { opacity: 1; }

.sidebar nav .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; min-width: 20px; text-align: center;
}

.sidebar .foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 13px 10px 2px; font-size: 11px; line-height: 1.5;
  color: rgba(157,176,201,.65);
}

/* ── Sağ sütun ────────────────────────────────────────── */
.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--header-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}

.topbar .page-title { font-size: 15px; font-weight: 700; letter-spacing: -.35px; }
.topbar .crumb      { font-size: 11.5px; color: var(--text-soft); }

.icon-btn {
  position: relative;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  width: 33px; height: 33px; display: grid; place-items: center;
  color: var(--text-soft); transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 999px; padding: 3px 5px; min-width: 17px;
  border: 2px solid var(--panel);
}

.who { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.who .av {
  width: 31px; height: 31px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.who .nm  { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.who .rl  { font-size: 11px; color: var(--text-soft); }

.content { flex: 1; padding: 18px; min-width: 0; }

@media (max-width: 1000px) {
  :root { --sidebar-w: 66px; }
  .sidebar nav button span.lbl, .sidebar nav .grp, .sidebar .foot { display: none; }
  /* Menü daraldığında ünvan tek harfe iner */
  .sidebar .head { text-align: center; padding: 8px 0 18px; }
  .sidebar .head .nm { font-size: 20px; }
  .sidebar .head .nm::after { content: "B"; }
  .sidebar .head .nm       { font-size: 0; }
  .sidebar .head .nm::after{ font-size: 20px; }
  .sidebar .head .tag { display: none; }
  .sidebar nav button { justify-content: center; padding: 11px 0; }
  .sidebar nav .badge { position: absolute; margin: 0; transform: translate(14px, -12px); }
  .sidebar nav button { position: relative; }
  .who .txt { display: none; }
  .content { padding: 16px; }
}

/* ═══ Kartlar ════════════════════════════════════════════ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  margin-bottom: 18px;
  overflow: hidden;
}

.card > header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 650; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.card > .body { padding: 16px; }

.sec-title {
  font-size: 11.5px; font-weight: 750; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g10    { gap: 10px !important; }

@media (max-width: 1250px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 950px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .grid-4 { grid-template-columns: 1fr; } }

/* ═══ Özet kutuları ══════════════════════════════════════ */
.stat {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 15px;
  box-shadow: var(--sh-1);
  display: flex; align-items: center; gap: 13px;
  transition: transform .16s, box-shadow .16s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

.stat .ico {
  width: 39px; height: 39px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat .ico svg { width: 19px; height: 19px; }

.stat .label { font-size: 11px; color: var(--text-soft); font-weight: 650; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 21px; font-weight: 750; margin-top: 2px; letter-spacing: -.8px; line-height: 1.1; }

.stat.ok     .ico { background: rgba(15,157,110,.12); color: var(--ok); }
.stat.warn   .ico { background: rgba(224,134,0,.13);  color: var(--warn); }
.stat.danger .ico { background: rgba(224,59,59,.12);  color: var(--danger); }
.stat.info   .ico { background: rgba(15,143,181,.12); color: var(--info); }

/* ═══ Dashboard: selamlama ═══════════════════════════════ */
.hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 65%, #1d3a63 100%);
  color: #fff;
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .10;
  background-image: radial-gradient(circle at 88% 20%, #fff 0, transparent 45%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2  { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.35px; }
.hero .hero-alt { font-size: 12.5px; color: rgba(255,255,255,.68); margin-top: 3px; }
.hero .spacer, .hero > .row { margin-left: auto; }
.hero .btn.ghost {
  background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22);
}
.hero .btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.24); }

/* Göstergelerin alt satırı */
.stat .alt { font-size: 11.5px; color: var(--text-soft); margin-top: 3px; }

/* ═══ Dashboard: küçük gösterge şeridi ═══════════════════ */
.mini-serit {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .mini-serit { grid-template-columns: repeat(2, 1fr); } }

.mini {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--sh-1);
  cursor: pointer; transition: border-color .14s, transform .14s;
}
.mini:hover { border-color: var(--accent); transform: translateY(-1px); }
.mini .nokta { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mini .mv { font-size: 17px; font-weight: 750; letter-spacing: -.4px; line-height: 1; }
.mini .ml { font-size: 11px; color: var(--text-soft); margin-top: 2px; }

/* ═══ Dashboard: çubuk grafik (HTML/CSS) ═════════════════ */
.grafik { position: relative; }

.grafik-alan {
  display: flex; align-items: stretch; gap: 2px;   /* 2px yüzey boşluğu */
  height: 172px;
}

.cubuk-grup {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  border-radius: var(--r-sm);
  padding: 2px 2px 0;
  cursor: default; outline: none;
  transition: background .12s;
}
.cubuk-grup:hover, .cubuk-grup:focus-visible { background: var(--accent-soft); }
.cubuk-grup:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* Değer etiketi için ayrılmış sabit alan — çubuk üstünü taşırmaz */
.cubuk-deger {
  height: 17px; line-height: 17px;
  font-size: 11px; font-weight: 700;
  text-align: center; color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden;
}

/* Çubuk tabana sabit; veri ucu yuvarlatılmış, taban düz */
.cubuk-ray {
  flex: 1; display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--border-2);
}
.cubuk {
  width: 100%;
  background: var(--grafik-cubuk);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: opacity .12s, height .35s ease;
}
.cubuk-grup:hover .cubuk { opacity: .8; }

.cubuk-gun {
  height: 20px; line-height: 20px;
  font-size: 11px; text-align: center; color: var(--text-soft);
  white-space: nowrap; overflow: hidden;
}

.grafik-ipucu {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 8px; box-shadow: var(--sh-2);
  padding: 8px 11px; font-size: 12.5px; white-space: nowrap;
  opacity: 0; transition: opacity .12s;
}
.grafik-ipucu.acik { opacity: 1; }
.grafik-ipucu .ib { font-weight: 700; margin-bottom: 2px; }
.grafik-ipucu .is { color: var(--text-soft); font-size: 11.5px; }

.grafik-bos { text-align: center; padding: 34px 12px; color: var(--text-dim); font-size: 13px; }

/* ═══ Dashboard: durum dağılımı ══════════════════════════ */
/* Durumlar renkle DEĞİL, etiket + sayı ile ayrılır; renk yalnızca pekiştirir. */
.durum-satir { margin-bottom: 14px; }
.durum-satir:last-child { margin-bottom: 0; }
.durum-ust {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.durum-ust .nokta { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.durum-ust .ad    { font-size: 13px; font-weight: 600; }
.durum-ust .sayi  { margin-left: auto; font-weight: 750; font-variant-numeric: tabular-nums; }
.durum-ust .yuzde { color: var(--text-soft); font-size: 11.5px; min-width: 38px; text-align: right; }

.durum-ray {
  height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden;
}
.durum-dolu { height: 100%; border-radius: 4px; transition: width .35s ease; }

/* Durum renkleri — açık/koyu için AYRI seçildi, otomatik çevrim değil.
   Ölçüldü: açık modda 4.87–5.46:1, koyu modda 6.70–7.99:1 kontrast. */
:root {
  --d-onarim:  #c62f2f;
  --d-parca:   #a56100;
  --d-kapali:  #0b7a55;
  --grafik-cubuk: #2f6bff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --d-onarim: #f2807f;
    --d-parca:  #e8a33d;
    --d-kapali: #3fbf92;
    --grafik-cubuk: #5b8bff;
  }
}
.cubuk { background: var(--grafik-cubuk); }

/* ═══ Form ═══════════════════════════════════════════════ */
label.field { display: block; margin-bottom: 11px; }
label.field > span {
  display: block; font-size: 11px; font-weight: 650;
  color: var(--text-soft); margin-bottom: 5px; letter-spacing: .2px;
}
label.field.req > span::after { content: " *"; color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=email], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover { border-color: var(--text-dim); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}

input:disabled, select:disabled {
  background: var(--panel-2); color: var(--text-dim); cursor: not-allowed;
}

textarea { resize: vertical; min-height: 68px; }

input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ═══ Düğmeler ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font: inherit; font-weight: 620; font-size: 12.5px;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(13,23,38,.10);
  transition: filter .14s, transform .06s, box-shadow .14s;
}
.btn:hover:not(:disabled)  { filter: brightness(1.07); box-shadow: 0 3px 10px rgba(47,107,255,.28); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 14px; height: 14px; }

.btn.ok     { background: var(--ok); }
.btn.ok:hover:not(:disabled)     { box-shadow: 0 3px 10px rgba(15,157,110,.3); }
.btn.warn   { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.danger:hover:not(:disabled) { box-shadow: 0 3px 10px rgba(224,59,59,.3); }
.btn.info   { background: var(--info); }

.btn.ghost  { background: var(--panel); color: var(--text); border-color: var(--border-2); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); border-color: var(--text-dim); box-shadow: none; filter: none; }

.btn.sm { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.lg { padding: 11px 20px; font-size: 14px; width: 100%; }

/* ═══ Tablo ══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }

table.data th {
  text-align: left; padding: 9px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border-2);
  font-size: 10.5px; font-weight: 750;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .6px;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}

table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--panel-2); }

/* Seçili satır (marka listesi gibi seçim yapılan tablolarda) */
table.data tbody tr.selected,
table.data tbody tr.selected:hover {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
table.data tbody tr.selected td { font-weight: 600; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .empty { text-align: center; padding: 42px 20px; color: var(--text-dim); }

/* ═══ Rozetler ═══════════════════════════════════════════ */
.badge-durum {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-durum::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-durum.onarimda  { background: rgba(224,59,59,.11);  color: var(--danger); }
.badge-durum.parca     { background: rgba(224,134,0,.13);  color: var(--warn); }
.badge-durum.kapatildi { background: rgba(15,157,110,.12); color: var(--ok); }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: var(--panel-3); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 620; color: var(--text-soft);
}
.pill.borc     { background: rgba(224,59,59,.11);  color: var(--danger); border-color: transparent; }
.pill.tahsilat { background: rgba(15,157,110,.12); color: var(--ok);     border-color: transparent; }

/* ═══ Otomatik tamamlama ═════════════════════════════════ */
.autocomplete { position: relative; }
.autocomplete .list {
  position: absolute; z-index: 60; left: 0; right: 0; top: 100%;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  max-height: 252px; overflow-y: auto;
  margin-top: 4px; padding: 4px;
}
.autocomplete .list div {
  padding: 7px 9px; cursor: pointer; font-size: 12.5px; border-radius: 6px;
}
.autocomplete .list div:hover, .autocomplete .list div.active { background: var(--accent-soft); }
.autocomplete .list .hint { color: var(--text-soft); font-size: 12px; }

/* ═══ Kalem toplamı ══════════════════════════════════════ */
.kalem-toplam {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel-3));
  border-top: 1px solid var(--border-2);
  flex-wrap: wrap; gap: 14px;
}
.kalem-toplam .tutar {
  font-size: 23px; font-weight: 780; letter-spacing: -.9px; line-height: 1;
  color: var(--accent);
}

.cari-switch {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--panel);
  transition: border-color .14s, background .14s;
}
.cari-switch:hover { border-color: var(--accent); }
.cari-switch.on { border-color: var(--danger); background: rgba(224,59,59,.06); }

/* ═══ Bakım tablosu ══════════════════════════════════════ */
table.bakim { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bakim th {
  text-align: left; padding: 8px 8px; font-size: 11px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; font-weight: 750;
  border-bottom: 1px solid var(--border-2);
}
table.bakim td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
table.bakim input { padding: 7px 9px; font-size: 13px; }
table.bakim .ad { font-weight: 620; white-space: nowrap; }
table.bakim tbody tr:hover { background: var(--panel-2); }

/* ═══ Modal ══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(9, 16, 28, .55);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  z-index: 120; padding: 22px;
  animation: fade .16s ease;
}
.modal {
  background: var(--panel);
  border-radius: 15px;
  box-shadow: var(--sh-3);
  width: 100%; max-width: 545px;
  max-height: 90vh; display: flex; flex-direction: column;
  border: 1px solid var(--border);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.1);
}
.modal.wide { max-width: 930px; }
.modal > header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14.5px; letter-spacing: -.2px;
  display: flex; align-items: center; gap: 10px;
}
.modal > .body  { padding: 18px; overflow-y: auto; }
.modal > footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--panel-2);
}
.modal .close {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--text-dim); padding: 0 4px;
}
.modal .close:hover { color: var(--text); }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop  { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }

/* ═══ Bildirim ═══════════════════════════════════════════ */
#toast-area {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200; max-width: 390px;
}
.toast {
  font-size: 12.5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--sh-2);
  padding: 10px 14px;
  animation: slidein .22s cubic-bezier(.2,.9,.3,1.1);
}
.toast.ok     { border-left-color: var(--ok); }
.toast.warn   { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }

@keyframes slidein { from { opacity: 0; transform: translateX(26px) } to { opacity: 1; transform: none } }

/* ═══ Durum çubuğu ═══════════════════════════════════════ */
.statusbar {
  background: var(--panel);
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 11.5px;
  padding: 7px 18px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
}
.statusbar .sep { opacity: .35; }
.statusbar b { color: var(--text); font-weight: 620; }

/* ═══ Demo şeridi ════════════════════════════════════════ */
.demo-bar {
  background: linear-gradient(90deg, #e08600, #f0a91b);
  color: #241704;
  font-size: 11.5px; font-weight: 700;
  padding: 6px 18px; text-align: center;
  letter-spacing: .2px;
}

/* ═══ Boş durum ══════════════════════════════════════════ */
.bos {
  text-align: center; padding: 46px 20px; color: var(--text-dim);
}
.bos svg { width: 42px; height: 42px; opacity: .35; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════
   TELEFON (≤640px)
   Sol menü ekranın %18'ini yiyordu; telefonda ALT ÇUBUĞA taşınıyor.
   Durum çubuğu telefonda 138px'e kadar sarıyordu — gizleniyor.
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  #app-screen { grid-template-columns: 1fr; }

  /* ── Menü: alt gezinme çubuğu ── */
  .sidebar {
    position: fixed; inset: auto 0 0 0;
    top: auto; height: auto;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .28);
    z-index: 60;
  }
  .sidebar .head, .sidebar .foot { display: none; }

  .sidebar nav {
    flex-direction: row; gap: 0; width: 100%;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav .grp { display: none; }

  .sidebar nav button {
    flex-direction: column; gap: 3px;
    min-width: 68px; padding: 8px 10px 7px;
    justify-content: center; border-radius: 0;
  }
  /* Etiketler geri gelsin — ikon tek başına yeterince anlaşılır değil */
  .sidebar nav button span.lbl {
    display: block; font-size: 9.5px; font-weight: 600;
    line-height: 1.15; white-space: nowrap;
  }
  .sidebar nav button.active {
    background: rgba(47, 107, 255, .18);
    box-shadow: inset 0 2px 0 var(--accent);
  }
  .sidebar nav .badge {
    position: absolute; top: 3px; right: 12px;
    transform: none; margin: 0; padding: 0 5px; font-size: 9.5px;
  }

  /* Alt çubuğun altında içerik kalmasın */
  .content { padding: 12px; padding-bottom: 82px; }

  /* Telefonda kur/lisans satırı yer kaplıyor, bilgi kritik değil */
  .statusbar { display: none; }

  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .crumb { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Özet kutuları ikili — tek sütunda sayfa çok uzuyordu */
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 11px 12px; gap: 10px; }
  .stat .ico { width: 32px; height: 32px; border-radius: 9px; }
  .stat .ico svg { width: 16px; height: 16px; }
  .stat .value { font-size: 17px; letter-spacing: -.4px; }
  .stat .label { font-size: 10px; letter-spacing: .3px; }

  /* Kalem toplamı: alt alta ve KAYDET tam genişlik
     (masaüstü düzeninde düğme ekran dışına taşıyordu) */
  .kalem-toplam { flex-direction: column; align-items: stretch; gap: 10px; }
  .kalem-toplam > .row { width: 100%; }
  .kalem-toplam .row[style*="gap: 22px"],
  .kalem-toplam .row { flex-wrap: wrap; }
  .kalem-toplam .right { text-align: left; }
  .kalem-toplam .tutar { font-size: 21px; }
  #btn-isemri-kaydet { width: 100%; justify-content: center; }

  .card > header { padding: 10px 13px; flex-wrap: wrap; row-gap: 7px; }
  .card > .body   { padding: 13px; }

  /* Modal telefonda tam ekrana yakın olsun */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; width: 100%;
    max-height: 92vh;
    border-radius: 15px 15px 0 0;
  }
  .modal > .body { padding: 15px; }
  .modal > footer { padding: 12px 15px; }
  .modal > footer .btn { flex: 1; justify-content: center; }

  /* Bildirimler tam genişlik */
  #toast-area { left: 12px; right: 12px; bottom: 80px; max-width: none; }

  /* Filtre satırlarındaki sabit genişlikleri serbest bırak */
  .card .body input[type=text],
  .card .body input[type=tel],
  .card .body input[type=email],
  .card .body select { max-width: 100% !important; }
}

/* Çok küçük ekran (≤380px) — özet kutuları tek sütun */
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: 1fr; }
  .sidebar nav button { min-width: 62px; }
}

/* ═══ Yazdırma ═══════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .statusbar, .demo-bar, #toast-area, .no-print { display: none !important; }
  #app-screen { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
}
