/* Ekranlara özel düzen (2026-10-26: eski app.css'ten, sırası korunarak taşındı; ortak bileşenler components.css) */

/* Duyurular */
.ann-list { display: grid; gap: 12px; }
.ann { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.ann.pinned { border-color: var(--accent); background: var(--accent-wash); }
.ann.expired { opacity: 0.6; }
.ann h3 { font-size: 16px; }
.ann-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ann-body a { color: var(--accent-strong); }

/* Dokümanlar */
.doc-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.doc-cat { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.doc-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.doc-title { font-weight: 600; overflow-wrap: anywhere; }
.doc .stack-form { flex: 1 1 100%; }

/* Hastalar */
.filter .field { font-size: 17px; padding: 12px 14px; }
table.patients td.name { white-space: normal; min-width: 140px; }

tr.dup td { background: var(--mid-bg); }
.dup-badge { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink);
  background: var(--warning); border-radius: var(--r-tag); padding: 1px 7px; cursor: help; }
.new-record { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border: 1px dashed var(--accent); border-radius: var(--radius); padding: 12px 14px; background: var(--accent-wash); }
.new-record.subtle { border-color: var(--border); background: transparent; }
.dup-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* Portal (yönetici istatistikleri) */
.portal { display: grid; gap: 16px; min-width: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile-label { color: var(--ink-2); font-size: 12.5px; }
.tile-value { font-size: 26px; font-weight: 650; line-height: 1.2; }
.tile-sub { color: var(--muted); font-size: 12px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  font-size: 13.5px; }
.bar-row.zero { color: var(--muted); }
.bar-label { overflow-wrap: anywhere; }
.bar-track { height: 10px; border-radius: var(--r-tag); background: var(--grid); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: var(--r-tag); background: var(--accent); }
.bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 6px; border-bottom: 1px solid var(--axis); }
.col-wrap { flex: 1 1 0; min-width: 2px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.col { display: block; width: 100%; height: 2%; background: var(--accent); border-radius: 3px 3px 0 0; }
.col.zero { background: var(--grid); }
.col-x { position: absolute; top: 100%; left: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.cols + .meta { margin-top: 18px; }
details.data-table summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; width: max-content; }
details.data-table table { margin-top: 8px; }
.defs-card summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.defs { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }


/* Hesaplar ve şifre */
.narrow-card { max-width: 560px; }
.acc-panel:empty { display: none; }
.acc-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2, var(--surface)); }
.secret-box { display: grid; gap: 8px; }
.secret-title { font-weight: 700; }
.secret { font-size: 20px; letter-spacing: 0.04em; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--good-bg);
  user-select: all; word-break: break-all; width: max-content; max-width: 100%; }
.note.small { font-size: 12px; }

/* Portal: dönem seçici */
.portal-period { display: grid; gap: 14px; }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.period-bar .note { flex-basis: 100%; }
.range { display: flex; gap: 6px; align-items: center; }
.field.date-in, .field.group-sel { width: auto; padding: 6px 8px; font-size: 13px; }
.group-wrap { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }

/* Hastalar: tanı, dosya no, REDCap bağlantıları */
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter #hasta-ara { flex: 1 1 260px; }
.dx-sel { max-width: 260px; }
table.patients td.dx { white-space: normal; min-width: 120px; font-size: 13px; }
.files, .links { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.file-chip { display: inline-flex; gap: 4px; align-items: baseline; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1px 6px; font-size: 12.5px; white-space: nowrap; background: var(--surface); }
.file-chip .file-list { color: var(--muted); font-size: 11.5px; }
.file-chip .file-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.file-chip.code { border-style: dashed; }
.weak { display: inline-block; min-width: 16px; text-align: center; border-radius: var(--r-tag); font-size: 11px; font-weight: 700;
  background: var(--mid-bg); color: var(--ink); cursor: help; }
.follow { font-size: 11.5px; border-radius: var(--r-tag); padding: 1px 8px; white-space: nowrap; }
.follow.ok { background: var(--good-bg); color: var(--ink); }
.follow.todo { background: var(--bad-bg); color: var(--ink); }
.follow.unknown { background: var(--surface-2); color: var(--ink-2); border: 1px dashed var(--border); }
.follow.moved { background: var(--surface-2); color: var(--ink-2); }
.consent { font-size: 11.5px; border-radius: var(--r-tag); padding: 1px 8px; white-space: nowrap; border: 1px solid var(--border); }
.consent.imzalandi { background: var(--good-bg); color: var(--ink); border-color: transparent; }
.consent.reddetti { background: var(--bad-bg); color: var(--ink); border-color: transparent; }
.consent.gonderildi { background: var(--surface-2); color: var(--ink-2); border-style: dashed; }
.consent.none { color: var(--ink-2); }
.transfer-fields dd { overflow-wrap: anywhere; }
.transfer-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 12px 0; }
.transfer-fields dt { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.transfer-fields dd { margin: 0; font-size: 13.5px; }
.transfer-fields dd.pre { white-space: pre-wrap; max-height: 220px; overflow: auto; background: var(--surface-2);
  padding: 8px; border-radius: var(--radius-sm); }
.subtypes { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 520px) { .transfer-fields { grid-template-columns: minmax(0, 1fr); } }

/* Hastalar tablosu ekrana sığsın: bağlantı/dosya hücreleri ve düğmeler gerekirse alt satıra geçer */
table.patients td.wrap { white-space: normal; min-width: 130px; }
table.patients td.act { white-space: nowrap; width: 1%; }
table.patients td.act .row { flex-direction: column; align-items: stretch; gap: 4px; }
table.patients .btn-small { white-space: nowrap; text-align: center; justify-content: center; }
table.patients td.dx { min-width: 110px; }
.visit-meta { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
@media (max-width: 1150px) {  /* dar ekran: her hasta bir kart, sütun adları hücre başında */
  table.patients thead { display: none; }
  table.patients, table.patients tbody, table.patients tr, table.patients td { display: block; width: 100%; }
  table.patients tr { border-bottom: 1px solid var(--grid); padding: 10px 0; }
  table.patients td { border: 0; padding: 3px 0; white-space: normal; min-width: 0; }
  table.patients td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  table.patients td.act { width: 100%; padding-top: 6px; }
  table.patients td.act .row, table.patients td.act .btn-stack { flex-direction: row; flex-wrap: wrap; align-items: center; }
  table.patients .btn-small { white-space: nowrap; }
}
table.patients th, table.patients td { padding: 8px 6px; }
table.patients td.name { min-width: 110px; }
table.patients td.wrap { min-width: 100px; }
table.patients td.num.mono { font-size: 13px; }
table.patients .follow { white-space: normal; }

/* Poliklinik planı */
.stack { display: grid; gap: 16px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.room-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.room-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: space-between; }
.room-note { font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-tag); padding: 1px 8px; }
.desk-line { display: flex; gap: 6px; align-items: baseline; font-size: 14px; min-width: 0; }
.desk-line > span { overflow-wrap: anywhere; }
.desk-line.empty { color: var(--muted); font-style: italic; }
.desk-tag { font-size: 11px; font-weight: 700; color: var(--accent-strong); background: var(--accent-wash); border-radius: 4px; padding: 0 5px; }
.desk-title { font-size: 11.5px; color: var(--muted); }
table.plan-grid th[scope="row"] { white-space: nowrap; font-weight: 600; }
table.plan-grid td.muted { color: var(--muted); }
.plan-sel { min-width: 160px; padding: 6px 8px; font-size: 13px; }
.plan-changes { padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.desk-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 8px 0; }
.desk-row { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.person-form .field { flex: 1 1 180px; }
.person-form .field.narrow { flex: 0 1 180px; }
.room-row .field { flex: 1 1 200px; }
.room-row .field.narrow { flex: 0 1 160px; }
.rooms-form { display: grid; gap: 8px; margin: 8px 0; }
.warn-line { font-size: 13px; background: var(--bad-bg); border-radius: var(--radius-sm); padding: 6px 10px; }
tr.inactive td { color: var(--muted); }

/* Hastalar tablosu (2026-10-11 düzeni): veritabanı bilgisi düz metin, düğmeler ayrı sütunlarda */
.db-info { display: grid; gap: 4px; }
.db-line { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.db-line.moved { color: var(--ink-2); font-size: 0.92em; text-decoration: none; }
.db-name { font-weight: 700; }
.db-rec { color: var(--ink-2); }
.db-line .visit-meta { flex-basis: auto; }
.btn-stack { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
a.btn.two-line { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2; height: auto;
  min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
.btn-sub { font-size: 11px; font-weight: 500; opacity: 0.85; }
table.patients td.files-cell { min-width: 120px; }

/* 2026-10-11 (3. tur): sütun çizgileri, sütun tonları, sabit başlık, belirgin arama */
table.patients th + th, table.patients td + td { border-left: 1px solid var(--grid); }
table.patients td.col-db { background: var(--col-db); }
table.patients td.act { background: var(--col-act); }
table.patients tr.dup td { background: var(--mid-bg); }
table.patients thead th { background: var(--thead-bg); color: var(--ink); font-size: 12.5px; }
@media (min-width: 1151px) {
  .patients-wrap { overflow: visible; }  /* kaydırma kabı olmazsa başlık sayfaya göre sabit kalır */
  table.patients thead th { position: sticky; top: var(--topbar-h, 0px); z-index: 3;
    box-shadow: inset 0 -1px 0 var(--axis); }
}
.filter { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px; }
.filter-label { font-weight: 700; font-size: 14px; color: var(--accent-strong); }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row #hasta-ara { flex: 1 1 260px; min-height: 40px; font-size: 15px; }
.filter-row .dx-sel { background: var(--surface); }

/* Portal veritabanı seçici */
.db-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; }
.db-switch-label { font-weight: 700; font-size: 13px; color: var(--ink-2); margin-right: 6px; }
.db-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); border-radius: var(--r-tag);
  padding: 6px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.db-btn:hover { border-color: var(--accent); }
.db-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Portal dönem: giriş takvimi (ısı haritası) + kim girdi */
.heat-wrap { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.heat-days { display: grid; align-items: center; grid-template-rows: 16px repeat(5, 20px); gap: 3px; font-size: 11px; color: var(--muted); }
.heat-body { display: grid; grid-template-rows: 16px auto; gap: 3px; }
.heat-months { display: grid; grid-template-columns: repeat(var(--weeks), 20px); gap: 3px; font-size: 11px;
  color: var(--muted); white-space: nowrap; }
.heat { display: grid; grid-template-rows: repeat(5, 20px); grid-auto-flow: column; grid-auto-columns: 20px; gap: 3px; }
.hc { display: inline-block; width: 20px; height: 20px; border-radius: 3px; background: var(--heat-0); }
.hc.l1 { background: var(--heat-1); } .hc.l2 { background: var(--heat-2); }
.hc.l3 { background: var(--heat-3); } .hc.l4 { background: var(--heat-4); }
.hc.lx { background: transparent; border: 1px dashed var(--grid); }
.hc.out { opacity: 0.35; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.heat-legend .hc { width: 12px; height: 12px; }
.heat-weekend { margin-left: 12px; }
/* display:table şart: appointments.css'teki .who { display:flex } tabloyu bölüp başlık/gövde/toplamı yan yana diziyordu
   (19.11.2026, Tüm Poliklinikler). Tablo seçicisi daha özgül olduğu için onu geçersiz kılar. */
table.who { display: table; width: 100%; }
table.who td.num, table.who tfoot td, table.who th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
table.who tfoot th, table.who tfoot td { font-weight: 700; border-top: 2px solid var(--axis); }

/* Panel (portal) sıkı düzen — kullanıcı 2026-10-21: "çok yer kaplıyor, daha minyon" */
.portal .card { padding: 14px 16px; }
.portal .tiles { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.portal .tile { padding: 8px 11px; border-radius: var(--radius-sm); }
.portal .tile-label { font-size: 12px; }
.portal .tile-value { font-size: 20px; }
.portal .tile-sub { font-size: 11.5px; }
.portal-period { gap: 10px; }
.period-pair { align-items: start; gap: 12px; }
@media (min-width: 1100px) { .period-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
table.who.compact th, table.who.compact td, .period-pair table.who th, .period-pair table.who td { padding: 5px 8px; font-size: 13px; }
table.who.entries td.name { white-space: normal; min-width: 140px; }
.login-name { display: block; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

td.warn { color: var(--critical); font-weight: 600; }

/* Ortak hesaptan kişisel hesaplara geçiş (2026-10-27): uyarı şeridi, "ortak" etiketi, toplu hesap + giriş kartları */
.shared-note { margin: 0 28px; max-width: 1184px; }
.info-strip.warn { border-left-color: var(--warning); color: var(--ink); }
.info-strip.warn .ico { color: var(--warn-ink); }
/* onam penceresi: yüz yüze bilgilendirme onayı (zorunlu; 2026-10-27) + deneme kipi şeridi */
.check.informed { align-items: flex-start; font-weight: 600; line-height: 1.4; }
.check.informed input { margin-top: 3px; }
dialog .info-strip { margin: 0 0 10px; }
.pill.warn-pill { margin-left: 6px; background: var(--poor-bg); color: var(--warn-ink); text-transform: uppercase; }
.secret-inline { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
#bulk-names { max-width: 520px; font-family: inherit; }
@media (max-width: 900px) { .shared-note { margin: 0 16px; } }
