:root {
  --bg-1: #0f172a;
  --bg-2: #1e1b4b;
  --bg-3: #312e81;
  --card: rgba(255, 255, 255, 0.08);
  --card-solid: #ffffff;
  --text: #e2e8f0;
  --text-dark: #1e293b;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #ec4899;
  --ok: #22c55e;
  --danger: #ef4444;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar .inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow);
}
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.brand p { font-size: 12px; color: var(--muted); }

.btn {
  border: 0; cursor: pointer; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform .12s ease, opacity .12s ease; text-decoration: none; display: inline-block;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .9; }
.btn.ghost { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #f97316); }
.btn.ok { background: linear-gradient(135deg, #22c55e, #16a34a); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero / controls ---------- */
.hero { padding: 28px 0 10px; }
.hero h2 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.hero .date-line { color: var(--muted); font-size: 15px; }

.controls {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.field input, .field select {
  background: rgba(255,255,255,.08); color: var(--text);
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; min-width: 180px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field select option { color: #111; }

.notice {
  margin: 16px 0; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .35);
  color: #fde68a; font-size: 14px;
}
.notice.empty { background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.3); color: var(--muted); }

/* ---------- Cards grid ---------- */
.summary { color: var(--muted); font-size: 14px; margin: 10px 4px; }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  position: relative; border-radius: var(--radius); padding: 16px 16px 18px;
  color: #fff; box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card .branch { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; opacity: .92; }
.card .name { font-size: 19px; font-weight: 800; margin-top: 8px; line-height: 1.25; }
.card .none { font-size: 15px; font-weight: 600; opacity: .85; margin-top: 8px; }
.card .pill {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.22); padding: 4px 10px; border-radius: 999px;
}
.card .glow {
  position: absolute; right: -30px; top: -30px; width: 120px; height: 120px;
  background: rgba(255,255,255,.18); border-radius: 50%; filter: blur(8px);
}

/* ---------- Auth / panel ---------- */
.center-wrap { min-height: 80vh; display: grid; place-items: center; padding: 24px; }
.panel {
  width: 100%; max-width: 420px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12); border-radius: 24px; padding: 28px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.panel.wide { max-width: 920px; }
.panel h2 { margin-bottom: 6px; font-size: 22px; }
.panel .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group select {
  width: 100%; background: rgba(255,255,255,.08); color: var(--text);
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.msg { font-size: 14px; margin: 10px 0; padding: 10px 12px; border-radius: 10px; display: none; }
.msg.show { display: block; }
.msg.err { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.msg.ok { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4); color: #86efac; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tab {
  padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: var(--text);
}
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.table tr:hover td { background: rgba(255,255,255,.04); }

/* ---------- Upload dropzone ---------- */
.drop {
  border: 2px dashed rgba(255,255,255,.25); border-radius: var(--radius);
  padding: 34px; text-align: center; cursor: pointer; transition: all .15s ease;
  background: rgba(255,255,255,.04);
}
.drop:hover, .drop.drag { border-color: var(--accent); background: rgba(99,102,241,.12); }
.drop .big { font-size: 38px; margin-bottom: 8px; }
.drop p { color: var(--muted); font-size: 14px; }

/* ---------- Day toggles (edit) ---------- */
.daygrid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.day-toggle {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: var(--text); font-size: 13px; cursor: pointer; font-weight: 600;
}
.day-toggle.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }

.edit-row { padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; margin-bottom: 12px; background: rgba(255,255,255,.04); }
.edit-row .head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.edit-row input { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.edit-row input[readonly] { opacity: .65; cursor: not-allowed; background: rgba(255,255,255,.04); }

/* ---------- Floating Save (FAB) ---------- */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  padding: 15px 24px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(0, 0, 0, .45); }
.fab:active { transform: translateY(0); }
.fab .ico { font-size: 17px; }
@media (max-width: 560px) {
  .fab { left: 14px; right: 14px; bottom: 14px; justify-content: center; padding: 16px; border-radius: 16px; }
}

/* ---------- Aylık tablo (Excel benzeri) ---------- */
.table-section { margin-top: 26px; }
.table-section .head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.table-section h3 { font-size: 18px; font-weight: 800; }
.table-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.legend-dot.today { background: linear-gradient(135deg, #f97316, #ea580c); }
.legend-dot.on { background: rgba(99,102,241,.55); }

.month-table-wrap {
  overflow-x: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  background: rgba(255,255,255,.03); -webkit-overflow-scrolling: touch;
}
table.mt { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; }
table.mt th, table.mt td { border-bottom: 1px solid rgba(255,255,255,.07); border-right: 1px solid rgba(255,255,255,.05); white-space: nowrap; }
table.mt thead th {
  position: sticky; top: 0; z-index: 4; background: #1b1c46; color: var(--muted);
  font-weight: 700; padding: 8px 6px; text-align: center;
}
table.mt thead th.col-today { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }

table.mt td.br, table.mt th.corner {
  position: sticky; left: 0; z-index: 3; background: #181a3d;
  width: 116px; min-width: 116px; max-width: 116px; padding: 7px 8px;
  font-weight: 800; font-size: 10.5px; text-transform: uppercase; letter-spacing: .2px;
  color: #fff; vertical-align: middle; white-space: normal; line-height: 1.2; cursor: pointer;
}
table.mt td.nm, table.mt th.nm-h {
  position: sticky; left: 116px; z-index: 2; background: #161832;
  width: 132px; min-width: 132px; max-width: 132px; padding: 7px 8px; color: var(--text);
  white-space: normal; line-height: 1.2; font-size: 11px;
}
/* Seçili günün icapçısı: ismin solunda turuncu çizgi (hover olmadan da belli) */
table.mt tbody tr.octoday td.nm { box-shadow: inset 3px 0 0 #f97316; }
/* Branşa gelince o günün icapçısını belirginleştir */
table.mt tbody tr.oc-hl td.nm { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; font-weight: 800; }
table.mt tbody tr.oc-hl td.br { background: #25275a; color: #fff; }
table.mt tbody tr.oc-hl td.day.on.today { box-shadow: inset 0 0 0 2px #fff, 0 0 16px rgba(249,115,22,.95); transform: scale(1.06); }
table.mt th.corner, table.mt th.nm-h { z-index: 5; }

table.mt td.day { width: 22px; min-width: 22px; text-align: center; color: transparent; padding: 6px 0; }
table.mt td.day.on { background: rgba(99,102,241,.45); color: rgba(255,255,255,.92); font-weight: 700; }
table.mt td.day.col-today { background: rgba(249,115,22,.12); }
table.mt td.day.on.today {
  background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}

/* Not: Genel satır-hover vurgusu kaldırıldı; branş hücresi ilk satıra ait olduğu
   için ilk doktoru yanlışlıkla "seçili" gösteriyordu. Vurgu yalnızca branşa
   gelince o günün icapçısı için (.oc-hl) yapılır. */

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 23, .65); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: grid; }
.modal {
  width: 100%; max-width: 420px; background: #1e1b4b;
  border: 1px solid rgba(255,255,255,.15); border-radius: 20px; padding: 24px;
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal input {
  width: 100%; background: rgba(255,255,255,.08); color: var(--text);
  border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none;
}
.modal input:focus { border-color: var(--accent); }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }
.row-actions { display: flex; gap: 8px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .hero h2 { font-size: 22px; }
  .field input, .field select { min-width: 0; width: 100%; }
  .controls { flex-direction: column; }
  .field { width: 100%; }

  /* Günün icapçı kartları: daha küçük ve yan yana */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card { padding: 10px 10px 12px; border-radius: 14px; }
  .card .branch { font-size: 9px; letter-spacing: .3px; }
  .card .name { font-size: 13px; margin-top: 5px; }
  .card .none { font-size: 11px; margin-top: 5px; }
  .card .pill { font-size: 9px; padding: 3px 7px; margin-top: 8px; }
  .card .glow { width: 70px; height: 70px; right: -20px; top: -20px; }

  /* Aylık tablo: ekrana daha çok sığsın */
  table.mt { font-size: 10px; }
  table.mt td.br, table.mt th.corner { width: 74px; min-width: 74px; max-width: 74px; font-size: 9px; padding: 5px 5px; }
  table.mt td.nm, table.mt th.nm-h { left: 74px; width: 96px; min-width: 96px; max-width: 96px; font-size: 9.5px; padding: 5px 5px; }
  table.mt td.day { width: 18px; min-width: 18px; font-size: 9px; padding: 4px 0; }
  table.mt thead th { padding: 5px 2px; }
  table.mt tbody tr.octoday td.nm { box-shadow: inset 2px 0 0 #f97316; }

  .table-section h3 { font-size: 16px; }
}
