@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-body: #f8f9fa; --bg-surface: #ffffff; --text-main: #111827; --text-muted: #6b7280;
    --border-color: #e5e7eb; --holiday-text: #10b981; --accent: #000000; --accent-fg: #ffffff; --weekend-bg: #f1f5f9;
    --m1-color: #111827; --n1-color: #4b5563; --m2-color: #6b7280; --n2-color: #1f2937;
    --ei-color: #f59e0b; --leave-color: #3b82f6; --report-color: #ef4444; --ok: #10b981; --warn: #f59e0b;
    --progress-bg: #e5e7eb; --progress-fill: #3b82f6; --progress-glow: rgba(59,130,246,.4);
    --bg-day: rgba(250,204,21,.15); --bg-night: rgba(14,165,233,.15);
    --bg-mixed: linear-gradient(135deg, rgba(250,204,21,.15) 0%, rgba(14,165,233,.15) 100%);
    --cell-fs: 11px; --date-fs: 15px; --weekcol: 64px; --radius: 8px;
    --shadow: 0 10px 25px rgba(0,0,0,.18);
}
[data-theme="dark"] {
    --bg-body: #000000; --bg-surface: #0a0a0a; --text-main: #f9fafb; --text-muted: #9ca3af;
    --border-color: #27272a; --accent: #ffffff; --accent-fg: #000000; --weekend-bg: #050505;
    --m1-color: #f3f4f6; --n1-color: #d1d5db; --m2-color: #9ca3af; --n2-color: #6b7280; --ei-color: #facc15;
    --progress-bg: #18181b; --progress-fill: #0ea5e9; --progress-glow: rgba(14,165,233,.6);
    --shadow: 0 10px 25px rgba(0,0,0,.7);
}
/* ---- 5 Renk Paleti ---- */
[data-palette="ocean"]  { --accent:#0369a1; --accent-fg:#fff; --m1-color:#0c4a6e; --n1-color:#0369a1; --m2-color:#0891b2; --n2-color:#1e3a8a; --progress-fill:#0284c7; --progress-glow:rgba(2,132,199,.45); }
[data-palette="forest"] { --accent:#15803d; --accent-fg:#fff; --m1-color:#14532d; --n1-color:#15803d; --m2-color:#65a30d; --n2-color:#064e3b; --progress-fill:#16a34a; --progress-glow:rgba(22,163,74,.45); }
[data-palette="sunset"] { --accent:#c2410c; --accent-fg:#fff; --m1-color:#7c2d12; --n1-color:#c2410c; --m2-color:#ea580c; --n2-color:#9a3412; --progress-fill:#f97316; --progress-glow:rgba(249,115,22,.45); }
[data-palette="grape"]  { --accent:#7c3aed; --accent-fg:#fff; --m1-color:#4c1d95; --n1-color:#7c3aed; --m2-color:#a855f7; --n2-color:#581c87; --progress-fill:#8b5cf6; --progress-glow:rgba(139,92,246,.45); }
[data-theme="dark"][data-palette="ocean"]  { --accent:#38bdf8; --accent-fg:#001018; --m1-color:#7dd3fc; --n1-color:#38bdf8; --m2-color:#22d3ee; --n2-color:#60a5fa; }
[data-theme="dark"][data-palette="forest"] { --accent:#4ade80; --accent-fg:#02130a; --m1-color:#86efac; --n1-color:#4ade80; --m2-color:#a3e635; --n2-color:#34d399; }
[data-theme="dark"][data-palette="sunset"] { --accent:#fb923c; --accent-fg:#1a0800; --m1-color:#fdba74; --n1-color:#fb923c; --m2-color:#fbbf24; --n2-color:#f97316; }
[data-theme="dark"][data-palette="grape"]  { --accent:#a78bfa; --accent-fg:#0e0520; --m1-color:#c4b5fd; --n1-color:#a78bfa; --m2-color:#e879f9; --n2-color:#8b5cf6; }

[data-fs="s"] { --cell-fs: 9px; --date-fs: 13px; }
[data-fs="l"] { --cell-fs: 13px; --date-fs: 17px; }

* { box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg-body); color: var(--text-main); padding: 20px; transition: background-color .3s, color .3s; }
a { color: inherit; }
button { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.mono { font-family: 'JetBrains Mono', monospace; }

body.power-save *, body.power-save *::before, body.power-save *::after { animation: none !important; transition: none !important; box-shadow: none !important; }

/* ---------- Butonlar & formlar ---------- */
.btn { background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: .2s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--border-color); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { padding: 7px 9px; font-size: 16px; position: relative; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.15); }
.btn-danger { background: var(--report-color); color: #fff; border-color: var(--report-color); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge-dot { position: absolute; top: -5px; right: -5px; background: var(--report-color); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.form-group { margin-bottom: 14px; }
.form-group > label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; }
.input, .form-group input, .form-group select, .form-group textarea, select.input {
    width: 100%; padding: 10px; background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 6px; outline: none; font-size: 14px; }
.input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; line-height: 1.4; }
.check input { width: 17px; height: 17px; margin-top: 1px; flex-shrink: 0; accent-color: var(--accent); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.help { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; line-height: 1.45; border: 1px solid; }
.alert-err { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); color: var(--report-color); }
.alert-ok { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.35); color: var(--ok); }
.alert-info { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.35); color: #3b82f6; }

/* ---------- Navbar ---------- */
.navbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-color); padding-bottom: 15px; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.logo-area { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-icon { background: var(--accent); color: var(--accent-fg); padding: 8px 12px; border-radius: 6px; font-size: 20px; }
.logo-text h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.logo-text p { margin: 0; font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.header-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.idle-chip { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-surface); }
.idle-chip.warn { color: var(--report-color); border-color: var(--report-color); }
.avatar-btn { font-size: 18px; padding: 5px 10px; }

/* ---------- Dropdown ---------- */
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; z-index: 60; display: none; }
.dd-menu.left { left: 0; right: auto; }
.dd.open .dd-menu { display: block; }
.dd-item { display: flex; width: 100%; gap: 8px; align-items: center; padding: 9px 10px; border: 0; background: none; color: var(--text-main); border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; text-decoration: none; }
.dd-item:hover { background: var(--bg-body); }
.dd-item.danger { color: var(--report-color); }
.dd-sep { height: 1px; background: var(--border-color); margin: 5px 0; }
.dd-head { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 6px 10px 3px; }

/* ---------- Duyuru bandı ---------- */
.ann-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; border: 1px solid; flex-wrap: wrap; }
.ann-bar .ann-text { flex: 1; min-width: 180px; }
.ann-info { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.35); }
.ann-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.4); }
.ann-success { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.35); }
.ann-danger { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); }
.ann-close { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--text-muted); }

/* ---------- Widget'lar ---------- */
.widget-dashboard { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.widget-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 6px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 68px; }
.widget-icon { font-size: 20px; margin-bottom: 4px; }
.widget-text { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; text-transform: uppercase; text-align: center; }

.progress-dashboard { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 6px; padding: 15px 18px; margin: 18px 0; font-family: 'JetBrains Mono', monospace; }
.progress-row { margin-bottom: 14px; }
.progress-row:last-child { margin-bottom: 0; }
.progress-info { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; margin-bottom: 6px; color: var(--text-muted); flex-wrap: wrap; }
.progress-bar-bg { width: 100%; height: 6px; background: var(--progress-bg); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--progress-fill); box-shadow: 0 0 8px var(--progress-glow); transition: width 1s linear; }

/* ---------- Yerleşim ---------- */
.layout { display: flex; gap: 26px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ---------- Takvim kontrolleri ---------- */
.cal-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav button { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 5px 12px; cursor: pointer; border-radius: 4px; color: var(--text-main); font-size: 16px; }
.month-nav h2 { margin: 0; font-size: 24px; font-weight: 900; white-space: nowrap; }
.month-nav h2 span { color: var(--text-muted); font-weight: 400; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.toolbar .sep { width: 1px; height: 26px; background: var(--border-color); margin: 0 2px; }
.search-wrap { position: relative; flex: 1 1 180px; min-width: 150px; max-width: 280px; }
.search-wrap input { width: 100%; padding: 8px 10px 8px 30px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-surface); color: var(--text-main); font-size: 13px; }
.search-wrap::before { content: '🔍'; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow); z-index: 55; font-size: 12px; }
.search-results div { padding: 7px 10px; cursor: pointer; border-bottom: 1px dashed var(--border-color); }
.search-results div:hover { background: var(--bg-body); }
.brush-select { padding: 7px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-surface); color: var(--text-main); font-size: 13px; max-width: 140px; }

.fav-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: 12px; }
.fav-bar .lbl { font-weight: 700; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--bg-surface); cursor: pointer; font-size: 12px; font-weight: 600; max-width: 180px; color: var(--text-main); }
.chip span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip .cdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Takvim ---------- */
.calendar-wrapper { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.cal-header, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)) var(--weekcol); }
.cal-header { border-bottom: 1px solid var(--border-color); }
.cal-header div { padding: 13px 4px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; overflow: hidden; }
.cal-header div.we { color: var(--report-color); }
.cal-header div.wk { background: var(--weekend-bg); font-size: 9px; letter-spacing: 0; }
.cal-cell { min-height: 112px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 8px; position: relative; cursor: pointer; transition: .15s; background: var(--bg-surface); min-width: 0; overflow: hidden; user-select: none; }
.cal-cell:hover { background: var(--bg-body); }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.we { background: var(--weekend-bg); }
.cal-cell.shift-day { background: var(--bg-day) !important; }
.cal-cell.shift-night { background: var(--bg-night) !important; }
.cal-cell.shift-mixed { background: var(--bg-mixed) !important; }
.cal-cell.search-hit { outline: 3px solid var(--warn); outline-offset: -3px; }
.cal-cell.locked::after { content: '🔒'; position: absolute; bottom: 4px; right: 5px; font-size: 10px; opacity: .45; }
.cal-cell.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { box-shadow: inset 0 0 0 3px var(--warn); } }
.week-cell { background: var(--weekend-bg); border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; text-align: center; font-family: 'JetBrains Mono', monospace; min-width: 0; overflow: hidden; }
.week-cell b { font-size: 13px; }
.week-cell small { font-size: 9px; color: var(--text-muted); }
.date-num { font-size: var(--date-fs); font-weight: 600; display: inline-flex; justify-content: center; align-items: center; width: 28px; height: 28px; border-radius: 50%; }
.cal-cell.today .date-num { background: var(--accent); color: var(--accent-fg); }
.holiday-text { position: absolute; top: 8px; right: 8px; font-size: 9px; color: var(--holiday-text); font-weight: 700; text-transform: uppercase; text-align: right; max-width: 62%; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.holiday-text.half { color: var(--ei-color); }
.shift-entry { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-badge { font-size: var(--cell-fs); font-weight: 700; display: flex; align-items: center; gap: 4px; line-height: 1.25; min-width: 0; }
.shift-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.shift-badge .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.shift-hosp { font-size: calc(var(--cell-fs) - 2px); font-weight: 500; opacity: .85; padding-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid transparent; margin-left: 2px; }
.shift-net { font-size: calc(var(--cell-fs) - 1px); color: var(--text-muted); margin-top: 2px; border-top: 1px dashed var(--border-color); padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.brush-mode .cal-cell:not(.empty) { cursor: crosshair; }

/* ---------- Sidebar kutuları ---------- */
.section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin: 0 0 12px 0; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 12px; border-radius: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-box label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.stat-box .value { font-size: 24px; font-weight: 900; letter-spacing: -1px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.stat-box .value span { font-size: 10px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.stat-box.wide { grid-column: span 2; }
.comp-badge { font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 4px; width: fit-content; max-width: 100%; }
.comp-up { background: rgba(16,185,129,.1); color: #10b981; }
.comp-down { background: rgba(239,68,68,.1); color: #ef4444; }
.comp-neutral { background: rgba(107,114,128,.1); color: var(--text-muted); }
.live-timer-box { background: var(--bg-surface); border: 2px solid var(--border-color); padding: 18px; border-radius: 8px; text-align: center; }
.box { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 14px; border-radius: 6px; font-size: 12px; }
.chart-box { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 12px; border-radius: 6px; min-height: 100px; position: relative; }
.hosp-stat-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 12px; font-weight: 600; }
.hosp-stat-item:last-child { border-bottom: none; }
.hosp-stat-item .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: flex; align-items: center; gap: 6px; }
.empty-msg { font-size: 11px; color: var(--text-muted); font-style: italic; text-align: center; padding: 10px 0; }
body.privacy-mode .blur-target { filter: blur(8px); opacity: .5; pointer-events: none; user-select: none; }

.poll-opt { display: block; width: 100%; text-align: left; margin-top: 6px; }
.poll-bar { height: 6px; background: var(--progress-bg); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.poll-bar i { display: block; height: 100%; background: var(--progress-fill); }

.legend-area { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 18px; margin-top: 18px; }
.legend-grid { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.legend-item::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--dot-color, #000); }
.legend-item span { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.legend-footer { font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-color); padding-top: 12px; line-height: 1.55; }

/* ---------- Modallar ---------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); align-items: center; justify-content: center; z-index: 100; padding: 15px; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-surface); padding: 20px; border-radius: 10px; width: 100%; max-width: 420px; border: 1px solid var(--border-color); box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; position: relative; }
.modal-content.wide { max-width: 760px; }
.modal-content.xwide { max-width: 1100px; }
.modal-content h3 { margin: 0 0 14px 0; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; padding-right: 30px; font-size: 17px; }
.modal-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal-x:hover { background: var(--bg-body); color: var(--text-main); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.shift-divider { border-top: 1px dashed var(--border-color); margin: 14px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 8px 12px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--text-main); border-bottom-color: var(--accent); }
.list-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg-body); font-size: 13px; }
.list-item .meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.list-item .reply { margin-top: 8px; padding: 10px; border-left: 3px solid var(--accent); background: var(--bg-surface); border-radius: 4px; white-space: pre-wrap; }
.list-item.unread { border-color: var(--accent); }
.status { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; }
.st-open { background: rgba(59,130,246,.12); color: #3b82f6; }
.st-progress { background: rgba(245,158,11,.14); color: #d97706; }
.st-resolved { background: rgba(16,185,129,.12); color: #10b981; }
.st-rejected { background: rgba(239,68,68,.12); color: #ef4444; }
.pre { white-space: pre-wrap; word-break: break-word; }
.kvkk-text { white-space: pre-wrap; font-size: 13px; line-height: 1.6; }

/* Yıllık görünüm */
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.mini-month { border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; background: var(--bg-body); cursor: pointer; }
.mini-month:hover { border-color: var(--accent); }
.mini-month h4 { margin: 0 0 6px 0; font-size: 12px; display: flex; justify-content: space-between; }
.mini-month h4 small { color: var(--text-muted); font-weight: 600; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-grid span { font-size: 9px; text-align: center; padding: 2px 0; border-radius: 3px; line-height: 1.3; }
.mini-grid span.h { color: var(--holiday-text); font-weight: 800; }
.mini-grid span.t { outline: 1px solid var(--accent); }
.mini-grid span.hd { color: var(--text-muted); font-weight: 700; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th, table.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border-color); text-align: left; white-space: nowrap; }
table.tbl th { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .5px; }
table.tbl tr.total td { font-weight: 800; border-top: 2px solid var(--border-color); }
.tbl-wrap { overflow-x: auto; }

/* Toast */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--text-main); color: var(--bg-surface); padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); animation: tin .25s ease; pointer-events: auto; }
.toast.err { background: var(--report-color); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* Tanıtım turu — arka planı kapatmaz, bulanıklaştırmaz */
.tour-tip { position: absolute; z-index: 250; background: var(--bg-surface); color: var(--text-main); border: 2px solid var(--accent); border-radius: 10px; padding: 16px; width: min(340px, calc(100vw - 24px)); box-shadow: var(--shadow); font-size: 13px; line-height: 1.55; }
.tour-tip h4 { margin: 0 0 8px 0; font-size: 15px; }
.tour-tip ul { margin: 6px 0; padding-left: 18px; }
.tour-tip li { margin-bottom: 3px; }
.tour-tip .tour-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.tour-tip .arrow { position: absolute; width: 14px; height: 14px; background: var(--bg-surface); border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); transform: rotate(45deg); }
.tour-highlight { outline: 3px solid var(--accent) !important; outline-offset: 4px; border-radius: 6px; position: relative; z-index: 5; }

/* Konfeti */
.confetti { position: fixed; top: -20px; z-index: 400; pointer-events: none; font-size: 22px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.celebrate { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 401; background: var(--bg-surface); border: 2px solid var(--accent); border-radius: 12px; padding: 12px 18px; font-weight: 800; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; max-width: 92vw; }

/* ---------- Auth sayfası ---------- */
.auth-wrap { min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 26px; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.auth-card .logo-area { justify-content: center; margin-bottom: 20px; }
.auth-foot { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 16px; line-height: 1.6; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 15px; }
.lang-switch { position: fixed; top: 14px; right: 14px; display: flex; gap: 4px; }

/* ---------- Profil sayfası ---------- */
.profile-wrap { max-width: 980px; margin: 0 auto; }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--border-color); padding-bottom: 14px; }
.profile-x { font-size: 26px; text-decoration: none; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); line-height: 1; }
.profile-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; align-items: start; }
.p-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 10px; }
.p-nav button { text-align: left; padding: 10px 12px; border: 1px solid transparent; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-main); }
.p-nav button.active { background: var(--bg-surface); border-color: var(--border-color); }
.p-section { display: none; }
.p-section.active { display: block; }
.p-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.p-card h3 { margin: 0 0 4px 0; font-size: 16px; }
.p-card > p.sub { margin: 0 0 14px 0; font-size: 12px; color: var(--text-muted); }
.opt-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { border: 2px solid var(--border-color); border-radius: 8px; padding: 9px 13px; cursor: pointer; background: var(--bg-body); font-weight: 700; font-size: 13px; color: var(--text-main); display: inline-flex; gap: 6px; align-items: center; }
.opt.active { border-color: var(--accent); }
.swatch { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-grid button { font-size: 22px; padding: 6px; border: 2px solid var(--border-color); border-radius: 8px; background: var(--bg-body); cursor: pointer; }
.emoji-grid button.active { border-color: var(--accent); }
.cs-row { display: grid; grid-template-columns: 70px 1fr 90px 80px 80px 70px 44px 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cs-row input, .cs-row select { padding: 7px; font-size: 12px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-body); color: var(--text-main); width: 100%; min-width: 0; }
.cs-row input[type=color] { padding: 2px; height: 32px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 13px; align-items: center; flex-wrap: wrap; }
.kv:last-child { border-bottom: 0; }

/* ---------- Paylaşım (salt-okunur) ---------- */
.share-wrap { max-width: 1000px; margin: 0 auto; }

/* ---------- Hata sayfaları ---------- */
.err-wrap { min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; text-align: center; }
.err-code { font-size: 96px; font-weight: 900; letter-spacing: -4px; line-height: 1; margin: 0; }
.err-wrap p { color: var(--text-muted); max-width: 440px; margin: 12px auto 22px; line-height: 1.6; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1000px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .widget-dashboard { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .year-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .profile-grid { grid-template-columns: 1fr; }
    .p-nav { flex-direction: row; overflow-x: auto; position: static; }
    .p-nav button { white-space: nowrap; }
    .cs-row { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 600px) {
    body { padding: 10px; }
    :root { --weekcol: 34px; }
    .logo-text h1 { font-size: 17px; }
    .navbar { gap: 8px; }
    .header-actions { width: 100%; justify-content: flex-end; }
    .cal-header div { font-size: 9px; padding: 9px 1px; letter-spacing: 0; }
    .cal-cell { min-height: 78px; padding: 3px; }
    .date-num { width: 20px; height: 20px; font-size: 11px; }
    .holiday-text { font-size: 7px; top: 3px; right: 3px; }
    .shift-entry { margin-top: 3px; }
    .shift-badge { font-size: 9px; gap: 2px; }
    .shift-badge::before { width: 5px; height: 5px; }
    .shift-badge .tm, .shift-hosp, .week-cell small { display: none; }
    .shift-net { font-size: 8px; }
    .week-cell b { font-size: 10px; }
    .month-nav h2 { font-size: 19px; }
    .month-nav { gap: 6px; }
    .stat-box .value { font-size: 20px; }
    .year-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .modal-content { padding: 16px; }
    .search-wrap { max-width: none; flex-basis: 100%; }
}

/* ---------- Dışa aktarma (PDF/PNG) ---------- */
body.exporting { background: #ffffff !important; }
body.exporting .sidebar, body.exporting .widget-dashboard, body.exporting .progress-dashboard, body.exporting .toolbar, body.exporting .fav-bar, body.exporting .ann-bar, body.exporting #annArea { display: none !important; }
body.exporting .layout { display: block !important; }
body.exporting .cal-controls button { display: none !important; }
body.exporting .cal-controls { justify-content: center !important; }
body.exporting .cal-cell { min-height: 85px !important; padding: 5px !important; }
body.exporting .cal-cell.today .date-num { background: transparent !important; color: #000 !important; }
@media print { .navbar, .sidebar, .toolbar, .fav-bar { display: none; } }

/* ================= v2 eklemeleri ================= */
/* Renk körü dostu palet (Okabe-Ito) */
[data-palette="cb"] { --accent:#0072B2; --accent-fg:#fff; --m1-color:#0072B2; --n1-color:#000000; --m2-color:#009E73; --n2-color:#56B4E9; --ei-color:#E69F00; --leave-color:#CC79A7; --report-color:#D55E00; --holiday-text:#009E73; --progress-fill:#0072B2; --progress-glow:rgba(0,114,178,.45); --bg-day: rgba(230,159,0,.16); --bg-night: rgba(86,180,233,.2); }
[data-theme="dark"][data-palette="cb"] { --accent:#56B4E9; --accent-fg:#000; --m1-color:#56B4E9; --n1-color:#F0E442; --m2-color:#009E73; --n2-color:#CC79A7; }
/* Yüksek kontrast */
[data-hc="1"] { --text-muted: var(--text-main); --border-color: #000; }
[data-hc="1"][data-theme="dark"] { --border-color: #fff; --bg-surface:#000; }
[data-hc="1"] .cal-cell, [data-hc="1"] .stat-box, [data-hc="1"] .btn, [data-hc="1"] .widget-card, [data-hc="1"] .box { border-width: 2px; }
[data-hc="1"] .shift-badge, [data-hc="1"] .date-num { font-weight: 900; }
[data-hc="1"] a { text-decoration: underline; }
[data-hc="1"] *:focus-visible { outline: 3px solid #f59e0b !important; outline-offset: 2px; }
/* Okunabilir yazı tipleri */
[data-font="readable"] * { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif !important; }
[data-font="dyslexia"] * { font-family: 'Lexend', system-ui, sans-serif !important; letter-spacing: .03em; word-spacing: .12em; }
[data-font="dyslexia"] body { line-height: 1.6; }

/* Şifre gücü */
.pw-meter { height: 5px; background: var(--progress-bg); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s; }

/* Sürükle-bırak */
.cal-cell.drag-src { opacity: .45; }
.cal-cell.drag-over { box-shadow: inset 0 0 0 3px var(--accent); }
.drag-ghost { position: fixed; z-index: 500; pointer-events: none; background: var(--accent); color: var(--accent-fg); padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow); transform: translate(12px, 12px); white-space: nowrap; }

/* Hafta no + icap */
.week-cell .wno { font-size: 9px; font-weight: 800; color: var(--accent); }
.oncall-hint { display: none; }

/* Çevrimdışı rozeti */
.offline-chip { font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 20px; background: var(--warn); color: #111; }
.ann-maint { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.5); }
.changelog-item { border-left: 3px solid var(--accent); padding: 6px 0 6px 12px; margin-bottom: 14px; }
.changelog-item h4 { margin: 0 0 4px 0; font-size: 15px; }

/* ================= A4 Yazdırma ================= */
#printArea { display: none; }
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    html, body { background: #fff !important; color: #000 !important; padding: 0 !important; }
    body.printing > *:not(#printArea) { display: none !important; }
    body.printing #printArea { display: block !important; }
    #printArea { font-family: Arial, Helvetica, sans-serif !important; color: #000; }
    #printArea * { font-family: Arial, Helvetica, sans-serif !important; color: #000 !important; }
    #printArea h1 { font-size: 18pt; margin: 0 0 2mm 0; }
    #printArea .p-sub { font-size: 9pt; margin-bottom: 3mm; }
    #printArea table.p-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
    #printArea table.p-cal th { font-size: 9pt; border: 1px solid #000; padding: 1.5mm; background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #printArea table.p-cal td { border: 1px solid #000; height: 22mm; vertical-align: top; padding: 1.2mm; font-size: 8pt; overflow: hidden; }
    #printArea table.p-cal td.we { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #printArea table.p-cal td.wk { background: #eee !important; text-align: center; vertical-align: middle; font-weight: bold; width: 14mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #printArea .p-d { font-weight: bold; font-size: 10pt; }
    #printArea .p-h { font-size: 6.5pt; font-style: italic; }
    #printArea .p-s { font-weight: bold; font-size: 9pt; margin-top: 1mm; }
    #printArea .p-i { font-size: 7pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #printArea .p-sum { margin-top: 3mm; font-size: 9pt; display: flex; gap: 8mm; flex-wrap: wrap; }
    #printArea .p-foot { margin-top: 2mm; font-size: 7pt; color: #555 !important; }
}
