/* ==========================================================
   Radyoloji Nöbet Otomasyonu — arayüz stilleri
   ========================================================== */

:root {
    --bg:            #0b1220;
    --bg-soft:       #111a2e;
    --surface:       #16203a;
    --surface-2:     #1c2947;
    --border:        #26355c;
    --border-soft:   #1f2c4d;
    --text:          #e6ecf8;
    --text-dim:      #96a3c2;
    --text-faint:    #64748b;
    --primary:       #4f7cff;
    --primary-soft:  rgba(79, 124, 255, .14);
    --success:       #22c55e;
    --success-soft:  rgba(34, 197, 94, .14);
    --warning:       #f59e0b;
    --warning-soft:  rgba(245, 158, 11, .14);
    --danger:        #f43f5e;
    --danger-soft:   rgba(244, 63, 94, .14);
    --night:         #6366f1;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 10px 30px rgba(0, 0, 0, .35);
    --sidebar-w:     248px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.icon { flex: none; }

/* ---------- İskelet ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #4f7cff, #7c3aed);
    display: grid; place-items: center;
    font-weight: 800; font-size: 17px; color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--text-faint); }

.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 13.5px; font-weight: 500;
    margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: #a9c0ff; font-weight: 600; }
.nav-group {
    display: block; margin: 14px 0 6px; padding: 0 11px;
    font-size: 10px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-faint);
    border-top: 1px solid var(--border-soft); padding-top: 12px;
}

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border-soft); }
.user-card { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--surface-2); display: grid; place-items: center;
    font-weight: 700; color: #a9c0ff; flex: none;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--text-faint); }

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

.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(11, 18, 32, .85);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; flex: 1; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; }

.content { padding: 22px 24px 40px; flex: 1; }
.footer { padding: 14px 24px 22px; color: var(--text-faint); font-size: 11.5px; text-align: center; }

/* ---------- Bildirimler ---------- */
.alerts { padding: 14px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: 13.5px; border: 1px solid transparent;
}
.alert span { flex: 1; }
.alert-success { background: var(--success-soft); border-color: rgba(34,197,94,.3);  color: #86efac; }
.alert-error   { background: var(--danger-soft);  border-color: rgba(244,63,94,.3);  color: #fda4af; }
.alert-warning { background: var(--warning-soft); border-color: rgba(245,158,11,.3); color: #fcd34d; }
.alert-info    { background: var(--primary-soft); border-color: rgba(79,124,255,.3); color: #a9c0ff; }
.alert-close { background: none; border: 0; color: inherit; font-size: 19px; cursor: pointer; opacity: .6; line-height: 1; }
.alert-close:hover { opacity: 1; }

/* ---------- Kartlar ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
}
.card-head h2 { font-size: 15px; font-weight: 620; flex: 1; letter-spacing: -.01em; }
.card-head .sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---------- İstatistik kutuları ---------- */
.stat {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-hint  { font-size: 12px; color: var(--text-dim); }
.stat.clickable {
    cursor: pointer; text-decoration: none; color: inherit;
    transition: border-color .15s, transform .15s;
}
.stat.clickable:hover { border-color: var(--primary); transform: translateY(-1px); }
.stat.accent  { border-color: rgba(79,124,255,.35);  background: linear-gradient(160deg, var(--primary-soft), var(--surface)); }
.stat.good    { border-color: rgba(34,197,94,.3);    background: linear-gradient(160deg, var(--success-soft), var(--surface)); }
.stat.warn    { border-color: rgba(245,158,11,.3);   background: linear-gradient(160deg, var(--warning-soft), var(--surface)); }
.stat.bad     { border-color: rgba(244,63,94,.3);    background: linear-gradient(160deg, var(--danger-soft), var(--surface)); }

/* ---------- Düğmeler ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: 13px; font-weight: 550; font-family: inherit;
    cursor: pointer; transition: filter .15s, background .15s, border-color .15s;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #04240f; }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; border-radius: 7px;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--primary); }
.icon-btn.danger:hover { color: #fda4af; border-color: var(--danger); }

/* ---------- Formlar ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field .hint { font-size: 11.5px; color: var(--text-faint); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=email], input[type=tel], input[type=color], select, textarea {
    width: 100%; padding: 8px 11px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type=color] { padding: 3px; height: 36px; cursor: pointer; }
textarea { resize: vertical; min-height: 72px; }
select { cursor: pointer; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.form-actions { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }

.toolbar {
    display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
    padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
}
.toolbar .field { min-width: 150px; }
.toolbar .grow { flex: 1; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left; padding: 10px 14px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-faint); font-weight: 700;
    border-bottom: 1px solid var(--border); background: var(--bg-soft);
    position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.data td { padding: 9px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.right { text-align: right; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .icon-btn + .icon-btn { margin-left: 4px; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-faint); }
.empty svg { opacity: .4; margin-bottom: 10px; }

/* ---------- Rozetler ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 650; letter-spacing: .01em;
    border: 1px solid transparent; white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: #a9c0ff; border-color: rgba(79,124,255,.3); }
.badge-success { background: var(--success-soft); color: #86efac; border-color: rgba(34,197,94,.3); }
.badge-warning { background: var(--warning-soft); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.badge-danger  { background: var(--danger-soft);  color: #fda4af; border-color: rgba(244,63,94,.3); }
.badge-muted   { background: var(--surface-2);    color: var(--text-dim); border-color: var(--border); }
.badge-night   { background: rgba(99,102,241,.16); color: #a5b4fc; border-color: rgba(99,102,241,.35); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- İlerleme çubuğu ---------- */
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .3s; }
.bar.good > span { background: var(--success); }
.bar.warn > span { background: var(--warning); }
.bar.bad  > span { background: var(--danger); }

/* ---------- Nöbet takvimi ---------- */
.roster-wrap { overflow: auto; max-height: 74vh; border-radius: var(--radius); }
table.roster { border-collapse: separate; border-spacing: 0; font-size: 11.5px; width: max-content; min-width: 100%; }
table.roster th, table.roster td { border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
table.roster thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--bg-soft); padding: 8px 6px;
    font-size: 10.5px; font-weight: 700; color: var(--text-dim);
    text-align: center; min-width: 84px; white-space: nowrap;
}
table.roster thead th.corner { left: 0; z-index: 5; min-width: 190px; text-align: left; padding-left: 14px; }
table.roster tbody th {
    position: sticky; left: 0; z-index: 2;
    background: var(--surface); padding: 6px 12px;
    text-align: left; font-weight: 550; font-size: 12px; white-space: nowrap;
    min-width: 190px; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
table.roster tbody th small { display: block; color: var(--text-faint); font-size: 10px; font-weight: 400; }
table.roster td { padding: 3px; text-align: center; background: var(--bg); height: 32px; }
table.roster td.weekend { background: #0e1830; }
table.roster tbody tr:hover td { background: #16203a; }
table.roster tbody tr:hover td.weekend { background: #1a2542; }
table.roster th.weekend { color: #fda4af; }
table.roster td.total { background: var(--surface-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.chip {
    display: inline-block; padding: 2px 6px; border-radius: 5px;
    font-size: 10.5px; font-weight: 650; letter-spacing: -.01em;
    line-height: 1.5; cursor: pointer; border: 1px solid transparent;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { filter: brightness(1.25); }
.chip small { display: block; font-size: 9px; font-weight: 500; opacity: .8; }
.chip-leave { background: rgba(148,163,184,.14); color: #94a3b8; border-color: rgba(148,163,184,.3); cursor: default; }
.cell-add { opacity: 0; color: var(--text-faint); font-size: 15px; transition: opacity .12s; }
table.roster td:hover .cell-add { opacity: .7; }

/* ---------- Lejant ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Kip (modal) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(3, 7, 18, .72);
    backdrop-filter: blur(3px); display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: grid; }
/* Onay penceresi, içerik modalının üstünde olmalı (yanlış tıklama koruması) */
#confirmModal { z-index: 220; }
.modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    width: 100%; max-width: 520px; padding: 22px;
    max-height: 88vh; overflow-y: auto;
}
.modal.modal-lg { max-width: 860px; }
.modal h3 { font-size: 16px; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.modal .table-wrap { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.modal .table-wrap.compact { max-height: 27vh; }
.modal table.data thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.modal-head {
    position: sticky; top: -22px; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: -22px -22px 14px; padding: 18px 22px 12px;
    background: var(--surface); border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { margin: 0; }

/* Sayaç düğmesi — tıklanabilir olduğunu belli eden rakam */
.count-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 20px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font-size: 12.5px; font-weight: 650;
    font-family: inherit; font-variant-numeric: tabular-nums;
    transition: border-color .15s, color .15s, background .15s;
}
.count-btn:hover { border-color: var(--primary); color: #a9c0ff; background: var(--primary-soft); }
.count-btn.zero { color: var(--text-faint); }
.count-btn.zero:hover { border-color: var(--danger); color: #fda4af; background: var(--danger-soft); }

/* Modal içi özet kutuları */
.mini-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mini-stat {
    flex: 1; min-width: 104px;
    display: flex; flex-direction: column; gap: 3px;
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 9px 12px;
}
.mini-stat span {
    font-size: 10px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--text-faint); font-weight: 700; white-space: nowrap;
}
.mini-stat strong { margin-top: auto; font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stat strong small { font-size: 14px; font-weight: 600; color: var(--text-faint); }
.mini-stat em {
    font-style: normal; font-size: 10.5px; color: var(--text-faint);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-stat.good strong { color: #86efac; }
.mini-stat.bad strong  { color: #fda4af; }

/* Çalışma süresi gerekçesi: üzerine gelince açıklama gösteren ünlem */
.hint-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; margin-left: 3px;
    vertical-align: -2px; border-radius: 50%;
    color: var(--warning, #f59e0b); cursor: help;
}
.hint-icon:hover { color: var(--text); }

/* JS ile konumlanan açıklama balonu */
.tip-bubble {
    position: fixed; z-index: 3000; max-width: 290px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    background: #0b1222; border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
    color: var(--text); font-size: 12px; line-height: 1.5;
    pointer-events: none;
}

/* Sayıların anlamını açıklayan bilgi kutusu */
.legend-note {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 0 0 14px; padding: 10px 13px;
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-dim); line-height: 1.55;
}
.legend-note svg { flex: none; margin-top: 1px; color: var(--primary); }
.legend-note ul { margin: 4px 0 0; padding-left: 16px; }
.legend-note li { margin-bottom: 2px; }
.legend-note b { color: var(--text); }

/* Modal içindeki katlanabilir yedek havuz listesi */
.pool-details > summary {
    cursor: pointer; user-select: none; list-style: none;
    padding: 8px 11px; border: 1px dashed var(--border);
    border-radius: var(--radius-sm); color: var(--text-dim);
    font-size: 12px; font-weight: 600;
}
.pool-details > summary::-webkit-details-marker { display: none; }
.pool-details > summary::before { content: '▸ '; color: var(--text-faint); }
.pool-details[open] > summary { margin-bottom: 8px; }
.pool-details[open] > summary::before { content: '▾ '; }
.pool-details > summary:hover { border-color: var(--primary); color: var(--text); }

.rule-summary {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 10px 12px; margin-bottom: 14px;
    background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    font-size: 12.5px; color: var(--text-dim);
}

/* ---------- Giriş ekranı ---------- */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(900px 500px at 12% -8%, rgba(79,124,255,.18), transparent 60%),
        radial-gradient(700px 480px at 92% 108%, rgba(124,58,237,.16), transparent 60%),
        var(--bg);
}
.login-card {
    width: 100%; max-width: 400px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 30px; box-shadow: var(--shadow);
}
.login-card .brand { padding: 0 0 20px; }
.login-card h2 { font-size: 19px; margin-bottom: 4px; letter-spacing: -.02em; }
.login-card .muted { color: var(--text-faint); font-size: 13px; margin-bottom: 22px; }
.login-hint {
    margin-top: 18px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-soft); border: 1px dashed var(--border);
    font-size: 12px; color: var(--text-faint); text-align: center;
}

/* ---------- Yardımcılar ---------- */
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.mono  { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---------- Duyarlı ---------- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: var(--shadow);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-grid; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .alerts { padding: 12px 16px 0; }
}

/* ---------- Yazdırma ---------- */
@media print {
    .sidebar, .topbar, .footer, .alerts, .no-print { display: none !important; }
    body { background: #fff; color: #000; font-size: 9pt; }
    .content { padding: 0; }
    .card { border: 0; background: #fff; margin: 0; }
    @page { size: A4 landscape; margin: 8mm; }
}

/* ==========================================================
   Cihaz / günün görevlileri ekranları
   ========================================================== */

.section-label {
    margin: 4px 2px 8px; font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 14px;
}
.device-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
    transition: border-color .15s, transform .15s;
    min-width: 0;
}
.device-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.device-card.empty { opacity: .65; }
.device-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 9px;
}
.device-head strong { font-size: 14px; letter-spacing: -.01em; }

.person-lines { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.person-lines li {
    display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 8px;
    min-width: 0;
}
.person-name {
    flex: 1 1 140px;
    font-size: 12.5px; font-weight: 600;
    overflow: visible; text-overflow: unset;
    white-space: normal; line-height: 1.35;
    word-break: break-word;
}
.person-title {
    font-weight: 500; font-size: 9px !important;
    margin-left: 2px; white-space: nowrap;
}
/* İsmin yanındaki statü + kadro durumu; tam metni ipucunda. */
.person-meta {
    font-weight: 500; font-size: 10px;
    margin-left: 4px;
    color: var(--text-dim);
}
.person-conflict .person-meta,
.person-on .person-meta { color: inherit; opacity: .75; }

.time-badge {
    display: inline-block; flex: none; padding: 2px 7px; border-radius: 5px;
    font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: rgba(79,124,255,.13); color: #a9c0ff;
    border: 1px solid rgba(79,124,255,.3); white-space: nowrap;
}
.time-badge.night { background: rgba(99,102,241,.2); color: #c7d2fe; border-color: rgba(99,102,241,.5); }
.time-badge.on { background: rgba(34,197,94,.16); color: #86efac; border-color: rgba(34,197,94,.4); }

.live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--success); margin-right: 3px;
    box-shadow: 0 0 0 3px rgba(34,197,94,.2); animation: livepulse 1.6s infinite;
}
@keyframes livepulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

/* Kendini tazeleyen tablonun durum göstergesi */
.live-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: var(--text-faint);
    font-variant-numeric: tabular-nums; cursor: help; white-space: nowrap;
}
.live-tag[data-state="stale"] { color: var(--warning); }
.live-tag[data-state="stale"] .live-dot {
    background: var(--warning); animation: none;
    box-shadow: 0 0 0 2px rgba(245,158,11,.2);
}
.live-tag[data-state="down"] { color: var(--danger); }
.live-tag[data-state="down"] .live-dot {
    background: var(--danger); animation: none;
    box-shadow: 0 0 0 2px rgba(244,63,94,.2);
}
@media (prefers-reduced-motion: reduce) {
    .live-tag .live-dot { animation: none; }
}

.leave-line {
    margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border-soft);
    font-size: 11px; color: var(--warning); display: flex; flex-wrap: wrap; gap: 4px 10px;
    align-items: center;
}

.footnote-line {
    margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border-soft);
    font-size: 10.5px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 4px 10px;
    align-items: center;
}
.footnote-line span { display: inline-flex; align-items: center; gap: 4px; }
.conflict-warn.inline-small { display: inline-flex; vertical-align: -1px; }

.duty-chip {
    display: inline-flex; align-items: center; gap: 5px;
    margin: 2px 6px 2px 0; padding: 3px 8px 3px 3px;
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-radius: 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.duty-chip .ha {
    font-style: normal; font-size: 9px; font-weight: 800;
    color: #a9c0ff; letter-spacing: .04em;
}

.inline-form { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.inline-form input[type="date"] {
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 6px 9px; font: inherit; font-size: 12.5px;
    color-scheme: dark;
}

.filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.filter-bar input[type="text"], .filter-bar select {
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 7px 10px; font: inherit; font-size: 13px;
}
.filter-bar input[type="text"] { min-width: 210px; }

.modal-date-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 13px;
}
.modal-date-nav strong { font-size: 13.5px; }

tr.weekend-row td { background: rgba(148,163,184,.05); }
tr.today-row td { background: rgba(79,124,255,.07); }

.mini-stat .small-strong { font-size: 13px; }

/* ==========================================================
   Kroki: PDF plan + cihaz pinleri
   ========================================================== */

.map-toolbar { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.zoom-level { min-width: 46px; text-align: center; font-size: 12px; color: var(--text-dim); }

.plan-viewport {
    position: relative; height: calc(100vh - 250px); min-height: 420px;
    overflow: hidden; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: #262b36;
    cursor: grab; user-select: none;
}
.plan-viewport.grabbing { cursor: grabbing; }
.plan-viewport.pin-mode { cursor: crosshair; }

.plan-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.plan-stage canvas { display: block; background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.5); }

.pin-layer { position: absolute; inset: 0; }

.map-pin {
    position: absolute; transform: translate(-50%, -100%);
    transform-origin: 50% 100%;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; padding: 0; cursor: pointer;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.45));
}
.pin-dot {
    order: 2; width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
    background: var(--danger); border: 2.5px solid #fff;
    transform: rotate(-45deg);
    position: relative;
}
.pin-dot::after {
    content: ''; position: absolute; inset: 7px;
    background: #fff; border-radius: 50%;
}
.map-pin .pin-label {
    order: 1; background: #0b1222; color: #fff; border: 1px solid var(--border);
    font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.map-pin:hover .pin-dot { background: var(--primary); }
.map-pin:hover .pin-label { border-color: var(--primary); color: #a9c0ff; }
/* Cihaz adları yan yana pinlerde üst üste binebilir; imlecin altındaki öne gelsin. */
.map-pin:hover { z-index: 5; }

.plan-loading {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--text-dim); font-size: 13.5px; background: rgba(11,18,34,.4);
}

.pin-select {
    width: 100%; margin: 8px 0 4px;
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 9px 10px; font: inherit; font-size: 13.5px;
}

/* Kroki pin modalı: gün sütunları */
.modal.modal-xl { max-width: 1080px; }

.pin-days {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-top: 4px;
}
@media (max-width: 900px) { .pin-days { grid-template-columns: 1fr; } }

.pin-day {
    background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.pin-day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.pin-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.pin-day-head strong { font-size: 14.5px; }
.pin-day.is-today .pin-day-head strong { color: var(--primary); }
.pin-day-head span { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

.pin-person {
    background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 9px 11px;
}
.pin-person.on { border-color: var(--success); }

.pp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.pp-time {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; letter-spacing: .01em;
    color: #ffd27a;
}
.pin-person:not(.night) .pp-time { color: #8fd0ff; }
.pp-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--success); white-space: nowrap; }
.pp-name { font-size: 13.5px; font-weight: 700; }
.pp-title { font-size: 7.5px; font-weight: 500; color: var(--text-faint); margin-left: 2px; }
.pp-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.pin-empty { font-size: 12.5px; color: var(--text-dim); font-style: italic; margin: 6px 0; }
.pin-footnote {
    font-size: 10.5px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 3px 10px;
    align-items: center; padding: 6px 8px; background: var(--bg-soft);
    border: 1px dashed var(--border-soft); border-radius: 6px;
}
.pin-footnote svg { flex: none; }
.pin-leaves {
    font-size: 11.5px; color: var(--warning, #e8b04b); margin-top: auto; padding-top: 4px;
    border-top: 1px dashed var(--border-soft);
}

/* Kroki kilit düğmeleri ve taşıma */
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.mode-btn .ic-open   { display: none; }
.mode-btn.active .ic-open   { display: inline-flex; }
.mode-btn.active .ic-locked { display: none; }
.mode-btn .ic-locked, .mode-btn .ic-open { align-items: center; }

.mode-status {
    margin: 0 0 10px; padding: 8px 13px;
    background: var(--primary-soft, rgba(99, 102, 241, .12));
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    color: var(--text); font-size: 12.5px; font-weight: 600;
}

.plan-viewport.pin-add  { cursor: crosshair; }
.plan-viewport.pin-del .map-pin { cursor: not-allowed; }
.plan-viewport.pin-del .map-pin:hover .pin-dot { background: var(--danger); filter: brightness(1.3); }
.plan-viewport.pin-move .map-pin { cursor: grab; }
.plan-viewport.pin-move .map-pin.dragging { cursor: grabbing; }
.map-pin.dragging .pin-dot { background: var(--warning); }
.map-pin.dragging { filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); }

/* Nöbet girişi sayfası */
input[type=month] {
    width: 100%; padding: 8px 11px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13.5px; font-family: inherit;
}
input[type=date], input[type=time], input[type=month] { color-scheme: dark; }
.filter-bar input[type="month"], .filter-bar input[type="date"] {
    width: auto; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 7px 10px; font: inherit; font-size: 13px;
}
.filter-bar select { max-width: 340px; }

/* Düzenleme/silme modallarındaki etki bilgisi kutusu */
.impact-box {
    border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
    font-size: 12.5px; line-height: 1.6; color: var(--text-dim);
}
.impact-box.info   { background: var(--primary-soft); border: 1px solid rgba(79,124,255,.35); }
.impact-box.danger { background: var(--danger-soft, rgba(239,68,68,.12)); border: 1px solid rgba(239,68,68,.4); }
.impact-box strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 13px; }
.impact-box ul { margin: 0; padding-left: 18px; }
.impact-box li { margin-bottom: 4px; }
.impact-box b { color: var(--text); }

/* Belirgin (dolgulu) sayaç düğmesi — cihaz listesi görevli sayısı */
.count-btn.accent {
    background: var(--primary); border-color: var(--primary); color: #fff;
    padding: 4px 12px; font-size: 13px;
    box-shadow: 0 2px 8px rgba(79, 124, 255, .35);
}
.count-btn.accent:hover { background: #6b93ff; border-color: #6b93ff; color: #fff; }
table.data th.center { text-align: center; }

/* ==========================================================
   Aylık takvim ızgarası (cihaz detay + nöbet girişi)
   ========================================================== */

.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
    background: var(--border-soft); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); overflow: hidden;
}
.cal-head {
    background: var(--surface-2); padding: 6px 8px; text-align: center;
    font-size: 11.5px; font-weight: 700; color: var(--text-dim); letter-spacing: .03em;
}
.cal-head.weekend { color: var(--warning); }

.cal-cell {
    background: var(--bg); padding: 6px 7px; min-height: 100px; display: flex;
    flex-direction: column; gap: 3px; transition: background .15s;
}
.cal-cell.empty { background: var(--bg-soft); }
.cal-cell.we { background: rgba(245, 158, 11, .04); }
.cal-cell.today { background: rgba(79, 124, 255, .08); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-cell.no-duty { opacity: .5; }
.cal-cell[role="button"] { cursor: pointer; }
.cal-cell[role="button"]:hover { background: rgba(79, 124, 255, .12); }

.cal-day {
    display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2px;
}
.cal-num { font-size: 15px; font-weight: 800; }
.cal-num.badge { font-size: 12px; padding: 1px 7px; }
.cal-dow { font-size: 10px; color: var(--text-faint); font-weight: 600; }

.cal-people { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.cal-person {
    display: flex; flex-direction: column; gap: 1px;
    padding: 3px 5px; border-radius: 4px; font-size: 10.5px;
}
.cal-person.day   { background: rgba(79, 124, 255, .12); }
.cal-person.night { background: rgba(245, 158, 11, .15); }
.cal-person.prev  { background: rgba(148, 163, 184, .12); opacity: .7; }

.cal-time { display: flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text-dim); }
.cal-person.night .cal-time { color: #ffd27a; }
.cal-person.day .cal-time { color: #8fd0ff; }

.cal-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-empty { font-size: 11px; color: var(--text-faint); text-align: center; margin-top: 8px; }

/* İstatistik sayfası */
.stat.danger { border-color: var(--danger); }
.stat.danger .stat-value { color: var(--danger); }
.stat.danger .stat-hint { color: var(--danger); opacity: .8; }
.danger-text { color: var(--danger) !important; font-weight: 700; }
.conflict-row { background: rgba(239, 68, 68, .06) !important; }
.conflict-row td { border-bottom-color: rgba(239, 68, 68, .2); }
.conflict-row.on-row { background: rgba(34, 197, 94, .08) !important; }
.conflict-row.on-row td { border-bottom-color: rgba(34, 197, 94, .25); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .grid-4 { grid-template-columns: 1fr; } }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.bar-bg {
    height: 8px; border-radius: 4px; background: var(--bg-soft);
    overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 4px; background: var(--primary);
    transition: width .3s ease;
}

/* Modal içindeki takvim — daha kompakt */
.modal-cal .cal-cell { min-height: 70px; padding: 4px 5px; }
.modal-cal .cal-num { font-size: 13px; }
.modal-cal .cal-person { font-size: 10px; }
.modal-cal .cal-time { font-size: 9.5px; }
.modal-cal .cal-name { font-size: 9.5px; }
.modal-cal .cal-head { font-size: 10.5px; padding: 4px 6px; }

.modal-date-nav {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 6px 0;
}
.modal-date-nav strong { font-size: 14px; min-width: 140px; text-align: center; }

table.data.stats-table th.num,
table.data.stats-table td.num {
    text-align: right; font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
table.data.stats-table th { white-space: nowrap; }

/* Silme onay modalı */
.confirm-modal {
    max-width: 420px; text-align: center;
}
.confirm-modal .confirm-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
    background: rgba(239, 68, 68, .15); color: var(--danger);
}
.confirm-modal .confirm-icon .icon { width: 32px; height: 32px; }
.confirm-modal h3 { color: var(--danger); font-size: 17px; margin-bottom: 8px; }
.confirm-modal p {
    color: var(--text-dim); font-size: 13.5px; line-height: 1.6;
    margin-bottom: 16px; padding: 0 8px;
}
.confirm-modal .modal-actions { justify-content: center; gap: 12px; }
.confirm-modal .btn-danger {
    padding: 9px 22px; font-size: 13.5px; font-weight: 700;
    display: flex; align-items: center; gap: 6px;
}
.confirm-modal .btn-primary {
    padding: 9px 22px; font-size: 13.5px; font-weight: 700;
}
.confirm-modal .btn-ghost { padding: 9px 22px; font-size: 13.5px; }

/* Nöbet girişi: seçili gün */
.cal-cell.selected {
    background: rgba(16, 185, 129, .15) !important;
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .65);
    cursor: pointer;
}
.cal-cell[data-date] { cursor: pointer; user-select: none; }

/* Takvim hücresindeki silme butonu — her zaman görünür */
.cal-del {
    position: absolute; top: 1px; right: 1px;
    width: 16px; height: 16px; border: none; background: rgba(239,68,68,.85); color: #fff;
    border-radius: 50%; font-size: 12px; line-height: 14px; cursor: pointer;
    opacity: .85; transition: opacity .15s, transform .1s;
    display: flex; align-items: center; justify-content: center; padding: 0; z-index: 2;
}
.cal-del:hover { opacity: 1; transform: scale(1.15); background: var(--danger); }
.cal-person { position: relative; padding-right: 16px !important; cursor: pointer; }
.cal-cell.active-day { box-shadow: inset 0 0 0 2px var(--primary); background: rgba(79,124,255,.1) !important; }

/* Nöbet gün paneli */
.duty-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start;
}
@media (max-width: 1100px) { .duty-layout { grid-template-columns: 1fr; } }
.day-panel { position: sticky; top: 16px; }
.day-duty-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.day-duty-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; background: var(--bg-soft); border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}
.day-duty-item.leave { border-left-color: var(--danger); }
.dd-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dd-info strong { font-size: 13px; }
.dd-info span { font-size: 12px; color: var(--text-dim); }
.dd-info em { font-size: 10px; font-style: normal; }
.dd-actions { display: flex; gap: 4px; flex: none; }
.day-add-form {
    border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 4px;
}
.day-add-form h4 { font-size: 13px; margin-bottom: 10px; color: var(--text-dim); }

/* İzin hücresi */
.cal-person.leave {
    background: rgba(239, 68, 68, .12); border-left: 3px solid var(--danger);
}
.cal-person.leave .cal-time { color: var(--danger); }

/* Toplu atama barı */
.bulk-bar {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; align-items: end;
    border-bottom: 1px solid var(--border-soft);
}
.bulk-bar .field { display: flex; flex-direction: column; gap: 4px; }
.bulk-bar .field label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.bulk-bar .field select, .bulk-bar .field input[type=time] {
    padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-soft); color: var(--text); font: inherit; font-size: 13px;
}
.bulk-bar .field select { min-width: 200px; }

@media (max-width: 900px) {
    .cal-grid { grid-template-columns: repeat(7, 1fr); font-size: 9px; }
    .cal-cell { min-height: 60px; padding: 3px; }
    .cal-num { font-size: 12px; }
    .cal-person { padding: 2px 3px; }
    .cal-name { font-size: 9px; }
    .bulk-bar { flex-direction: column; }
}

/* ==========================================================
   Cihaz kart grid — kompakt tasarım
   ========================================================== */
.dev-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 1200px) { .dev-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .dev-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .dev-grid { grid-template-columns: 1fr; } }

.dev-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--dev-color);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.dev-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    border-color: var(--dev-color);
    background: var(--surface-2);
}

.dev-top {
    display: flex; align-items: center; gap: 10px;
}
.dev-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(79, 124, 255, .1);
    background: color-mix(in srgb, var(--dev-color) 12%, transparent);
    color: var(--dev-color); flex: none;
}
.dev-info { flex: 1; min-width: 0; }
.dev-name {
    display: block; font-size: 14px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
}
.dev-cat {
    font-size: 10px; color: var(--text-faint); font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em;
}

.dev-row {
    display: flex; gap: 6px;
}
.dev-chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; padding: 2px 8px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}
.dev-chip.sun   { background: rgba(79, 124, 255, .1);  color: #8fb8ff; }
.dev-chip.moon  { background: rgba(245, 158, 11, .1);  color: #ffd27a; }
.dev-chip.total { background: rgba(148, 163, 184, .1); color: var(--text-dim); }

.dev-live-bar {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; color: var(--success);
    background: rgba(34, 197, 94, .08);
    padding: 4px 10px; border-radius: 6px;
}
.dev-empty-bar {
    font-size: 10.5px; color: var(--text-faint);
}

.dev-actions {
    display: flex; align-items: center; gap: 4px;
    justify-content: flex-end;
    margin-top: -2px;
}
.dev-actions .icon-btn { opacity: .5; transition: opacity .15s; }
.dev-card:hover .dev-actions .icon-btn { opacity: 1; }

/* ==========================================================
   Çoklu cihaz çakışma uyarıları
   ========================================================== */
.conflict-banner {
    border: 1px solid rgba(244, 63, 94, .45) !important;
    background: rgba(244, 63, 94, .06);
}
.conflict-list { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 14px; }
.conflict-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; background: var(--bg-soft); border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}
.conflict-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conflict-who strong {
    color: var(--danger); font-size: 13.5px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.conflict-who strong .badge { font-weight: 650; }
.conflict-devices { font-size: 11.5px; color: var(--text-dim); }
.conflict-devices .device-jump { cursor: pointer; }
.conflict-devices .device-jump:hover { filter: brightness(1.15); text-decoration: underline; }
.conflict-actions { display: flex; gap: 6px; flex: none; }

.person-conflict {
    background: rgba(244, 63, 94, .1) !important;
    border-radius: 6px; padding: 3px 6px !important; margin: 1px -4px;
}
.person-group {
    border-radius: 6px; padding: 3px 6px !important; margin: 1px -4px;
    background: rgba(79, 124, 255, .08);
}
/* Çakışma + şu an görevde → yeşil satır, kırmızı yanıp sönen ünlem */
.person-conflict.person-on {
    background: rgba(34, 197, 94, .12) !important;
    box-shadow: inset 3px 0 0 var(--success);
}
.person-on .on-name { color: #86efac; font-weight: 650; }
.conflict-name { color: var(--danger) !important; font-weight: 700; }
.conflict-warn {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--danger); flex: none; cursor: help;
}
.conflict-warn.blink {
    animation: conflict-blink 1s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(244, 63, 94, .7));
}
@keyframes conflict-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .2; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
    .conflict-warn.blink { animation: none; opacity: 1; }
}
.conflict-warn.inline { vertical-align: middle; }
.conflict-hint {
    font-size: 10.5px; color: var(--danger); opacity: .85; margin-top: 2px;
    line-height: 1.3;
}
.time-badge.conflict {
    background: rgba(244, 63, 94, .2) !important;
    color: #fda4af !important;
    border-color: rgba(244, 63, 94, .4);
}
.device-card.has-conflict {
    border-color: rgba(244, 63, 94, .4);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .15);
}
.cal-cell.conflict-day {
    background: rgba(244, 63, 94, .08) !important;
    box-shadow: inset 0 0 0 1.5px rgba(244, 63, 94, .45);
}
.cal-num.conflict-num { color: var(--danger); }
.cal-person.conflict-box {
    background: rgba(244, 63, 94, .15) !important;
    border-left: 2px solid var(--danger);
}
.cal-person.conflict-box .cal-time { color: #fda4af; }
.cal-person.conflict { outline: 1px solid rgba(244, 63, 94, .35); }

/* Nöbet: kişi cihaz çipleri + çakışma çözümü */
.person-device-bar {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
}
.chip-row {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.pdb-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
}
.dev-chip-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 8px; cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--dev-color, var(--primary)) 45%, transparent);
    background: color-mix(in srgb, var(--dev-color, var(--primary)) 12%, transparent);
    color: var(--text); font-size: 12px; font-weight: 600;
    transition: transform .12s ease, border-color .12s ease;
}
.dev-chip-btn:hover {
    transform: translateY(-1px);
    border-color: var(--dev-color, var(--primary));
}
.dev-chip-btn.active {
    border-color: var(--dev-color, var(--primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--dev-color, var(--primary)) 35%, transparent);
}
.dev-chip-btn em {
    font-style: normal; font-weight: 500; font-size: 10.5px;
    opacity: .75; padding: 1px 5px; border-radius: 4px;
    background: rgba(0,0,0,.2);
}
.cal-cell.filter-miss {
    opacity: .35;
    filter: grayscale(.4);
}
.cal-cell.filter-hit {
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, transparent);
}
.cal-cell.filter-hit.conflict-day {
    box-shadow: inset 0 0 0 1.5px rgba(244, 63, 94, .55);
}
.cal-person[hidden] { display: none !important; }
.resolve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    width: 100%;
}
.resolve-chip {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px; border-radius: 8px;
    background: rgba(244, 63, 94, .08);
    border: 1px solid rgba(244, 63, 94, .25);
}
.resolve-name { font-weight: 700; font-size: 12.5px; }
.resolve-cat { font-size: 10.5px; color: var(--text-dim); margin-bottom: 2px; }
.day-duty-item.conflict {
    border-color: rgba(244, 63, 94, .4);
    background: rgba(244, 63, 94, .06);
}
.day-duty-item {
    flex-wrap: wrap;
}
.cal-day { display: flex; align-items: center; gap: 4px; }
.cal-day .conflict-warn { margin-left: auto; }
