:root {
  --bg: #f3f5f8; --panel: #ffffff; --text: #1d2533; --muted: #667085; --line: #e3e7ee; --soft: #f7f8fb;
  --brand: #1f5fa8; --brand-2: #174a83; --ok: #1a7f4b; --ok-bg: #e3f5ea; --bad: #c0362c; --bad-bg: #fde8e6;
  --warn: #9a6700; --warn-bg: #fff4d6; --info: #1f5fa8; --info-bg: #e5eefa; --gray-bg: #eef0f4; --purple: #6941c6; --purple-bg: #efe9fd;
  --teal: #0e7490; --teal-bg: #def4f8; --orange: #b54708; --orange-bg: #fdecdc;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --panel: #1a2029; --text: #e5e9f0; --muted: #98a2b3; --line: #2b3340; --soft: #1f2630;
    --brand: #5b9be6; --brand-2: #7fb0ec; --ok: #4ade80; --ok-bg: #133022; --bad: #f87171; --bad-bg: #3a1a1a;
    --warn: #fbbf24; --warn-bg: #3a2e10; --info: #7fb0ec; --info-bg: #17283d; --gray-bg: #262d38; --purple: #b69cff; --purple-bg: #2a2140;
    --teal: #5fd4ea; --teal-bg: #102e36; --orange: #fb923c; --orange-bg: #3a2414;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 8px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* yerleşim */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #16263d; color: #cfd8e6; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { color: #fff; font-weight: 700; font-size: 17px; padding: 4px 10px 2px; }
.side .co { font-size: 12px; color: #93a4bd; padding: 0 10px 14px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; color: #cfd8e6; text-decoration: none; margin-bottom: 2px; }
.side a:hover { background: #20344f; }
.side a.on { background: var(--brand); color: #fff; }
.side .ico { width: 18px; text-align: center; opacity: .9; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .sp { flex: 1; }
.top .burger { display: none; }
.content { padding: 18px 20px 40px; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: -240px; width: 230px; z-index: 30; transition: left .2s; }
  .side.open { left: 0; }
  .top .burger { display: inline-flex; }
  .content { padding: 14px 12px 40px; }
}

/* parçalar */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 12px 16px 0; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.bar .sp { flex: 1; }
.bar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); }
.kpi:hover, .kpi.on { border-color: var(--brand); }
.kpi .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .t { color: var(--muted); font-size: 12px; }
.kpi.ok .n { color: var(--ok); } .kpi.bad .n { color: var(--bad); } .kpi.warn .n { color: var(--warn); } .kpi.info .n { color: var(--info); }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-height: 34px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type=checkbox] { min-height: auto; }
textarea { min-height: 60px; width: 100%; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 8px; min-height: 26px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* tablolar */
.tw { overflow: auto; max-width: 100%; }
.tw.tall { max-height: calc(100vh - 230px); }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { background: var(--soft); font-weight: 600; color: var(--muted); font-size: 12px; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t tr:hover td { background: color-mix(in srgb, var(--brand) 4%, transparent); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 700; background: var(--soft); position: sticky; bottom: 0; }
table.t tr.off td { color: var(--muted); }
table.t tr.deleted td { text-decoration: line-through; color: var(--muted); }
.empty { padding: 22px; text-align: center; color: var(--muted); }

/* aylık matris */
table.mx td.d, table.mx th.d { padding: 3px 0; width: 30px; min-width: 30px; text-align: center; font-size: 11px; }
table.mx th.we { color: var(--bad); }
table.mx td.name { position: sticky; left: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
table.mx th.name { position: sticky; left: 0; z-index: 2; }

/* durum rozetleri */
.b { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--muted); }
.b.s-C { background: var(--ok-bg); color: var(--ok); }
.b.s-I { background: var(--info-bg); color: var(--info); }
.b.s-D { background: var(--bad-bg); color: var(--bad); }
.b.s-B { background: var(--warn-bg); color: var(--warn); }
.b.s-RT { background: var(--purple-bg); color: var(--purple); }
.b.s-YI, .b.s-MI, .b.s-SI { background: var(--teal-bg); color: var(--teal); }
.b.s-RP, .b.s-UI { background: var(--orange-bg); color: var(--orange); }
.b.s-DG { background: var(--info-bg); color: var(--info); }
.b.warn { background: var(--warn-bg); color: var(--warn); }
.b.bad { background: var(--bad-bg); color: var(--bad); }
.b.ok { background: var(--ok-bg); color: var(--ok); }
.cell { display: block; border-radius: 4px; margin: 0 2px; padding: 3px 0; font-weight: 600; }
.cell.s-C { background: var(--ok-bg); color: var(--ok); }
.cell.s-I { background: var(--info-bg); color: var(--info); }
.cell.s-D { background: var(--bad-bg); color: var(--bad); }
.cell.s-HT, .cell.s-CT { color: var(--muted); }
.cell.s-RT { background: var(--purple-bg); color: var(--purple); }
.cell.s-YI, .cell.s-MI, .cell.s-SI { background: var(--teal-bg); color: var(--teal); }
.cell.s-RP, .cell.s-UI { background: var(--orange-bg); color: var(--orange); }
.cell.s-DG { background: var(--info-bg); color: var(--info); }
.cell.miss { box-shadow: inset 0 0 0 2px var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin: 8px 0; }

/* maaş tablosu */
table.pay td input { width: 80px; min-height: 26px; padding: 2px 5px; text-align: right; font-size: 12px; border-color: transparent; background: transparent; }
table.pay td input:hover { border-color: var(--line); }
table.pay td input:focus { background: var(--panel); }
table.pay td.ovr input { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
table.pay td.calc { background: color-mix(in srgb, var(--brand) 5%, transparent); }

/* form ve modal */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.form input, .form select { width: 100%; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.modal-bg { position: fixed; inset: 0; background: rgba(10,15,25,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 10px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.wide { max-width: 900px; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 16px 18px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
#toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1d2533; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); color: #fff; }
.note { background: var(--info-bg); color: var(--text); border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.note.warn { background: var(--warn-bg); }
.note.bad { background: var(--bad-bg); }
code, .code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
pre.code { padding: 10px; white-space: pre-wrap; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 360px; padding: 26px; }
.login h1 { margin-bottom: 4px; }
.login form { display: grid; gap: 12px; margin-top: 18px; }
.login input { width: 100%; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.upload { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; }
.sessions { font-size: 12px; color: var(--muted); }
@media print {
  .side, .top, .bar, .tabs, .btn { display: none !important; }
  .layout { display: block; } .content { padding: 0; } .card { box-shadow: none; border: 0; }
  .tw.tall { max-height: none; overflow: visible; }
}
