/* ============================================================
   Klinik Takip — clineo marka teması (v3)
   Logo paleti: lacivert #152d56 · yeşil #55b893 · teal #2ba69e · mavi #1f7cb6 · gök #5cb4de
   Lüks · hareketli · şık · ergonomik · AI-odaklı
   ============================================================ */
:root {
  /* yüzeyler — serin, mavi-teal alt tonlu */
  --bg: #edf2f4;
  --bg-2: #e5edf0;
  --surface: #ffffff;
  --surface-2: #f6fafb;
  --line: #e2eaed;
  --line-2: #d2dde2;

  /* mürekkep — lacivert ailesi */
  --ink: #142338;
  --ink-2: #42536a;
  --muted: #72818f;

  /* marka — clineo logosu (bulut gradyanı) */
  --brand: #1f7cb6;
  --brand-2: #14639c;
  --brand-ink: #152d56;
  --brand-soft: #e7f2f8;
  --brand-grad: linear-gradient(135deg, #3fb28e 0%, #26a3a3 46%, #1f7cb6 100%);
  --navy-grad: linear-gradient(180deg, #1a3862 0%, #0f2244 100%);
  /* ikincil aksan — logo teal'i */
  --accent: #2ba69e;
  --accent-soft: #e2f4f2;
  --sky: #5cb4de;

  /* AI aksanı (sesli/akıllı özellikler) */
  --ai: #6d5cf0;
  --ai-2: #8b5cf6;
  --ai-soft: #eef0fe;
  --ai-grad: linear-gradient(135deg, #7c6cf5 0%, #9b6cf2 100%);

  /* durum */
  --danger: #d1453b;
  --danger-soft: #fcebe9;
  --warn: #c07a00;
  --warn-soft: #fbf2dd;
  --info: #3f9ad0;
  --info-soft: #e7f2fa;
  --ok: #1f9d77;

  /* tedavi durumları (diş şeması) */
  --t-planned: #d68a04;
  --t-progress: #2b8ac2;
  --t-done: #16a081;

  /* gölge & yarıçap — lacivert alt tonlu */
  --sh-sm: 0 1px 2px rgba(15,25,45,.06), 0 1px 1px rgba(15,25,45,.04);
  --sh: 0 2px 6px rgba(15,25,45,.06), 0 12px 28px rgba(15,25,45,.08);
  --sh-lg: 0 8px 18px rgba(15,25,45,.10), 0 30px 60px rgba(15,25,45,.15);
  --sh-brand: 0 8px 22px rgba(31,124,182,.30);
  --sh-ai: 0 8px 22px rgba(109,92,240,.30);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* iOS güvenli alan (çentik / home çubuğu) — viewport-fit=cover ile zorunlu */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* tipografi — tek aile, güçlü ağırlık kontrastı (okunaklı + premium) */
  --font-body: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Sora", system-ui, sans-serif;
  --font-brand: "Quicksand", "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { margin: 0; font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; }
/* rakamlar hizalı otursun (tablolar, KPI'lar, tutarlar) */
table, .mono, .kpi-val, .stat-value, .k-val, .dkc-val, .fin-kpi, .tnum { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd6d2; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c1bc; background-clip: content-box; }

/* ---------- Animasyonlar ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { transform: translateX(34px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { 100% { background-position: -200% 0; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(109,92,240,.45); } 70% { box-shadow: 0 0 0 16px rgba(109,92,240,0); } 100% { box-shadow: 0 0 0 0 rgba(109,92,240,0); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: 12px;
  border: 1px solid transparent; background: var(--brand-grad); color: #fff;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--sh-brand); transition: transform .12s var(--ease), box-shadow .2s, filter .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 10px 26px rgba(31,124,182,.35); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; box-shadow: none; transform: none; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-sm); }
.btn-ghost:hover { background: var(--surface-2); filter: none; box-shadow: var(--sh-sm); }
.btn-danger { background: linear-gradient(135deg,#e0584e,#c43b31); box-shadow: 0 8px 22px rgba(209,69,59,.28); }
.btn-ai { background: var(--ai-grad); box-shadow: var(--sh-ai); }
.btn-ai:hover { box-shadow: 0 10px 26px rgba(109,92,240,.4); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 13px 0 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line-2);
  border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { resize: vertical; min-height: 78px; }

.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 12px; }

/* ---------- Giriş ---------- */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: max(24px, var(--sat)) max(24px, var(--sar)) max(24px, var(--sab)) max(24px, var(--sal));
  background:
    radial-gradient(1100px 560px at 88% -8%, #d9efe7, transparent 60%),
    radial-gradient(900px 520px at -8% 108%, #d3e9f6, transparent 55%),
    linear-gradient(120deg, #eef3f4, #e8eff2);
  background-size: 200% 200%, 200% 200%, 200% 200%;
  animation: gradientShift 18s ease 3;
}
.auth-card {
  width: 100%; max-width: 392px; background: rgba(255,255,255,.96);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid rgba(255,255,255,.7); border-radius: var(--r-lg);
  padding: 30px; box-shadow: var(--sh-lg); animation: fadeUp .5s var(--ease);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo-mark { width: 42px; height: 40px; flex: none; filter: drop-shadow(0 3px 8px rgba(31,124,182,.25)); }
.brand-name { font-size: 19px; font-weight: 700; font-family: var(--font-brand); letter-spacing: -.01em; line-height: 1.1; }
.brand-name .wm-a { color: var(--brand-ink); }
.brand-name .wm-b {
  background: linear-gradient(100deg, #2ba69e 0%, #39abb6 45%, #5cb4de 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-name small { display: block; font-size: 10.5px; font-weight: 700; color: var(--accent); letter-spacing: .14em; text-transform: uppercase; font-family: var(--font-body); }
.auth-card h2 { font-size: 23px; margin: 22px 0 3px; }
.auth-sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.auth-switch { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.seed-note {
  margin-top: 18px; padding: 12px 14px; border-radius: 12px; line-height: 1.7;
  background: linear-gradient(135deg, var(--brand-soft), #eef0fe); color: var(--brand-ink); font-size: 12.5px;
}

/* ---------- İskelet ---------- */
.layout { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 20;
}
.sidebar .brand { padding: 4px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: none; background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 550; border-radius: 12px; cursor: pointer;
  text-align: left; width: 100%; position: relative; transition: background .16s, color .16s;
}
.nav button .ic { width: 20px; text-align: center; font-size: 16px; opacity: .9; transition: transform .16s; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button:hover .ic { transform: scale(1.12); }
.nav button.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav button.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; padding: 4px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--brand-grad); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; box-shadow: var(--sh-brand);
}
.who-name { font-weight: 650; font-size: 13.5px; }
.who-role { color: var(--muted); font-size: 12px; }

.main { padding: 30px 36px; min-width: 0; animation: fadeUp .4s var(--ease); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 25px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Kartlar ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 16px; margin-bottom: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--sh); position: relative; overflow: hidden;
  transition: transform .16s var(--ease), box-shadow .2s;
  animation: fadeUp .45s var(--ease) backwards;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--brand-soft); opacity: .5; }
.card:nth-child(2) { animation-delay: .05s; } .card:nth-child(3) { animation-delay: .1s; } .card:nth-child(4) { animation-delay: .15s; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; position: relative; }
.stat-value { font-size: 30px; font-weight: 700; font-family: var(--font-head); margin-top: 8px; letter-spacing: -.03em; position: relative; }
.stat-foot { color: var(--muted); font-size: 12px; margin-top: 5px; position: relative; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; animation: fadeUp .5s var(--ease); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h3 { font-size: 15.5px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { padding-left: 34px; width: 250px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Tablo ---------- */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 12px 20px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); border-bottom: 1px solid var(--line); }
tbody td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cell-name { font-weight: 650; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty { padding: 48px 18px; text-align: center; color: var(--muted); }
.empty .big { font-size: 36px; margin-bottom: 10px; opacity: .5; }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: #eef1f0; color: var(--muted); }
.badge.admin { background: var(--brand-soft); color: var(--brand-ink); }
.badge.doctor { background: var(--info-soft); color: var(--info); }
.badge.reception { background: var(--warn-soft); color: var(--warn); }
.badge.nurse { background: #f1ecfb; color: #6b3fa0; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }
.badge.ok { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Modal / çekmece ---------- */
.overlay { position: fixed; inset: 0; background: rgba(13,24,20,.55); backdrop-filter: none; display: flex; justify-content: flex-end; z-index: 60; animation: fadeIn .18s ease; }
.overlay.center { align-items: center; justify-content: center; }
.drawer { width: 540px; max-width: 100%; height: 100%; background: var(--surface); box-shadow: var(--sh-lg); display: flex; flex-direction: column; animation: slideIn .26s var(--ease); }
.modal { width: 460px; max-width: calc(100% - 32px); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: 24px; animation: pop .2s var(--ease); }
.drawer-head, .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 19px; }
.modal-head { margin-bottom: 16px; }
.modal-head h3 { font-size: 18px; }
.x { border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 3px 8px; border-radius: 9px; transition: background .15s; }
.x:hover { background: var(--surface-2); color: var(--ink); }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 -22px 18px; padding: 0 22px; }
.tabs button { border: none; background: transparent; padding: 11px 4px; margin-right: 16px; color: var(--muted); font-size: 14px; font-weight: 650; cursor: pointer; border-bottom: 2.5px solid transparent; transition: color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* ---------- Detay satırları ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; align-items: center; }
.kv dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kv dd { margin: 0; font-size: 14px; }
.reveal-row { display: flex; align-items: center; gap: 10px; }
.kvkk-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; display: flex; gap: 8px; }
.ai-card { border: 1.5px dashed var(--ai); border-radius: 12px; padding: 15px; margin-top: 10px; background: linear-gradient(135deg, #fbfbff, #f6f5ff); }
.ai-card .ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 650; }
.ai-soon { color: var(--muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--sh-lg); z-index: 90; animation: pop .2s var(--ease); }
.toast.err { background: linear-gradient(135deg,#e0584e,#c43b31); }

/* ---------- Randevu ajandası ---------- */
.appt-wrap { display: flex; flex-direction: column; }
.appt-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; flex-wrap: wrap; }
.appt-row:hover { background: var(--surface-2); }
.appt-row:last-child { border-bottom: none; }
.appt-time { width: 70px; flex: none; font-weight: 700; font-size: 16px; font-family: var(--font-head); }
.appt-time .dur { display: block; font-weight: 500; font-size: 11px; color: var(--muted); font-family: var(--font-body); }
.appt-main { flex: 1; min-width: 170px; }
.appt-name { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.appt-status { flex: none; }
.appt-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   DİŞ ŞEMASI v2
   ============================================================ */
.dchart { animation: fadeUp .4s var(--ease); }
.dchart-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.mode-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 13px; padding: 4px; gap: 4px; }
.mode-seg button { border: none; background: transparent; padding: 8px 15px; font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer; border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; transition: all .18s var(--ease); }
.mode-seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }
.mode-seg button.on[data-mode="voice"] { background: var(--ai-grad); color: #fff; box-shadow: var(--sh-ai); }

.set-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; }
.set-seg button { border: none; background: #fff; padding: 7px 13px; font-size: 12.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.set-seg button.on { background: var(--brand-grad); color: #fff; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* Sesli (AI) panel */
.voice-panel { border: 1.5px solid var(--ai); border-radius: var(--r); padding: 18px; margin-bottom: 18px; background: linear-gradient(135deg, #fbfaff, #f4f2ff); animation: pop .25s var(--ease); }
.voice-top { display: flex; align-items: center; gap: 16px; }
.mic-btn {
  width: 58px; height: 58px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  background: var(--ai-grad); color: #fff; font-size: 23px; display: grid; place-items: center;
  box-shadow: var(--sh-ai); transition: transform .14s var(--ease);
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.live { animation: ring 1.4s infinite; }
.voice-info { flex: 1; min-width: 0; }
.voice-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.voice-hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.transcript { margin-top: 12px; padding: 11px 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; font-size: 14px; min-height: 44px; color: var(--ink); }
.transcript .ph { color: var(--muted); }
.transcript .interim { color: var(--ai); }
.wave { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.wave i { width: 3px; background: #fff; border-radius: 3px; animation: wv .9s ease-in-out infinite; }
.wave i:nth-child(2){animation-delay:.15s} .wave i:nth-child(3){animation-delay:.3s} .wave i:nth-child(4){animation-delay:.45s} .wave i:nth-child(5){animation-delay:.6s}
@keyframes wv { 0%,100%{height:5px} 50%{height:16px} }

/* AI öneri kartı (onay bekler) */
.ai-suggest { margin-top: 14px; border: 1.5px solid var(--ai); background: #fff; border-radius: 14px; padding: 14px 16px; animation: pop .2s var(--ease); }
.ai-suggest .sg-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.ai-suggest .sg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ai-suggest .sg-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.sg-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; gap: 6px; }

/* Odontogram */
/* (eski quad-row odontogram düzeni kaldırıldı — v4 ark düzeni aşağıda) */
.tooth {
  position: relative; border: none; background: transparent; cursor: pointer;
  padding: 3px 1px; border-radius: 11px; flex: none; display: flex; flex-direction: column;
  align-items: center; gap: 1px; transition: transform .12s var(--ease), background .15s;
}
.tooth:hover { background: rgba(31,124,182,.08); transform: translateY(-2px); }
.tooth.sel { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.tooth .tsvg { display: block; filter: drop-shadow(0 1px 1px rgba(13,30,25,.10)); transition: transform .12s var(--ease); }
.tooth:hover .tsvg { transform: scale(1.04); }
.tooth .tnum { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.2; font-weight: 600; }
.tooth.sel .tnum { color: var(--brand-ink); }
.tooth .tcount { position: absolute; top: -2px; right: -2px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center; }

/* Diş detay */
.tooth-detail { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; animation: fadeUp .3s var(--ease); }
.td-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 12px; }
.td-head strong { font-size: 17px; font-family: var(--font-head); }
.td-list { display: flex; flex-direction: column; gap: 9px; }
.td-item { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; transition: box-shadow .15s; }
.td-item:hover { box-shadow: var(--sh-sm); }
.td-item .tdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.td-item strong { font-size: 13.5px; }
.td-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-actions { display: flex; gap: 6px; margin-top: 9px; }
.td-add { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.td-add .full { grid-column: 1 / -1; }

/* skeleton */
.skel { background: linear-gradient(90deg, #eef1f0 25%, #f6f8f7 37%, #eef1f0 63%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }

/* ============================================================
   NEO — global AI asistanı ("Hey Neo")
   ============================================================ */
.neo-fab { position: fixed; right: 26px; bottom: 26px; z-index: 80; display: flex; align-items: center; gap: 10px; }
.neo-btn { width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer; background: var(--ai-grad); color: #fff; font-size: 26px; box-shadow: var(--sh-ai); display: grid; place-items: center; position: relative; transition: transform .14s var(--ease); }
.neo-btn:hover { transform: scale(1.07); }
.neo-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: ring 2.6s 3; }
.neo-tip { background: #fff; border: 1px solid var(--line); box-shadow: var(--sh); border-radius: 12px; padding: 9px 13px; font-size: 12.5px; font-weight: 650; color: var(--ink); animation: floaty 3s ease-in-out 3; }

.neo-panel { position: fixed; right: 26px; bottom: 100px; width: 388px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 140px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-lg); z-index: 81; display: flex; flex-direction: column; overflow: hidden; animation: pop .22s var(--ease); }
.neo-head { padding: 15px 18px; background: var(--ai-grad); color: #fff; display: flex; align-items: center; gap: 12px; }
.neo-ava { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 20px; flex: none; }
.neo-head h4 { font-size: 16.5px; font-family: var(--font-head); }
.neo-head .st { font-size: 11.5px; opacity: .92; margin-top: 1px; }
.neo-wake { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #fff; margin: 0 0 0 auto; cursor: pointer; font-weight: 600; }
.neo-wake input { width: auto; }
.neo-spk { border: none; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; font-size: 14px; border-radius: 8px; padding: 4px 8px; line-height: 1; transition: background .15s; }
.neo-spk:hover { background: rgba(255,255,255,.3); }
.neo-head .x { color: #fff; }
.neo-head .x:hover { background: rgba(255,255,255,.18); }

.neo-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 11px; background: var(--surface-2); }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; animation: fadeUp .25s var(--ease); word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand-grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: var(--sh-sm); }
.msg.neo { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--sh-sm); }
.msg .big-num { font-family: var(--font-head); font-size: 27px; font-weight: 700; color: var(--ai); vertical-align: -3px; margin: 0 2px; }
.neo-report { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.neo-report .ri { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; }
.neo-report .ri b { font-family: var(--font-head); font-size: 19px; display: block; color: var(--ink); }
.neo-report .ri span { font-size: 11px; color: var(--muted); }
.neo-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.neo-chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: all .14s; }

/* Neo tedavi onay kartı — AI önerir, hekim onaylar (sert kural #1) */
.neo-tx { border: 1.5px solid var(--ai); border-radius: 14px; background: linear-gradient(180deg, #fff, var(--ai-soft)); padding: 12px 13px; margin-top: 4px; box-shadow: 0 6px 18px rgba(109,92,240,.14); }
.neo-tx-head { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 9px; }
.neo-tx-ai { margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: var(--ai); background: #fff; border: 1px solid var(--ai); padding: 2px 7px; border-radius: 999px; }
.neo-tx-body { display: grid; gap: 6px; }
.neo-tx-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; font-size: 12.5px; }
.neo-tx-row > span { color: var(--muted); font-weight: 600; }
.neo-tx-row input, .neo-tx-row select { padding: 7px 10px; font-size: 13px; border-radius: 9px; }
.neo-tx-actions { display: flex; gap: 8px; margin-top: 11px; }
.neo-tx-note { margin-top: 9px; font-size: 10.5px; color: var(--muted); }
.neo-tx.done { opacity: .55; pointer-events: none; }
.neo-tx.done .neo-tx-actions { display: none; }
.neo-tx.cancelled { opacity: .45; pointer-events: none; text-decoration: none; }
.neo-tx.cancelled .neo-tx-actions { display: none; }
.neo-chip:hover { border-color: var(--ai); color: var(--ai); background: var(--ai-soft); }
.neo-typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.neo-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: wv2 1s infinite; }
.neo-typing i:nth-child(2){animation-delay:.15s} .neo-typing i:nth-child(3){animation-delay:.3s}
@keyframes wv2 { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.neo-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: #fff; }
.neo-foot input { flex: 1; padding: 10px 12px; }
.neo-mic { width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer; background: var(--ai-soft); color: var(--ai); font-size: 18px; flex: none; transition: transform .12s; }
.neo-mic:hover { transform: scale(1.05); }
.neo-mic.live { background: var(--ai-grad); color: #fff; animation: ring 1.4s infinite; }

/* ---------- Responsive ----------
   NOT: kenar çubuğu (çekmece) + neo + güvenli-alan kuralları aşağıdaki
   tek yetkili blokta (bkz. "MOBİL SAĞLAMLAŞTIRMA"). Burada yalnızca
   çakışmayan grid/padding düzeltmeleri kalır. */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .main { padding: 20px 16px; }
  .ai-suggest .sg-grid { grid-template-columns: 1fr; }
  .quad-row { gap: 12px; }
}

/* ============================================================
   CREATIVE FX (v3) — aurora arka plan, glassmorphism, animasyon
   ============================================================ */
:root {
  --glass: rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.82);
  --glass-brd: rgba(255,255,255,.7);
}

/* Hareketli aurora arka plan */
body { background: #e9eef1; position: relative; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 42% at 12% 16%, rgba(31,124,182,.26), transparent 60%),
    radial-gradient(36% 38% at 88% 10%, rgba(85,184,147,.22), transparent 60%),
    radial-gradient(44% 46% at 80% 90%, rgba(43,166,158,.24), transparent 60%),
    radial-gradient(42% 44% at 16% 94%, rgba(92,180,222,.22), transparent 60%);
  filter: saturate(120%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(233,238,241,.55), rgba(227,233,236,.78));
}
@keyframes auroraMove {
  0%   { transform: translate3d(0,0,0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(2.5%,-2%,0) scale(1.1) rotate(4deg); }
  100% { transform: translate3d(-2.5%,2.5%,0) scale(1.06) rotate(-3deg); }
}

/* Cam yüzeyler */
.auth-wrap { background: transparent !important; }
.auth-card {
  background: rgba(255,255,255,.96); backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-brd);
  box-shadow: var(--sh-lg);
  animation: popIn .5s var(--ease) both;
}
.sidebar {
  background: var(--surface); backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 1px solid var(--glass-brd);
}
.card, .panel {
  background: var(--surface); backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-brd);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  animation: fadeUp .45s var(--ease) both;
}
.drawer, .modal { background: rgba(255,255,255,.97); }

/* Kart hover: yükselme + üst gradient şerit */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--brand-grad); opacity: 0; transition: opacity .22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.card:hover::before { opacity: 1; }

/* Parlayan logo işareti */
.logo-mark { animation: logoFloat 5s ease-in-out 3; }
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* İstatistik değerleri gradient */
.stat-value { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Birincil butonlar: gradient + glow + mikro etkileşim */
.btn { transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease); }
.btn:not(.btn-ghost):not(.btn-danger) { background: var(--brand-grad); border-color: transparent; box-shadow: var(--sh-brand); }
.btn:not(.btn-ghost):not(.btn-danger):hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 28px rgba(31,124,182,.38); }
.btn:active { transform: translateY(0) scale(.98); }

/* Nav aktif: yumuşak gradient */
.nav button.active { background: linear-gradient(135deg, rgba(43,166,158,.15), rgba(124,108,245,.12)); color: var(--brand-ink); }
.nav button { transition: background .18s var(--ease), transform .12s var(--ease); }
.nav button:hover { transform: translateX(2px); }

/* Tablo satır hover */
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: rgba(31,124,182,.06); }

/* Sayfa başlığı + panel girişi */
.page-head { animation: fadeUp .4s var(--ease) both; }

/* Neo FAB: güçlü glow + nabız */
.neo-btn { box-shadow: 0 10px 30px rgba(109,92,240,.5), 0 0 0 0 rgba(124,108,245,.45); animation: neoPulse 2.6s ease-in-out 3; }
@keyframes neoPulse {
  0%   { box-shadow: 0 10px 30px rgba(109,92,240,.5), 0 0 0 0 rgba(124,108,245,.45); }
  70%  { box-shadow: 0 10px 34px rgba(109,92,240,.55), 0 0 0 16px rgba(124,108,245,0); }
  100% { box-shadow: 0 10px 30px rgba(109,92,240,.5), 0 0 0 0 rgba(124,108,245,0); }
}

/* Giriş animasyonları */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Diş hover parıltısı (varsa güçlendir) */
.tooth { transition: transform .14s var(--ease), filter .14s var(--ease); }
.tooth:hover { transform: translateY(-2px) scale(1.04); }

@media (prefers-reduced-motion: reduce) {
  body::before, .logo, .neo-btn { animation: none; }
}

/* ============================================================
   TEDAVİ & ÖDEME (finansal) + diş şeması efektleri
   ============================================================ */
.fin-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.fin-card {
  background: var(--surface); backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
  animation: fadeUp .4s var(--ease) both;
}
.fin-card span { font-size: 12px; color: var(--muted); font-weight: 600; }
.fin-card b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-card.balance.due { border-color: rgba(209,69,59,.35); background: linear-gradient(135deg, rgba(252,235,233,.9), var(--glass)); }
.fin-card.balance.due b { color: var(--danger); }
.fin-card.balance.paid { border-color: rgba(15,157,110,.35); }
.fin-card.balance.paid b { color: var(--t-done); }

.fin-sec-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
.fin-tbl { width: 100%; border-collapse: collapse; }
.fin-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.fin-tbl td { padding: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fin-tbl tbody tr:hover { background: rgba(31,124,182,.05); }

.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pay-form #pay-note { grid-column: 1 / -1; }
.pay-form #pay-add { grid-column: 1 / -1; }
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px;
  background: var(--surface-2);
}
.pay-row .cell-sub { grid-column: 1 / 2; }
.pay-row .pay-del { grid-row: 1 / 3; grid-column: 2; align-self: center; }

/* Diş şeması — giriş animasyonu + tedavili diş parıltısı */
.odonto .tooth { animation: toothIn .4s var(--ease) both; }
@keyframes toothIn { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
.tooth.has { filter: drop-shadow(0 0 6px rgba(43,166,158,.30)); }
.tooth.has:hover { filter: drop-shadow(0 4px 10px rgba(43,166,158,.4)); }
.tooth.sel { animation: toothPulse 1.4s ease-in-out 2; }
@keyframes toothPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(43,166,158,.0); } 50% { box-shadow: 0 0 0 5px rgba(43,166,158,.18); } }

@media (max-width: 560px) { .fin-cards { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .odonto .tooth, .tooth.sel { animation: none; } }

/* ============================================================
   ODONTOGRAM v2 — gerçekçi, referans tarzı
   ============================================================ */
.odo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.odo-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.odo-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Odontogram paneli — yumuşak klinik zemin */
.odonto {
  background:
    radial-gradient(120% 90% at 50% -12%, #ffffff 0%, transparent 55%),
    linear-gradient(180deg, #f6fafb 0%, #e9f0f3 100%);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 24px 16px 22px; position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.85), var(--sh-sm);
}
.arch-tag { display: flex; align-items: baseline; gap: 7px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 4px 8px 6px; }
.arch-tag.bot { margin: 10px 4px 0 6px; }
.arch-tag small { font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.arch-side { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: .02em; }
.arch-side b { color: var(--ink-2); }
/* Ark satırı — gülüş eğrisi transformları hücre --aty/--arot değişkenlerinden gelir */
.arch-row { display: flex; justify-content: center; align-items: flex-start; gap: 1px; min-width: 740px; padding-bottom: 16px; }
.arch-row.lower { align-items: flex-end; padding: 16px 0 0; }
.arch-mid { align-self: stretch; width: 12px; flex: none; background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 12px) 50% 0 / 1px 100% no-repeat; }
.arch-mid-line { height: 1px; margin: 6px 36px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 16px); }

/* Diş — biraz daha büyük, gölgeli, gerçekçi */
.tooth .tsvg { filter: drop-shadow(0 2px 2px rgba(13,30,25,.14)); }
.tooth.has .tnum { color: var(--ink); font-weight: 700; }

/* Açıklama (legend) şeridi */
.odo-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
}
.odo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.04); }
.lg-sep { width: 1px; height: 16px; background: var(--line-2); }
.lg-tooth { width: 13px; height: 16px; border-radius: 4px 4px 6px 6px; background: linear-gradient(180deg,#fff,#e9edec); border: 1.5px solid #b4beba; }
.lg-tooth.treated { border-color: var(--t-done); background: linear-gradient(180deg,#fff,#e7f1ed); box-shadow: 0 0 5px rgba(43,166,158,.4); }
.lg-badge { width: 16px; height: 16px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; }

@media (max-width: 560px) {
  .quad-row { gap: 14px; }
  .tooth .tsvg { width: 28px; height: 44px; }
}

/* Sonsuz animasyonları sınırla (perf + ekran yakalama; statik glow korunur) */
.neo-btn { animation: neoPulse 2.6s ease-in-out 3 both !important; }
.neo-btn::after { animation: ring 2.6s 3 both !important; }
.neo-tip { animation: floaty 3s ease-in-out 3 both !important; }
.logo { animation: logoFloat 5s ease-in-out 3 both !important; }
.tooth .tsvg { filter: drop-shadow(0 1px 1.5px rgba(13,30,25,.16)); }

/* Perf: dişlerde pahalı CSS drop-shadow filtrelerini kaldır (derinlik SVG gradyanında) */
.tooth .tsvg, .tooth.has, .tooth.has:hover, .tooth:hover .tsvg { filter: none !important; }
.tooth.has { background: rgba(43,166,158,.10); border-radius: 11px; }
.tooth.has:hover { background: rgba(43,166,158,.16); }

/* ============================================================
   ODONTOGRAM v3 — yüzey bazlı (clinio tarzı) + işlem paleti
   ============================================================ */
.odo-title small { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-left: 6px; }
.seg-group { display: inline-flex; align-items: center; gap: 8px; }
.seg-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.rec-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.rec-seg button { border: none; background: transparent; padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.rec-seg button.on { background: var(--brand-grad); color: #fff; }

/* işlem paleti */
.tool-palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.tool {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: #fff; border-radius: 10px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: border-color .14s, box-shadow .14s, transform .1s;
}
.tool:hover { transform: translateY(-1px); border-color: var(--tc); }
.tool.on { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); color: var(--ink); }
.tool .tool-sw { width: 13px; height: 13px; border-radius: 4px; background: var(--tc); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tool small { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* diş hücresi (anatomik diş + dairesel yüzey haritası) */
.tcell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 2px; border-radius: 12px; cursor: default;
  transform: translateY(var(--aty, 0)) rotate(var(--arot, 0));
  transition: background .12s, box-shadow .12s;
}
.tcell.sel { background: rgba(43,166,158,.10); box-shadow: inset 0 0 0 2px var(--accent); }
.tcell .tnum { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.tcell.has .tnum { color: var(--brand-ink); }
.tcell .tcrown { position: relative; line-height: 0; cursor: pointer; display: inline-block; transition: transform .14s var(--ease), filter .14s; }
.tcell .tcrown:hover { transform: translateY(-2px) scale(1.06); filter: drop-shadow(0 5px 9px rgba(15,25,45,.20)); }
.tcell .tcrown .tsvg { width: 40px; height: 76px; }
.tcell .tcount { position: absolute; top: -3px; right: -3px; background: var(--brand-ink); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(15,25,45,.3); }

/* Diş adı tooltip'i — hover'da FDI no + konum + diş adı */
.tcell::after {
  content: attr(data-tip);
  position: absolute; left: 50%; translate: -50% 0; z-index: 40;
  background: var(--brand-ink); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(15,25,45,.35);
  opacity: 0; pointer-events: none; transition: opacity .14s var(--ease), translate .14s var(--ease);
}
.tcell.tc-up::after { top: -30px; }
.tcell.tc-low::after { bottom: -30px; }
.tcell:hover::after { opacity: 1; }
.tcell.tc-up:hover::after { translate: -50% -3px; }
.tcell.tc-low:hover::after { translate: -50% 3px; }
@media (pointer: coarse) { .tcell::after { display: none; } } /* dokunmatikte tooltip yerine seçim detayı var */

.surfgrid { display: block; }
.surfgrid .sz { cursor: pointer; transition: opacity .1s, filter .1s; }
.surfgrid .sz:hover { opacity: .6; filter: brightness(.92); }

.lg-sw { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

@media (max-width: 640px) {
  /* mobil: küçültme YOK — şema yatay kaydırılır (.odonto overflow-x) */
  .odonto { padding: 18px 10px 16px; }
}

/* ============================================================
   UYGULAMA KABUĞU v4 — clineo.app (koyu yan menü + üst bar)
   ============================================================ */
.layout { grid-template-columns: 250px 1fr; }
#app-view.nav-collapsed { grid-template-columns: 0 1fr; }
#app-view.nav-collapsed .sidebar { display: none; }

/* --- Koyu yan menü (logo laciverti) --- */
.sidebar {
  background: var(--navy-grad) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border-right: 1px solid rgba(255,255,255,.06);
  color: #cfe0f5; padding: 18px 14px; gap: 4px;
}
.sidebar .brand { padding: 6px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand-name .wm-a { color: #fff; }
.sidebar .brand-name .wm-b { background: linear-gradient(100deg, #55b893 0%, #3fc0c9 45%, #5cb4de 100%); -webkit-background-clip: text; background-clip: text; }
.sidebar .brand .logo-mark { filter: drop-shadow(0 3px 10px rgba(92,180,222,.35)) brightness(1.12); }
.sidebar .brand-name .dot-app, .auth-card .dot-app { color: #5cb4de; -webkit-text-fill-color: #5cb4de; }
.sidebar .brand-name small { color: rgba(255,255,255,.5); }
.nav-sec { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.38); padding: 14px 12px 6px; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: transparent; color: rgba(255,255,255,.78);
  font-size: 14px; font-weight: 600; border-radius: 10px; cursor: pointer;
  position: relative; transition: background .14s, color .14s;
}
.nav button .ic { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: linear-gradient(90deg, rgba(43,166,158,.22), rgba(92,180,222,.14)); color: #fff; }
.nav button.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #55b893, #1f7cb6); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.side-logout { width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #e6f3ee; border-radius: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .14s; }
.side-logout:hover { background: rgba(255,255,255,.1); }
.side-credit { font-size: 10.5px; color: rgba(255,255,255,.35); text-align: center; margin-top: 10px; }

/* --- İçerik + üst bar --- */
.content { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 62px; padding: 0 22px; background: #ffffff;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.tb-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; color: var(--ink-2); display: grid; place-items: center; position: relative; transition: background .14s, border-color .14s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.icon-btn.bell .nd { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }
.tb-search { position: relative; display: flex; align-items: center; }
.tb-search .ic { position: absolute; left: 11px; color: var(--muted); font-size: 15px; }
.tb-search input { width: 230px; padding: 9px 12px 9px 32px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; }
.tb-search input:focus { background: #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 12px; cursor: pointer; transition: background .14s; }
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; font-family: var(--font-head); }
.user-chip .who-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.user-chip .who-role { font-size: 11.5px; color: var(--muted); line-height: 1.15; }
.user-chip .uc-caret { color: var(--muted); font-size: 11px; }

/* aurora'yı kabuğun altında tut (içerik beyaz zaten) */
.content .main { background: transparent; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  /* Kenar çubuğu: dışarı kayan çekmece (display:none yerine translateX → animasyonlu) */
  #app-view .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 84vw; max-width: 300px; z-index: 90;
    flex-direction: column; align-items: stretch;
    overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
    box-shadow: var(--sh-lg);
    transform: translateX(-100%); transition: transform .26s var(--ease);
    padding-top: calc(20px + var(--sat)); padding-bottom: calc(20px + var(--sab));
    padding-left: calc(14px + var(--sal));
  }
  #app-view.nav-open .sidebar { transform: translateX(0); }
  .user-chip .uc-text, .user-chip .uc-caret, .tb-search { display: none; }
  .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 89; }
}
.nav-backdrop[hidden] { display: none !important; }

/* perf: üst bar opak (capture/perf) */
.topbar { background: #ffffff !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* ============================================================
   HASTA KARTI v1 — clineo.app referans tasarımı
   ============================================================ */
.pcard { animation: fadeUp .35s var(--ease) both; }
.pcard-back { margin-bottom: 8px; color: var(--muted); font-size: 13px; }

/* ---------- Hero başlık ---------- */
.pcard-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1f7cb6 0%, #17335f 58%, #0f2244 100%);
  border-radius: var(--r-lg); padding: 28px 32px; color: #fff;
  position: relative; overflow: hidden;
}
.pcard-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 30%, rgba(133,183,235,.25) 0%, transparent 55%);
  pointer-events: none;
}
.pcard-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; font-family: var(--font-head);
  flex-shrink: 0; position: relative; z-index: 1;
}
.pcard-info { flex: 1; min-width: 200px; position: relative; z-index: 1; }
.pcard-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; line-height: 1.2; }
.pcard-name .badge { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.pcard-meta { font-size: 13px; opacity: .85; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.pcard-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pbadge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.22); color: #fff; backdrop-filter: none;
}
.pbadge.alert { background: rgba(211,69,69,.5); }
.pbadge.ins { background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.35); }

.pcard-actions {
  display: flex; flex-direction: column; gap: 8px;
  position: relative; z-index: 1; flex-shrink: 0;
}
.pcard-btn {
  padding: 8px 18px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  white-space: nowrap; text-align: center;
}
.pcard-btn.primary { background: #fff; color: #0a5544; }
.pcard-btn.primary:hover { background: #e3f3ee; }
.pcard-btn.outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.pcard-btn.outline:hover { background: rgba(255,255,255,.12); }
.pcard-btn.danger-o { background: transparent; color: #ffb4b4; border: 1.5px solid rgba(255,180,180,.4); font-size: 12px; }
.pcard-btn.danger-o:hover { background: rgba(211,69,69,.2); }

/* ---------- Stat kartları ---------- */
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.pstat {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh-sm);
}
.pstat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
}
.pstat-icon.active { background: #e6f0f7; color: var(--info); }
.pstat-icon.money { background: #fef2e3; color: #c07a00; }
.pstat-icon.clock { background: #f3f0fe; color: var(--ai); }
.pstat-body { display: flex; flex-direction: column; }
.pstat-body b { font-size: 1.35rem; font-family: var(--font-head); font-weight: 700; color: var(--ink); line-height: 1.1; }
.pstat-body span { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pstat-tag { font-size: 11px; color: var(--info); font-weight: 600; margin-top: 2px; }

/* ---------- Sekmeler (hasta kartı — mevcut .tabs'i genişlet) ---------- */
.pcard .tabs { margin-bottom: 0; border-bottom: 2px solid var(--line); padding: 0; }
.pcard .tabs button {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  background: none; border: none; color: var(--muted);
  cursor: pointer; position: relative;
}
.pcard .tabs button.active { color: var(--brand); font-weight: 600; }
.pcard .tabs button.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2.5px; background: var(--brand); border-radius: 2px 2px 0 0;
}

/* ---------- Genel Bilgiler — alan ızgarası ---------- */
.info-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-top: 16px; }
.info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.info-head h4 { font-size: 15px; font-weight: 600; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.info-field {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.info-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.info-field div { font-size: 14px; font-weight: 500; color: var(--ink); word-break: break-word; }
.info-field .reveal-row { display: flex; align-items: center; gap: 8px; }

.kvkk-note { margin-top: 16px; font-size: 12px; color: var(--muted); padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-sm); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .pstats { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .pcard-hero { flex-direction: column; text-align: center; padding: 20px; }
  .pcard-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pcard-meta { justify-content: center; }
  .pcard-badges { justify-content: center; }
}
@media (max-width: 500px) {
  .pstats { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ---------- Anamnez ---------- */
.anam-alert {
  display: flex; align-items: center; gap: 14px;
  background: #fef3cd; border-left: 4px solid #f59e0b;
  border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 8px;
}
.anam-alert-num {
  width: 40px; height: 40px; border-radius: 10px;
  background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; font-family: var(--font-head); flex-shrink: 0;
}
.anam-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.anam-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.anam-label { font-size: 13.5px; font-weight: 500; }
/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-left: 8px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #cdd6d2;
  border-radius: 24px; transition: .2s;
}
.slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .slider { background: #ef4444; }
.toggle input:checked + .slider::before { transform: translateX(20px); }
.toggle input:disabled + .slider { opacity: .5; cursor: default; }

/* İlaçlar */
.meds-wrap { display: flex; flex-direction: column; gap: 10px; }
.meds-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.med-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid rgba(43,166,158,.25);
  border-radius: 16px; padding: 5px 12px; font-size: 13px; font-weight: 500;
}
.med-del { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--muted); padding: 0 0 0 2px; }
.med-del:hover { color: var(--danger); }
.med-add { display: flex; gap: 8px; align-items: center; }
.med-add input { flex: 1; max-width: 220px; }
@media (max-width: 820px) { .anam-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .anam-grid { grid-template-columns: 1fr; } }

/* ---------- Tedavi Timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--brand-soft);
}
.tl-item { position: relative; margin-bottom: 16px; }
.tl-dot {
  position: absolute; left: -28px; top: 8px; width: 16px; height: 16px;
  border-radius: 50%; border: 2.5px solid var(--line-2); background: #fff; z-index: 1;
}
.tl-dot.done { border-color: var(--brand); background: var(--brand); }
.tl-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.tl-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px; position: relative;
}
.tl-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tl-color { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.tl-price {
  position: absolute; right: 16px; top: 14px;
  font-size: 15px; font-weight: 700; font-family: var(--font-head); color: var(--brand);
}

/* ---------- Randevu Kartları ---------- */
.rappt-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 10px;
}
.rappt-date {
  display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
  min-width: 42px;
}
.rappt-date b { font-size: 22px; font-family: var(--font-head); font-weight: 700; line-height: 1; color: var(--ink); }
.rappt-date span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.rappt-body { flex: 1; }
.rappt-body b { font-size: 14px; }

/* ---------- Belgeler ---------- */
.docs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.doc-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden; position: relative;
}
.doc-thumb {
  width: 100%; height: 100px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2ba69e, #1f7cb6); font-size: 32px;
}
.doc-thumb.upload-icon {
  background: none; border: 2px dashed var(--line-2); color: var(--muted); font-size: 24px;
  height: 100px;
}
.doc-info { padding: 10px 12px; }
.doc-info b { font-size: 13px; display: block; }
.doc-upload { cursor: pointer; border-style: dashed; }
.doc-upload:hover { border-color: var(--brand); }
.doc-del { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.85) !important; border-radius: 50%; width: 24px; height: 24px; padding: 0; font-size: 14px; }
@media (max-width: 820px) { .docs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .docs-grid { grid-template-columns: 1fr; } }

/* ---------- Notlar ---------- */
.note-add { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.note-add textarea { flex: 1; min-height: 60px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; }
.note-add .btn { align-self: flex-start; margin-top: 0; }
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note-card {
  background: var(--surface-2); border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 14px 16px;
}
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.note-body { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.note-del { margin-left: 4px; }

/* ================= FİNANS & FATURALANDIRMA ================= */
.fin-period select { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; background: var(--surface); }

/* Pano — KPI kartları */
.fin-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.fin-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--sh-sm); display: flex; flex-direction: column; gap: 6px;
  border-left: 4px solid var(--line-2);
}
.fin-kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.fin-kpi b { font-size: 23px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-kpi.income { border-left-color: var(--t-done); }
.fin-kpi.income b { color: var(--t-done); }
.fin-kpi.inv { border-left-color: var(--info); }
.fin-kpi.due { border-left-color: var(--danger); }
.fin-kpi.due b { color: var(--danger); }
.fin-kpi.exp { border-left-color: var(--warn); }
.fin-kpi.net-pos { border-left-color: var(--brand); }
.fin-kpi.net-pos b { color: var(--brand-ink); }
.fin-kpi.net-neg { border-left-color: var(--danger); }
.fin-kpi.net-neg b { color: var(--danger); }

.fin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .fin-cols { grid-template-columns: 1fr; } }

/* Basit bar grafik */
.bars { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 10px; }
.bar-lbl { font-size: 13px; color: var(--ink-2); }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--t-done); border-radius: 999px; }
.bar-fill.exp { background: var(--warn); }
.bar-val { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Yaşlandırma */
.aging-buckets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 20px 4px; }
.aging-b { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; text-align: center; }
.aging-b span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.aging-b b { font-size: 16px; font-variant-numeric: tabular-nums; }
.aging-table { margin-top: 8px; }
.aging-table tr { cursor: pointer; }

/* Fatura & gider tabloları */
.inv-table td, .inv-table th { padding: 11px 18px; }
.inv-table b { font-variant-numeric: tabular-nums; }

/* Gider ekleme formu */
.exp-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.exp-form input, .exp-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; background: var(--surface); }
.exp-form input[type=number] { width: 120px; }

/* Hasta kartı — fatura / taksit listeleri */
.inv-list, .pay-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.inv-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.inv-row .inv-total b { font-variant-numeric: tabular-nums; }
.plan-card { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.plan-head { padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.inst-list { display: flex; flex-direction: column; }
.inst-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.inst-row:last-child { border-bottom: none; }
.inst-row.paid { opacity: .72; }
.inst-row b { font-variant-numeric: tabular-nums; }

/* Fatura / plan formu (çekmecede) */
.inv-form { display: flex; flex-direction: column; gap: 12px; }
.inv-pick { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.inv-pick-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.inv-pick-row b { font-variant-numeric: tabular-nums; }
.inv-form-row { display: flex; align-items: center; gap: 12px; }
.inv-form-row label { min-width: 120px; font-size: 13px; color: var(--ink-2); }
.inv-form-row input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; flex: 1; }
.inv-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ================= SAATLİK AJANDA (hekim kolonlu) ================= */
.view-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.view-seg button { border: none; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.view-seg button.on { background: var(--brand); color: #fff; }

.agenda-wrap { overflow-x: auto; padding: 4px; }
.agenda { display: grid; min-width: 520px; position: relative; }
.ag-corner { position: sticky; left: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.ag-head {
  grid-row: 1; display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); border-top: 3px solid var(--line-2);
  position: sticky; top: 0; z-index: 2;
}
.ag-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; font-family: var(--font-head); }
.ag-h-txt { min-width: 0; display: flex; flex-direction: column; }
.ag-doc { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-spec { font-size: 10.5px; font-weight: 700; margin-top: 1px; letter-spacing: .02em; }
.ag-cnt { margin-left: auto; flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); font-size: 11px; font-weight: 800; }
.ag-time { grid-column: 1; font-size: 11px; color: var(--muted); padding: 2px 8px 0 0; text-align: right; font-variant-numeric: tabular-nums; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 600; }
.ag-cell { border-top: 1px solid var(--surface-2); border-left: 1px solid var(--line); }
.ag-cell.hour { border-top: 1px solid var(--line); }
.ag-block {
  position: relative; z-index: 1; margin: 2px 5px; border-radius: 11px; border-left: 4px solid var(--brand);
  padding: 6px 10px; cursor: pointer; overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,25,45,.08), 0 4px 12px rgba(15,25,45,.05);
  background-image: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
  transition: transform .13s var(--ease), box-shadow .16s;
}
.ag-block:hover { transform: translateY(-2px) scale(1.012); box-shadow: 0 8px 24px rgba(15,25,45,.16); z-index: 4; }
.ag-block.st-completed { opacity: .72; }
.ag-block.st-cancelled, .ag-block.st-no_show { opacity: .45; text-decoration: line-through; }
.ag-b-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.ag-b-time { font-size: 11.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ag-b-st { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.65); box-shadow: inset 0 0 0 1px rgba(15,25,45,.08); color: var(--ink-2); white-space: nowrap; }
.ag-b-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.ag-b-reason { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Şimdi çizgisi — bugünün ajandasında geçerli saat */
.ag-now { position: absolute; left: 58px; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 3; pointer-events: none; box-shadow: 0 1px 6px rgba(43,166,158,.4); }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(43,166,158,.25); }
.ag-now-t { position: absolute; left: -56px; top: -9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }

.aq-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Dashboard yeni layout ---- */
.dash-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card {
  background: #fff; border-radius: 16px; padding: 18px 18px 14px;
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 1px solid var(--line);
  animation: fadeUp .3s var(--ease) both;
}
.kpi-card.kpi-link { cursor: pointer; transition: transform .12s, box-shadow .15s; }
.kpi-card.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.kpi-icon { font-size: 24px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.kpi-val { font-size: 28px; font-weight: 800; font-family: var(--font-head); letter-spacing: -.03em; line-height: 1; }
.kpi-label { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi-blue .kpi-val  { color: #1f7cb6; }
.kpi-green .kpi-val { color: #0e8a5f; }
.kpi-teal .kpi-val  { color: #0891b2; }
.kpi-purple .kpi-val{ color: #7c3aed; }
.kpi-emerald .kpi-val{color: #059669; }
.kpi-amber .kpi-val { color: #d97706; }
.kpi-red .kpi-val   { color: #dc2626; }
.kpi-gray .kpi-val  { color: var(--muted); }

.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.dash-live, .dash-quick { min-height: 160px; }

.live-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.live-row:last-child { border-bottom: none; }
.live-row:hover { background: var(--surface-2); border-radius: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.live-info { flex: 1; min-width: 0; }
.live-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.live-meta { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.live-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-sm { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 0; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); font-size: 12px; font-weight: 700; color: var(--ink);
  cursor: pointer; transition: all .13s var(--ease);
}
.quick-btn:hover { border-color: var(--brand); background: rgba(24,95,165,.06); color: var(--brand); transform: translateY(-1px); }
.quick-btn > :first-child { font-size: 20px; }
.qc-blue:hover   { border-color: #1f7cb6; background: rgba(31,124,182,.07);  color: #1f7cb6; }
.qc-teal:hover   { border-color: #0891b2; background: rgba(8,145,178,.07);  color: #0891b2; }
.qc-indigo:hover { border-color: #4f46e5; background: rgba(79,70,229,.07);  color: #4f46e5; }
.qc-purple:hover { border-color: #7c3aed; background: rgba(124,58,237,.07); color: #7c3aed; }
.qc-emerald:hover{ border-color: #059669; background: rgba(5,150,105,.07);  color: #059669; }
.qc-amber:hover  { border-color: #d97706; background: rgba(217,119,6,.07);  color: #d97706; }
.qc-rose:hover   { border-color: #e11d48; background: rgba(225,29,72,.07);  color: #e11d48; }

@media (max-width: 820px) {
  .dash-row { grid-template-columns: 1fr; }
  .dash-kpi { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= PAKETLER & FİYATLANDIRMA ================= */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); }
.plan-col.featured { border: 2px solid var(--brand); box-shadow: var(--sh-brand); }
.plan-col.current { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-top { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); position: relative; }
.plan-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 10px; }
.plan-tag.cur { background: var(--accent-soft); color: #04342c; }
.plan-top h3 { font-size: 21px; }
.plan-sub { color: var(--muted); font-size: 13px; margin: 4px 0 14px; min-height: 34px; }
.plan-price { font-size: 16px; font-weight: 700; color: var(--ink); }
.plan-price span { font-size: 30px; letter-spacing: -.02em; }
.plan-price small { color: var(--muted); font-weight: 600; font-size: 13px; }
.plan-cta { width: 100%; margin-top: 16px; }
.plan-feats { list-style: none; margin: 0; padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 9px; }
.plan-feats li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.plan-feats li .pf-ic { color: var(--brand); font-weight: 800; flex: none; }
.plan-feats li.soon { color: var(--muted); }
.plan-feats li.soon .pf-ic { color: var(--line-2); }
.soon-tag { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.plan-note { color: var(--muted); font-size: 12.5px; margin-top: 16px; }

/* ================= BİLDİRİMLER / HATIRLATMA ================= */
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chk-row { display: flex !important; align-items: center; gap: 9px; margin: 12px 0; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chk-row input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-row { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; background: var(--surface-2); }
.notif-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notif-body { margin-top: 7px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

/* ================= ONAM FORMLARI ================= */
.consent-add { display: flex; gap: 8px; margin-bottom: 14px; }
.consent-add select { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13.5px; background: var(--surface); }
.consent-list { display: flex; flex-direction: column; gap: 10px; }
.consent-row { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }
.consent-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.consent-sig { display: block; max-height: 70px; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.consent-sig.big { max-height: 150px; }
.consent-doc { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; max-height: 240px; overflow-y: auto; }
.sign-wrap { margin: 14px 0 10px; }
#sign-pad { width: 100%; height: 180px; background: #fff; border: 2px dashed var(--line-2); border-radius: var(--r-sm); touch-action: none; cursor: crosshair; }
.sign-actions { display: flex; justify-content: space-between; gap: 10px; }

/* ================= AYARLAR / BİLGİ TABANI / EĞİTİM ================= */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.set-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.set-field select, .set-field input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: var(--surface); }
.set-field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.inv-act { white-space: nowrap; }

.kb-item { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; background: var(--surface-2); }
.kb-item summary { padding: 12px 14px; cursor: pointer; list-style: none; }
.kb-item summary::-webkit-details-marker { display: none; }
.kb-item[open] summary { border-bottom: 1px solid var(--line); }
.kb-body { padding: 14px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }

.edu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.edu-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.edu-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.edu-ic { font-size: 20px; }
.edu-card a { align-self: flex-start; }

/* ================= STOK / LAB / SEGMENT ================= */
.stock-low { color: var(--danger); }
.lab-list { display: flex; flex-direction: column; gap: 10px; }
.lab-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }
.lab-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }
.lab-side select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: var(--surface); }
.lab-f.on { background: var(--brand); color: #fff; }

.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.seg-card { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: var(--surface); box-shadow: var(--sh-sm); cursor: pointer; transition: transform .12s var(--ease), box-shadow .15s; }
.seg-card:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--brand); }
.seg-count { font-size: 30px; font-weight: 800; color: var(--brand-ink); letter-spacing: -.02em; }
.seg-label { font-weight: 700; margin-top: 2px; }

/* ---------- Dijital formlar ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.form-card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); box-shadow: var(--sh-sm); display: flex; flex-direction: column; gap: 8px; }
.form-card:hover { box-shadow: var(--sh); border-color: var(--brand); }
.form-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.form-card-top h4 { margin: 0; font-size: 15.5px; }
.form-meta { font-size: 12.5px; color: var(--muted); }
.form-card .inv-act { margin-top: auto; padding-top: 4px; }
/* Form oluşturucu (modal içi alan satırları) */
.fb-fields-head { display: flex; justify-content: space-between; align-items: center; }
#fb-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.fb-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); }
.fb-row-main { display: flex; gap: 8px; align-items: center; }
.fb-row-main .fb-label { flex: 1; }
.fb-row-main .fb-type { flex: none; width: 130px; }
.fb-req { display: flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; color: var(--muted); margin: 0; }
.fb-req input { width: auto; margin: 0; }
.fb-del { flex: none; }
.fb-opts { margin-top: 8px; font-size: 13px; }
.fr-ans { padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; min-height: 18px; }
.opt { display: block; margin: 4px 0; font-weight: 400; }
.opt input { width: auto; margin-right: 6px; }

/* KPI kartı (doğrulama/itibar — fin-kpi span/b yerine k-* sınıfları) */
.fin-kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.fin-kpi .k-val { font-size: 23px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-kpi .k-sub { font-size: 11.5px; color: var(--muted); }
.fin-kpi.promoter { border-left-color: var(--t-done, #16a081); }
.fin-kpi.promoter .k-val { color: var(--t-done, #16a081); }
.fin-kpi.detractor { border-left-color: var(--danger); }
.fin-kpi.detractor .k-val { color: var(--danger); }

/* Anket sonuç kartı */
.sv-ans { font-size: 13.5px; margin: 3px 0; }
.sv-q { color: var(--muted); font-weight: 600; }
/* İtibar hunisi */
.rep-funnel { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.rep-tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Üst bantlar (platform duyuru + impersonation) */
#app-banners { display:flex; flex-direction:column; }
.app-banner { position:relative; padding:10px 40px 10px 16px; font-size:13.5px; line-height:1.45; border-bottom:1px solid var(--line); background:var(--brand-soft); color:var(--ink); }
.app-banner.warn { background:#fff4e0; color:#7a5200; }
.app-banner.success { background:#e3f6ec; color:#0f7a4f; }
.app-banner.imp { background:#fde9c8; color:#7a4a00; font-weight:500; }
.app-banner .ab-x { position:absolute; right:10px; top:50%; transform:translateY(-50%); background:rgba(0,0,0,.08); border:0; border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; color:inherit; font-weight:600; }
.app-banner .ab-x:hover { background:rgba(0,0,0,.16); }

/* Prim kuralları (modal) */
.cm-cfg-list { display: flex; flex-direction: column; gap: 8px; }
.cm-cfg-row { display: grid; grid-template-columns: 1.4fr 1.1fr 70px 90px; gap: 8px; align-items: center; }
.cm-cfg-name { font-weight: 600; font-size: 14px; }
.cm-cfg-row input, .cm-cfg-row select { font-size: 13px; }

/* Fırsat raporları kart toplamı */
.opp-total { font-weight: 800; color: var(--accent, #2ba69e); font-size: 16px; margin: 2px 0; }
.opp-card .seg-count { color: var(--brand-ink); }

/* PWA yükle butonu */
.pwa-install { position: fixed; left: 18px; bottom: 18px; z-index: 70; padding: 11px 16px; border-radius: 999px;
  background: var(--brand); color: #fff; border: none; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: var(--sh-brand); }
.pwa-install:hover { filter: brightness(1.05); }

/* ============================================================
   MOBİL SAĞLAMLAŞTIRMA (v-mobile) — iOS/Android tek yetkili blok
   Bu blok dosyanın SONUNDA → aynı özgüllükte son söz haktır.
   Kapsam: güvenli alan, dokunma hedefi, tablo/sekme kaydırma,
   iOS input zoom, z-index katmanı, form daraltma, diş şeması.
   ============================================================ */

/* --- Katman sırası (mobilde menü çekmecesi Neo'nun ÜSTÜNDE olmalı) --- */
.overlay { z-index: 100; }              /* modal/çekmece her şeyin üstünde */
.toast   { z-index: 120; bottom: calc(26px + var(--sab)); }
.neo-fab   { z-index: 60; bottom: calc(26px + var(--sab)); right: calc(26px + var(--sar)); }
.neo-panel { z-index: 61; max-height: calc(100dvh - 140px); }
.pwa-install { bottom: calc(18px + var(--sab)); left: calc(18px + var(--sal)); }

/* --- Üst bar: iPhone çentiği/Dynamic Island altına girmesin --- */
.topbar {
  padding-top: var(--sat);
  padding-left: calc(22px + var(--sal)); padding-right: calc(22px + var(--sar));
  height: calc(62px + var(--sat));
}

/* --- Momentum (ataletli) kaydırma --- */
.agenda-wrap, .drawer-body, .neo-body, .inv-pick, .consent-doc,
.modal { -webkit-overflow-scrolling: touch; }

/* --- Hamburger yalnızca mobilde --- */
#menu-toggle { display: none; }

@media (max-width: 820px) {
  /* Hamburger görünür */
  #menu-toggle { display: grid; }

  /* iOS odak-zoom'unu engelle: tüm form alanları ≥16px */
  input, select, textarea,
  .tb-search input, .fin-period select,
  .exp-form input, .exp-form select,
  .lab-side select, .cm-cfg-row input, .cm-cfg-row select,
  .set-field { font-size: 16px; }

  /* Menü açıkken Neo (çekmecenin kardeşi #neo-root) üstte yüzmesin */
  #app-view.nav-open ~ #neo-root { display: none; }
  .neo-fab   { bottom: calc(16px + var(--sab)); right: calc(16px + var(--sar)); }
  .neo-panel { right: 12px; left: 12px; width: auto; bottom: calc(84px + var(--sab));
               top: calc(var(--sat) + 12px); height: auto; }

  /* Performans/jank: tam-ekran aurora boya katmanlarını telefonda kapat */
  body::before, body::after { display: none !important; }

  /* TABLOLAR yana taşıp sayfayı kırmasın → kendi içinde kaydır */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #ptable, #fin-body, #stock-host, #utable, #vf-host, #rc-host,
  #lab-host, #bk-host, #cm-host, #ak-host, #wh-host {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  thead th, tbody td { white-space: nowrap; padding: 11px 13px; }

  /* SEKME barları kaydırılabilir (8 sekme taşmasın) — margin main padding'iyle eşleşsin (taşma yok) */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar { height: 0; }

  /* Panel içi arama tam genişlik */
  .search input { width: 100%; }

  /* Diş şeması: dar ekranda taşmak yerine kaydır */
  .odonto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* --- Dokunma hedefleri ≥44px (iOS HIG) / dokunmatik cihazlar --- */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .x { min-width: 44px; min-height: 44px; padding: 0; display: inline-grid; place-items: center; }
  .neo-mic { width: 46px; height: 46px; }
  .tabs button, .pcard .tabs button { padding-top: 14px; padding-bottom: 14px; }
  .nav button { padding-top: 13px; padding-bottom: 13px; }
  .view-seg button, .mode-seg button, .rec-seg button, .set-seg button,
  .neo-chip, .tool { min-height: 44px; }
  /* dokunmada hover-zıplamasını kapat, basılı geri-bildirim ekle */
  .card:hover, .kpi-card.kpi-link:hover, .quick-btn:hover,
  .seg-card:hover { transform: none; }
  tbody tr:active, .live-row:active, .quick-btn:active,
  .kpi-card.kpi-link:active { background: var(--surface-2); }
  .btn:active, .neo-chip:active, .tool:active { filter: brightness(.96); }
}

/* --- Çok dar ekranda çok-kolonlu form/grid'leri tek/çift kolona indir --- */
@media (max-width: 560px) {
  .form-row, .pay-form, .td-add, .cm-cfg-row, .inv-form-row,
  .ai-suggest .sg-grid { grid-template-columns: 1fr; }
  .aging-buckets { grid-template-columns: 1fr 1fr; }
  .exp-form { flex-direction: column; align-items: stretch; }
  .exp-form input, .exp-form select, .exp-form input[type=number] { width: 100%; }
}
@media (max-width: 400px) {
  .dash-kpi, .fin-cards { grid-template-columns: 1fr; }
  .kpi-val, .stat-value, .seg-count { font-size: 22px; overflow-wrap: anywhere; }
}

/* ============================================================
   PANEL PREMIUM (v-premium) — bento · glassmorphism · efektler
   ============================================================ */
.dsh { display: flex; flex-direction: column; gap: 20px; }
.dsh > * { animation: dshUp .5s var(--ease) backwards; }
.dsh-kpis { animation-delay: .06s; }
.dsh-bento { animation-delay: .12s; }
@keyframes dshUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- HERO ---------- */
.dsh-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 30px; color: #fff;
  background: linear-gradient(118deg, #12294e 0%, #1c6fa8 52%, #2ba69e 100%);
  box-shadow: 0 20px 44px -20px rgba(12,68,124,.6);
}
.dsh-hero-glow {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(520px 240px at 86% -30%, rgba(29,158,117,.55), transparent 60%),
    radial-gradient(440px 220px at 8% 140%, rgba(109,92,240,.5), transparent 60%);
}
.dsh-hero::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 38%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.16), transparent);
  transform: skewX(-18deg); animation: dshSheen 7s ease 1.4s infinite;
}
@keyframes dshSheen { 0% { left: -60%; } 55%, 100% { left: 135%; } }
.dsh-hero-in { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dsh-greet { font-family: var(--font-head); font-weight: 800; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.dsh-grad { background: linear-gradient(90deg, #a7e8d0, #d4e8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dsh-wave { display: inline-block; transform-origin: 70% 70%; animation: dshWave 2.8s ease infinite; }
@keyframes dshWave { 0%,62%,100% { transform: rotate(0); } 10% { transform: rotate(16deg); } 22% { transform: rotate(-8deg); } 32% { transform: rotate(14deg); } 42% { transform: rotate(-4deg); } }
.dsh-hsub { margin-top: 7px; font-size: 13.5px; color: rgba(255,255,255,.82); font-weight: 500; }
.dsh-pulse { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.dsh-chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.92); }
.dsh-chip b { font-family: var(--font-head); font-weight: 800; color: #fff; margin-right: 3px; }
.dsh-cta {
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px; border: none; cursor: pointer;
  background: rgba(255,255,255,.97); color: var(--brand-2); font-weight: 800; font-size: 14.5px; border-radius: 14px;
  font-family: var(--font-head); box-shadow: 0 12px 26px -10px rgba(0,0,0,.45); transition: transform .14s var(--ease), box-shadow .2s;
}
.dsh-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(0,0,0,.55); }
.dsh-cta-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; }

/* ---------- Glass yüzey ---------- */
.dsh-glass {
  background: rgba(255,255,255,.72); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,.68); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(13,30,25,.04), 0 24px 46px -30px rgba(12,68,124,.4);
}

/* ---------- KPI ---------- */
.dsh-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dsh-kpi {
  position: relative; overflow: hidden; padding: 18px 18px 20px; border-radius: 18px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 1px 2px rgba(13,30,25,.05), 0 22px 42px -32px rgba(12,68,124,.55);
  animation: dshUp .5s var(--ease) backwards; animation-delay: var(--d, 0ms);
  transition: transform .16s var(--ease), box-shadow .22s;
}
.dsh-kpi.is-link { cursor: pointer; }
.dsh-kpi:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(13,30,25,.05), 0 28px 48px -26px rgba(12,68,124,.6); }
.dsh-kpi-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; background: var(--kc-soft, var(--brand-soft)); margin-bottom: 14px; }
.dsh-kpi-val { font-family: var(--font-head); font-weight: 800; font-size: 31px; letter-spacing: -.03em; line-height: 1; color: var(--kc, var(--brand)); overflow-wrap: anywhere; }
.dsh-kpi-lbl { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.dsh-kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dsh-kpi-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--kc, var(--brand)), transparent); opacity: .85; }
.dkc-blue    { --kc:#1f7cb6; --kc-soft:#e7f2f8; }
.dkc-green   { --kc:#0e8a5f; --kc-soft:#e2f6ee; }
.dkc-teal    { --kc:#0891b2; --kc-soft:#e0f5fa; }
.dkc-purple  { --kc:#7c3aed; --kc-soft:#f1e9fd; }
.dkc-emerald { --kc:#059669; --kc-soft:#e2f6ef; }
.dkc-amber   { --kc:#d97706; --kc-soft:#fdf0dd; }
.dkc-red     { --kc:#dc2626; --kc-soft:#fdeaea; }
.dkc-gray    { --kc:#6b7280; --kc-soft:#eef1f4; }

/* ---------- Bento ---------- */
.dsh-bento { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; align-items: start; }
.dsh-rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dsh-ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid rgba(13,30,25,.06); }
.dsh-ph h3 { font-size: 15px; font-family: var(--font-head); display: flex; align-items: center; gap: 8px; }
.dsh-lnk { border: none; background: transparent; color: var(--brand); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.dsh-lnk:hover { text-decoration: underline; }
.dsh-agenda { overflow: hidden; min-width: 0; }
.dsh-agenda #today-appts { padding: 6px; }

/* Günün Durumu — donut */
.dsh-status-in { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.dsh-donut { width: 116px; height: 116px; flex: none; }
.dsh-donut-bg { fill: none; stroke: rgba(13,30,25,.08); stroke-width: 11; }
.dsh-donut-fg { fill: none; stroke: url(#dshG); stroke-width: 11; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; animation: dshDonutIn 1.1s var(--ease) both; }
@keyframes dshDonutIn { from { stroke-dashoffset: 327; } }
.dsh-donut-num { font-family: var(--font-head); font-weight: 800; font-size: 25px; fill: var(--ink); text-anchor: middle; }
.dsh-donut-cap { font-size: 8px; fill: var(--muted); text-anchor: middle; letter-spacing: .12em; }
.dsh-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.dsh-lg { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.dsh-lg i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dsh-lg b { margin-left: auto; font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 15px; }

/* Klinikte Şu An */
.dsh-live #live-list { padding: 6px; }
.dsh-liverow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; cursor: pointer; transition: background .13s; }
.dsh-liverow:hover { background: rgba(24,95,165,.06); }
.dsh-ava { position: relative; width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; font-family: var(--font-head); background: linear-gradient(135deg, #2ba69e, #1f7cb6); }
.dsh-ava.chair { background: linear-gradient(135deg, #34b3e0, #1f8bd6); }
.dsh-ava-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--t-done); border: 2px solid #fff; }
.dsh-ava.chair .dsh-ava-dot { background: var(--t-progress); animation: dshPing 1.6s ease infinite; }
@keyframes dshPing { 0% { box-shadow: 0 0 0 0 rgba(31,139,214,.5); } 70% { box-shadow: 0 0 0 7px rgba(31,139,214,0); } 100% { box-shadow: 0 0 0 0 rgba(31,139,214,0); } }
.dsh-live-info { flex: 1; min-width: 0; }
.dsh-live-name { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-live-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-live-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dsh-pill { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.dsh-pill.p-chair { background: var(--info-soft); color: var(--info); }
.dsh-pill.p-wait { background: var(--brand-soft); color: var(--brand-ink); }
.dsh-live-t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dsh-livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--t-done); animation: dshPing 1.9s ease infinite; }
.dsh-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* Hızlı Aksiyonlar */
.dsh-qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.dsh-qbtn { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid rgba(13,30,25,.08); border-radius: 14px; background: rgba(255,255,255,.6); cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: left; transition: transform .13s var(--ease), border-color .15s, background .15s; }
.dsh-qbtn:hover { transform: translateY(-2px); border-color: var(--qc, var(--brand)); background: #fff; }
.dsh-qic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: var(--qc-soft, var(--brand-soft)); flex: none; }
.dqc-blue { --qc:#1f7cb6; --qc-soft:#e7f2f8; } .dqc-teal { --qc:#2ba69e; --qc-soft:#e2f4f2; }
.dqc-indigo { --qc:#4f46e5; --qc-soft:#eae8fd; } .dqc-purple { --qc:#7c3aed; --qc-soft:#f1e9fd; }
.dqc-emerald { --qc:#059669; --qc-soft:#e2f6ef; } .dqc-amber { --qc:#d97706; --qc-soft:#fdf0dd; }
.dqc-rose { --qc:#e11d48; --qc-soft:#fde7ec; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) { .dsh-bento { grid-template-columns: 1fr; } .dsh-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .dsh-glass, .dsh-kpi { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .dsh-hero { padding: 22px 20px; }
  .dsh-greet { font-size: 24px; }
}
@media (max-width: 460px) { .dsh-kpis { grid-template-columns: 1fr 1fr; } .dsh-greet { font-size: 21px; } .dsh-cta { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) {
  .dsh-hero::after, .dsh-wave, .dsh-livedot, .dsh-ava.chair .dsh-ava-dot { animation: none; }
  .dsh-donut-fg { animation: none; }
}

/* ============================================================
   PREMIUM SİSTEM — TÜM SAYFALAR (v-premium2)
   Ortak yapı taşlarını (panel/kart/tablo/başlık/rozet/randevu satırı)
   yükseltir → her sayfa tek tek yazılmadan premium olur.
   + Tabloların mobilde küçülme/çakışma sorununu kökten çözer.
   ============================================================ */
.page-head h2, .panel-head h3, .stat-value, .fin-kpi b, .fin-card b { font-family: var(--font-head); letter-spacing: -.02em; }

/* Paneller — cam yüzey + yumuşak yükseklik (aurora üstünde premium) */
.panel {
  border-radius: 20px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 1px 2px rgba(13,30,25,.04), 0 22px 44px -32px rgba(12,68,124,.35);
}
.panel-head { padding: 16px 22px; border-bottom: 1px solid rgba(13,30,25,.06); }
.card {
  border-radius: 18px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 1px 2px rgba(13,30,25,.05), 0 22px 42px -32px rgba(12,68,124,.5);
}

/* Tablolar — premium başlık + satır hover */
thead th { background: linear-gradient(180deg, #f5f9f8, #edf3f1); border-bottom: 1px solid var(--line); color: var(--ink-2); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(24,95,165,.05); }

/* Randevu satırları — premium kart görünümü */
.appt-row { margin: 6px 8px; padding: 13px 16px; border: 1px solid rgba(13,30,25,.06); border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(13,30,25,.04); transition: transform .12s var(--ease), box-shadow .15s; }
.appt-row:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(12,68,124,.28); background: #fff; }
.appt-row:last-child { border-bottom: 1px solid rgba(13,30,25,.06); }

/* Rozetler + zarif kaydırma çubuğu */
.badge { border-radius: 8px; }
.panel, .agenda-wrap, .drawer-body { scrollbar-width: thin; scrollbar-color: rgba(12,68,124,.28) transparent; }
.panel::-webkit-scrollbar, .agenda-wrap::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { height: 8px; width: 8px; }
.panel::-webkit-scrollbar-thumb, .agenda-wrap::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb { background: rgba(12,68,124,.22); border-radius: 8px; }

/* ---- MOBİL: tablolar KÜÇÜLMEZ/ÇAKIŞMAZ → doğal genişlik + kaydır ---- */
@media (max-width: 820px) {
  /* tabloyu saran her kap yatay kaydırsın */
  .panel, .inv-table, #ptable, #fin-body, #stock-host, #utable, #vf-host,
  #rc-host, #lab-host, #bk-host, #cm-host, #ak-host, #wh-host {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  /* tablo içeriğine göre genişlesin (sütunlar sıkışıp çakışmasın) */
  table { width: auto; min-width: 100%; }
  thead th, tbody td { white-space: nowrap; padding: 12px 14px; font-size: 13px; }
  /* perf: mobilde cam bulanıklığı kapat, düz beyaz */
  .panel, .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
}
