/* İyilikte Öncü — Donation Archive. Calm, dense, keyboard-first. Light & dark follow the OS. */
/* Palette from the İyilikte Öncü logo: dove blue (actions), globe sky blue (data), olive green (success). */
:root {
  --bg: #f6f8f7; --panel: #ffffff; --side: #edf3f6; --hover: #e4edf2; --line: #dde6eb; --line-strong: #c9d6de;
  --text: #16232e; --muted: #5d6f7c; --faint: #8fa0ab;
  --accent: #3b6c97; --accent-hover: #305d84; --accent-soft: #e4eff7; --on-accent: #ffffff;
  --sky: #7bbbd7; --sky-soft: #e3f1f8;
  --green: #4e8a2f; --green-soft: #ebf5e4; --red: #c2362f; --red-soft: #fcecea; --blue: #2f6fa8; --blue-soft: #e3eef8;
  --mark: #fdf1a6;
  --radius: 8px; --shadow: 0 1px 2px rgb(22 35 46 / .05), 0 2px 8px rgb(22 35 46 / .04);
  --font: "Inter", "Inter var", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Ethiopic", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1319; --panel: #111b23; --side: #0a1016; --hover: #172530; --line: #1d2b36; --line-strong: #2a3b48;
    --text: #e4edf2; --muted: #8ea2b0; --faint: #5e7180;
    --accent: #7bbbd7; --accent-hover: #93c9e1; --accent-soft: #15293a; --on-accent: #0b1a26;
    --sky: #7bbbd7; --sky-soft: #132634;
    --green: #8cc56a; --green-soft: #15261a; --red: #f08a82; --red-soft: #2c1515; --blue: #7bbbd7; --blue-soft: #132634;
    --mark: #4d4512; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 13.5px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
p { margin: 0; }
code, .code, kbd { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.icon { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { min-width: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; background: var(--side); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 12px; }
.brand:hover { color: inherit; }
.brand-logo { width: 42px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text span { font-weight: 650; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 11.5px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding-bottom: 4px; }
.auth-brand img { width: 148px; height: auto; margin-bottom: 6px; }
.auth-brand h1 { font-size: 22px; color: var(--accent); }
.side-search { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0 8px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); }
.side-search input { border: 0; background: none; padding: 0; height: 28px; flex: 1; min-width: 0; box-shadow: none; }
.side-search input:focus { box-shadow: none; }
.nav { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.active { background: var(--hover); color: var(--text); }
.nav.active .icon { color: var(--accent); }
.nav-section { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 6px; }
.me:hover { background: var(--hover); color: inherit; }
.me-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); text-transform: capitalize; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; flex: none; }
.icon-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.main { padding: 24px 32px 64px; max-width: 1280px; width: 100%; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 4px; }
.page-header h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-header p { margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs span { color: var(--faint); margin: 0 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { background: var(--hover); color: var(--text); }
.btn kbd { margin-left: 2px; padding: 0 4px; border-radius: 3px; background: rgb(127 127 127 / .14); color: inherit; opacity: .75; font-size: 10.5px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-ghost { border-color: transparent; background: none; box-shadow: none; color: var(--muted); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; height: 36px; }
.btn.disabled { opacity: .45; pointer-events: none; }
form.inline { display: inline-flex; }
.inline-row { display: flex; gap: 6px; }

/* ---------- Inputs ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; height: 30px; padding: 0 9px; width: 100%; min-width: 0; transition: border-color .1s, box-shadow .1s; }
textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.5; }
select { padding-right: 24px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .5; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); flex: none; margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide, .check.wide { grid-column: 1 / -1; }
.label { font-weight: 500; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--red); font-size: 12px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check > span { display: flex; flex-direction: column; }
.input-group { display: flex; }
.input-group input { border-radius: 6px 0 0 6px; }
.input-group select { width: 96px; flex: none; border-radius: 0 6px 6px 0; margin-left: -1px; }

/* ---------- Cards, forms ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.form { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.form.narrow { max-width: 460px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.notes { white-space: pre-wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.card > .notes:first-child { margin: 0; padding: 0; border: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
.split .stack:last-child .facts, .split > .card .facts { grid-template-columns: 1fr; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.facts a { color: var(--accent); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters > input, .filters > select { width: auto; max-width: 200px; }
.filters .grow { flex: 1 1 240px; max-width: none; }
.filters .xs { width: 80px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.inline-field input { width: 140px; }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-x: auto; }
.card .table-wrap { border: 0; margin: 0 -16px; border-radius: 0; border-top: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.kb-active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.table.compact td { padding: 6px 0; }
.table.compact td + td { padding-left: 12px; }
.table .truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link { font-weight: 500; }
tr.inactive td { opacity: .55; }
.pill { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--hover); color: var(--muted); font-size: 11.5px; }
.code { padding: 1px 6px; border-radius: 4px; background: var(--hover); color: var(--muted); font-weight: 500; }
.hash { color: var(--muted); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pagination span:last-child { display: flex; gap: 6px; }

/* ---------- Badges, flashes, empty ---------- */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 500; background: var(--hover); color: var(--muted); text-transform: capitalize; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }
.flash { padding: 9px 12px; border-radius: 6px; border: 1px solid; font-weight: 500; }
.flash-ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.flash-error { background: var(--red-soft); border-color: transparent; color: var(--red); }
.empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.card .empty { border: 0; padding: 24px 8px; }

/* ---------- Overview ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat strong { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat:hover { border-color: var(--line-strong); color: inherit; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 4px 0 8px; }
.total { display: flex; flex-direction: column; }
.total-amount { font-size: 18px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 12px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar span { width: 100%; max-width: 36px; border-radius: 4px 4px 2px 2px; background: var(--sky); }
.bar:hover span { background: var(--accent); }
.bar small { color: var(--faint); font-size: 11px; }
.h-1 { height: 5%; } .h-2 { height: 10%; } .h-3 { height: 15%; } .h-4 { height: 20%; } .h-5 { height: 25%; } .h-6 { height: 30%; } .h-7 { height: 35%; } .h-8 { height: 40%; } .h-9 { height: 45%; } .h-10 { height: 50%; }
.h-11 { height: 55%; } .h-12 { height: 60%; } .h-13 { height: 65%; } .h-14 { height: 70%; } .h-15 { height: 75%; } .h-16 { height: 80%; } .h-17 { height: 85%; } .h-18 { height: 90%; } .h-19 { height: 95%; } .h-20 { height: 100%; }

/* ---------- Documents ---------- */
.doc-list, .results, .timeline { list-style: none; margin: 0; padding: 0; }
.doc-list li + li, .results li + li { border-top: 1px solid var(--line); }
.doc-link, .results a { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.doc-link > span:last-child, .results a { flex-direction: column; align-items: flex-start; gap: 0; }
.doc-link > span:last-child { display: flex; }
.file-icon { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; flex: none; }
.file-icon.sm { display: inline-grid; width: 28px; height: 18px; border-radius: 4px; font-size: 9px; vertical-align: middle; margin-right: 4px; }
.preview { padding: 0; overflow: hidden; }
.preview iframe { display: block; width: 100%; height: 78vh; border: 0; background: #fff; }
.preview img { display: block; max-width: 100%; margin: 0 auto; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone strong { color: var(--text); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-error { border-color: var(--red); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.dropzone-files { font-size: 12px; color: var(--text); }
.timeline li { display: flex; flex-direction: column; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline time { font-size: 11.5px; }

/* ---------- Demo instance ---------- */
.demo-banner { position: sticky; top: 0; z-index: 5; padding: 8px 16px; background: var(--red); color: #fff; font-weight: 600; font-size: 12.5px; text-align: center; }
@media (min-width: 761px) { .demo-banner + .shell .sidebar { top: 34px; height: calc(100vh - 34px); } }
.demo-accounts { padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.demo-accounts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ---------- Language switch ---------- */
.lang-switch { display: flex; align-items: center; gap: 4px; padding: 6px 8px; color: var(--muted); font-size: 12px; }
.lang-switch a, .lang-switch .lang-current { padding: 1px 7px; border-radius: 10px; }
.lang-switch a:hover { background: var(--hover); color: var(--text); }
.lang-switch .lang-current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.auth-card .lang-switch { justify-content: center; padding: 0; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, var(--sky-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }

/* ---------- Keyboard help ---------- */
.kb-help { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .4); z-index: 10; }
.kb-help > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; min-width: 300px; }
.kb-help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0 0; }
.kb-help dt kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .split, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; gap: 2px; width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; order: 4; }
  .sidebar nav .nav { flex: none; padding: 5px 8px; }
  .nav-section { display: none; }
  .side-search { order: 3; width: 100%; margin: 4px 0; }
  .side-search kbd { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .sidebar > .lang-switch { order: 5; padding: 4px 0 0; }
  .demo-banner { position: static; font-size: 12px; padding: 6px 12px; }
  .me-text { display: none; }
  .brand { padding: 4px 0; }
  .main { padding: 16px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > input, .filters > select, .inline-field, .inline-field input { max-width: none; width: 100%; }
  .filters .grow, .filters .btn { grid-column: span 2; justify-content: center; }
  .filters .xs { width: 100%; }
  .inline-field { flex-direction: column; align-items: stretch; gap: 2px; }
  .btn kbd { display: none; }
}
@media print {
  .sidebar, .actions, .filters, .pagination, .form-actions { display: none !important; }
  .shell { display: block; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}
