/* ============================================================
   MobilKira — Demo Design System
   Statik prototip. Üretim kodu değil, onay için görsel referans.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cfd7e6;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-fg: #ffffff;

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0284c7;
  --info-soft: #f0f9ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --sh: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-lg: 0 12px 32px rgba(15, 23, 42, .12);

  --sidebar-w: 258px;
  --topbar-h: 62px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* harita katmanları */
  --map-sea: #dbe7f5;
  --map-land: #eef3f9;
  --map-line: #94a3b8;
  --map-parcel: #ffffff;
  --map-build: #d3cec3;

  /* kadastro altlığı (TKGM parsel sorgu görünümü) */
  --map-ground: #eef0ea;
  --map-block: #e6e3dc;
  --map-green: #cfe3c4;
  --map-green-text: #4a7040;
  --map-road: #ffffff;
  --map-road-edge: #d8d5cd;
  --map-road-text: #6b7280;
  --map-cadastre: #8a94a6;
  --map-cadastre-text: #4b5563;
  --map-ada-text: #374151;
  --map-halo: rgba(255, 255, 255, .85);
}

[data-theme="dark"] {
  --bg: #0a0f1f;
  --bg-soft: #0f162b;
  --surface: #121a30;
  --surface-2: #16203a;
  --border: #24304f;
  --border-strong: #33416a;
  --text: #e8edf9;
  --muted: #97a4c2;
  --faint: #6f7d9e;

  --primary: #7c8cff;
  --primary-hover: #93a0ff;
  --primary-soft: #1c2445;
  --primary-fg: #0b1020;

  --success: #34d399;
  --success-soft: #10281f;
  --warning: #fbbf24;
  --warning-soft: #2a2110;
  --danger: #f87171;
  --danger-soft: #2c1618;
  --info: #38bdf8;
  --info-soft: #0d2436;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --sh: 0 2px 10px rgba(0, 0, 0, .35);
  --sh-lg: 0 18px 40px rgba(0, 0, 0, .5);

  --map-sea: #0c1426;
  --map-land: #17223d;
  --map-line: #46577f;
  --map-parcel: #131c33;
  --map-build: #2f3b58;

  --map-ground: #1a2033;
  --map-block: #212a42;
  --map-green: #1e3527;
  --map-green-text: #6fbf87;
  --map-road: #2d3852;
  --map-road-edge: #3a4664;
  --map-road-text: #9fb0d0;
  --map-cadastre: #5a6b90;
  --map-cadastre-text: #b9c6e0;
  --map-ada-text: #d6e0f2;
  --map-halo: rgba(10, 15, 31, .75);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar__brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: -.02em; }
.brand-text span { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
  padding: 0 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 13.5px;
  transition: background .14s, color .14s;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; flex: 0 0 18px; }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--danger); color: #fff;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center;
}
.nav-item .count.is-neutral { background: var(--border-strong); color: var(--text); }

.sidebar__foot { border-top: 1px solid var(--border); padding: 12px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.userbox:hover { background: var(--surface-2); }
.userbox__meta { min-width: 0; }
.userbox__meta b { display: block; font-size: 13px; }
.userbox__meta span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-role {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; padding: 8px; width: 100%;
  border: 1px dashed var(--border-strong); border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.switch-role:hover { color: var(--primary); border-color: var(--primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar__title b { font-size: 15.5px; }
.crumbs { font-size: 11.5px; color: var(--muted); }
.crumbs span + span::before { content: "/"; margin: 0 6px; color: var(--faint); }
.topbar__spacer { flex: 1; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 11px; width: 250px;
  color: var(--muted);
}
.searchbox input { border: 0; background: transparent; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.searchbox kbd {
  font-family: var(--font); font-size: 10.5px; color: var(--faint);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); display: grid; place-items: center; font-size: 15px;
  position: relative; transition: .14s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 99px; background: var(--danger);
  border: 2px solid var(--surface);
}

.avatar {
  width: 34px; height: 34px; border-radius: 99px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: var(--primary-soft); color: var(--primary);
}
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }

/* İçerik genişliği ekrana göre büyür.
   Sabit 1440px, 2560px'lik bir masaüstünde ekranın kırkta birini boş
   bırakıyordu. Yine de sınırsız değil: 1600px'ten sonra satır uzunluğu
   okunmayı zorlaştırıyor, o yüzden kademeli açılıyor ve ortalanıyor. */
.content {
  padding: 24px;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
}
@media (min-width: 1600px) { .content { max-width: 1600px; padding: 28px 32px; } }
@media (min-width: 1900px) { .content { max-width: 1800px; padding: 30px 40px; } }
@media (min-width: 2400px) { .content { max-width: 2100px; } }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  transition: .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.card__head h3 { font-size: 14.5px; }
.card__head p { font-size: 12px; color: var(--muted); }
.card__head .spacer { flex: 1; }
.card__body { padding: 18px; }
.card__body.tight { padding: 0; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.side-l { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

/* ---------- Stat tiles ---------- */
.stat { padding: 16px 18px; }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat__value { font-size: 25px; font-weight: 720; letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 700; font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; padding: 3px 9px;
  border-radius: 99px; border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }
.badge--muted   { background: var(--surface-2);    color: var(--muted); border-color: var(--border); }
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge.no-dot::before { display: none; }
/* uzun metinli rozetler: sarmalanabilir */
.badge--wrap { white-space: normal; text-align: left; }
.badge--wrap::before { flex: 0 0 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
  padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface-2);
}
.tbl tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main b { display: block; font-weight: 600; }
.cell-main small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.check input { margin-top: 3px; accent-color: var(--primary); }

/* ---------- Progress / meters ---------- */
.meter { height: 7px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
[data-theme="dark"] .meter { background: rgba(255, 255, 255, .08); }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.meter > span.success { background: var(--success); }
.meter > span.warning { background: var(--warning); }
.meter > span.danger { background: var(--danger); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 10px; height: 10px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.tl-item.is-done::before { background: var(--success); border-color: var(--success); }
.tl-item.is-active::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tl-item.is-danger::before { background: var(--danger); border-color: var(--danger); }
.tl-item b { font-size: 13px; display: block; }
.tl-item small { color: var(--muted); font-size: 11.5px; }
.tl-item p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Charts (inline svg helpers) ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 78px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Empty / alert ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { font-size: 30px; opacity: .5; }
.empty b { display: block; margin-top: 10px; color: var(--text); }
.empty p { font-size: 12.5px; margin-top: 4px; }

.alert {
  display: flex; gap: 12px; padding: 13px 15px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13px;
}
.alert .ico { font-size: 16px; line-height: 1.2; }
.alert b { display: block; margin-bottom: 2px; }
.alert p { color: var(--muted); font-size: 12.5px; }
/* metin içindeki vurgular satır kırmasın — blok kural yalnız başlık için */
.alert p b, .alert p strong, .alert dd b, .alert dd strong { display: inline; margin: 0; }
.alert--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alert--danger  { background: var(--danger-soft);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert--info    { background: var(--info-soft);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: 0; background: transparent; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Property card ---------- */
.prop-card { overflow: hidden; display: flex; flex-direction: column; }
.prop-card__img {
  height: 138px; background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid; place-items: center; color: #fff; font-size: 34px; position: relative;
}
.prop-card__img .badge { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.94); color: #0f172a; }
.prop-card__body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.prop-card__body h4 { font-size: 14px; }
.prop-card__body .addr { font-size: 12px; color: var(--muted); }
.prop-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.prop-card__foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Messages ---------- */
.msg-layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 560px; }
.msg-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 620px; }
.msg-item { display: flex; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.is-active { background: var(--primary-soft); }
.msg-item__body { min-width: 0; flex: 1; }
.msg-item__body .top { display: flex; align-items: baseline; gap: 8px; }
.msg-item__body b { font-size: 13px; }
.msg-item__body time { margin-left: auto; font-size: 11px; color: var(--faint); }
.msg-item__body p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread { display: flex; flex-direction: column; }
.msg-thread__head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 11px; }
.msg-thread__body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 460px; background: var(--bg-soft); }
.bubble { max-width: 68%; padding: 10px 13px; border-radius: 14px; font-size: 13px; box-shadow: var(--sh-sm); }
.bubble time { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.bubble.them { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.me { background: var(--primary); color: var(--primary-fg); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg-thread__foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 24, .55);
  backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  animation: pop .16s ease-out;
}
.modal--wide { max-width: 760px; }
@media (min-width: 1400px) { .modal--wide { max-width: 900px; } }
@media (min-width: 1800px) { .modal--wide { max-width: 1040px; } }

/* Modal gövdesi kendi içinde kaysın; başlık ve ayak sabit kalsın —
   uzun izin listelerinde "Kaydet" düğmesi ekranın dışında kalıyordu. */
.modal { display: flex; flex-direction: column; }
.modal__head, .modal__foot { flex: 0 0 auto; }
.modal__body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal__head { padding: 18px 20px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal__head h3 { font-size: 16px; }
.modal__head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 18px 20px; }
.modal__foot { padding: 0 20px 20px; display: flex; gap: 9px; justify-content: flex-end; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r); box-shadow: var(--sh-lg);
  padding: 11px 15px; font-size: 13px; min-width: 260px;
  animation: slide-in .18s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.xsmall { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.kv { display: grid; grid-template-columns: minmax(84px, 150px) minmax(0, 1fr); gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.kv dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
/* dar sütunlarda uzun rozetler taşmasın */
.kv dd .badge { white-space: normal; }
.demo-note {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 11.5px; color: var(--faint); padding: 22px 0 6px;
}

/* ---------- Login / role picker ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-hero {
  background: linear-gradient(150deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  color: #fff; padding: 54px; display: flex; flex-direction: column; gap: 28px;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ""; position: absolute; right: -140px; bottom: -160px;
  width: 460px; height: 460px; border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.auth-hero h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; max-width: 15ch; }
.auth-hero p { color: rgba(255,255,255,.85); font-size: 15px; max-width: 44ch; }
.hero-points { display: flex; flex-direction: column; gap: 14px; margin-top: auto; position: relative; z-index: 1; }
.hero-point { display: flex; gap: 12px; align-items: flex-start; }
.hero-point .ico {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: rgba(255,255,255,.17); display: grid; place-items: center; font-size: 16px;
}
.hero-point b { display: block; font-size: 14px; }
.hero-point span { font-size: 12.5px; color: rgba(255,255,255,.78); }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 412px; }
.role-picker { display: flex; flex-direction: column; gap: 10px; }
.role-opt {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border); background: var(--surface); transition: .14s;
}
.role-opt:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--sh); }
.role-opt.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.role-opt .ico {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 42px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--primary-soft); color: var(--primary);
}
.role-opt b { display: block; font-size: 14px; }
.role-opt span { display: block; font-size: 12px; color: var(--muted); }
.role-opt .arrow { margin-left: auto; color: var(--faint); font-size: 16px; }

/* ---------- Kimlik ekranları ---------- */
.auth-msg {
  display: none; border-radius: var(--r); padding: 11px 13px; font-size: 13px;
  border: 1px solid var(--border); background: var(--bg-soft); line-height: 1.5;
}
.auth-msg.is-on { display: block; }
.auth-msg.is-error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.auth-msg.is-ok { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.auth-msg.is-warn { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.auth-msg ul { margin: 6px 0 0; padding-left: 18px; }
.auth-msg li { margin-top: 2px; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted);
}
.pw-toggle:hover { background: var(--bg-soft); }

.pw-strength { display: flex; flex-direction: column; gap: 6px; }
.pw-strength .bars { display: flex; gap: 4px; }
.pw-strength .bars i {
  flex: 1; height: 5px; border-radius: 99px; background: var(--bg-soft);
  transition: background .15s;
}
.pw-strength .bars i.on-1 { background: var(--danger); }
.pw-strength .bars i.on-2 { background: var(--warning); }
.pw-strength .bars i.on-3 { background: #0ea5e9; }
.pw-strength .bars i.on-4 { background: var(--success); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 5px; }
.pw-rules span {
  font-size: 11px; padding: 3px 8px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}
.pw-rules span.ok { border-color: var(--success); color: var(--success); background: var(--success-soft); }

.otp-input {
  letter-spacing: .5em; text-align: center; font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qr-box {
  display: grid; place-items: center; padding: 14px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--border);
}
.qr-box svg { display: block; }
.secret-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  letter-spacing: .08em; word-break: break-all; background: var(--bg-soft);
  padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border);
}

.offline-warn {
  display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px;
  padding: 9px 11px; border-radius: 10px; font-size: 11.5px; line-height: 1.45;
  border: 1px solid var(--warning); background: var(--warning-soft); color: var(--warning);
}
.offline-warn span { color: var(--muted); }
.offline-warn code { font-size: 10.5px; }

/* ---------- Harita ---------- */
.mapbox {
  position: relative; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--border); background: var(--map-sea);
  /* Leaflet katmanları (z-index 400–1200) kutunun içinde kalsın;
     yoksa modal, topbar ve sidebar'ın üstüne çıkıyor. */
  isolation: isolate; z-index: 0;
}
.map-svg { display: block; width: 100%; touch-action: none; user-select: none; }
.map-toolbar { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; }
.map-toolbar .icon-btn { width: 32px; height: 32px; flex: 0 0 32px; font-size: 14px; line-height: 1; background: var(--surface); box-shadow: var(--sh-sm); }
.map-legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 1200;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 10px; font-size: 11px; color: var(--muted);
  max-width: calc(100% - 176px);
}
@media (max-width: 900px) { .map-legend .faint { display: none; } }
.map-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.map-popup {
  position: absolute; z-index: 1200; width: 226px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--sh-lg); padding: 11px 12px;
}
/* ---- Gerçek harita altlığı (Leaflet) ---- */
.mapbox--live { background: var(--surface-2); }
.map-canvas { width: 100%; }
.map-canvas.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-container a { color: var(--primary); }
/* koyu temada sokak karolarını karart */
[data-theme="dark"] .tiles-street { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) grayscale(.15); }

.parcel-no {
  display: inline-block; font-size: 11px; font-weight: 600; color: #1f2937;
  background: rgba(255, 255, 255, .82); border-radius: 5px; padding: 0 5px;
  line-height: 16px; white-space: nowrap;
}
.parcel-no.is-focus { font-size: 13px; font-weight: 800; color: #b3271a; background: rgba(255, 255, 255, .92); }
.ada-no {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em;
  color: #8a5a00; background: rgba(255, 236, 200, .78);
  border-radius: 4px; padding: 0 5px; line-height: 14px; white-space: nowrap;
}
.is-sat .parcel-no { background: rgba(255, 255, 255, .88); }
.is-sat .ada-no { color: #6b4400; background: rgba(255, 240, 210, .85); }

.map-coordbar {
  position: absolute; left: 10px; bottom: 32px; z-index: 1200;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 9px; font-size: 10.5px; color: var(--muted);
}
.map-note {
  position: absolute; right: 56px; top: 10px; z-index: 1200; max-width: 44%;
  background: color-mix(in srgb, var(--warning-soft) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 34%, transparent);
  color: var(--warning); border-radius: 8px; padding: 5px 9px; font-size: 10.5px;
}
.map-note.is-real {
  background: color-mix(in srgb, var(--success-soft) 92%, transparent);
  border-color: color-mix(in srgb, var(--success) 34%, transparent);
  color: var(--success);
}
.mapbox--live .map-layers { bottom: 32px; }
.map-pop b { font-size: 13px; }
.map-pop__sub { font-size: 11.5px; color: #64748b; margin-top: 2px; }
.map-pop__row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.map-pop__tag { color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }

/* parsel bilgi kartı — TKGM parsel sorgu ekranındaki künye kutusu gibi */
.map-infocard {
  position: absolute; top: 10px; left: 10px; width: 238px; z-index: 1200;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--sh); padding: 10px 12px 11px; font-size: 12px;
}
.map-infocard__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.map-infocard__head b { font-size: 12.5px; }
.map-infocard__x {
  margin-left: auto; border: 0; background: transparent; color: var(--faint);
  font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 5px;
}
.map-infocard__x:hover { color: var(--text); background: var(--surface-2); }
.map-infocard dl { display: grid; grid-template-columns: 74px 1fr; gap: 4px 8px; margin: 0; }
.map-infocard dt { color: var(--muted); font-size: 11px; }
.map-infocard dd { margin: 0; font-weight: 600; font-size: 11.5px; }
.map-infocard__coord {
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border);
  font-size: 10.5px; color: var(--muted);
}

/* harita / uydu katman değiştirici */
.map-layers {
  position: absolute; right: 10px; bottom: 10px; z-index: 1200;
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; overflow: hidden; box-shadow: var(--sh-sm);
}
.map-layers button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 600; padding: 6px 10px;
}
.map-layers button + button { border-left: 1px solid var(--border); }
.map-layers button.is-active { background: var(--primary); color: var(--primary-fg); }

.map-pin, .map-parcel { cursor: pointer; }
.map-pin:hover circle:last-of-type { r: 6; }
.map-parcel:hover rect:first-of-type { filter: brightness(.96); }
[data-theme="dark"] .map-parcel:hover rect:first-of-type { filter: brightness(1.25); }

/* parsel künyesi */
.parcel-card {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px; padding: 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
}
.parcel-card div span { display: block; font-size: 11px; color: var(--muted); }
.parcel-card div b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Takvim ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cal__dow { background: var(--surface-2); padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.cal__day { background: var(--surface); min-height: 96px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal__day.is-out { background: var(--surface-2); opacity: .55; }
.cal__day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal__num { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal__day.is-today .cal__num { color: var(--primary); }
.cal-ev {
  font-size: 10.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev.t-warning { background: var(--warning-soft); color: var(--warning); }
.cal-ev.t-danger { background: var(--danger-soft); color: var(--danger); }
.cal-ev.t-success { background: var(--success-soft); color: var(--success); }
.cal-ev.t-info { background: var(--info-soft); color: var(--info); }

/* ---------- Galeri ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gal-item { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); cursor: pointer; }
.gal-item__img { height: 108px; display: grid; place-items: center; font-size: 34px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; }
.gal-item__body { padding: 8px 10px; }
.gal-item__body b { font-size: 12px; display: block; }
.gal-item__body span { font-size: 10.5px; color: var(--muted); }

/* ---------- Yükleme alanı ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  padding: 24px; text-align: center; color: var(--muted); font-size: 13px;
  transition: border-color .14s, background .14s;
}
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone b { color: var(--primary); }
.dropzone:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dropzone { cursor: pointer; }

/* Yüklenmiş belge satırı */
.dz-liste:not(:empty) { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dz-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; background: var(--surface-2);
}
.dz-item.is-yukleniyor { border-style: dashed; }
.dz-ico { font-size: 17px; line-height: 1; }
.dz-bilgi { flex: 1; min-width: 0; }
.dz-bilgi b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-mesaj:not(:empty) { margin-top: 8px; }
.dz-mesaj.is-warn { color: var(--warning); }
.dz-mesaj.is-error { color: var(--danger); }
.dz-mesaj.is-ok { color: var(--success); }

/* ---------- Responsive ---------- */

/* Çok geniş ekranda daha fazla sütun: kartlar gereğinden fazla uzamasın. */
@media (min-width: 1700px) {
  .grid.side   { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); }
  .grid.side-l { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); }
}
@media (min-width: 2000px) {
  .grid.cols-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablolar kartın içinde kendi kaydırma alanında kalsın; sayfa yatay
   kaymasın. `.table-wrap` zaten var ama min-width: 0 olmadan grid
   çocuğu içinde taşabiliyor. */
.table-wrap { overflow-x: auto; min-width: 0; }
.grid > *, .stack > * { min-width: 0; }

.sidebar-toggle { display: none; }
@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side, .grid.side-l { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--sh-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8,12,24,.45); z-index: 35; }
  .sidebar-toggle { display: grid; }
  .searchbox { display: none; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .msg-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 34px 26px; }
  .auth-hero h1 { font-size: 27px; }
}
/* ---- Tablet ve altı: kart başlıkları taşmasın ---- */
@media (max-width: 860px) {
  .card__head { flex-wrap: wrap; }
  .card__head .spacer { display: none; }
  .card__head .searchbox,
  .card__head .select { width: 100% !important; }
  .page-head__actions { width: 100%; }
  .modal__foot { flex-wrap: wrap; }
  .modal__foot .btn { flex: 1 1 auto; }
  .parcel-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .content { padding: 16px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: 84px 1fr 62px; font-size: 12px; }

  /* topbar: kırıntı yolu satırlara bölünüp yer kaplamasın */
  .topbar { padding: 0 14px; gap: 10px; }
  .crumbs { display: none; }
  .topbar__title b { font-size: 15px; }

  /* başlık ve aksiyonlar tam genişlik, butonlar eşit paylaşsın */
  .page-head { gap: 12px; }
  .page-head h1 { font-size: 19px; }
  .page-head__actions { margin-left: 0; }
  .page-head__actions .btn { flex: 1 1 auto; justify-content: center; }
  .page-head__actions .row { width: 100%; }

  /* tablolar yatay kaydırılır — kaydırma olduğu belli olsun */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .tbl thead th, .tbl tbody td { padding: 10px 12px; }

  /* takvim: metin yerine renkli şerit, ayrıntı alttaki listede */
  .cal { grid-template-columns: repeat(7, minmax(40px, 1fr)); }
  .cal__dow { padding: 6px 4px; font-size: 9.5px; text-align: center; }
  .cal__day { min-height: 56px; padding: 4px 3px; gap: 3px; }
  .cal__num { font-size: 11px; }
  .cal-ev { font-size: 0; line-height: 0; padding: 0; height: 5px; border-radius: 99px; }

  /* galeri iki sütun */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gal-item__img { height: 84px; font-size: 26px; }

  /* harita üstü kutular ekranı kaplamasın */
  .map-infocard { width: auto; max-width: calc(100% - 88px); top: 8px; left: 8px; padding: 8px 10px; }
  .map-infocard dl { grid-template-columns: 64px 1fr; }
  .map-note { display: none; }
  .map-legend { max-width: calc(100% - 20px); bottom: 44px; }
  .mapbox--live .map-layers { bottom: 8px; }
  .map-coordbar { display: none; }

  /* modal kenarlara yapışmasın */
  .modal-backdrop { padding: 12px; }
  .modal__head { padding: 14px 15px 0; }
  .modal__body { padding: 14px 15px; }
  .modal__foot { padding: 0 15px 15px; }

  /* uzun rozet dizileri alt alta geçsin */
  .prop-card__foot, .card__foot { flex-wrap: wrap; }

  /* uyarı kutularındaki sondaki buton/rozet taşmasın, alta insin */
  .alert { flex-wrap: wrap; }
  .alert .spacer { display: none; }
  .alert > .btn, .alert > .badge { margin-left: auto; }
  .alert > .btn { flex: 1 1 auto; justify-content: center; }
  .dropzone { padding: 18px 12px; font-size: 12.5px; }
}

@media (max-width: 420px) {
  .stat__value { font-size: 22px; }
  .cal { grid-template-columns: repeat(7, minmax(34px, 1fr)); }
  .cal__day { min-height: 48px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar.xl { width: 60px; height: 60px; font-size: 20px; }
}

/* ============================================================
   Yazdırma / PDF
   Tarayıcının "Hedef: PDF olarak kaydet" seçeneği kullanılır; böylece
   Türkçe karakterler ve yazı tipleri sorunsuz çıkar. `MK.yazdir()` sayfaya
   `#mk-print` kutusunu ekler ve <body>'ye `yazdiriliyor` sınıfını verir;
   aşağıdaki kurallar o anda sadece bu kutuyu bırakır.
   ============================================================ */

#mk-print { display: none; }

@media print {
  .sidebar, .topbar, .page-head__actions, .demo-note,
  .toast-wrap, .modal-backdrop, .fab, .pager { display: none !important; }

  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #d8dde5; break-inside: avoid; }
  a[href]::after { content: ""; }              /* bağlantı adreslerini basma */
  .tbl thead { display: table-header-group; }  /* sayfa başına başlık tekrarı */
  .tbl tr { break-inside: avoid; }

  /* Yazdırma kipinde sayfanın kalanını gizle, sadece belgeyi bırak. */
  body.yazdiriliyor > *:not(#mk-print) { display: none !important; }
  body.yazdiriliyor #mk-print { display: block; }

  @page { size: A4; margin: 16mm 14mm; }
}

/* ---- yazdırma belgesi biçimi (ekranda önizleme için de geçerli) ---- */
.pr-belge { color: #111; font-size: 12px; line-height: 1.5; }
.pr-belge h1 { font-size: 19px; margin: 0 0 2px; letter-spacing: -.2px; }
.pr-belge h2 { font-size: 13px; margin: 18px 0 6px; padding-bottom: 4px;
  border-bottom: 1px solid #c9d2dd; text-transform: uppercase; letter-spacing: .4px; color: #33415a; }
.pr-bas { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; border-bottom: 2px solid #1f6feb; padding-bottom: 10px; margin-bottom: 6px; }
.pr-bas .pr-marka { font-weight: 700; color: #1f6feb; font-size: 15px; }
.pr-bas .pr-meta { text-align: right; font-size: 10.5px; color: #566277; }
.pr-belge dl.pr-cift { display: grid; grid-template-columns: 34% 1fr; gap: 4px 12px; margin: 0; }
.pr-belge dl.pr-cift dt { color: #566277; }
.pr-belge dl.pr-cift dd { margin: 0; font-weight: 600; }
.pr-belge table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pr-belge table th { text-align: left; background: #eef2f7; color: #33415a;
  padding: 6px 8px; border: 1px solid #d8dde5; font-weight: 600; }
.pr-belge table td { padding: 6px 8px; border: 1px solid #e3e8ef; vertical-align: top; }
.pr-belge table td.sag, .pr-belge table th.sag { text-align: right; }
.pr-belge tfoot td { font-weight: 700; background: #f7f9fc; }
.pr-not { margin-top: 6px; font-size: 10.5px; color: #566277; }
.pr-imza { display: flex; gap: 32px; margin-top: 34px; }
.pr-imza > div { flex: 1; border-top: 1px solid #98a2b3; padding-top: 6px;
  font-size: 10.5px; color: #566277; text-align: center; }
/* Ekrandan kopyalanan kartlar: kâğıtta sadeleşsin. */
.pr-kopya .card, .pr-belge .card { box-shadow: none; border: 1px solid #d8dde5;
  margin-bottom: 12px; break-inside: avoid; background: #fff; }
.pr-kopya .card__head, .pr-belge .card__head { border-bottom: 1px solid #e3e8ef; }
.pr-kopya .grid, .pr-belge .grid { display: grid; gap: 10px; }
.pr-kopya .stat__value, .pr-belge .stat__value { font-size: 19px; }
.pr-kopya .table-wrap, .pr-belge .table-wrap { overflow: visible; }

.pr-dip { margin-top: 22px; padding-top: 8px; border-top: 1px solid #e3e8ef;
  font-size: 10px; color: #7a8699; display: flex; justify-content: space-between; }
