:root {
  --bg: #f4f3f0;
  --surface: #fcfcfb;
  --border: #e4e2dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #8a8984;
  --accent: #184f95;
  --accent-soft: #e6eefa;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* düzen */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #12233d; color: #dfe6f1; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 2px; color: #fff; }
.brand-sub { font-size: 11px; padding: 0 10px 16px; color: #9fb0c8; }
.side a { color: #dfe6f1; padding: 9px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.side a:hover { background: #1d3557; }
.side a.active { background: #2a78d6; color: #fff; }
.side .badge { background: var(--critical); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.side .spacer { flex: 1; }
.side .who { font-size: 12px; padding: 10px; border-top: 1px solid #2a3f5f; color: #9fb0c8; }
.side .who b { color: #fff; display: block; font-size: 13px; }
.side .who button { margin-top: 8px; }
main { padding: 24px 28px 60px; max-width: 1400px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* bileşenler */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stat .label { color: var(--text-2); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 2px 0; }
.unit-card h3 { display: flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--text-2); }
.kv span:nth-child(even) { font-variant-numeric: tabular-nums; text-align: right; font-weight: 550; }
.meter { height: 8px; background: #ecebe6; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; border-radius: 4px; }

button, .btn {
  font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { border-color: #c9c7bf; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #104281; }
button.danger { color: var(--critical); }
button.good { background: var(--good); border-color: var(--good); color: #fff; }
button.ghost { background: transparent; border-color: #3a5175; color: #dfe6f1; }
button.sm { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

input, select, textarea {
  font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: #f8f7f4; position: sticky; top: 0; }
td { padding: 8px 10px; border-bottom: 1px solid #efeee9; }
tr.click:hover td { background: #f5f8fd; cursor: pointer; }
tfoot td { font-weight: 650; background: #f8f7f4; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill.beklemede { background: #fff3d6; color: #7a5300; }
.pill.onaylandi { background: #dff3df; color: #0a6b0a; }
.pill.reddedildi { background: #fbe3e3; color: #9d2222; }
.pill.ayrildi { background: #ecebe6; color: #52514e; }
.delta-up { color: var(--critical); }
.delta-down { color: #0a7a0a; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; overflow: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 760px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.section { margin-top: 18px; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; }
#toast div { background: #12233d; color: #fff; padding: 10px 16px; border-radius: 8px; margin-top: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#toast div.err { background: var(--critical); }

/* giriş */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #12233d, #1c5cab); }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }

/* grafik */
.chart { max-width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--text-2); }
.chart .grid-line { stroke: #ecebe6; }
.chart .axis { stroke: #c9c7bf; }
.chart rect.bar:hover { opacity: .85; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin: 4px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { position: fixed; z-index: 200; background: #0b0b0b; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; max-width: 300px; line-height: 1.5; }
.tip .swatch { margin-right: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .side .spacer, .brand-sub { display: none; }
  main { padding: 16px; }
  .g2 { grid-template-columns: 1fr; }
}
[hidden] { display: none !important; }

/* rapor merkezi */
.report-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.report-picks button { flex-direction: column; align-items: flex-start; text-align: left; gap: 3px; padding: 10px 12px; }
.report-picks button span { font-size: 12px; color: var(--text-2); }
.report-picks button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.report-head { margin-bottom: 10px; }
.report-table { max-height: none; }
.report-table td, .report-table th { white-space: nowrap; }
.steps { padding-left: 20px; line-height: 2.2; margin-top: 0; }

@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff; }
  .side, .filters, button, .no-print, #toast, .tip { display: none !important; }
  .layout { display: block; }
  main { padding: 0; max-width: none; }
  .table-wrap { max-height: none !important; overflow: visible !important; border: 0; }
  table { font-size: 9px; }
  th, td { padding: 3px 5px; }
  th { position: static; background: #e6eefa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tfoot td { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
  .report-table td, .report-table th { white-space: normal; }
}
.cur-switch { padding: 10px; font-size: 12px; color: #9fb0c8; display: flex; flex-direction: column; gap: 6px; }
.cur-switch .seg { background: #1d3557; border-color: #2a3f5f; align-self: flex-start; }
.cur-switch .seg button { background: transparent; color: #dfe6f1; border-color: #2a3f5f; padding: 5px 14px; }
.cur-switch .seg button.on { background: #2a78d6; color: #fff; }

/* Employment Approval Form (uygulama içi) */
.eaf-prop { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; }
.eaf-h { background: #efede8; color: #1d2b4a; font-weight: 700; letter-spacing: .14em; font-size: 12px; padding: 7px 12px; margin: 16px 0 10px; }
.radios { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.radios .opt { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.radios .opt input { width: auto; margin: 0; }
.checks { padding: 2px 2px 4px; }
.lbl { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.form.appr { grid-template-columns: 2fr 1fr; }
.eaf-total { background: #f3f7fd; border: 1px solid #d6e3f5; border-radius: 8px; padding: 10px 12px; }
.eaf-total > div:first-child { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.eaf-total b { font-size: 18px; }
.eaf-foot { font-size: 11px; letter-spacing: .08em; color: var(--text-2); text-align: center; margin: 16px 0 0; }
.note-box { background: #fff3d6; border: 1px solid #f2d48a; color: #6b4a00; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.note-box.warn { margin: 0; }

/* Yazdırılabilir form (yalnızca yazdırırken görünür) */
#print-root { display: none; }
.pf { font-family: "Lato", "Helvetica Neue", Arial, sans-serif; color: #1d2b4a; font-size: 11.5px; max-width: 760px; margin: 0 auto; }
.pf-logo { text-align: center; margin-bottom: 6px; }
.pf-mark { font-size: 18px; letter-spacing: -4px; }
.pf-brand { font-size: 40px; letter-spacing: .12em; font-weight: 300; line-height: 1.1; }
.pf-sub { font-size: 8px; letter-spacing: .3em; }
.pf-sub2 { font-size: 6px; letter-spacing: .3em; margin-top: 4px; }
.pf-title { text-align: center; letter-spacing: .35em; font-size: 15px; margin: 12px 0 18px; }
.pf-prop { display: flex; justify-content: space-between; border-bottom: 1px solid #8a93a8; padding-bottom: 6px; margin-bottom: 12px; font-size: 11.5px; }
.pf-h { background: #efede8; font-weight: 700; letter-spacing: .14em; padding: 6px 10px; margin: 12px 0 8px; }
.pf-row { display: flex; align-items: flex-end; gap: 10px; margin: 9px 0; }
.pf-l { white-space: nowrap; }
.pf-w { min-width: 190px; }
.pf-line { flex: 1; border-bottom: 1px solid #8a93a8; min-height: 15px; padding: 0 4px; }
.pf-checks { justify-content: space-between; }
.pf-board { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; border: 1px solid #1d2b4a; padding: 12px; margin-top: 16px; }
.pf-board .pf-line { display: inline-block; min-width: 150px; }
.pf-bname { font-size: 16px; font-weight: 700; }
.pf-btitle { font-size: 8.5px; letter-spacing: .1em; margin-top: 3px; }
.pf-foot { text-align: center; font-size: 9px; letter-spacing: .1em; margin-top: 18px; }
.pf-meta { text-align: center; font-size: 8px; color: #8a93a8; margin-top: 10px; }
@media print {
  body.print-form > *:not(#print-root) { display: none !important; }
  body.print-form #print-root { display: block; }
  body.print-form { background: #fff; }
}
.lang-seg { align-self: flex-start; }
.auth .lang-seg button { padding: 4px 10px; font-size: 12px; }
.cur-switch .lang-seg { background: #1d3557; border-color: #2a3f5f; }

/* vardiya planı */
.shift-table { max-height: none; }
.shift-table td.sc { cursor: pointer; text-align: center; min-width: 96px; vertical-align: middle; }
.shift-table td.sc:hover { background: #f5f8fd; }
.shift-table th.today, .shift-table td.today { background: #f3f7fd; }
.shift-table .sname { white-space: nowrap; }
.chip { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.chip small { font-weight: 400; font-size: 10.5px; opacity: .8; }
.chip.work { background: #e6eefa; color: #184f95; }
.chip.off { background: #ecebe6; color: #52514e; }
.chip.leave { background: #fff3d6; color: #7a5300; }
.chip.empty { color: #c9c7bf; font-size: 16px; font-weight: 400; }
.opt-row { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 13px !important; }
@media print { .shift-table td.sc { min-width: 0; } .chip { padding: 1px 3px; } .chip.empty { display: none; } }

/* zimmet tutanağı (yazdırma) */
.pf-table { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-top: 6px; }
.pf-table th, .pf-table td { border: 1px solid #8a93a8; padding: 4px 6px; text-align: left; background: #fff; position: static; color: #1d2b4a; }
.pf-table .num { text-align: right; }
.pf-text { font-size: 11px; line-height: 1.6; margin: 16px 0; text-align: justify; }
.pf-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.pf-sign .pf-line { display: block; height: 40px; margin: 6px 0 4px; flex: none; }
.pf-sl { font-weight: 700; font-size: 11.5px; }
