.nav-rozet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: auto;
  padding: 0 .45rem;
  border-radius: 1rem;
  background: var(--primary-soft);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* ============================================================
   NarClinic HIS — Uygulama stili
   Tasarım dili: Epic Systems ilhamı, açık tonlar, sade işlevsellik
   ============================================================ */

:root {
  --hedef-min: 24px; /* WCAG 2.2 SC 2.5.8 dokunma hedefi asgari boyutu */
  --bg: var(--bg-canvas);
  --surface: var(--bg-pure);
  --border: var(--border-light);
  --text: var(--text-primary);
  --muted: var(--text-muted-aa);
  --primary: var(--emerald-mid);
  --primary-soft: var(--emerald-soft);
  --accent: var(--emerald-mid);
  --success: var(--durum-ok);
  --warning: var(--durum-caution);
  --danger: var(--durum-critical);

  --radius: 12px;
  --shadow: 0 1px 2px rgb(15 36 25 / .06);
  --shadow-lg: 0 8px 24px rgb(15 36 25 / .10);

  --sidebar-w: 232px;
  --sidebar-w-narrow: 64px;
  --topbar-h: 60px;

  --font: var(--font-sans);

}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 600; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.surum-bandi {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  /* modal (250) ve pencere (>=1000) katmanlarının altında: eylem düğmelerini örtmez */
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 48px;
  background: var(--emerald-ink);
  color: var(--bg-pure);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}

.surum-bandi button {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--lime-accent);
  border-radius: var(--radius-md);
  background: var(--lime-accent);
  color: var(--emerald-ink);
  font: inherit;
  cursor: pointer;
}

.surum-bandi button:focus-visible {
  outline: 2px solid var(--lime-accent);
  outline-offset: 2px;
}

/* WCAG 2.4.1: odakta görünür; display:none YASAK */
.atla-baglantisi {
  position: fixed;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
  border-radius: var(--radius);
}
.atla-baglantisi:focus { left: 8px; top: 8px; z-index: 1000; }

/* ---------- Kabuk düzeni ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

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

/* ---------- Sol navigasyon ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 34px; width: auto; display: block; }
.sidebar-logo .logo-kucuk { display: none; height: 34px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  flex: 1;
}
/* Sahip kararı (2026-11-04): Kılavuz / Geri bildirim kenar çubuğunun tabanında. */
.nav-taban { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--border); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-item svg { flex: 0 0 20px; width: 20px; height: 20px; }
.nav-item .nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-bolum {
  margin: 16px 12px 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.nav-bolum-dugme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 24px);
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  font: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  padding: 12px 0 0;
}
.nav-bolum-dugme::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s;
}
.nav-bolum-dugme[aria-expanded="true"]::after { transform: rotate(-135deg); }
.nav-bolum-dugme:hover { color: var(--text, inherit); }
.nav-bolum-dugme:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-modul-liste[hidden] { display: none; }
.nav-rozet { font-size: 10px; }
.nav-yakinda { opacity: .6; cursor: not-allowed; }
.nav-moduller { min-width: 0; }
.nav-moduller .nav-item { min-height: 44px; padding: 7px 8px; gap: 6px; }
.nav-metin { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.nav-moduller .nav-label { font-size: 12px; white-space: normal; }
.nav-urun { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-moduller .nav-rozet { flex-shrink: 0; }
.nav-yakinda:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* Üst maddenin alt maddesi (örn. Geri Çağırma -> Randevular'ın altında) */
.nav-subitem {
  padding-left: 32px; font-size: 13px; font-weight: 400; color: var(--muted);
}
.nav-subitem svg { flex: 0 0 16px; width: 16px; height: 16px; }
.nav-subitem.active { color: var(--primary); }

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Üst çubuk ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.global-search {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}
.global-search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  display: flex;
  pointer-events: none;
}
.global-search-icon svg { width: 16px; height: 16px; }
#globalSearch {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
}
#globalSearch:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}
.gsr-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text);
  cursor: pointer;
}
.gsr-item:hover, .gsr-item[aria-selected="true"] { background: var(--primary-soft); text-decoration: none; }
.gsr-item .gsr-name { font-weight: 500; }
.gsr-item .gsr-meta { color: var(--muted); font-size: 12px; }
.gsr-empty { padding: 12px; color: var(--muted); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.gizlilik-dugme {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.gizlilik-dugme:hover { background: var(--bg); }
.gizlilik-dugme[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.gizlilik-dugme:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ozel-not-baslik { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ozel-not-goz { width: 32px; height: 32px; }

/* ---------- İçerik ---------- */
.content {
  padding: 24px;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; }
.page-head .page-sub { color: var(--muted); font-size: 13px; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
/* Ayarlar akordeonu (2026-10-27): bölüm paneli içindeki kartlar ikinci gölge taşımaz. */
.ayar-bolum [data-ayar-panel] > .card { box-shadow: none; margin-bottom: 12px; }
/* Ayarlar 6 ek (Faz R 2026-10-27k-ayarlar6): arama, menü + içerik, kaydet çubuğu.
   <768px menü üstte yatay şerit; >=768px solda dikey liste. */
.ayar-arama{margin-bottom:12px}
.ayar-arama .input{width:100%;max-width:420px;min-width:0}
.ayar-arama [role="status"]{margin:4px 0 0;font-size:12px}
.ayar-arama [role="status"]:empty{display:none}
.ayar-menu{margin-bottom:12px;min-width:0}
.ayar-menu [role="list"]{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0}
.ayar-icerik{min-width:0}
@media (min-width: 768px) {
  .ayar-duzen{display:grid;grid-template-columns:200px minmax(0,1fr);gap:20px;align-items:start}
  .ayar-menu{position:sticky;top:12px;margin-bottom:0}
  .ayar-menu [role="list"] { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  .ayar-menu [role="list"] .btn{width:100%;justify-content:flex-start;text-align:left}
}
.ayar-kaydet-cubugu{position:sticky;bottom:0;z-index:40;display:flex;flex-wrap:wrap;align-items:center;
  gap:8px;margin-top:16px;padding:10px 14px;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);box-shadow:var(--shadow)}
.ayar-kaydet-cubugu[hidden]{display:none}
.ayar-kaydet-metni{flex:1;min-width:0;overflow-wrap:anywhere}
.card + .card { margin-top: 16px; }

.kilavuz-arama, .kilavuz-liste, .kilavuz-kart { min-width: 0; max-width: 100%; }
.kilavuz-arama .input { width: 100%; min-width: 0; max-width: 100%; }
.kilavuz-kart { overflow-wrap: anywhere; }
.kilavuz-kart ul { padding-left: 20px; margin: 12px 0; }
.kilavuz-yer-tutucu {
  max-width: 100%;
  padding: 24px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.geri-bildirim-eylemler .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { width: 16px; height: 16px; color: var(--muted); }

/* Kart başlığı hem etiket hem açılır-kapanır (pulldown) tetikleyici olabilir
   — ör. Hastalar'daki "Son 12 Ay Muayene" (kullanıcı kararı, 2026-09-12). */
button.dropdown-toggle {
  width: 100%; border: none; background: none; padding: 0; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
}
button.dropdown-toggle:hover { color: var(--primary); }
.dropdown-ok { margin-left: auto; color: var(--muted); transition: transform .15s; }
button.dropdown-toggle[aria-expanded="true"] .dropdown-ok { transform: rotate(180deg); }

/* ---------- Stat kartları ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-grid > .acik-protokol-liste {
  grid-column: 1 / -1;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: inherit; text-decoration: none; /* <a>-tabanlı kart olabilir */
}
.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-icon.accent { background: var(--emerald-soft); color: var(--accent); }
.stat-icon.success { background: var(--durum-ok-zemin); color: var(--success); }
.stat-icon.warning { background: var(--durum-caution-zemin); color: var(--warning); }
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); white-space: pre-line; font-variant-numeric: tabular-nums; }
.stat-card > .stat-body { min-width: 0; flex: 1; }
.stat-body .kasa-kapanis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.stat-body .kasa-kapanis .btn { white-space: nowrap; }

@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
  .stat-card { min-width: 0; flex-wrap: wrap; }
  .stat-card > div { min-width: 0; max-width: 100%; flex: 1 1 0; }
  .stat-sub { overflow-wrap: anywhere; }
  .stat-card > .kasa-kapanis {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
    overflow-wrap: anywhere;
  }
  .kasa-kapanis > * { min-width: 0; max-width: 100%; }
  .kasa-kapanis .btn { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- Izgara yardımcıları ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.grid-2-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td, .data-table td,
html[data-yogunluk] table.data td, html[data-yogunluk] .data-table td {
  /* Toplam satır yüksekliği: dolgu ve çizgi bu değere dahildir (border-box). */
  box-sizing: border-box;
  height: var(--satir-yuksekligi);
  padding: var(--hucre-dolgu-y) var(--hucre-dolgu-x);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--primary-soft); }
table.data td { font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* SMS gönderim günlüğü: LOG satırı = mesaj DIŞARI ÇIKMADI (test modu vb.).
   Gerçek gönderimlerden ilk bakışta ayrılsın diye soluk + sol şeritli. */
table.data tbody tr.sms-log-satir td {
  background: var(--bg);
  color: var(--muted);
  font-style: italic;
}
table.data tbody tr.sms-log-satir td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
/* Mobil tablo -> kart (WEB-ORNEKLER 2026-10-27a-tablo; GOV.UK Table +
   govuk-table-card): aynı <table>, <=640px her satır kart, hücre "Etiket: değer"
   (etiket tablo-kart.js'in yazdığı data-etiket). >=641px tablo aynen kalır.
   Yatay taşma yok: hücre metni kırılır, sarmalayıcı kaydırmaz. */
@media (max-width: 640px) {
  .table-wrap:has(> table.tablo-kart) { overflow-x: visible; }
  table.tablo-kart, table.tablo-kart tbody { display: block; width: 100%; }
  /* Başlık hücreleri etikete dönüşür; denetim taşıyan (toplu "tümünü seç") üstte kalır. */
  table.tablo-kart thead, table.tablo-kart thead tr { display: block; }
  table.tablo-kart thead th:not(:has(input, button, select)) { display: none; }
  table.tablo-kart thead th { display: block; width: auto; border-bottom: 1px solid var(--border); }
  table.tablo-kart thead .toplu-hedef::after { content: "Tümünü seç"; margin-left: 8px; text-transform: none; }
  table.tablo-kart tbody tr {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  table.tablo-kart tbody tr:last-child { border-bottom: none; }
  html table.data.tablo-kart td, html table.tablo-kart.toplu-tablo td:nth-child(n) {
    display: block;
    height: auto;
    min-width: 0;
    padding: 0;
    border-bottom: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html table.tablo-kart td.toplu-sutun { width: auto; padding: 0 !important; }
  table.tablo-kart td[data-kart-baslik] { order: -1; font-size: 15px; }
  table.tablo-kart td[data-etiket]::before {
    content: attr(data-etiket) ": ";
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  table.tablo-kart td > * { max-width: 100%; }
}

/* ---------- Rozetler ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success { background: var(--durum-ok-zemin); color: var(--success); }
.badge-warning { background: var(--durum-caution-zemin); color: var(--warning); }
.badge-danger  { background: var(--durum-critical-zemin); color: var(--danger); }
.badge-muted   { background: var(--bg-warm-stone); color: var(--text-secondary); }
.badge-info    { background: var(--emerald-soft); color: var(--emerald-ink); }
.badge-arsiv   { background: var(--bg-warm-stone); color: var(--emerald-ink); }

/* DoktorTakvimi arşivi klinik randevulardan bilinçli olarak ayrı görünür. */
.dt-arsiv-kart { border-left: 4px solid var(--emerald-mid); margin-top: 16px; }
.dt-arsiv-tablo tbody tr { background: var(--bg-canvas); }
.dt-arsiv-filtreler { padding: 14px; background: var(--bg-warm-stone); border-radius: var(--radius); }
.btn-arsiv { border-color: var(--emerald-mid); color: var(--emerald-ink); }
.dt-arsiv-link-satiri { margin: -4px 0 16px; text-align: right; }
.dt-arsiv-link { color: var(--emerald-ink); font-size: 13px; font-weight: 600; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.btn[hidden] { display: none; }
/* hidden özelliği sınıf display'i tarafından ezilmesin (ör. .field). */
[hidden] { display: none !important; }
.btn:hover { background: var(--bg); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--emerald-ink); }
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: color-mix(in srgb, var(--durum-critical) 85%, black); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Form elemanları ---------- */
.input, select.input {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
input:is([type=date],[type=time],[type=datetime-local],[type=month],[type=week]):focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* Zorunlu alan açıklaması: form başında tek, nötr satır (WEB-ORNEKLER 2026-10-27g-zorunlu). */
.form-zorunlu-aciklama { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.alan-isaret { font-weight: 400; }
label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.field-sabit {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-etiket {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.field-deger {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: default;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
/* Dar ekran (375px telefon): alanlar satıra sığar, giriş kutuları taşmaz. */
@media (max-width: 480px) {
  .toolbar { gap: 8px; }
  .toolbar .field { flex: 1 1 130px; min-width: 0; }
  .toolbar .input { min-width: 0; max-width: 100%; }
}

/* ---------- Sayfalama ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pagination-ozet { margin: 0; }
.pagination-liste { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* WEB-ORNEKLER 2026-10-27d-sayfalama: dokunma hedefi >=44px; aktif sayfa yalnız renkle değil. */
.pagination .pagination-dugme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
}
.pagination [aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 6px;
}
.pagination [aria-disabled="true"] { color: var(--muted); opacity: .6; cursor: default; }
.pagination-bosluk { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- Sekmeler ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 9px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- Hasta storyboard düzeni ---------- */
.chart-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.chart-layout > * { min-width: 0; }
.patient-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}
.patient-card .p-name { font-size: 17px; font-weight: 700; }
.patient-card .p-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.p-field {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.p-field .k { color: var(--muted); }
.p-field .v { font-weight: 500; text-align: right; word-break: break-all; }

/* ---------- Zaman çizelgesi (epikriz) ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline-body {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 5px;
  font-size: 13px;
}
.timeline-body dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.timeline-body dt { color: var(--muted); font-weight: 500; }
.timeline-body dd { margin: 0; }

/* ---------- Klinik kart (şikayet/bulgu/...) ---------- */
.clinical-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.clinical-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.clinical-cell .c-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.clinical-cell .c-value { font-size: 13px; white-space: pre-wrap; }
.clinical-cell .c-empty { color: var(--muted); font-style: italic; }

/* ---------- Hasta belgeleri ---------- */
.belge-araclar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px;
  flex-wrap: wrap;
}
.belge-ad-input { min-width: 220px; max-width: 360px; }
.belge-ipucu { font-size: 12px; color: var(--muted); margin-top: 6px; }
.belge-dosya-input { flex: 1; min-width: 220px; }
.belge-durum { flex-basis: 100%; font-size: 13px; min-height: 18px; }
.belge-durum-ok { color: var(--success); }
.belge-durum-hata { color: var(--danger); }
.belge-bolum + .belge-bolum { margin-top: 22px; }
.belge-bolum-baslik { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.belge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.belge-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  min-width: 0;
}
.belge-onizleme { display: block; color: inherit; }
.belge-onizleme img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}
.belge-meta { display: flex; flex-direction: column; gap: 2px; padding: 9px 36px 9px 10px; font-size: 12px; }
.belge-adi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.belge-sil { position: absolute; right: 6px; bottom: 6px; color: var(--danger); padding: 5px; }
.belge-liste { display: flex; flex-direction: column; gap: 8px; }
.belge-liste-item { display: flex; align-items: center; gap: 10px; padding: 10px; }
.belge-liste-link { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.belge-liste-meta { font-size: 12px; white-space: nowrap; margin-right: 34px; }

/* ---------- Grafikler ---------- */
.chart-bar rect.bar { fill: var(--primary); }
.chart-bar rect.bar:hover { fill: var(--emerald-ink); }
.chart-axis { font-size: 10px; fill: var(--muted); }
.chart-tooltip {
  position: fixed;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

/* Yatay dağılım barları (randevu durumları) */
.hbar-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}
.hbar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
}
.hbar-fill { height: 100%; border-radius: 5px; }
.hbar-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- İş listesi ---------- */
.task-list { display: flex; flex-direction: column; }
.task-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--primary-soft); text-decoration: none; }
/* Bugün tamamlanmış (Healthy'deki gibi soluklaşıp alta sarkan) satır */
.task-item-sonuk { opacity: .55; }
.task-item-sonuk:hover { opacity: 1; }
.task-main { flex: 1 1 200px; min-width: 160px; }
.task-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-sub { font-size: 12px; color: var(--muted); }
.kabul-bagla { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Skeleton / boş / hata durumları ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-warm-stone);
  border-radius: 6px;
  min-height: 14px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .7), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.skel-row { height: 38px; margin-bottom: 6px; }
.skel-card { height: 76px; }

.empty-state, .error-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.empty-state svg, .error-state svg {
  width: 40px; height: 40px;
  margin-bottom: 10px;
  color: var(--border);
}
.error-state svg { color: var(--danger); }
.empty-state .e-title, .error-state .e-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.error-state .e-detail { white-space: pre-line; }
.error-state .btn { margin-top: 12px; }
/* bosDurumKur (bos-durum.js): boş = nötr + oluştur eylemi; hata = uyarı rengi + yeniden dene. */
.bos-durum { text-align: center; padding: 36px 20px; color: var(--muted); width: 100%; box-sizing: border-box; }
.bos-durum-ikon svg { width: 40px; height: 40px; margin-bottom: 10px; color: var(--border); }
/* Seviye yükseldi, görünüm aynı */
.gorsel-h3 { font-size: 1.17em; }
.gorsel-h4 { font-size: 1em; margin: 1.33em 0; }
.bos-durum h2 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 4px; }
.bos-durum p { margin: 0; }
.bos-durum-eylem, .bos-durum-ikincil { margin: 12px 4px 0; min-height: 44px; }
.bos-durum[data-durum=hata] .bos-durum-ikon svg { color: var(--danger); }
/* TUR 48 — "Yeniden dene" + "Sorun Bildir" yan yana, tek satır. */
.error-state-eylemler { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.error-state-eylemler .btn { margin-top: 12px; }

/* TUR 48 — Sorun bildirimleri (YONETICI ekranı). */
.sorun-bildirim-liste { display: flex; flex-direction: column; gap: 12px; }
.sorun-bildirim-satir { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sorun-bildirim-ust { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sorun-bildirim-mesaj { margin-top: 4px; white-space: pre-line; }
.sorun-bildirim-baglam { margin-top: 4px; font-size: 12px; }

/* Yetki kısıtı (403) bir ARIZA değildir: kırmızı uyarı ikonu yerine nötr
   kilit. Metin ve buton `hataDurumu()` içinde kurulur (bkz. ui.js). */
.error-state--yetki svg { color: var(--muted); }

/* Kapalı modül (TUR 41) de bir ARIZA değildir — aynı nötr ton. Metin ve
   buton `modulKapaliDurumu()` içinde kurulur (bkz. ui.js). */
.error-state--modul svg { color: var(--muted); }

/* ---------- Bilgi kartları ---------- */
.notice {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.notice-info { background: var(--emerald-soft); border-color: var(--border-strong); color: var(--emerald-ink); }
.notice-warning { background: var(--durum-caution-zemin); border-color: var(--border-strong); color: var(--warning); }
.notice-danger { background: var(--durum-critical-zemin); border-color: var(--border-strong); color: var(--danger); }

/* Kaydetme bildirim banner'ı (WEB-ORNEKLER 2026-10-27b-bildirim; GOV.UK/DWP
   notification banner): sayfa tepesinde, kalıcı; durum kelimeyle ("Başarılı"
   / "Hata"), renk tek başına anlam taşımaz. */
.bildirim-banner {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--durum-ok);
  border-radius: var(--radius);
  background: var(--durum-ok-zemin);
  margin: 0 0 16px;
  padding: 10px 14px 12px;
}
.bildirim-banner--hata { border-left-color: var(--danger); background: var(--durum-critical-zemin); }
.bildirim-banner-etiket { font-size: 13px; font-weight: 600; margin: 0 0 4px; color: var(--success); }
.bildirim-banner--hata .bildirim-banner-etiket { color: var(--danger); }
.bildirim-banner-icerik p { margin: 0; }
.bildirim-banner-metin { font-weight: 600; color: var(--text); }
.bildirim-banner-aciklama { color: var(--text); margin-top: 2px; }
.bildirim-banner-eylem { display: inline-block; margin-top: 6px; font-weight: 600; }
.bildirim-banner-eylem:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Donut açıklaması ---------- */
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 12px; }
.legend-item .l-val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* ---------- Para / sayı renkleri ---------- */
.money-pos { color: var(--success); font-weight: 600; }
.money-neg { color: var(--danger); font-weight: 600; }
/* Bedel/Ödenen/Kalan kutusu — mevcut .p-field deseninin vurgulu satırı */
.p-field.p-total { border-top-width: 2px; font-size: 14px; }
.p-field.p-total .k { color: var(--text); font-weight: 600; }
.text-muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-2, .grid-2-even { grid-template-columns: minmax(0, 1fr); }
  .chart-layout { grid-template-columns: minmax(0, 1fr); }
  .patient-card { position: static; }
  .clinical-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-w-narrow); flex-basis: var(--sidebar-w-narrow); }
  .sidebar-logo { justify-content: center; padding: 12px 8px; }
  .sidebar-logo .logo-full { display: none; }
  .sidebar-logo .logo-kucuk { display: block; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-label { display: none; }
  .sidebar-version { display: none; }
  .content { padding: 16px; }
}

/* ---------- Mobil menu dugmesi + cekmece (<768px) ---------- */
.menu-dugme { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.menu-dugme:hover { background: var(--bg); }
.menu-dugme:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 767px) {
  .menu-dugme { display: inline-flex; align-self: flex-start; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); flex-basis: var(--sidebar-w); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; z-index: 60; }
  .sidebar.acik { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
  .sidebar-logo { justify-content: flex-start; padding: 14px 16px; }
  .sidebar-logo .logo-full { display: inline-flex; }
  .sidebar-logo .logo-kucuk { display: none; }
  .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .nav-item .nav-label { display: inline; }
  .sidebar-version { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar.acik { transition: none; }
  .skeleton::after { animation: none; }
  .toast { animation: none; }
  .toast.is-gidiyor { transition: none; }
  .progress-bar { transition: none; }
  .dropdown-ok { transition: none; }
}

/* ---------- İptal edilmiş epikriz (hasta grafiği zaman çizelgesi) ---------- */
.timeline-item.is-iptal { opacity: .55; }
.timeline-item.is-iptal::before { border-color: var(--danger); }

/* ---------- İlerleme çubuğu (geri çağırma toplu çekme) ---------- */
.progress {
  height: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 5px;
  transition: width .25s ease;
}

/* ---------- Faz-3: toast bildirimleri ---------- */
.toast-kapsul {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  font-size: 13px;
  animation: toast-gel .2s ease;
}
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--accent); }
.toast .toast-icon { display: flex; margin-top: 1px; color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--accent); }
.toast.is-gidiyor { opacity: 0; transform: translateX(12px); transition: all .25s ease; }
@keyframes toast-gel {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Faz-3: modal ---------- */
.modal-ort {
  position: fixed;
  inset: 0;
  background: rgb(16 24 40 / .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 250;
  overflow-y: auto;
}
.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  padding: 18px;
}
.modal-baslik { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-right: 30px; }
.modal-kapat {
  position: absolute;
  top: 10px; right: 10px;
  border: none;
  background: none;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--hedef-min);
  min-height: var(--hedef-min);
}
.modal-kapat:hover { background: var(--bg); color: var(--text); }
.modal-eylemler { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Faz-3: kullanıcı chip'i ---------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}
.chip-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.chip-name { font-size: 13px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-grup::before { display: none; }

/* ---------- Faz-3: giriş ekranı ---------- */
.giris-sahne {
  min-height: calc(100vh - var(--topbar-h) - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.giris-kart {
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 28px 26px;
}
.giris-kart img { height: 44px; margin-bottom: 18px; }
.giris-kart form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.giris-hata {
  background: var(--durum-critical-zemin);
  border: 1px solid var(--border-strong);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
}
.giris-not {
  font-size: 12px;
  color: var(--muted);
  max-width: 380px;
  text-align: center;
}

/* Kurulum göstergesi: hangi kurulumda ve hangi veritabanına bağlı olunduğunu
   söyler. Nottan daha sönük — bilgi taşır ama dikkati giriş alanlarından
   çalmaz. `hidden` iken görünmez (health okunamazsa hiç gösterilmez). */
.giris-kurulum {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ---------- Faz-3: form doğrulama ---------- */
.input-hata, textarea.input-hata, select.input-hata { border-color: var(--danger) !important; }
.input-hata:focus { box-shadow: 0 0 0 3px var(--durum-critical-zemin) !important; }
.form-hata { color: var(--danger); font-size: 12px; margin-top: 2px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .tam { grid-column: 1 / -1; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }

.ozel-not-karti { min-width: 0; max-width: 100%; }
.ozel-not-karti .ozel-not-govde {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ozel-not-karti textarea.ozel-not-metin {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 16rem;
  max-height: 960px;
  overflow-y: hidden;
  resize: none;
}
.ozel-not-karti .ozel-not-eylemler { display: block; }

/* ---------- Faz-3: otomatik tamamlama (ICD-10 / hasta arama) ---------- */
.ac-wrap { position: relative; }
.ac-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 80;
}
.ac-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.ac-item:hover, .ac-item[aria-selected="true"] { background: var(--primary-soft); }
.ac-item .ac-kod { font-weight: 600; flex: 0 0 auto; }
.ac-item .ac-adi { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-bos { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* ---------- Faz-3: chip (seçili ICD / seçili hasta) ---------- */
.sec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-soft);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 1px 2px 1px 10px;
  font-size: 12px;
  font-weight: 600;
}
.sec-chip button {
  border: none;
  background: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  min-width: var(--hedef-min);
  min-height: var(--hedef-min);
  border-radius: 50%;
}
.sec-chip button:hover { background: rgb(0 0 0 / .08); }

/* ---------- Faz-3: şablon paleti ---------- */
.tpl-palet {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 320px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  z-index: 220;
}
.tpl-palet .tpl-baslik {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tpl-liste { overflow-y: auto; }
.tpl-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tpl-item:hover, .tpl-item[aria-selected="true"] { background: var(--primary-soft); }
.tpl-item .tpl-kisa { font-weight: 600; color: var(--primary); margin-right: 8px; }
.tpl-item .tpl-ozet { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Faz-3: muayene çalışma alanı ---------- */
.muayene-serit {
  position: sticky;
  top: var(--topbar-h);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.muayene-serit .m-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.muayene-serit .m-ad { font-weight: 600; }
.muayene-serit .m-meta { color: var(--muted); font-size: 12px; }
.muayene-serit .m-spacer { flex: 1; }

@media (max-width: 768px) {
  .topbar { height: auto; min-height: var(--topbar-h); padding: 10px 12px; gap: 8px; flex-direction: column; align-items: stretch; }
  .global-search { width: 100%; max-width: none; min-width: 0; flex: none; }
  .topbar-right { width: 100%; min-width: 0; margin-left: 0; gap: 8px; flex-wrap: wrap; }
  .user-chip { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex: 1 1 160px; min-width: 0; gap: 2px 6px; border-radius: 10px; padding: 5px 8px; }
  .user-chip .chip-avatar { display: none; }
  .user-chip .chip-name { grid-column: 1; min-width: 0; max-width: 100%; }
  .user-chip .chip-grup { grid-column: 1; justify-self: start; }
  .user-chip .btn { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .tpl-palet { width: min(320px, calc(100vw - 32px)); }
}

/* 375px telefon düzeltmeleri: grid/flex çocukları taşmasın, sekmeler yatay kaydırılsın. */
@media (max-width: 480px) {
  .chart-layout { min-width: 0; }
  .chart-layout > * { min-width: 0; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .field { flex: 1 1 100%; min-width: 0; }
  .toolbar .field input[type='search'], .toolbar .field input[type='text'] { width: 100%; min-width: 0; }
  .p-field .v { min-width: 0; overflow-wrap: anywhere; }
  .user-chip { min-width: 0; }
  .user-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.hasta-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
}
.hasta-tabs .tab {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ---------- Yazdırma ---------- */
.print-header { display: none; }
.print-imza { display: none; }

@media print {
  .sidebar,
  .topbar,
  .breadcrumb,
  .atla-baglantisi,
  .no-print,
  .btn { display: none !important; }

  html, body { background: #fff; }
  .shell { display: block; }
  .main-col { display: block; }
  .content { padding: 0; max-width: none; margin: 0; }

  .card {
    box-shadow: none;
    border: 1px solid #C9D2DB;
    border-radius: 6px;
    break-inside: avoid;
  }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 18px; }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--text);
    padding-bottom: 8px;
    margin-bottom: 14px;
  }
  .print-header .ph-title { font-size: 16px; font-weight: 700; }
  .print-header .ph-date { font-size: 12px; color: var(--muted); }
  .print-imza { display: block; margin-top: 36px; break-inside: avoid; }
  .print-imza-cizgi { width: 240px; border-top: 1px solid #000; margin-top: 36px; padding-top: 4px; text-align: center; }

  .timeline::before { background: #C9D2DB; }
  .timeline-body { background: #fff; }

  a { color: inherit; text-decoration: none; }
}


/* Scoped clinical transfer preview: literal text, narrow-screen-safe controls. */
.aktarim-modal fieldset { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; min-width:0; }
.aktarim-modal fieldset label { display:flex; gap:6px; align-items:center; }
.aktarim-modal .modal-eylemler { flex-wrap:wrap; }
.aktarim-modal section { min-width:0; overflow-wrap:anywhere; }
.aktarim-modal h3 { font-size:15px; margin:16px 0 8px; }
.aktarim-modal h4 { font-size:12px; margin:8px 0 4px; }
.aktarim-metin { white-space:pre-wrap; overflow-wrap:anywhere; padding:8px; background:var(--bg); border-radius:6px; }
.aktarim-kontrolleri { margin-top:16px; }
.aktarim-kontrolleri [role="status"] { overflow-wrap:anywhere; }

.modal-ort:has(.aktarim-modal) { padding:16px 8px; align-items:center; overflow:hidden; }
.modal:has(.aktarim-modal) { display:flex; flex-direction:column; max-height:calc(100dvh - 32px); min-height:0; }
.modal:has(.aktarim-modal) > .modal-baslik { flex-shrink:0; }
.modal-govde:has(.aktarim-modal) { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:3px; }
.aktarim-eylemler { flex-shrink:0; flex-wrap:wrap; padding-top:10px; border-top:1px solid var(--border); }


/* Giriş / zorunlu şifre değişimi: uygulama kabuğu gizlenir.
   Oturum yokken sol gezinme ve üst çubuk görünüyordu; menüler tıklanabilir
   duruyor ama hepsi girişe geri atıyordu. Kabuk gizlenince ekranda yalnız
   giriş formu kalır. */
body.kabuksuz .sidebar,
body.kabuksuz .topbar { display: none; }
body.kabuksuz .content { margin: 0; }
body.kabuksuz { display: block; }

/* Pano — hızlı işlemler (sekreterde 12 aylık grafiğin yerini alır) */
.hekim-pano-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.hekim-pano-grid > *,
.hekim-pano-grid .card,
.hekim-hizli-islem .hizli-eylem-grid,
.hekim-hizli-islem .hizli-eylem,
.hekim-hizli-islem .hizli-eylem > div { min-width: 0; }
.hekim-hizli-islem .hizli-eylem {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 1024px) {
  .hekim-pano-grid { grid-template-columns: minmax(0, 1fr); }
}

.hizli-eylem-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .hizli-eylem-grid { grid-template-columns: 1fr; } }
.hizli-eylem {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: inherit; background: var(--card);
  transition: border-color .15s, transform .15s;
}
.hizli-eylem:hover, .hizli-eylem:focus-visible {
  border-color: var(--accent); transform: translateY(-1px);
}
.hizli-eylem-baslik { font-weight: 600; }

/* Pano — açık protokol kartı tıklanabilir, liste yerinde açılır */
.stat-card.tiklanabilir { cursor: pointer; }
.stat-card.tiklanabilir:hover, .stat-card.tiklanabilir:focus-visible {
  border-color: var(--accent);
}
.acik-protokol-liste {
  display: block; margin: -6px 0 20px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); overflow-x: auto;
}
/* HATA (2026-09-15, sahada bulundu): yukaridaki `display: flex` yazar
   kurali, `hidden` HTML ozelliginin tarayici varsayilan `[hidden]{display:
   none}` kuralini SPESIFIKLIK/KOKEN geregi HER ZAMAN ezer -- JS `kutu.hidden`
   ile dogru gecis yapiyordu ama kutu HER ZAMAN gorunur kaliyordu, tiklama
   gorsel olarak hicbir sey degistirmiyordu. `[hidden]` durumunu ACIKCA
   yazmak zorundayiz. */
.acik-protokol-liste[hidden] { display: none; }
.acik-protokol-iptal { flex-shrink: 0; }
.acik-protokol-tablo { width: 100%; border-collapse: collapse; font-size: 13px; }
.acik-protokol-tablo th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.acik-protokol-tablo td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.acik-protokol-tablo tbody tr:last-child td { border-bottom: 0; }
.acik-protokol-tablo td.sayi { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acik-protokol-tablo a { color: inherit; font-weight: 600; text-decoration: none; }
.acik-protokol-tablo a:hover, .acik-protokol-tablo a:focus-visible { text-decoration: underline; }
.acik-protokol-tablo td.eylemler { white-space: nowrap; text-align: right; }
.acik-protokol-tablo td.eylemler .btn + .btn { margin-left: 6px; }

/* Pano — hekimin günün hasta listesi */
.gun-saat {
  font-variant-numeric: tabular-nums; font-weight: 600;
  min-width: 46px; color: var(--muted, #667);
}

/* Şifre alanı + göster düğmesi (2026-09-15) */
.sifre-sarmal { display: block; }
.sifre-alan { position: relative; display: block; }
.sifre-alan .input { padding-right: 76px; width: 100%; }
.sifre-goster {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: none; border: 0; padding: 4px 8px; cursor: pointer;
  font-size: 13px; color: var(--muted, #6b7280); border-radius: 6px;
}
.sifre-goster:hover { background: rgba(0,0,0,.05); color: inherit; }
.sifre-sayac { display: block; margin-top: 4px; font-size: 12px; color: var(--muted, #6b7280); }

/* ---------- Sorun bildirimi: ekran görselleri (2026-09-23) ---------- */
/* Ortak, sayfa üzerinde taşınabilir pencereler. */
.pencere {
  width: 100%; max-height: 100dvh; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-elevated, var(--shadow-lg));
  overflow: hidden; overflow-wrap: anywhere;
}
.pencere-baslik {
  flex-shrink: 0; padding: 16px 92px 16px 16px; font-weight: 600;
  border-bottom: 1px solid var(--border); cursor: move; touch-action: none;
  user-select: none;
}
.pencere-kapat { position: absolute; right: 8px; top: 8px; }
.pencere-govde { min-height: 0; overflow: auto; padding: 16px; }
.pencere-govde > *, .pencere-govde input, .pencere-govde select,
.pencere-govde textarea { max-width: 100%; min-width: 0; }
.pencere :focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
button.sorun-bildirim-satir {
  display: flex; flex-wrap: wrap; gap: 8px; width: 100%; text-align: left;
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; overflow-wrap: anywhere;
}
button.sorun-bildirim-satir:hover { background: var(--primary-soft); }
.sorun-bildirim-mesaj { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Kayma kapısı (v36 "ekran kayması"): boşluksuz konu/not/çizelge metni 390px'te sayfayı
   1104px'e taşırıyordu. Flex/sütun çocukları min-width:0 + metin overflow-wrap:anywhere. */
.geri-bildirim-eylemler { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; max-width: 100%; }
.sorun-bildirim-liste, .geri-bildirim-kayit { min-width: 0; max-width: 100%; }
.geri-bildirim-kayit { display: flex; flex-direction: column; gap: 4px; }
.geri-bildirim-kayit > * { min-width: 0; max-width: 100%; }
button.sorun-bildirim-satir > * { min-width: 0; max-width: 100%; }
.geri-bildirim-not { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; min-width: 0; }
.geri-bildirim-not-etiket { font-weight: 600; }
.geri-bildirim-not-metin { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geri-bildirim-not-ayrinti { flex-basis: 100%; overflow-wrap: anywhere; }
.geri-bildirim-cizelge { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .pencere, .pencere * { animation: none !important; transition: none !important; }
}

.sorun-bildir-panel { display: flex; flex-direction: column; gap: 10px; }
.sorun-ek-yapistir {
  border: 1.5px dashed var(--border, #c9ced6); border-radius: 8px; padding: 14px;
  text-align: center; font-size: 13px; color: var(--text-muted-aa, #5a6a60); cursor: pointer;
}
.sorun-ek-yapistir:focus-visible, .sorun-ek-yapistir.uzerinde { border-color: var(--primary, #2f6fde); }
.sorun-ek-yapistir.dolu { cursor: default; opacity: .6; }
.sorun-ek-onizleme, .sorun-ek-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.sorun-ek-kucuk-img {
  height: 72px; max-width: 128px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border, #c9ced6);
}
.sorun-ek-kucuk-img { cursor: zoom-in; }
.sorun-ek-buyuk-img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.sorun-ek-uyari { font-size: 12px; }
.sorun-ek-durum { font-size: 13px; min-height: 1em; }
.sorun-ek-liste { margin-top: 8px; }

.giris-yasal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; max-width: 420px; font-size: 12px; text-align: center; }
.giris-yasal a, .giris-not { overflow-wrap: anywhere; }
.sidebar-foot a, .giris-yasal a, .dt-arsiv-link { display: inline-flex; align-items: center; min-height: var(--hedef-min); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.tablo-siralama { padding: 12px; font-size: 12px; overflow-wrap: anywhere; }
.tablo-siralama-mobil { display: none; }
.tablo-siralama-baslik { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; padding: 8px 0; min-height: 44px; text-align: left; }
.tablo-siralama-baslik:hover { text-decoration: underline; }
.tablo-siralama-baslik:focus-visible { outline: 2px solid var(--odak-halka); outline-offset: 2px; }
@media (max-width: 640px) {
  table.tablo-kart thead th:has(.tablo-siralama-baslik) { display: none; }
  .tablo-siralama-mobil { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
  .tablo-siralama-secim { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; }
}
.breadcrumb a, .user-chip a { display: inline-flex; align-items: center; min-height: var(--hedef-min); }
/* WEB 2026-10-27m-hedef-boyut: tüm genişliklerde (390px dahil) 24px taban; etiketli kutuda hedef etikettir.
   :where() özgüllüğü 0: yalnız taban; 44px'lik hedef kuralları (toplu seçim, boş durum) ezilmez. */
:where(.btn, .btn-sm, button.dropdown-toggle, select) { min-height: var(--hedef-min); }
:where(label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) { min-height: var(--hedef-min); }
/* Masaüstünde tablo satırı eylemleri yoğunluk satır yüksekliğine uyar (>=32px). */
@media (min-width:1024px) {
  .btn-sm, table.data .btn, .data-table .btn {
    min-height: var(--satir-yuksekligi-aksiyon);
    padding: max(0px, calc(var(--hucre-dolgu-y) - 4px)) var(--hucre-dolgu-x);
  }
  /* Toplu seçim hedefi de satırı büyütür; sonraki stylesheet'in 44px tabanını aş. */
  html[data-yogunluk] .toplu-hedef {
    min-height: var(--satir-yuksekligi-aksiyon);
  }
}
.link-hedef { display: inline-flex; align-items: center; min-height: var(--hedef-min); margin-top: 10px; }


/* ============================================================
   Gün görünümü + sağ randevu paneli
   ============================================================ */

/* --- Gün ızgarası --- */
.randevu-gun-izgara {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  border-top: 1px solid var(--border);
}

.randevu-gun-eksen {
  position: relative;
  background: var(--bg);
}

.randevu-gun-saat-etiketi {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
}

.randevu-gun-sutun {
  position: relative;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.randevu-gun-slot {
  position: absolute;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.randevu-gun-slot:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.randevu-gun-slot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* --- Randevu kartı --- */
.gun-kart {
  position: absolute;
  z-index: 3;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 4px;
  font-size: 12px;
  cursor: pointer;
}

.gun-kart:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.gun-kart strong,
.gun-kart span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ad öncelikli: hasta adı kalın ve ≥12px, en fazla 2 satır; saat/işlem küçük. */
.gun-kart strong {
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gun-kart .gun-kart-saat,
.gun-kart .gun-kart-tur {
  font-size: 11px;
}

/* --- Durum renkleri --- */
.gun-kart-durum-g {
  background: var(--durum-ok-zemin);
  color: var(--durum-ok);
}

.gun-kart-durum-b {
  background: var(--durum-caution-zemin);
  color: var(--durum-caution);
}

.gun-kart-durum-t {
  background: var(--emerald-soft);
  color: var(--emerald-ink);
}

.gun-kart-durum-i {
  background: var(--surface);
  color: var(--muted);
}

.gun-kart[data-renk]:not(.gun-kart-durum-i) {
  background: var(--rk-bg);
  border-left-color: var(--rk-kenar);
  color: var(--rk-yazi);
}

.gun-kart-durum-diger {
  background: var(--surface);
}

/* --- Tür göstergesi --- */
.gun-kart-tur-muayene {
  border-left-color: var(--emerald-mid);
}

.gun-kart-tur-kontrol {
  border-left-color: var(--durum-ok);
}

.gun-kart-tur-diger {
  border-left-color: var(--border);
}

/* --- İptal --- */
.gun-kart-iptal strong,
.gun-kart-iptal span {
  text-decoration: line-through;
}

.gun-kart-iptal {
  opacity: .55;
}

/* --- Bloke --- */
.randevu-gun-bloke {
  position: absolute;
  z-index: 2;
  left: 2px;
  right: 2px;
  background: var(--bg-warm-stone);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 4px;
  pointer-events: none;
}

.randevu-gun-kilit {
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

/* --- Ön izleme --- */
.randevu-gun-onizleme {
  position: absolute;
  z-index: 4;
  left: 2px;
  right: 2px;
  border: 1px dashed var(--muted);
  background: color-mix(in srgb, var(--muted) 25%, transparent);
  pointer-events: none;
  font-size: 12px;
  padding: 4px;
}

.randevu-gun-onizleme strong,
.randevu-gun-onizleme span {
  display: block;
}

/* --- Sağ randevu paneli --- */
.randevu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  z-index: 50;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(15, 23, 42, .12);
}

.randevu-panel[hidden] {
  display: none;
}

.randevu-panel-acik {
  padding-right: 440px;
}

.randevu-panel-sekme {
  cursor: pointer;
  padding: 10px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.randevu-panel-sekme[aria-selected="true"] {
  border-bottom: 2px solid var(--primary);
  font-weight: 600;
  color: var(--text);
}

.randevu-form-grup { margin:0; min-width:0; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.randevu-form-grup > legend { padding:0 6px; font-size:14px; font-weight:600; }
.randevu-form-grup > .field { margin-bottom:10px; }
.randevu-form-grup .field { min-width:0; }
.randevu-form-grup .input { width:100%; min-width:0; }
.randevu-sure-alani { width:110px; }
@media (max-width:480px) {
  .randevu-tip-sure { flex-direction:column; }
  .randevu-tip-sure .randevu-sure-alani { width:100%; }
}
.randevu-form-alanlari { display:flex; flex-direction:column; gap:16px; min-width:0; }
.randevu-yeni-form { container: randevu-form / inline-size; }
.randevu-form-duzen { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; align-items:start; }
.randevu-ozet { display:none; position:sticky; top:0; min-width:0; padding:16px; border:1px solid var(--border); border-radius:8px; background:var(--bg); overflow-wrap:anywhere; }
.randevu-ozet h3 { margin:0 0 12px; font-size:15px; }
.randevu-ozet dl { margin:0; }
.randevu-ozet dt { color:var(--muted); font-size:12px; margin-top:10px; }
.randevu-ozet dd { margin:2px 0 0; }
/* Modal 900px = 862px içerik + 36px padding + 2px kenarlık. */
@container randevu-form (min-width:862px) {
  .randevu-form-duzen { grid-template-columns:minmax(0,1fr) 260px; }
  .randevu-ozet { display:block; }
}
@media (max-width:899px) { .randevu-ozet { display:none; } .randevu-form-duzen { grid-template-columns:minmax(0,1fr); } }
.randevu-panel .randevu-form-grup { margin:8px; padding:4px; }
.randevu-zaman-bloku {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:12px;
}
.randevu-zaman-bloku > label { display:flex; flex-direction:column; gap:6px; min-width:0; }
.randevu-zaman-bloku input { width:100%; min-width:0; box-sizing:border-box; }
.randevu-panel .randevu-zaman-bloku { padding:8px 16px; }
@media (max-width:360px) {
  .randevu-zaman-bloku input { padding-inline:6px; }
}
.randevu-panel-bolum {
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}

.randevu-panel-bolum > summary {
  cursor: pointer;
  font-weight: 600;
}

.randevu-panel-alt {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.randevu-panel-hasta-oge {
  display: block;
  width: 100%;
  text-align: left;
}

.randevu-panel-cakisma {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  border: 1px solid var(--warning);
}

/* --- Panel odak halkaları --- */
.randevu-panel button:focus-visible,
.randevu-panel summary:focus-visible,
.randevu-panel a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Mobil: panel tam ekran --- */
@media (max-width: 767px) {
  .randevu-panel {
    inset: 0;
    width: 100%;
    border-left: 0;
  }
  .randevu-panel-acik {
    padding-right: 0;
  }
}

/* Marka: Verge amblem + yazı (tek logo kaynağı: /assets/img/marka/) */
.sidebar-logo .logo-full { display: inline-flex; align-items: center; gap: 10px; }
.sidebar-logo .logo-full img, .sidebar-logo .logo-kucuk { height: 34px; width: 34px; border-radius: 10px; object-fit: cover; }
.sidebar-logo .logo-yazi { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; color: var(--text); }
.marka-404 { display: inline-flex; align-items: center; gap: 14px; font-weight: 800; font-size: 2.2rem; letter-spacing: -0.035em; }
.marka-404 img { width: 72px; height: 72px; border-radius: 20px; }
.hasta-ozet-olcumler { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin-bottom: 12px; }
.hasta-ozet-olcu { display: flex; flex-direction: column; min-width: 0; }
.hasta-ozet-olcu .k { color: var(--muted); font-size: 12px; }
.hasta-ozet-olcu .v { font-weight: 600; }
.hasta-ozet-olcu .t { font-size: 12px; }
.hasta-ozet-ozgecmis { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.hasta-ozet-tikla { cursor: pointer; }
.kasa-bolumu { margin-top: 12px; }
.kasa-bolumu-dugme { width: 100%; text-align: left; margin-bottom: 8px; }
.hasta-ozet-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.hasta-ozet-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.hasta-ozet-form .field { display: flex; flex-direction: column; gap: 2px; }
.hasta-ozet-form textarea, .hasta-ozet-form input[type="text"], .hasta-ozet-form select { width: 100%; box-sizing: border-box; }
.hasta-ozet-olcum-ekle { margin-top: 8px; }
.hasta-ozet-olcum-ekle summary { cursor: pointer; font-weight: 600; }
.randevu-panel-hasta-teyit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; }
.randevu-panel-telefon { font-variant-numeric: tabular-nums; }
.randevu-panel-telefon-duzenle { text-decoration: underline; display: inline-flex; align-items: center; min-height: var(--hedef-min); }
/* Kasa: fatura eylemi mobilde kartin altinda da erisilebilir kalir. */
.kasa-fatura-aksiyon { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.kasa-fatura-btn, table.data .kasa-fatura-btn, .data-table .kasa-fatura-btn { min-width:44px; min-height:44px; }
.kasa-fatura-aksiyon [role="status"] { flex-basis:100%; overflow-wrap:anywhere; }
@media (max-width:480px) {
  .kasa-tablo, .kasa-tablo tbody { display:block; width:100%; }
  .kasa-tablo thead { display:none; }
  .kasa-tablo tr { display:block; border-bottom:2px solid var(--border, #e3e9ef); padding:12px 0; }
  .kasa-tablo td { display:flex; gap:12px; justify-content:space-between; white-space:normal; overflow-wrap:anywhere; }
  /* Flex/block hücrelerde height sabittir; uzun fatura içeriğiyle büyümeyi koru. */
  html table.data.kasa-tablo td, html .data-table.kasa-tablo td,
  html[data-yogunluk] .kasa-tablo td {
    height: auto;
    min-height: var(--satir-yuksekligi);
  }
  .kasa-tablo td::before { content:attr(data-label); font-weight:600; flex-shrink:0; }
  .kasa-tablo .kasa-fatura-hucre { display:block; }
  .kasa-tablo .kasa-fatura-hucre::before { display:none; }
  .kasa-fatura-aksiyon { margin-top:8px; }
}
.protokol-gecmis-baslik { margin-bottom: 0; }
.protokol-gecmis-baslik[aria-expanded="true"] { margin-bottom: 12px; }
.protokol-gecmis-baslik:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.protokol-gecmis-bolge[hidden] { display: none; }
/* Reçete yaz: ilaç adı ayrı satırda, öneriler input ile aynı genişlikte. */
.recete-form-satir { display:flex; flex-direction:column; gap:8px; min-width:0; }
.recete-satir-no { font-family:var(--font-mono, 'IBM Plex Mono', monospace); font-variant-numeric:tabular-nums; font-weight:600; color:var(--text-muted-aa, inherit); }
.recete-tam-genislik { width:100%; min-width:0; }
.recete-ilac-alan { position:relative; }
.recete-ilac-alan label, .recete-alt-alan label { display:block; margin-bottom:4px; font-size:12px; }
.recete-ilac-input { width:100%; min-height:44px; font-size:14px; box-sizing:border-box; }
.recete-doz-satiri { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(64px,.65fr); gap:8px; }
.recete-alt-alan { min-width:0; }
.recete-alt-alan .input { width:100%; min-width:0; box-sizing:border-box; }
.recete-oneriler { position:absolute; top:66px; left:0; right:0; z-index:5; max-height:320px; overflow-y:auto; overscroll-behavior:contain; background:var(--surface); border:1px solid var(--border); border-radius:6px; box-shadow:var(--shadow-lg); }
.recete-oneriler[hidden] { display:none; }
.recete-oneri { height:52px; box-sizing:border-box; padding:6px 10px; cursor:pointer; border-bottom:1px solid var(--border); min-width:0; }
.recete-oneri:hover, .recete-oneri[aria-selected="true"] { background:var(--bg); outline:2px solid var(--primary, #2563eb); outline-offset:-2px; }
.recete-oneri-ad { font-size:14px; font-weight:600; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.recete-oneri-ad strong { font-weight:900; text-decoration:underline; }
.recete-oneri-etken { font-size:12px; line-height:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
.recete-ipucu, .recete-durum { font-size:12px; line-height:18px; color:var(--muted); }
.recete-liste-mesaj { padding:8px 10px; font-size:12px; white-space:nowrap; }
.recete-iskelet { height:52px; box-sizing:border-box; border:10px solid var(--surface); background:linear-gradient(90deg,var(--bg),var(--border),var(--bg)); }
.recete-ilac-input:focus-visible, .recete-alt-alan .input:focus-visible { outline:2px solid var(--primary, #2563eb); outline-offset:2px; }
.recete-modal-kutu { box-sizing:border-box; }
@media (max-width:480px) {
  .recete-modal-ort { padding:0; }
  .recete-modal-kutu { width:100%; min-height:100dvh; max-width:100% !important; border-radius:0; padding:16px; }
  .recete-oneri { min-height:52px; }
}
/* TUR 8 — Hasta zaman çizelgesi (role="feed") */
.hasta-zaman-kart h2 { font-size:16px; font-weight:600; margin:0 0 8px; }
.hasta-zaman-kart h2:focus-visible,
.hasta-zaman-feed article:focus-visible,
.hasta-zaman-kart .z-eylem:focus-visible,
.hasta-zaman-kart .z-daha-eski:focus-visible,
.hasta-zaman-kart .z-bitis:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.hasta-zaman-durum { font-size:13px; color:var(--muted); margin:0 0 12px; }
.hasta-zaman-feed { display:flex; flex-direction:column; gap:10px; }
.hasta-zaman-oge { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; align-items:center; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); min-width:0; }
.hasta-zaman-ust { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:4px; }
.hasta-zaman-oge .rozet { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid var(--border); }
.hasta-zaman-oge .rozet::before { display:none; }
.hasta-zaman-oge .rozet-muayene { background:var(--emerald-soft); color:var(--emerald-ink); }
.hasta-zaman-oge .rozet-belge { background:var(--bg-warm-stone); color:var(--text); }
.hasta-zaman-oge .rozet-tahsilat { background:var(--durum-ok-zemin); color:var(--success); }
.hasta-zaman-oge time, .hasta-zaman-oge .z-tarih-bilinmiyor { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.hasta-zaman-baslik { font-size:14px; font-weight:600; color:var(--text); margin:0 0 2px; overflow-wrap:anywhere; }
.hasta-zaman-ozet { font-size:13px; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.hasta-zaman-kart .z-eylem,
.hasta-zaman-kart .z-daha-eski,
.hasta-zaman-kart .bos-durum-eylem,
.hasta-tabs .tab { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; }
.hasta-zaman-alt { margin-top:12px; display:flex; flex-direction:column; align-items:flex-start; gap:8px; width:100%; }
.hasta-zaman-kart .z-bitis { margin:0; font-size:13px; color:var(--muted); }
@media (max-width:640px) {
  .hasta-zaman-oge { grid-template-columns:minmax(0,1fr); }
  .hasta-zaman-kart .z-eylem, .hasta-zaman-kart .z-daha-eski { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
  .hasta-zaman-kart, .hasta-zaman-kart * { animation-name:none !important; animation-duration:0s !important; transition-duration:0s !important; }
}

/* ---------- Yan panel göster/gizle (masaüstü; mobil çekmeceye dokunmaz) ---------- */
.yan-dugme { position: absolute; top: 16px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); cursor: pointer; }
.yan-dugme:hover { background: var(--bg); color: var(--text); }
.yan-dugme:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 768px) {
  .yan-dugme { display: none; }
}
@media (min-width: 769px) {
  body.yan-daralt .sidebar { width: var(--sidebar-w-narrow); flex-basis: var(--sidebar-w-narrow); }
  body.yan-daralt .sidebar-logo { justify-content: center; padding: 12px 8px; }
  body.yan-daralt .sidebar-logo .logo-full, body.yan-daralt .sidebar-version { display: none; }
  body.yan-daralt .sidebar-logo .logo-kucuk { display: block; }
  body.yan-daralt .yan-dugme { position: static; margin: 8px auto 0; flex: 0 0 auto; }
  body.yan-daralt .nav-item { justify-content: center; padding: 10px; }
  body.yan-daralt .nav-item .nav-label, body.yan-daralt .nav-metin, body.yan-daralt .nav-rozet, body.yan-daralt .nav-bolum { display: none; }
  body.yan-daralt .nav-modul-liste[hidden] { display: block; }
  body.yan-daralt .sidebar-foot { padding: 8px 4px; font-size: 10px; text-align: center; }
}
/* Geri al şeridi: tembel CSS beklenmeden 44px hedef (UI kapısı 2026-11-04) */
.geri-al-seridi { position:fixed; z-index:1500; bottom:16px; left:16px; right:16px; max-width:640px; margin:auto; padding:12px; background:var(--surface,#fff); color:var(--text,#182230); border:1px solid var(--border,#ccc); border-radius:8px; box-shadow:0 4px 20px #0002; display:flex; align-items:center; gap:8px; flex-wrap:wrap; overflow-wrap:anywhere; }
.geri-al-seridi.kalici { position:static; margin:12px 0; box-shadow:none; }
.geri-al-seridi button { min-width:44px; min-height:44px; }
.geri-al-seridi button:focus-visible { outline:2px solid var(--primary,#175cd3); outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { .geri-al-seridi { animation:none; transition:none; } }
