/* HBA Finance — telefon öncelikli panel. Kurumsal kimlik: lacivert #042248, altın #D39A2B, Montserrat. */
@font-face { font-family: "Montserrat"; src: url("montserrat.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --navy: #042248; --navy-2: #0e3466; --gold: #d39a2b; --gold-light: #edb64b; --gold-ink: #8a5f0c;
  --bg: #f2f5fa; --surface: #fff; --ink: #0b1b33; --muted: #5a6880; --line: #dde3ee;
  --co: #0e3466; /* şirket */
  --per: #b0244e; /* şahsi */
  --in: #0b7a55; /* gelir */
  --danger: #b3261e;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.boot { padding: 48px 20px; text-align: center; color: var(--muted); }

/* düğmeler ve alanlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; font-size: 0.97rem; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(100deg, #cf9721, var(--gold-light) 55%, #d8a031); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-line { background: none; border-color: var(--line); color: var(--navy); }
.btn-danger { background: none; border-color: transparent; color: var(--danger); }
.link { background: none; border: 0; padding: 4px 0; color: var(--gold-ink); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--navy); }
.icon-btn:disabled { opacity: 0.25; cursor: default; }
.icon-btn svg { width: 22px; height: 22px; }
.input { width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; font-size: 1rem; }
.input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(14, 52, 102, 0.14); }
textarea.input { resize: vertical; min-height: 0; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.field small, .hint { font-size: 0.82rem; color: var(--muted); }
.center { text-align: center; }
.error { background: #fdecec; color: #8f1d17; border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: 0.93rem; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60; background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 0.93rem; box-shadow: 0 10px 30px -10px rgba(4, 34, 72, 0.6); transition: opacity 0.4s; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); }
.toast.out { opacity: 0; }

/* giriş */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 480px at 80% -10%, #14458a 0%, transparent 60%), var(--navy); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 22px; padding: 30px 24px; display: grid; gap: 14px; }
.auth-card form { display: grid; gap: 16px; margin-top: 6px; }
.auth-logo { width: 230px; max-width: 80%; height: auto; }
.auth-card h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-top: 8px; }
.sub { color: var(--muted); font-size: 0.95rem; }
.who { display: grid; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.who span { color: var(--muted); font-size: 0.9rem; }

/* iskelet */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 920px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; }
.top-in img { width: 168px; height: 30px; margin-right: auto; }
.top-nav, .top-add { display: none; }
.main { max-width: 920px; margin: 0 auto; padding: 14px 16px calc(104px + env(safe-area-inset-bottom)); }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 12px; }
.month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month b { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(4, 34, 72, 0.5); }
.tab { display: grid; justify-items: center; gap: 2px; min-height: 54px; padding: 6px 2px; background: none; border: 0; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 0.72rem; }
.tab-ic svg { width: 23px; height: 23px; display: block; }
.tab[aria-current="page"] { color: var(--navy); }
.tab[aria-current="page"] .tab-ic { color: var(--gold-ink); }
.tab-add .tab-ic { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #cf9721, var(--gold-light)); color: var(--navy); box-shadow: 0 8px 18px -8px rgba(150, 104, 14, 0.9); }
.tab-add { color: var(--navy); }

/* kartlar */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; text-align: left; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 1.02rem; font-weight: 800; color: var(--navy); }
.card-head small { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.empty { color: var(--muted); font-size: 0.93rem; padding: 8px 0; }
.hero-card { background: radial-gradient(520px 260px at 95% -30%, #1a4f9c 0%, transparent 65%), var(--navy); color: #fff; border-radius: 20px; padding: 20px; display: grid; gap: 6px; border-bottom: 5px solid var(--gold); }
.label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-light); }
.big { font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 4px 18px; color: #c9d4e8; font-size: 0.9rem; margin-top: 4px; }
.hero-sub b { color: #fff; font-variant-numeric: tabular-nums; }
.hero-sub b.neg { color: #ffb4b4; }
.partners { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.partner { gap: 8px; padding: 14px; border-top: 4px solid var(--per); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--navy); color: var(--gold-light); font-weight: 800; }
.avatar.sm { width: 28px; height: 28px; font-size: 0.8rem; vertical-align: middle; }
.p-name { font-size: 0.98rem; color: var(--navy); line-height: 1.25; }
.p-line { display: grid; }
.p-line small { color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.p-line b { font-variant-numeric: tabular-nums; font-size: 1.02rem; }
.per { color: var(--per); } .in { color: var(--in); }

/* çubuklar ve seyir */
.bars { display: grid; gap: 11px; }
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.bar-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { display: block; height: 8px; background: var(--bg); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; }
.b-co, .t-co { background: var(--co); } .b-per, .t-per { background: var(--per); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; height: 150px; }
.t-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; background: none; border: 0; padding: 4px 2px; border-radius: 10px; min-width: 0; }
.t-col.on { background: var(--bg); }
.t-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.t-bars i { width: min(14px, 34%); min-height: 3px; border-radius: 4px 4px 0 0; }
.t-col small { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.t-col.on small { color: var(--navy); }

/* kayıt satırları */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-areas: "day main amt" "day main chip"; column-gap: 12px; align-items: center; padding: 11px 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.row:last-child { border-bottom: 0; }
.row-day { grid-area: day; display: grid; justify-items: center; font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; background: var(--bg); border-radius: 10px; padding: 5px 0; line-height: 1.2; }
.row-day b { font-size: 1.05rem; color: var(--navy); }
.row-main { grid-area: main; display: grid; min-width: 0; }
.row-main b { font-size: 0.96rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-amt { grid-area: amt; justify-self: end; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 0.96rem; white-space: nowrap; }
.row-amt.out { color: var(--ink); }
.chip { grid-area: chip; justify-self: end; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 8px; border-radius: 99px; }
.chip-co { background: rgba(14, 52, 102, 0.1); color: var(--co); } .chip-per { background: rgba(176, 36, 78, 0.1); color: var(--per); }

/* süzgeçler */
.filters { display: grid; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: #e3e9f3; border-radius: 12px; padding: 4px; gap: 2px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg button { min-height: 40px; border: 0; background: none; border-radius: 9px; font-weight: 700; font-size: 0.84rem; color: var(--muted); padding: 6px 4px; line-height: 1.2; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 4px rgba(4, 34, 72, 0.18); }
.totals { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.totals span { display: grid; }
.totals small { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.totals b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; color: var(--muted); }

/* kayıt penceresi */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 94dvh; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); overflow: auto; }
.sheet::backdrop { background: rgba(4, 16, 36, 0.6); }
.sheet form { display: grid; gap: 14px; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); margin: -16px -16px 0; padding: 10px 8px 6px 16px; z-index: 1; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.sheet-fields { display: grid; gap: 14px; }
.amount { font-size: 1.7rem; font-weight: 800; min-height: 60px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 40px; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 0.9rem; }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ayarlar */
.set-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; }
.set-list li:last-child { border-bottom: 0; }
.set-list li.off > span { color: var(--muted); text-decoration: line-through; }
.set-list small { color: var(--muted); font-weight: 500; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inline-form select { grid-column: 1 / -1; grid-row: 2; }

/* geniş ekran */
@media (min-width: 860px) {
  .tabbar { display: none; }
  .top-nav { display: flex; gap: 4px; }
  .top-add { display: inline-flex; min-height: 42px; padding: 8px 18px; }
  .top .tab { grid-auto-flow: column; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; color: #c9d4e8; font-size: 0.9rem; }
  .top .tab[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.12); }
  .top .tab[aria-current="page"] .tab-ic { color: var(--gold-light); }
  .top .tab-ic svg { width: 19px; height: 19px; }
  .main { padding: 24px 16px 64px; }
  .stack { grid-template-columns: 1fr 1fr; align-items: start; }
  .stack > .hero-card, .stack > .partners, .stack > .filters, .stack > .totals, .stack > .pager, .stack > .card:last-of-type, .stack > .btn { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 260px; }
  .sheet { margin: auto; border-radius: 22px; }
  .toast { bottom: 32px; }
  .inline-form { grid-template-columns: minmax(0, 1fr) 150px auto; }
  .inline-form select { grid-column: auto; grid-row: auto; }
}
@media (max-width: 359px) { .partners { grid-template-columns: 1fr; } }
