/* (c) Ozan Eren Kayan */
:root {
  --page: #EEF1F5;
  --surface: #FFFFFF;
  --ink: #172231;
  --muted: #5D6878;
  --line: #D5DBE3;
  --accent: #1D4E89;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4ECF6;
  --done: #2B7A4F;
  --track: #DCE3EC;
  --error: #A8321F;
  --brand: #BA272D;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--page);
  min-height: 100vh; display: flex; flex-direction: column;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- butonlar ve alanlar ---------- */
.btn {
  font: inherit; font-weight: 600; border-radius: 6px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; line-height: 1.2; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #173f70; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-soft); }
.btn-quiet { background: transparent; color: var(--muted); padding: 6px 10px; font-weight: 500; }
.btn-quiet:hover { color: var(--ink); }
.btn-block { width: 100%; margin-top: 8px; }

.field label, .login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; min-height: 38px; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
.form-error { color: var(--error); font-size: 14px; margin: 8px 0 0; flex-basis: 100%; }

/* ---------- giriş ---------- */
.login-page { align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid var(--brand); border-radius: 8px; padding: 28px 28px 24px;
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-logo { display: block; width: 160px; height: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 20px; line-height: 1.25; margin: 0 0 4px; }
.login-sub { color: var(--muted); margin: 0; font-size: 14px; }
.login-card input { margin-bottom: 14px; }
.login-page .page-foot { margin-top: 18px; }

/* ---------- üst bar ---------- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 42px; width: auto; display: block; }
.topbar h1 { font-size: 18px; margin: 0; padding-left: 14px; border-left: 1px solid var(--line); line-height: 42px; }
.topbar-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.user { color: var(--ink); font-weight: 600; }

.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 20px 24px 32px; flex: 1; }

/* ---------- filtre ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px;
}
.field { flex: 0 1 200px; min-width: 150px; }
.field-actions { display: flex; gap: 10px; margin-left: auto; }

.empty { color: var(--muted); max-width: 64ch; margin: 28px 4px; }

/* ---------- özet: sayfanın tek vurgulu öğesi ---------- */
.summary {
  margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.summary-main { padding: 20px 24px; }
.summary-line { margin: 0 0 12px; font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.summary-line #sumPlanned { color: var(--ink); font-weight: 600; }
.num-strong { font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.bar { height: 14px; background: var(--track); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--done); border-radius: 7px; transition: width .6s ease; }
.summary-rate { margin: 8px 0 0; font-size: 14px; color: var(--done); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-side {
  margin: 0; padding: 16px 24px; border-left: 1px solid var(--line); background: #F7F9FB;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; align-content: center;
}
.summary-side dt { font-size: 13px; color: var(--muted); }
.summary-side dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- sekmeler ve tablo ---------- */
.results { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tab {
  font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0;
  border-bottom: 3px solid transparent; padding: 12px 12px 10px; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel { padding: 12px 16px 16px; }
.panel table { width: 100% !important; }

table.dataTable { font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.dataTable thead th { background: #F7F9FB; color: var(--ink); font-weight: 600; }
table.dataTable td.num, table.dataTable th.num { text-align: right; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; }
.pill-ok { background: #E3F1E8; color: var(--done); }
.pill-no { background: #F6E7E2; color: #9A3F22; }
.pill-neutral { background: var(--accent-soft); color: var(--accent); }
div.dt-container label { display: inline; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 6px 0 0; }
div.dt-container .dt-search input { min-height: 32px; width: 240px; }
div.dt-container .dt-length select { width: auto; min-height: 32px; }
div.dt-container .dt-processing { color: var(--muted); }

.page-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 0 18px; }

@media (max-width: 860px) {
  .summary { grid-template-columns: 1fr; }
  .summary-side { border-left: 0; border-top: 1px solid var(--line); }
  .field-actions { margin-left: 0; width: 100%; }
  .field { flex: 1 1 140px; }
  .topbar, .wrap { padding-left: 14px; padding-right: 14px; }
  .brand-logo { height: 30px; }
  .topbar h1 { font-size: 16px; line-height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }
