:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --ink: #18212b;
  --ink-2: #3b4550;
  --muted: #7a7468;
  --line: #e6e0d4;
  --line-2: #efeae0;
  --navy: #1f4e78;
  --navy-2: #163a5a;
  --navy-soft: #e7eef5;
  --input: #fff8e1;
  --low: #c4532d;
  --low-soft: #f8e6de;
  --mid: #b9851b;
  --mid-soft: #f6ecd4;
  --high: #2e7d57;
  --high-soft: #dfeee5;
  --danger: #b4372c;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 0 rgba(24, 33, 43, .03), 0 12px 32px -18px rgba(24, 33, 43, .22);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 28px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--navy); color: #fff;
  font: 700 12px/1 var(--sans); letter-spacing: .06em;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.saved { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.saved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--high); transition: background .3s, transform .3s var(--ease); }
.saved.is-saving::before { background: var(--mid); transform: scale(1.4); }

.tabs {
  justify-self: center; position: relative; display: flex; gap: 2px; padding: 4px;
  background: #ebe6db; border-radius: 12px;
}
.tab {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 8px 20px; border-radius: 9px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px; transition: color .25s;
}
.tab:hover, .tab.is-active { color: var(--ink); }
.tab-indicator, .seg-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  background: var(--surface); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(24,33,43,.08), 0 2px 8px -2px rgba(24,33,43,.08);
  transition: transform .45s var(--ease), width .45s var(--ease);
}
.badge {
  min-width: 20px; padding: 0 6px; height: 20px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: rgba(24,33,43,.07); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.badge.bump { animation: bump .35s var(--ease); }

.actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn {
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; white-space: nowrap;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s, opacity .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px -8px rgba(31,78,120,.7); }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface); border-color: #d8d0c1; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #962b22; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy svg { animation: drop .9s var(--ease) infinite; }
[hidden] { display: none !important; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- Layout ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 24px 28px 80px; }
.view { animation: viewIn .45s var(--ease); }
.view[hidden] { display: none; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { padding: 22px 24px 0; }
.card-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-head p { color: var(--muted); margin-top: 3px; font-size: 13px; }

/* ---------- Ümumi məlumat ---------- */
.meta { margin-bottom: 18px; }
.meta-grid {
  display: grid; grid-template-columns: 2fr 1fr 1.2fr 2fr 1.2fr 1fr; gap: 14px;
  padding: 20px 24px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field span { font-size: 12px; font-weight: 500; color: var(--muted); }
.max-wrap { position: relative; }
.max-wrap em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 500 11px var(--sans); color: var(--navy); opacity: .75; pointer-events: none; }
.field input {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fbf9f4;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:hover { border-color: #d8d0c1; }
.field input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(31,78,120,.12); }
.field.max input { font-weight: 600; font-variant-numeric: tabular-nums; }
.field input.auto { background: var(--navy-soft); border-color: transparent; color: var(--navy); cursor: default; }
.field input.auto:focus { box-shadow: none; }
.field.is-error input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180,55,44,.12); }

.classes {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px 16px; border-top: 1px solid var(--line-2);
}
.classes-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips-empty { font-size: 12.5px; color: #a49c8d; }
.chip {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  background: #fbf9f4; overflow: hidden; animation: rowIn .35s var(--ease) both;
  transition: border-color .2s, background .2s;
}
.chip button { border: 0; background: none; cursor: pointer; padding: 5px 4px 5px 12px; font-weight: 600; font-size: 13px; }
.chip button small { font-weight: 500; color: var(--muted); margin-left: 2px; }
.chip .x { padding: 5px 10px 5px 6px; color: var(--muted); font-weight: 400; font-size: 15px; line-height: 1; }
.chip .x:hover { color: var(--danger); }
.chip:hover, .chip.is-current { border-color: var(--navy); background: var(--navy-soft); }
.chip.is-current { color: var(--navy); }
.link {
  border: 0; background: none; cursor: pointer; color: var(--navy); font-weight: 600; font-size: 13px; padding: 4px 2px;
  border-radius: 6px; transition: color .2s;
}
.link:hover { color: var(--navy-2); text-decoration: underline; text-underline-offset: 3px; }
.classes .link { margin-left: auto; }

/* ---------- Nəticələr cədvəli ---------- */
.book { overflow: hidden; }

.seg { position: relative; display: flex; padding: 4px; background: #ebe6db; border-radius: 11px; flex: none; }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 7px 14px; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--ink-2); transition: color .25s;
}
.seg button.is-active { color: var(--ink); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.book-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-variant-numeric: tabular-nums; }
.book-table th, .book-table td { padding: 0; background: var(--surface); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.book-table thead th {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  text-align: center; padding: 10px 4px; background: #faf7f1; border-bottom-color: var(--line);
}
.book-table thead tr:not(:last-child) th:not([rowspan]) { border-bottom: 0; }

/* Yapışqan sütunlar: № və ad */
.book-table .c-n { position: sticky; left: 0; z-index: 2; width: 48px; min-width: 48px; text-align: left; padding-left: 20px; color: var(--muted); font-size: 13px; }
.book-table .c-name { position: sticky; left: 48px; z-index: 2; min-width: 220px; text-align: left; box-shadow: 1px 0 0 var(--line); }
.book-table thead .c-n, .book-table thead .c-name { z-index: 3; }
.book-table thead .c-name { padding-left: 14px; }
.book-table th.lbl { text-align: right; padding-right: 14px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.book-table th.lbl small { font-weight: 400; color: var(--muted); }

.book-table th.c-q { min-width: 76px; position: relative; }
.book-table th.c-q { vertical-align: bottom; }
.qh {
  border: 0; background: none; cursor: pointer; padding: 2px 6px; border-radius: 7px; max-width: 86px;
  display: flex; flex-direction: column; align-items: center; margin: 0 auto; font: inherit; color: inherit;
  text-transform: inherit; letter-spacing: inherit; transition: background .15s, color .15s;
}
.qh span { color: var(--ink); }
.qh small { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.qh:hover { background: var(--navy-soft); }
.qh:hover span, .qh:hover small { color: var(--navy); }
.qh .qh-m { font-weight: 700; color: var(--ink-2); }
.qh .qh-m.is-missing { color: var(--danger); }
.book-table thead th.c-q.is-error { box-shadow: inset 0 -2px 0 var(--danger); }
.book-table thead th.col-on { background: var(--navy-soft); }
.book-table thead th.col-on span, .book-table thead th.col-on small { color: var(--navy); }



.book-table td { height: 46px; }
.book-table td.c-q { text-align: center; padding: 0 4px; }
.book-table tbody tr { transition: background .15s; }
.book-table tbody tr:hover td, .book-table tbody tr:focus-within td { background: #f9f6ef; }
.book-table tbody tr.enter td { animation: rowIn .4s var(--ease) both; }
.col-enter { animation: colIn .45s var(--ease) both; }

.name {
  width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  font-weight: 500; transition: background .15s, border-color .15s, box-shadow .2s;
}
.name::placeholder { color: #bdb5a7; font-weight: 400; }
.name:hover { background: #f1ece2; }
.name:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,78,120,.12); }
.name.is-error { border-color: var(--danger); background: #fdf2ef; }
.book-table td.c-name { padding: 0 8px 0 4px; }

.g {
  width: 60px; height: 34px; text-align: center; border-radius: 8px; border: 1px solid transparent;
  background: #f4f0e7; font-weight: 600;
  transition: background .15s, border-color .15s, box-shadow .2s, color .2s;
}
.g:hover { background: #ece6da; }
.g:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,78,120,.14); }
.g.full { background: var(--high-soft); color: var(--high); }
.g.is-error { border-color: var(--danger); background: #fdf2ef; color: var(--danger); animation: shake .35s; }

.book-table .c-tot { min-width: 200px; text-align: left; padding: 0 14px; }
.book-table.is-q .c-tot { position: sticky; right: 0; z-index: 2; box-shadow: -1px 0 0 var(--line), -12px 0 16px -14px rgba(24,33,43,.25); }
.book-table.is-q thead .c-tot { z-index: 3; }
.book-table.is-q .c-note { width: auto; min-width: 140px; }
.book-table thead .c-tot { text-align: left; padding-left: 14px; }
.tot-max { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tc { display: flex; align-items: center; gap: 10px; }
.book-table td.c-tot b { min-width: 34px; font-size: 15px; }
.book-table tr.is-error td.c-tot b { color: var(--danger); }
.tot-in { position: relative; display: flex; align-items: center; }
.g.tot { width: 92px; text-align: left; padding: 0 36px 0 12px; }
.tot-in .of { position: absolute; right: 9px; color: var(--muted); font-size: 12px; pointer-events: none; }

.lvl { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; transition: background .3s, color .3s; }
.lvl:empty { display: none; }
.lvl.low { background: var(--low-soft); color: var(--low); }
.lvl.mid { background: var(--mid-soft); color: #8a6210; }
.lvl.high { background: var(--high-soft); color: var(--high); }
.lvl.partial { background: #efeae0; color: var(--ink-2); font-weight: 500; }
.lvl.absent { background: transparent; color: var(--muted); font-weight: 500; padding-left: 0; }
.lvl.pop { animation: pop .35s var(--ease); }

.book-table .c-note { min-width: 150px; width: 100%; padding: 0 6px; }
.book-table thead .c-note { text-align: left; padding-left: 16px; }
.note {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); transition: background .15s, border-color .15s, box-shadow .2s;
}
.note:hover { background: #f1ece2; }
.note:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,78,120,.12); }
.book-table td.c-n { position: sticky; }
.book-table td.c-n .num { transition: opacity .15s; }
.del {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--muted); display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: opacity .15s, background .15s, color .15s;
}
.del svg { width: 14px; height: 14px; }
.book-table tbody tr:hover .del, .del:focus-visible { opacity: 1; pointer-events: auto; }
.book-table tbody tr:hover .c-n .num { opacity: 0; }
.del:hover { background: var(--low-soft); color: var(--danger); }

.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.add {
  border: 1px dashed #d3cabb; background: none; border-radius: 10px; padding: 8px 14px;
  cursor: pointer; color: var(--ink-2); font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .2s, background .2s, color .2s;
}
.add span { font-size: 16px; line-height: 1; transition: transform .3s var(--ease); }
.add:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.add:hover span { transform: rotate(90deg); }
.add:disabled { opacity: .45; pointer-events: none; }
.hint { color: var(--muted); font-size: 12.5px; text-align: right; }
.foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.add.soft { border-style: solid; border-color: var(--line); }

/* İxrac yoxlaması */
.check-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.check-list ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.check-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 2px; }
.check-h.err { color: var(--danger); }
.check-h.warn { color: #8a6210; }
.check-item {
  width: 100%; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbf9f4; cursor: pointer;
  animation: rowIn .3s var(--ease) both; transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.check-item i { width: 8px; height: 8px; border-radius: 50%; }
.check-item.err i { background: var(--danger); }
.check-item.warn i { background: var(--mid); }
.check-item.err { background: #fdf4f1; border-color: #f1d3c8; }
.check-item em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--navy); opacity: 0; transition: opacity .2s, transform .2s var(--ease); transform: translateX(-4px); }
.check-item:hover { border-color: var(--navy); background: #fff; }
.check-item:hover em { opacity: 1; transform: none; }
.check-list li:nth-child(2) .check-item { animation-delay: .04s; }
.check-list li:nth-child(3) .check-item { animation-delay: .08s; }
.check-list li:nth-child(4) .check-item { animation-delay: .12s; }

/* Suallar pəncərəsi */
.modal-sub { color: var(--muted) !important; font-size: 13px; margin: -8px 0 16px; }
.q-list { padding: 4px 24px 8px; }
.qhead, .qrow { display: grid; grid-template-columns: 30px minmax(0, 1.6fr) 72px minmax(0, 1.1fr) 28px; gap: 8px; align-items: center; }
.qhead { padding: 0 0 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.qhead small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.qrow { padding: 4px 0; }
.qrow.enter { animation: rowIn .35s var(--ease) both; }
.qno {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #efeadf; color: var(--muted); font-weight: 700; font-size: 12px; transition: background .25s, color .25s;
}
.qno.done { background: var(--navy-soft); color: var(--navy); }
.qrow input {
  width: 100%; min-width: 0; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fbf9f4;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.qrow input.qmax { text-align: center; font-weight: 700; padding: 0 4px; }
.qrow input.qmax.is-empty { background: var(--input); border-color: #f0dfaa; }
.qrow input.qmax.is-error { border-color: var(--danger); background: #fdf2ef; }
.qrow input::placeholder { color: #b9ae96; font-weight: 400; }
.qrow input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(31,78,120,.12); }
.qrow .q-del {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: #b5ab99; cursor: pointer;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.qrow .q-del svg { width: 11px; height: 11px; }
.qrow:hover .q-del, .qrow:focus-within .q-del, .q-del:focus-visible { opacity: 1; }
.qrow .q-del:hover { background: var(--low-soft); color: var(--danger); }

/* ---------- Hesabat ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 6px 0 22px; }
.eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.report-head h1 { font: 44px/1.05 var(--serif); letter-spacing: -.01em; font-weight: 400; }

.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi { padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: 150px; }
.kpi .num { font: 56px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi > span:last-child { color: var(--ink-2); }
.kpi em { font-style: normal; color: var(--muted); }
.ring-card { flex-direction: row; align-items: center; justify-content: flex-start; gap: 20px; }
.ring { width: 116px; height: 116px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: #efe9de; }
.ring-fg { stroke: var(--navy); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.1s var(--ease), stroke .4s; }
.ring-label { display: flex; flex-direction: column; gap: 6px; }

.report-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: end; height: 280px; padding: 24px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.bar-col { width: 100%; max-width: 88px; border-radius: 10px 10px 4px 4px; height: 0; transition: height .8s var(--ease); position: relative; min-height: 4px; }
.bar-col b { position: absolute; top: -30px; left: 0; right: 0; text-align: center; font: 26px/1 var(--serif); font-weight: 400; }
.bar.low .bar-col { background: var(--low); }
.bar.mid .bar-col { background: var(--mid); }
.bar.high .bar-col { background: var(--high); }
.bar-label { font-weight: 600; font-size: 13px; }
.bar-sub { color: var(--muted); font-size: 12px; margin-top: -6px; }

.qbars { padding: 18px 24px 24px; display: grid; gap: 12px; }
.qbar { display: grid; grid-template-columns: 28px 1fr 56px; gap: 12px; align-items: center; opacity: 0; transform: translateX(-6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.qbar.in { opacity: 1; transform: none; }
.qbar .qn { color: var(--muted); font-size: 13px; }
.qbar .qt { font-size: 13px; color: var(--ink-2); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbar .qt em { font-style: normal; color: var(--muted); }
.qbar .track { height: 8px; border-radius: 4px; background: #efe9de; overflow: hidden; }
.qbar .track i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .8s var(--ease); }
.qbar.low .track i { background: var(--low); } .qbar.mid .track i { background: var(--mid); } .qbar.high .track i { background: var(--high); }
.qbar .qv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.qempty { color: var(--muted); padding: 30px 0; text-align: center; }

.empty { text-align: center; padding: 80px 20px; border: 1px dashed #d3cabb; border-radius: var(--radius); }
.empty p { color: var(--muted); margin-bottom: 16px; font-size: 15px; }

/* ---------- Pəncərələr ---------- */
.modal {
  border: 0; border-radius: 18px; padding: 26px; max-width: 420px; width: calc(100% - 40px);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(24,33,43,.45);
}
.modal[open] { animation: modalIn .35s var(--ease); }
.modal::backdrop { background: rgba(24,33,43,.32); backdrop-filter: blur(2px); animation: fade .3s; }
.modal h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.modal.wide { max-width: 640px; padding: 26px 28px; }
.modal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-top h2 { margin: 0; font-size: 20px; }
.icon-btn { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: #f1ece2; color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps > li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; }
.steps h3 { font-size: 15px; font-weight: 600; margin: 4px 0 4px; }
.steps p { color: var(--ink-2); font-size: 13.5px; }
kbd { font: 600 11.5px var(--sans); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #fbf9f4; }
.ai-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
#ai-input {
  width: 100%; min-height: 120px; margin-top: 10px; padding: 12px; border-radius: 10px; resize: vertical;
  border: 1px solid var(--line); background: #fbf9f4; font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#ai-input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(31,78,120,.12); }
.ai-preview:empty { display: none; }
.ai-preview { margin-top: 10px; border-radius: 10px; padding: 12px 14px; font-size: 13px; animation: rowIn .3s var(--ease); }
.ai-preview.ok { background: var(--high-soft); color: #1e5a3d; }
.ai-preview.err { background: var(--low-soft); color: #8f3a1d; }
.ai-preview ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.ai-preview li { display: flex; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.55); border-radius: 6px; padding: 4px 8px; }
.ai-preview li em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ai-preview .more { margin-top: 4px; opacity: .8; }
.privacy { margin-top: 18px; font-size: 12px; color: var(--muted); }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: max-content; max-width: calc(100% - 32px); }
.toast {
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.5);
  animation: toastIn .4s var(--ease) both;
}
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.toast.ok .ic { background: var(--high); }
.toast.err .ic { background: var(--danger); }
.toast small { display: block; opacity: .7; }

/* ---------- Keyframes ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } }
@keyframes colIn { from { opacity: 0; transform: translateX(-8px); } }
@keyframes pop { 40% { transform: scale(1.1); } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes drop { 50% { transform: translateY(2px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .top-inner { grid-template-columns: 1fr auto; }
  .tabs { grid-row: 2; grid-column: 1 / -1; }
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top-inner { grid-template-columns: 1fr; padding: 12px 16px; }
  .actions { flex-wrap: wrap; } .actions .btn { flex: 1; justify-content: center; }
  .tabs { justify-self: stretch; } .tab { flex: 1; justify-content: center; }
  main { padding: 16px 12px 60px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .classes .link { margin-left: 0; }
  .book-table .c-name { min-width: 160px; }
  .book-foot { flex-direction: column; align-items: stretch; } .hint { text-align: left; }
  .kpis { grid-template-columns: 1fr; }
  .report-head h1 { font-size: 34px; }
}

@media print {
  .top, .book-foot, .del, .actions, .seg, .q-del, .step-foot, .snum { display: none !important; }
  body { background: #fff; }
}

/* ---------- Addımlar ---------- */
.step { margin-bottom: 18px; position: relative; scroll-margin-top: 120px; }
.step.book { overflow: hidden; }
.step-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px 14px; }
.step-head > div { flex: 1; min-width: 0; }
.step-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.step-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.snum {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--navy); color: var(--navy); font-weight: 700; font-size: 14px;
  transition: background .3s var(--ease), color .3s, border-color .3s;
}
.snum b, .snum svg { grid-area: 1 / 1; transition: opacity .25s, transform .35s var(--ease); }
.snum svg { width: 16px; height: 16px; opacity: 0; transform: scale(.5); }
.step.is-done .snum { background: var(--navy); color: #fff; }
.step.is-done .snum b { opacity: 0; transform: scale(.5); }
.step.is-done .snum svg { opacity: 1; transform: none; }
.step .meta-grid { padding-top: 4px; }
.step-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px 18px; border-top: 1px solid var(--line-2); margin-top: 8px;
}
.q-sum { flex: 1; color: var(--muted); font-size: 13px; }
.q-sum b { color: var(--ink); }
.q-off { padding: 0 24px 20px 70px; color: var(--muted); font-size: 13.5px; }
.q-off b { color: var(--ink-2); }
.step.book .classes { border-top: 0; padding-top: 0; }
@media (max-width: 760px) {
  .step-head { flex-wrap: wrap; }
  .step-head .seg { width: 100%; }
  .q-list { padding: 4px 12px 8px; }
  .qhead { display: none; }
  .qrow { grid-template-columns: 26px 1fr 60px 28px; }
  .qrow input[data-qf="note"] { grid-column: 2 / 4; grid-row: 2; }
  .q-off { padding-left: 24px; }
}
