:root {
  --bg: #f6f7f9; --fg: #1d2330; --muted: #5d6573; --line: #d6dae1; --accent: #1f5fa8; --accent-fg: #fff;
  --ok: #1f7a4d; --warn: #9a6200; --bad: #b3261e; --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, "Segoe UI", Roboto, "DejaVu Sans", sans-serif; background: var(--bg); color: var(--fg); }
header#top { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: #14325c; color: #fff; flex-wrap: wrap; }
header#top .brand { font-weight: 700; letter-spacing: .3px; }
nav#nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav#nav a { color: #dce6f5; text-decoration: none; padding: 4px 10px; border-radius: 4px; }
nav#nav a.active, nav#nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
#who { font-size: 13px; color: #dce6f5; display: flex; gap: 8px; align-items: center; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 20px; margin: 4px 0 12px; } h2 { font-size: 16px; margin: 18px 0 8px; } h3 { font-size: 14px; margin: 12px 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
th { background: #eef1f5; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: #f3f5f8; }
.scroll { overflow-x: auto; }
button, .btn { font: inherit; padding: 5px 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); border-radius: 4px; cursor: pointer; }
button.secondary { background: #fff; color: var(--accent); }
button.danger { background: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid #4b8de0; outline-offset: 1px; }
textarea { width: 100%; min-height: 60px; }
label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e6ebf2; color: #233; }
.pill.kabul, .pill.applied, .pill.kesin, .pill.acik-donem { background: #dff3e8; color: var(--ok); }
.pill.iade, .pill.rejected { background: #fbe4e2; color: var(--bad); }
.pill.gonderildi, .pill.applied_with_warnings { background: #fff1d6; color: var(--warn); }
.pill.overdue { background: var(--bad); color: #fff; }
.muted { color: var(--muted); } .error { color: var(--bad); } .ok { color: var(--ok); }
ul.errors { margin: 6px 0; padding-left: 18px; color: var(--bad); }
#toast { position: fixed; bottom: 16px; right: 16px; max-width: 480px; }
#toast .msg { background: #1d2330; color: #fff; padding: 10px 14px; border-radius: 6px; margin-top: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
#toast .msg.bad { background: var(--bad); }
.login { max-width: 360px; margin: 60px auto; }
.stages { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.stages span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; background: #fff; }
.stages span.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.stages span.done { background: #e5f0e9; }
details { margin: 6px 0; } summary { cursor: pointer; font-weight: 600; }
.secret { font-family: ui-monospace, monospace; background: #fff6d6; padding: 6px; border: 1px dashed var(--warn); word-break: break-all; }
@media print { header#top, button, .row { display: none !important; } main { max-width: none; padding: 0; } .card { border: none; } }
#who a.wholink { color: #dce6f5; }
.w70 { width: 70px; } .w90 { width: 90px; } .w120 { width: 120px; } .w130 { width: 130px; } .w150 { width: 150px; } .w160 { width: 160px; }
.w200 { width: 200px; } .w260 { width: 260px; } .w280 { width: 280px; } .w300 { width: 300px; } .w420 { min-width: 420px; }
.resource td.actions { white-space: nowrap; }
.resource-form { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 6px; }
.resource-form textarea { min-width: 420px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 6px 12px; text-decoration: none; color: var(--fg); border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; }
.tabs a.active { background: #fff; border-color: var(--line); font-weight: 600; }
.kpi { display: inline-block; min-width: 140px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; margin: 4px; background: #fff; }
.kpi b { display: block; font-size: 18px; }
ul.checks { margin: 6px 0; padding-left: 18px; }
ul.checks li.ok { color: var(--ok); }
pre.doc { white-space: pre-wrap; font: inherit; }
.w100p { width: 100%; }
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .print-only { display: block; font-size: 11px; color: #444; }
  .no-print, .tabs, #toast, .resource-form, td.actions { display: none !important; }
  table { font-size: 10px; } th, td { padding: 2px 4px; }
  h2 { page-break-after: avoid; } tr { page-break-inside: avoid; }
}
/* performance indicator charts (dashboard) */
.dash .wide { grid-column: 1 / -1; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); gap: 10px 24px; }
.chart h3 { margin: 6px 0 0; font-size: 14px; }
.chart p { margin: 0 0 4px; font-size: 12px; }
svg.ichart { --series-1: #2a78d6; width: 100%; max-width: 760px; height: auto; display: block; }
.ichart text.ohead { font-weight: 600; fill: var(--muted); font-size: 11.5px; }
.ichart text { font-size: 12px; fill: var(--fg); }
.ichart text.muted { fill: var(--muted); font-size: 11px; }
.ichart .bar { fill: var(--series-1); }
.ichart .grid { stroke: var(--line); stroke-width: 1; }
.ichart .ref { stroke: var(--muted); stroke-width: 1.5; }
.ichart .hit { fill: transparent; }
.ichart .irow:hover .hit { fill: var(--bg); }
@media (max-width: 640px) { .charts { grid-template-columns: 1fr; } }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.unread { font-weight: 600; }
.unitpick { margin-left: auto; font-size: 13px; }
.unitpick select { max-width: 340px; }
