/* ==========================================================================
   Ev Bütçesi — Modern Engineering & Data-Dense Design System
   Philosophy: Zero AI-slop, solid crisp surfaces, 1px borders, tabular figures,
               functional color, high information density (Linear/Catalyst style).
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #09090b;
  --bg-elev: #121215;
  --surface: #141417;
  --surface-solid: #18181b;
  --surface-2: #1f1f23;
  --surface-3: #27272a;
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --ink-3: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-ink: #ffffff;
  --cta: #10b981;
  --cta-ink: #ffffff;
  --good: #10b981;
  --good-soft: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --bad: #f43f5e;
  --bad-soft: rgba(244, 63, 94, 0.12);
  --accent: #f43f5e;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.65);
  --scrim: rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elev: #f1f5f9;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --ink: #0f172a;
  --ink-2: #64748b;
  --ink-3: #94a3b8;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-ink: #ffffff;
  --cta: #059669;
  --cta-ink: #ffffff;
  --good: #059669;
  --good-soft: rgba(5, 150, 105, 0.1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --bad: #e11d48;
  --bad-soft: rgba(225, 29, 72, 0.1);
  --accent: #e11d48;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --scrim: rgba(15, 23, 42, 0.45);
  color-scheme: light;
}

:root {
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 12px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: 1.5rem; line-height: 1.25; }
h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: 0.95rem; line-height: 1.35; font-weight: 600; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

button, input, select {
  font: inherit;
  color: inherit;
}
button, a.btn, [role="button"] {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.muted { color: var(--ink-2); }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Shell & Sidebar ---------- */
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 4px 8px 16px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: none;
}
.brand-mark svg {
  width: 17px;
  height: 17px;
  color: var(--cta);
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--line);
}
.nav a[aria-current="page"] svg {
  color: var(--brand);
}

.nav svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--ink-3);
  transition: color 120ms ease;
}

.side-foot {
  margin-top: auto;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.user-chip .meta-col {
  min-width: 0;
  flex: 1;
}
.user-chip .u-name {
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .u-hh {
  font-size: 0.72rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

main {
  padding: 24px clamp(16px, 3vw, 36px) 96px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.page-head p.muted {
  margin: 3px 0 0;
  font-size: 0.85rem;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

/* ---------- Crisp Solid Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease;
}

.card > h2,
.card > .row > h2 {
  margin-bottom: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 600;
}
.card-title svg {
  width: 16px;
  height: 16px;
  color: var(--ink-2);
}

/* ---------- Buttons & Inputs ---------- */
.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  min-height: 36px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  transition: background-color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}
.btn:active {
  opacity: 0.88;
}
.btn.primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}
.btn.primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}
.btn.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.danger {
  color: var(--bad);
  border-color: rgba(244, 63, 94, 0.25);
  background: var(--bad-soft);
}
.btn.danger:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: var(--bad);
}
.btn.small {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.78rem;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

.field {
  display: grid;
  gap: 5px;
}
.field > span {
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  min-height: 38px;
  font-size: 14px;
  color: var(--ink);
  touch-action: manipulation;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 120ms ease, color 120ms ease;
}
.seg button svg {
  width: 14px;
  height: 14px;
}
.seg button[aria-pressed="true"] {
  background: var(--surface-solid);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.seg button.exp[aria-pressed="true"] {
  background: var(--bad-soft);
  color: var(--bad);
}
.seg button.inc[aria-pressed="true"] {
  background: var(--good-soft);
  color: var(--good);
}

.month-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.month-nav .label {
  min-width: 130px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---------- Focus Hero & KPI Bento ---------- */
.hero {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.hero-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.hero .label {
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero .big {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 6px 0;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-actions .btn {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}
.hero-actions .btn:hover {
  background: var(--surface-3);
}
.hero-actions .btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}
.hero-actions .btn.primary:hover {
  background: var(--brand-deep);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
}
.kpi-ico {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.kpi-ico svg {
  width: 15px;
  height: 15px;
}
.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 0.74rem;
  color: var(--ink-2);
}

/* ---------- Progress Bars & Badges ---------- */
.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 300ms ease;
}
.bar.warn > i { background: var(--warn); }
.bar.over > i { background: var(--bad); }
.hero .bar { background: var(--surface-2); }
.hero .bar > i { background: var(--cta); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.badge svg {
  width: 12px;
  height: 12px;
}
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad  { background: var(--bad-soft);  color: var(--bad);  border-color: transparent; }

/* ---------- Charts & Legends ---------- */
.legend {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legend li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  transition: background-color 100ms ease;
}
.legend li:hover {
  background: var(--surface-2);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.cat-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cat-badge svg {
  width: 14px;
  height: 14px;
}
.donut-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
}
.donut-wrap .legend {
  flex: 1 1 200px;
}
.chart-tip {
  fill: var(--ink-2);
  font-size: 11px;
  font-family: var(--font-mono);
}

/* ---------- People & Settle-Up ---------- */
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.person + .person {
  border-top: 1px solid var(--line);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  flex: none;
}
.avatar.sm {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.pill svg {
  width: 11px;
  height: 11px;
}

.settle-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- Transactions & Filters ---------- */
.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  min-height: 32px;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 120ms ease;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--brand);
}
.chip[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters > * {
  flex: 1 1 140px;
  width: auto;
}
.filters input[type="search"] {
  flex: 2 1 200px;
}

.day-head {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 6px 5px;
  border-bottom: 1px solid var(--line);
}

.tx {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: background-color 100ms ease;
}
.tx:hover {
  background: var(--surface-2);
}
.tx .ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}
.tx .ico svg {
  width: 17px;
  height: 17px;
}
.tx .t {
  font-weight: 500;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx .meta {
  font-size: 0.76rem;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 1px;
}
.amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  color: var(--ink);
}
.amt.inc {
  color: var(--good);
}
.amt.exp {
  color: var(--bad);
}

.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  gap: 8px;
}
.empty-ico {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.empty-ico svg {
  width: 22px;
  height: 22px;
}

/* ---------- Budgets & Goals ---------- */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.budget-card {
  display: grid;
  gap: 10px;
}
.budget-card input {
  width: 130px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 5px 8px;
  min-height: 34px;
}

.goal-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.goal-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
}
.goal-ring-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.list-row + .list-row {
  border-top: 1px solid var(--line);
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}

/* ---------- Auth Screen ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-wrap {
  width: min(840px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.auth-Pitch {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.auth-Pitch h1 {
  font-size: 1.65rem;
  margin-top: 12px;
}
.auth-Pitch p {
  color: var(--ink-2);
  font-size: 0.9rem;
  margin: 8px 0 0;
}
.auth-features {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}
.auth-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.84rem;
}
.auth-feat svg {
  width: 16px;
  height: 16px;
  color: var(--cta);
  flex: none;
}
.auth-card {
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.auth form {
  display: grid;
  gap: 12px;
}
.err {
  color: var(--bad);
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 1.2em;
  margin: 0;
}

/* ---------- Dialogs & Icon Picker ---------- */
dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  width: min(480px, calc(100vw - 24px));
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: var(--scrim);
}
dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}
dialog .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
dialog .actions .spacer {
  margin-right: auto;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.amount-input {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  min-height: 52px;
}
.cat-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-pick button {
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 120ms ease;
}
.cat-pick button svg {
  width: 14px;
  height: 14px;
}
.cat-pick button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  font-weight: 600;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 5px;
}
.icon-grid button {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.icon-grid button svg {
  width: 17px;
  height: 17px;
}
.icon-grid button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 60;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  height: 48px;
  padding: 0 18px 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cta);
  background: var(--cta);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  gap: 6px;
  align-items: center;
  box-shadow: var(--shadow-md);
  transition: opacity 120ms ease;
}
.fab:hover {
  opacity: 0.92;
}
.fab svg {
  width: 19px;
  height: 19px;
}

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

/* ---------- Shopping List ---------- */
.shopping-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 120ms ease, border-color 120ms ease;
}
.shopping-item:hover {
  background: var(--surface-3);
}
.shopping-item.is-done {
  opacity: 0.55;
}
.shopping-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--ink-3);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 120ms ease;
  color: #ffffff;
}
.shopping-check:hover {
  border-color: var(--brand);
}
.shopping-check.checked {
  background: var(--good);
  border-color: var(--good);
}
.shopping-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}
.shopping-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.shopping-title {
  font-weight: 500;
  font-size: 0.88rem;
  word-break: break-word;
}
.shopping-title.completed {
  text-decoration: line-through;
  color: var(--ink-2);
}
.shopping-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* ---------- Mobile & Tablet Responsive ---------- */
@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-Pitch {
    padding: 20px;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: fixed;
    z-index: 30;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line-strong);
    background: var(--surface);
  }
  .brand, .side-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    flex-direction: column;
    gap: 2px;
    font-size: 0.68rem;
    padding: 4px 6px;
    min-height: 42px;
    border-radius: var(--radius-xs);
    flex: 1 0 auto;
  }
  .nav a svg {
    width: 17px;
    height: 17px;
  }
  main {
    padding-top: 16px;
    padding-bottom: 110px;
  }
  .fab {
    right: 14px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    height: 44px;
  }
  #toast {
    bottom: 120px;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .shopping-add-form {
    flex-direction: column;
    align-items: stretch;
  }
  .shopping-add-form > input,
  .shopping-add-form > select,
  .shopping-add-form > button {
    width: 100% !important;
  }
  .hide-sm {
    display: none;
  }
  /* iPhone Safari input zoom engelleme (sadece mobilde 16px) */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ---------- Bildirimler, Notlar & Bütçe Simülatörü ---------- */
.notif-btn {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bad);
}
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sim-impact {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.sim-impact.good {
  border-left: 3px solid var(--good);
}
.sim-impact.warn {
  border-left: 3px solid var(--warn);
}
.sim-impact.bad {
  border-left: 3px solid var(--bad);
}
