:root { --fg: #1d2433; --muted: #5b6475; --bg: #f6f7f9; --card: #ffffff; --accent: #1f5fbf; --line: #dde1e8; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.env-banner { padding: .35rem 1rem; font-weight: 600; text-align: center; color: #fff; background: #8a5a00; }
.env-banner.env-development { background: #4b5563; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--fg); }
.lang-switch { display: flex; gap: .75rem; }
.lang-active { font-weight: 600; }
.notice { margin: 0; padding: .6rem 1rem; background: #fff7e0; border-bottom: 1px solid #f0d58a; }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.hero h1 { margin: .5rem 0 .25rem; font-size: 1.6rem; }
.tagline { color: var(--muted); margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin: 1rem 0; }
.card h2 { margin-top: 0; font-size: 1.15rem; }
.modules { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.modules li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.code { font-family: ui-monospace, monospace; color: var(--muted); min-width: 2.5rem; }
.badge { font-size: .8rem; padding: .05rem .5rem; border-radius: 999px; background: #e8eef7; }
.badge.status-in_progress { background: #e3f4e8; }
.footer { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; padding: 1.5rem 1rem; color: var(--muted); font-size: .9rem; }
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }
/* P02: formlar, tablolar, bildirimler, gezinme */
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--card); padding: .25rem .5rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar { flex-wrap: wrap; gap: .5rem 1rem; }
.mainnav { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.company-switch { display: flex; gap: .35rem; align-items: center; }
.company-switch select { max-width: 16rem; }
.narrow { max-width: 32rem; margin-left: auto; margin-right: auto; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .85rem; margin: .2rem 0 0; }
.muted-card { background: transparent; }
.field { margin: 0 0 .9rem; display: flex; flex-direction: column; gap: .25rem; }
label { font-weight: 600; }
label.check { font-weight: 400; display: inline-flex; gap: .3rem; align-items: center; margin-right: .75rem; }
input, select, button, .button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select {
  padding: .5rem .6rem; border: 1px solid #b9c0cc; border-radius: 6px; background: #fff; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.has-error input { border-color: #b42318; }
.field-error { color: #b42318; margin: .2rem 0 0; font-size: .9rem; }
button, .button { display: inline-block; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
button.small { padding: .2rem .6rem; font-size: .85rem; }
button.danger { background: #fff; color: #b42318; border-color: #b42318; }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
button:disabled { opacity: .6; cursor: wait; }
form.inline { display: inline; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.grid-form { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: start; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 1rem; }
.flash { padding: .6rem .8rem; border-radius: 6px; border: 1px solid var(--line); background: #eef4ff; }
.flash-success { background: #e8f6ec; border-color: #a7d7b5; }
.flash-warning { background: #fff7e0; border-color: #f0d58a; }
.flash-error { background: #fdecea; border-color: #f2b8b5; }
.links { margin-top: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.detail { font-size: .85rem; color: var(--muted); word-break: break-word; }
.roles-form { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.1rem; }
.codes li { margin: .2rem 0; }
.qr img { display: block; margin: .5rem 0; background: #fff; }
.steps li { margin-bottom: .6rem; }
.keys { padding-left: 1.2rem; }
.badge.status-live { background: #d9f2e1; }
@media (max-width: 640px) { .topbar { flex-direction: column; align-items: flex-start; } .codes { columns: 1; } }
/* P03: bankalar, ekstre ve hareketler */
.credit { color: #146c2e; }
.debit { color: #9b1c1c; }
.balance-ok { background: #d9f2e1; }
.balance-mismatch, .balance-not_available { background: #fde2e1; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.preview-grid td { font-family: ui-monospace, monospace; font-size: .8rem; white-space: pre; }
textarea.code { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }

/* P03A: PDF tasarımcısı ve satır incelemesi */
.pdf-pages { display: flex; flex-wrap: wrap; gap: 1rem; }
.pdf-page { position: relative; margin: 0; max-width: 100%; width: 620px; border: 1px solid var(--border, #d0d5dd); }
.pdf-page img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; }
.pdf-page figcaption { font-size: .85rem; color: var(--muted, #667085); padding: .25rem .5rem; }
.pdf-overlay { position: absolute; inset: 0 0 1.6rem 0; pointer-events: none; }
.pdf-line { position: absolute; }
.pdf-line-x { top: 0; bottom: 0; width: 0; border-left: 2px solid #1570ef; }
.pdf-line-x.end { border-left-color: #b42318; border-left-style: dashed; }
.pdf-line-y { left: 0; right: 0; height: 0; border-top: 2px dotted #027a48; }
.pdf-columns select, .pdf-columns input { min-width: 6rem; }
.review-item { border-top: 1px solid var(--border, #d0d5dd); padding: .75rem 0; }
.review-item.reviewed { opacity: .75; }
.review-crop { display: block; max-width: 100%; border: 1px solid var(--border, #d0d5dd); margin: .5rem 0; image-rendering: auto; }
.source-manual { background: #fef0c7; color: #93370d; }
.source-pdf { background: #e0f2fe; color: #075985; }
.source-sync { background: #ecfdf3; color: #027a48; }
/* P05: sınıflandırma, gerekçe, kural düzenleyici */
.reason-list { margin: .3rem 0 .6rem 1.2rem; padding: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.badge.cat-user { background: #fff1d6; }
.badge.cat-rule { background: #e3f4e8; }
.badge.cat-default { background: #eef0f4; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; }
tr.dragging { opacity: .5; }
tr.changed td { background: #fff9e8; }
.bulk-bar { border: 1px dashed var(--line); border-radius: 6px; padding: .4rem .6rem; }
.bulk-bar legend { font-size: .85rem; color: var(--muted); }
.steps { margin: .3rem 0 .6rem 1.2rem; }
.actions { white-space: nowrap; }
pre.raw { white-space: pre-wrap; word-break: break-word; font-size: .8rem; background: #f6f7f9; padding: .5rem; border-radius: 4px; }
/* P06: fişler */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.tabs a { padding: .25rem .6rem; border: 1px solid #d6dce6; border-radius: 6px; text-decoration: none; }
.tabs a.active { background: #1f4e8c; color: #fff; border-color: #1f4e8c; }
.tabs a.active .badge { background: #fff; color: #1f4e8c; }
.badge.journal-draft { background: #eef0f4; }
.badge.journal-pending_review { background: #fff1d6; }
.badge.journal-ready { background: #e3f4e8; }
.badge.journal-delivered { background: #e0ecfb; }
.badge.journal-posted { background: #cfe9d8; font-weight: 600; }
.badge.journal-rejected { background: #fbe0e0; }
.badge.issue-block, li.issue-block { color: #8a1c1c; }
.badge.issue-block { background: #fbe0e0; }
.badge.issue-warn { background: #fff1d6; }
.journal-edit td input { width: 100%; min-width: 5rem; }
.journal-edit td select { min-width: 6rem; }
.totals { font-weight: 600; }
