:root {
  --brand-dark: #131b2c;   /* logodaki "C" */
  --brand-blue: #3459f2;   /* logodaki "K" */
  --banner-h: 64px;
  --sidebar-w: 232px;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5f6b7a;
  --border: #dde1e7;
  --primary: #3459f2;
  --primary-hover: #2747cc;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --ins-bg: #dcfae6;
  --del-bg: #fee4e2;
  --chip: #eef2f6;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }

/* Sabit üst banner */
.banner {
  position: fixed; top: 0; left: 0; right: 0; height: var(--banner-h); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.25rem; background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(19, 27, 44, .06);
}
.banner .brand { display: flex; align-items: center; gap: .7rem; color: var(--brand-dark);
                 font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.banner .brand img { height: 40px; width: auto; mix-blend-mode: multiply; /* logonun açık gri zeminini gizler */ }
.banner .brand .name { display: flex; flex-direction: column; line-height: 1.1; }
.banner .brand small { color: var(--muted); font-weight: 400; font-size: .72rem; letter-spacing: .02em; }
.lang-switch { display: flex; gap: 2px; margin: 0 .4rem 0 0; padding: 2px; border: 1px solid var(--border);
               border-radius: 8px; background: #fff; }
.lang-switch button { display: flex; align-items: center; gap: .3rem; border: 0; background: transparent;
                      padding: .25rem .45rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: .75rem;
                      color: var(--muted); opacity: .75; }
.lang-switch button:hover { background: var(--chip); opacity: 1; }
.lang-switch button.active { background: rgba(52, 89, 242, .1); color: var(--brand-dark); font-weight: 600; opacity: 1; }
.lang-switch img { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); display: block; }
.login-lang { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.banner .user { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.banner .user form { margin: 0; }
.banner .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-weight: 500; }
.banner .roles { color: var(--muted); font-size: .75rem; font-weight: 400; }

/* Sol menü */
.sidebar {
  position: fixed; top: var(--banner-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 10;
  background: var(--brand-dark); overflow-y: auto; padding: 1rem .75rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar a { color: #c9d1e3; padding: .55rem .75rem; border-radius: 6px; border-left: 3px solid transparent;
             display: flex; align-items: center; justify-content: space-between; }
.sidebar a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar a.active { background: rgba(52, 89, 242, .18); color: #fff; border-left-color: var(--brand-blue);
                    font-weight: 600; }
.sidebar .nav-section { color: #7e8aa6; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
                        margin: 1.1rem .75rem .35rem; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--danger);
         color: #fff; font-size: .75rem; text-align: center; }

main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
body.has-shell main { margin: 0 0 0 var(--sidebar-w); max-width: none; padding: calc(var(--banner-h) + 1.25rem) 1.5rem 2rem; }

@media (max-width: 900px) {
  .banner { padding: 0 1rem; }
  .banner .who { display: none; }
  .banner .brand .name { font-size: 1rem; }
  .banner .brand small { display: none; }
  .lang-switch span { display: none; }
  .card { overflow-x: auto; }
  .sidebar { position: fixed; top: var(--banner-h); bottom: auto; right: 0; width: auto; padding: .4rem .5rem; }
  .sidebar nav { flex-direction: row; overflow-x: auto; white-space: nowrap; }
  .sidebar .nav-section { display: none; }
  body.has-shell main { margin-left: 0; padding-top: calc(var(--banner-h) + 3.6rem); }
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
        margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.stat .n { font-size: 1.5rem; font-weight: 600; }
.stat .l { color: var(--muted); font-size: .8rem; }
.stat.alert .n { color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }
tr.overdue td { background: #fff1f0; }
td.num, th.num { text-align: right; white-space: nowrap; }

.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; background: var(--chip);
          white-space: nowrap; }
.status.draft { background: #eef2f6; }
.status.legal_review, .status.management_approval { background: #e0ecfb; color: #184c87; }
.status.revision { background: #fef0c7; color: #93370d; }
.status.approved, .status.signed { background: #dcfae6; color: #085d3a; }
.status.cancelled, .status.expired { background: #f2f4f7; color: #667085; text-decoration: line-through; }
.chip { display: inline-block; padding: 0 .45rem; border-radius: 4px; background: var(--chip); font-size: .78rem; }
.chip.warn { background: #fef0c7; color: #93370d; }
.chip.lock { background: #e0ecfb; color: #184c87; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.danger { color: var(--danger); }

form p { margin: 0 0 .75rem; }
label { display: block; font-weight: 500; margin-bottom: .2rem; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea {
  width: 100%; max-width: 520px; padding: .4rem .55rem; border: 1px solid var(--border); border-radius: 6px;
  font: inherit; background: #fff;
}
input[type=checkbox] { margin-right: .4rem; }
input.confidential { background: #fffaeb; }
.helptext, .help { display: block; color: var(--muted); font-size: .8rem; }
.errorlist { color: var(--danger); margin: .2rem 0; padding-left: 1rem; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .25rem 1.25rem; }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.inline-form p { margin: 0; }

.btn { display: inline-block; padding: .42rem .9rem; border-radius: 6px; border: 1px solid var(--border);
       background: #fff; color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f2f4f7; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .2rem .55rem; font-size: .82rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .4rem; background: #e0ecfb; }
.messages li.success { background: #dcfae6; }
.messages li.warning { background: #fef0c7; }
.messages li.error { background: #fee4e2; }

.notice { padding: .6rem .9rem; border-radius: 6px; background: #fef0c7; margin-bottom: 1rem; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .4rem 0 .4rem 1rem; border-left: 3px solid var(--border); margin-left: .3rem; }
.timeline li.pending { border-color: var(--primary); }
.timeline li.approved, .timeline li.auto { border-color: var(--ok); }
.timeline li.revision { border-color: var(--warn); }

.comment { border-bottom: 1px solid var(--border); padding: .5rem 0; }
.comment .meta { color: var(--muted); font-size: .8rem; }
.comment .body { white-space: pre-wrap; }

.diff td { font-family: Georgia, "Times New Roman", serif; font-size: .95rem; line-height: 1.55; }
.diff tr.equal td { color: #475467; }
.diff tr.changed td, .diff tr.inserted td, .diff tr.deleted td { background: #fffdf5; }
.diff ins { background: var(--ins-bg); text-decoration: none; }
.diff del { background: var(--del-bg); color: #912018; }
.diff.only-changes tr.equal { display: none; }
.diff th { font-family: inherit; }

details summary { cursor: pointer; color: var(--primary); }
.pagination { margin-top: .75rem; display: flex; gap: .5rem; align-items: center; }
.login { max-width: 380px; margin: 8vh auto; }

/* ---- Dashboard görselleri ---- */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }

.pipeline { display: flex; gap: 4px; }
.pipeline .stage {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: .1rem;
  padding: .7rem 1.4rem .7rem 1.5rem; color: var(--brand-dark); text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
  transition: filter .15s;
}
.pipeline .stage:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
                               border-radius: 6px 0 0 6px; padding-left: 1rem; }
.pipeline .stage:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); border-radius: 0 6px 6px 0; }
.pipeline .stage:hover { filter: brightness(.95); text-decoration: none; }
.pipeline .stage.empty { opacity: .55; }
.stage-label { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stage-eur { font-size: .74rem; color: rgba(19, 27, 44, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-draft { background: #eef1f6; }
.stage-revision { background: #fdecc8; }
.stage-legal { background: #dce6fe; }
.stage-management { background: #c3d2fd; }
.stage-approved { background: #d3f4e0; }

.admin-top { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 1rem; margin-bottom: 1rem; }
.admin-top .card { margin: 0; }
.admin-top .stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.ring-wrap { display: flex; align-items: center; gap: 1rem; }
.ring-bg { fill: none; stroke: var(--chip); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-fg.ok { stroke: #12a150; }
.ring-fg.warn { stroke: #f0a020; }
.ring-fg.late { stroke: var(--danger); }
.ring-pct { font-size: 20px; font-weight: 700; text-anchor: middle; fill: var(--brand-dark); }
.ring-sub { font-size: 9px; text-anchor: middle; fill: var(--muted); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; }
.dot.ok { background: #12a150; }
.dot.late { background: var(--danger); }

@media (max-width: 900px) {
  .pipeline { flex-direction: column; gap: 3px; }
  .pipeline .stage, .pipeline .stage:first-child, .pipeline .stage:last-child { clip-path: none; border-radius: 6px;
    flex-direction: row; align-items: baseline; gap: .6rem; padding: .5rem .8rem; }
  .stage-n { font-size: 1.2rem; order: -1; }
  .admin-top { grid-template-columns: 1fr; }
}

/* ---- İkonlu sayaçlar ---- */
.icon { width: 1em; height: 1em; display: block; }
.stat-icon { display: flex; align-items: center; justify-content: space-between; gap: .6rem; color: inherit;
             text-decoration: none; }
a.stat-icon:hover { border-color: #b9c3d6; text-decoration: none; }
.stat-icon .n { color: var(--brand-dark); }
.ic { flex: none; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center;
      justify-content: center; font-size: 24px; }
.tone-draft .ic, .ic.tone-draft { background: #eef1f6; color: #3d4659; }
.tone-revision .ic, .ic.tone-revision { background: #fdecc8; color: #8a5300; }
.tone-legal .ic, .ic.tone-legal { background: #dce6fe; color: #2747cc; }
.tone-management .ic, .ic.tone-management { background: #c3d2fd; color: #1c35a0; }
.tone-approved .ic, .ic.tone-approved { background: #d3f4e0; color: #0d7a3d; }
.tone-muted .ic, .ic.tone-muted { background: #f0f1f4; color: #5f6b7a; }
.tone-late .ic, .ic.tone-late { background: #fee4e2; color: var(--danger); }
.stat.alert { border-color: #f5b8b2; }
.stat.alert .n { color: var(--danger); }

/* ---- Legal göstergeleri ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; }
.kpi-alert { border-color: #f5b8b2; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .82rem;
            margin-bottom: .2rem; }
.kpi-head .ic { width: 34px; height: 34px; font-size: 19px; border-radius: 8px; }
.kpi-n { font-size: 1.6rem; font-weight: 600; color: var(--brand-dark); line-height: 1.2; }
.kpi-n.danger { color: var(--danger); }
.kpi-n small { font-size: .78rem; font-weight: 400; color: var(--muted); }
.kpi-n small.up { color: #0d7a3d; }
.kpi-n small.down { color: #8a5300; }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.seg { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: .6rem 0 .45rem; }
.seg .fresh, .dot.fresh { background: var(--brand-blue); }
.seg .aging, .dot.aging { background: #8da4f8; }
.seg .late, .dot.late { background: var(--danger); }
.seg .none { background: var(--chip); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .75rem; color: var(--muted); }
.legend .dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border-radius: 50%; }
.spark { display: block; width: 100%; height: 34px; margin-top: .5rem; }
.spark rect { fill: #9fdcb8; }
.spark rect.cur { fill: #0d7a3d; }
.target { position: relative; height: 10px; border-radius: 5px; background: var(--chip); margin: .75rem 0 .35rem; }
.target .fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.target .fill.ok { background: #12a150; }
.target .fill.warn { background: #f0a020; }
.target .fill.late { background: var(--danger); }
.target .goal { position: absolute; right: -1px; top: -4px; width: 2px; height: 18px; background: #5f6b7a; }

/* ---- ExpenSafe: mobil öncelikli ek kurallar ---- */
.banner .brand .name { display: inline-block; white-space: nowrap; }
.brand .name b { color: #3b6cf6; font-weight: 700; display: inline; }
.login-brand { display:flex; align-items:center; gap:.75rem; margin-bottom:1rem; }
.login-brand h1 { margin:0; }
.login-brand h1 b { color:#3b6cf6; }
.home { max-width: 960px; margin: 0 auto; }
.btn.big { display:block; text-align:center; font-size:1.25rem; padding:1rem; margin:1rem 0 .25rem; }
.btn.disabled { opacity:.5; pointer-events:none; }
.cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-top: 1rem; }
.cards .card h3 { margin:.1rem 0 .4rem; font-size:1rem; }
@media (max-width: 640px) { .card.login { margin: 1rem auto; } }


/* Faz 1 adım 2: bağlantı kopyalama, davet durumları */
.copy-row { display: flex; gap: .5rem; align-items: center; margin: .75rem 0; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.status.st-pending { background: #fff4d6; color: #7a5b00; }
.status.st-accepted { background: #e3f4e8; color: #1c6b35; }
.status.st-revoked, .status.st-expired { background: #eceef2; color: #5b6475; }
td.actions form { display: inline; }

/* Şifre göster/gizle (static/js/password-toggle.js) */
.pw-wrap { position: relative; display: block; max-width: 520px; }
.pw-wrap input { width: 100%; padding-right: 48px; box-sizing: border-box; }
.pw-toggle { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); width: 44px; height: 44px;
  min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #5b6475; cursor: pointer; border-radius: 6px; padding: 0; }
.pw-toggle:hover { color: #1f2633; background: rgba(31, 38, 51, .06); }
.pw-toggle:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 1px; }
.pw-toggle[aria-pressed="true"] { color: #3b5bdb; }
.notice.danger { background: #fde8e8; color: var(--danger); }
.privacy { max-width: 760px; }
.privacy h2 { margin-top: 1.25rem; font-size: 1.05rem; }

/* Faz 1 adım 3: listeler (mobil öncelikli kartlar), formlar, ikonlar, Admin bandı */
.page-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.page-head h1 { margin: 0; }
.item-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.item { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .7rem .85rem; }
.item.inactive { opacity: .62; }
.item.empty { justify-content: center; text-align: center; }
.item-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; background: #eef2ff; color: #3b5bdb; display: inline-flex; align-items: center; justify-content: center; }
.item-body { flex: 1 1 auto; min-width: 0; }
.item-title { font-weight: 600; display: block; overflow-wrap: anywhere; }
.item-meta { font-size: .85rem; color: #5b6475; margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.item-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.item-actions form { display: inline; }
.item-list.compact .item { padding: .5rem .75rem; }
.chip.ok { background: #e3f4e8; color: #1c6b35; }
svg.icon { width: 20px; height: 20px; flex: none; }
.form-card fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.form-card legend { font-weight: 600; margin-bottom: .5rem; }
input.upper { text-transform: uppercase; }
.icon-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-picker legend { width: 100%; }
.icon-opt { cursor: pointer; }
.icon-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-opt span { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #3e4757; }
.icon-opt input:checked + span { border-color: #3b5bdb; background: #eef2ff; color: #3b5bdb; box-shadow: 0 0 0 2px #3b5bdb inset; }
.icon-opt input:focus-visible + span { outline: 2px solid #3b5bdb; outline-offset: 2px; }
.owner-banner { background: #e8eefc; border-left: 4px solid #3b5bdb; }
.owner-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 .75rem; }
.owner-filter select { max-width: 320px; }
.onboarding { border-left: 4px solid #3b5bdb; margin-bottom: 1rem; }
tr.inactive td { opacity: .6; }
@media (max-width: 600px) {
  .item { flex-wrap: wrap; }
  .item-actions { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .item-actions .btn { min-height: 40px; }
}

/* Faz 1 adım 4: yükleme, masraf ekranı */
.home-actions { display: grid; grid-template-columns: 2fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.stat-card { color: inherit; text-decoration: none; }
.big-n { font-size: 2rem; font-weight: 700; margin: .25rem 0 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
.upload-buttons { display: grid; gap: .6rem; margin: .5rem 0 1rem; }
.upload-btn { position: relative; overflow: hidden; text-align: center; min-height: 52px; display: flex; align-items: center; justify-content: center; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upload-btn:focus-within { outline: 2px solid #3b5bdb; outline-offset: 2px; }
.upload-card.busy .upload-buttons { opacity: .5; pointer-events: none; }
.upload-status { font-weight: 600; min-height: 1.2em; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin: .5rem 0 1rem; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; gap: .2rem; }
.filters select, .filters input { min-width: 0; max-width: 200px; }
.item-amount { font-weight: 700; white-space: nowrap; }
.status.st-to_verify { background: #fff4d6; color: #7a5b00; }
.status.st-ready { background: #e3f4e8; color: #1c6b35; }
.status.st-in_report, .status.st-paid { background: #e8eefc; color: #2b47b5; }
.expense-layout { display: grid; gap: 1rem; }
@media (min-width: 900px) { .expense-layout.has-receipt { grid-template-columns: minmax(280px, 5fr) 6fr; align-items: start; }
  .receipt-pane { position: sticky; top: 1rem; } }
.receipt-img { display: block; margin-bottom: .5rem; }
.receipt-img img { width: 100%; height: auto; max-height: 75vh; object-fit: contain; background: #f3f4f6; border-radius: 8px; cursor: zoom-in; }
.tax-table { width: 100%; }
.tax-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .25rem .75rem; align-items: end; margin-top: .75rem; }
.tax-add .btn { justify-self: start; }
.confirm-box form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) { .item-amount { width: 100%; padding-left: 52px; } .filters label { flex: 1 1 45%; } .filters select, .filters input { max-width: none; width: 100%; } }
.choice-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: .5rem; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 120px; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; font-weight: 600; font-size: 1.1rem; text-align: center; }
.choice svg.icon { width: 36px; height: 36px; color: #3b5bdb; }
.choice small { font-weight: 400; font-size: .8rem; color: #5b6475; }
.choice:hover, .choice:focus-visible { border-color: #3b5bdb; background: #eef2ff; }
.reason-types { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }
.reason-types legend { font-weight: 600; margin-bottom: .35rem; }
.reason-opt { display: flex; align-items: center; gap: .5rem; min-height: 40px; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.more-fields { margin: .5rem 0 1rem; }
.more-fields summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.expense-layout { grid-template-columns: minmax(0, 1fr); }
.expense-layout > * { min-width: 0; }
.tax-lines { overflow-x: auto; }
.form-card input, .form-card select, .form-card textarea { max-width: 100%; box-sizing: border-box; }

/* Adım 5: okuma durumu ve alan vurguları */
.ocr-running { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid #c9d3f5; border-top-color: #3b5bdb; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.field.ocr-ok input, .field.ocr-ok select { border-color: #2f9e55; background: #f0faf3; }
.field.ocr-check input, .field.ocr-check select { border-color: #d99a00; background: #fff8e6; }
.ocr-badge { font-size: .7rem; font-weight: 600; padding: .05rem .4rem; border-radius: 999px; margin-left: .3rem; }
.ocr-ok .ocr-badge { background: #e3f4e8; color: #1c6b35; }
.ocr-check .ocr-badge { background: #fff1c7; color: #7a5b00; }
.ocr-other { display: block; font-size: .75rem; color: #7a5b00; margin-top: .15rem; }
.ocr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ocr-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ocr-key.ok { background: #f0faf3; border: 1px solid #2f9e55; }
.ocr-key.check { background: #fff8e6; border: 1px solid #d99a00; }
form.inline { display: inline; margin-left: .5rem; }

/* 5b/5a: kutu düzenleyici (ayırma ve maske) */
.be-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.be-toolbar .btn { min-height: 40px; }
.be-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.be-img { display: block; max-width: 100%; max-height: 78vh; height: auto; pointer-events: none; }
.be-layer { position: absolute; inset: 0; cursor: crosshair; }
.be-box { position: absolute; border: 3px solid #3b5bdb; background: rgba(59, 91, 219, .12); padding: 0; margin: 0; cursor: move; border-radius: 2px; min-width: 0; }
.be-box.sel { border-color: #e8590c; background: rgba(232, 89, 12, .18); box-shadow: 0 0 0 2px #fff inset; }
.be-box:focus-visible { outline: 3px solid #e8590c; outline-offset: 2px; }
.be-num { position: absolute; left: 2px; top: 2px; background: #3b5bdb; color: #fff; font-size: .75rem; font-weight: 700; padding: 0 .35rem; border-radius: 3px; }
.be-h { position: absolute; width: 22px; height: 22px; background: #fff; border: 2px solid #3b5bdb; border-radius: 50%; }
.be-nw { left: -12px; top: -12px; cursor: nwse-resize; } .be-ne { right: -12px; top: -12px; cursor: nesw-resize; }
.be-sw { left: -12px; bottom: -12px; cursor: nesw-resize; } .be-se { right: -12px; bottom: -12px; cursor: nwse-resize; }
.mask .be-box { background: #000; border-color: #000; }
.mask .be-box.qr { background: #111; }
.mask .be-box.off { background: transparent; border: 2px dashed #c92a2a; }
.mask .be-box.sel { border-color: #e8590c; box-shadow: 0 0 0 3px #e8590c; }
.mask .be-h { border-color: #000; width: 18px; height: 18px; }
.confirm-previews { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1rem 0; }
.confirm-previews img { width: 100%; height: auto; display: block; }
.be-box:not(.sel) .be-h { display: none; }  /* önce dokunup seç, sonra köşeden boyutlandır (ince kutularda dokunma kaymasın) */

/* Fotoğraf ipucu (karar 49) */
.photo-tip { background: #fff8e1; border: 1px solid #f0d98a; border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem; }
.photo-tip p { margin: 0 0 .4rem; }
.photo-tip-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 0; }
.photo-tip[hidden] { display: none; }

/* Döviz (adım 6) */
.fx-sub { display: block; font-size: .75rem; font-weight: 400; color: var(--muted, #5b6475); }
.fx-box .big-n { margin: .2rem 0; }
.warn-text { color: #7a5b00; }

/* Avanslar (adım 7) */
.status.st-adv-open { background: #fff4d6; color: #7a5b00; }
.status.st-adv-closed { background: #eceef2; color: #5b6475; }
.adv-history li { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
details.card > summary { cursor: pointer; padding: .2rem 0; }
input:disabled, textarea:disabled { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }

/* Beyanlar (adım 8) */
.status.st-rep-draft { background: #eceef2; color: #5b6475; }
.status.st-rep-created { background: #e6edff; color: #2d4bb3; }
.status.st-rep-sent { background: #fff4d6; color: #7a5b00; }
.status.st-rep-paid { background: #e3f4e8; color: #1c6b35; }
.status.st-rep-revised { background: #f3e8ff; color: #6b21a8; }
.wizard-steps { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .8rem; }
.wizard-steps li { padding: .2rem .6rem; border-radius: 999px; background: var(--chip, #eef0f4); color: #5b6475; }
.wizard-steps li.cur { background: #2d4bb3; color: #fff; }
.wizard-steps li.done { background: #e3f4e8; color: #1c6b35; }
.pick-list { list-style: none; padding: 0; margin: 0; }
.pick-list li { border-bottom: 1px solid var(--line, #e5e7eb); }
.pick-list li.tip { padding-left: 1.2rem; }
.pick-list label { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem 0; cursor: pointer; }
.pick-list input { margin-top: .2rem; }
.pick-main { flex: 1; min-width: 0; }
.pick-main .small { display: block; }
.pick-amt { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.rep-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rep-table th, .rep-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--line, #e5e7eb); vertical-align: top; text-align: left; }
.rep-table .num { text-align: right; white-space: nowrap; }
.result-card .result-line { border-top: 2px solid #1f2633; padding-top: .3rem; margin-top: .3rem; }
.result-card .plain li { display: flex; justify-content: space-between; gap: .5rem; }
ul.plain.grand-totals { margin: .8rem 0 0 auto; max-width: 26rem; }
.grand-totals li { display: flex; justify-content: space-between; gap: .5rem; }
.grand-totals .result-line { border-top: 2px solid #1f2633; padding-top: .3rem; margin-top: .3rem; }
.download-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: 0 0 .8rem; }
.inline-form label { display: flex; flex-direction: column; font-size: .8rem; gap: .15rem; }
/* Beyan detayı: dar ekranda tablo yerine kartlar (yatay kaydırma yok) */
@media (max-width: 640px) {
  .rep-cards thead { display: none; }
  .rep-cards, .rep-cards tbody, .rep-cards tfoot, .rep-cards tr, .rep-cards td { display: block; width: 100%; }
  .rep-cards tbody tr { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: .45rem .6rem; margin: 0 0 .5rem; }
  .rep-cards td { border: 0; padding: .12rem 0; text-align: left; white-space: normal; }
  .rep-cards td[data-label]::before { content: attr(data-label) ": "; color: #6b7280; font-size: .78rem; }
  .rep-cards td.num { text-align: left; }
  .rep-cards td.rep-vendor { font-weight: 600; }
  .rep-cards td.rep-amount { font-weight: 700; }
  .rep-cards tfoot tr { display: flex; justify-content: space-between; padding: .3rem .6rem; }
  .rep-cards tfoot td { width: auto; }
  .rep-cards tfoot td.km-foot-gap { display: none; }
  ul.plain.grand-totals { max-width: none; }
  .table-wrap { overflow-x: visible; }
}
.pick-list li.differs { background: #fff8e1; }

/* İkonlar: menü ve ana ekran kartları (dekoratif; anlam metinde) */
.sidebar a { display: flex; align-items: center; gap: .55rem; min-height: 40px; }
.sidebar a svg.icon { width: 20px; height: 20px; opacity: .85; }
.sidebar a.active svg.icon { opacity: 1; color: #8fa6ff; }
.user .btn.small { display: inline-flex; align-items: center; gap: .3rem; }
.user .btn.small svg.icon { width: 16px; height: 16px; }
@media (max-width: 900px) {
  .sidebar nav { gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .sidebar a { flex: none; padding: .45rem .7rem; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
  .sidebar a.active { border-left: 0; border-bottom-color: var(--brand-blue); }
}
.card-title { display: flex; align-items: center; gap: .5rem; }
.card-title svg.icon { width: 22px; height: 22px; color: #3b5bdb; flex: none; }
.card-title .count { margin-left: auto; font-size: 1.1rem; }
.card-warn { border-color: #e7b416; background: #fffbea; }
.card-warn .card-title svg.icon, .card-warn .card-title .count { color: #93370d; }
.home-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.home-actions .btn svg.icon { width: 22px; height: 22px; }
.with-icon { display: inline-flex; align-items: center; gap: .3rem; }
.with-icon svg.icon { width: 16px; height: 16px; }
.row-meta { margin-top: .15rem; font-size: .75rem; } .record-meta { margin: -.3rem 0 .8rem; }
@media (max-width: 480px) { .profile-btn span { display: none; } .profile-btn { padding: .2rem .45rem; } }
.inline-form label.check { flex-direction: row; align-items: center; gap: .4rem; font-size: .9rem; }
.home-actions .btn span { white-space: nowrap; }
.home .plain li b { white-space: nowrap; }
.sidebar a { justify-content: flex-start; }
.deletion-banner { display: flex; gap: .5rem; align-items: flex-start; } .deletion-banner svg.icon { flex: none; }

/* Kullanım kılavuzu */
.guide { max-width: 760px; line-height: 1.6; }
.guide section { scroll-margin-top: calc(var(--banner-h) + 4rem); margin: 0 0 2rem; }
.guide h2 { margin-top: 1.6rem; }
.guide figure { margin: .8rem 0; }
.guide figure img { width: 100%; max-width: 375px; height: auto; border: 1px solid var(--border); border-radius: 12px; display: block; }
.guide-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.guide-toc ol { margin: .3rem 0 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } }
.guide dt { font-weight: 600; margin-top: .6rem; }
.guide dd { margin: .2rem 0 0; }
.help-link { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #3b5bdb; font-weight: 700; font-size: .85rem; text-decoration: none; margin-left: .4rem; vertical-align: middle; }
.help-link:hover { background: #eef2ff; text-decoration: none; }
.adv-history li b { white-space: nowrap; }
.filters input[type=month], .filters input[type=date] { min-height: 2.1rem; padding: .25rem .4rem; font-size: .85rem; }
