/* Mutabık – tasarım kanvasındaki renk ve bileşen sistemi */
:root {
  --red: #D7263D; --red-soft: #FDECEE; --red-dark: #B01D30;
  --green: #1B9E5A; --green-soft: #E6F6EC;
  --amber: #C98A00; --amber-soft: #FFF4D6; --amber-border: #F3DFA3;
  --navy: #14213D; --navy-soft: #EEF1F7;
  --text: #1F2937; --muted: #6B7280; --faint: #9CA3AF;
  --border: #E6E8EE; --bg: #F4F5F8; --card: #FFFFFF; --chip-bg: #FFFFFF;
  --shadow: 0 10px 24px rgba(215,38,61,0.32);
}
[hidden] { display: none !important; }
[data-theme="dark"] {
  --bg: #0F1626; --card: #1A2236; --border: #273149; --navy: #F3F4F6; --navy-soft: #232D45;
  --text: #E5E7EB; --muted: #9CA3AF; --faint: #6B7280; --chip-bg: #1A2236;
  --red-soft: rgba(215,38,61,0.18); --green-soft: rgba(27,158,90,0.18); --amber-soft: #2A2312; --amber-border: #4A3B14;
}
@media (prefers-color-scheme: dark) { html[data-theme="system"] { --bg: #0F1626; --card: #1A2236; --border: #273149; --navy: #F3F4F6; --navy-soft: #232D45; --text: #E5E7EB; --muted: #9CA3AF; --faint: #6B7280; --chip-bg: #1A2236; --red-soft: rgba(215,38,61,0.18); --green-soft: rgba(27,158,90,0.18); --amber-soft: #2A2312; --amber-border: #4A3B14; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4; }
a { color: var(--red); text-decoration: none; } a:hover { color: var(--red-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 72px; }
.app.bare { padding-bottom: 0; }

/* Üst çubuk */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar .title { flex: 1; font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--bg); color: var(--navy); border: 0; position: relative; flex-shrink: 0; }
.iconbtn.red { background: var(--red); color: #fff; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }

.page { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12px; } .tiny { font-size: 11px; }
.bold { font-weight: 800; } .semi { font-weight: 700; }
.navy { color: var(--navy); } .red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.h1 { font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; line-height: 1.25; }
.h2 { font-size: 15px; font-weight: 800; color: var(--navy); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .mt-auto { margin-top: auto; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.card.pad16 { padding: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.card.navy { background: #14213D; color: #fff; border-color: #14213D; }
.card.soft-red { background: var(--red-soft); border-color: var(--red-soft); }
.card.soft-green { background: var(--green-soft); border-color: var(--green-soft); }
.card.soft-amber { background: var(--amber-soft); border-color: var(--amber-border); }
.card.soft-navy { background: var(--navy-soft); border-color: var(--navy-soft); }
.card.danger-border { border-color: #F5B7BF; }
.divider { height: 1px; background: var(--border); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* Ana menü kutuları */
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 96px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; color: inherit; }
.tile .t { font-size: 15px; font-weight: 800; color: var(--navy); }
.tile .s { font-size: 12px; color: var(--muted); }
.tile .n { position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.iconbox { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 12px; width: 36px; height: 36px; }
.iconbox.red { background: var(--red-soft); color: var(--red); }
.iconbox.green { background: var(--green-soft); color: var(--green); }
.iconbox.amber { background: var(--amber-soft); color: var(--amber); }
.iconbox.navy { background: var(--navy-soft); color: var(--navy); }
.iconbox.lg { width: 44px; height: 44px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; width: 44px; height: 44px; font-weight: 800; font-size: 15px; background: var(--navy-soft); color: var(--navy); }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; } .avatar.xs { width: 30px; height: 30px; font-size: 11px; } .avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.avatar.red { background: var(--red-soft); color: var(--red); } .avatar.green { background: var(--green-soft); color: var(--green); }
.avatar.solid { background: var(--red); color: #fff; } .avatar.amber { background: var(--amber-soft); color: var(--amber); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--navy-soft); color: var(--navy); }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.pill.no { background: var(--red-soft); color: var(--red); }
.pill.white { background: rgba(255,255,255,0.14); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--chip-bg); color: var(--muted); border: 1px solid var(--border); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .chip.active { background: #F3F4F6; color: #14213D; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; min-height: 48px; padding: 0 16px; border-radius: 14px; font-weight: 800; font-size: 15px; border: 1px solid transparent; text-decoration: none; flex: 1 1 auto; width: 100%; }
.btnrow > .btn, .btnrow > form, form > .btn { flex: 1 1 0; width: auto; }
.btnrow > form { display: flex; }
.btn.sm { height: 40px; min-height: 40px; font-size: 14px; border-radius: 12px; } .btn.xs { height: 36px; min-height: 36px; font-size: 13px; padding: 0 12px; }
.btn.fit { flex: 0 0 auto; width: auto; }
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.outline { background: var(--card); color: var(--navy); border-color: var(--border); }
.btn.outline-red { background: var(--card); color: var(--red); border-color: var(--red); }
.btn.soft { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn.navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { padding: 0 2px; }
.input { width: 100%; min-height: 50px; padding: 0 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; font-size: 15px; font-weight: 600; color: var(--text); outline: none; }
.input:focus { border-color: var(--navy); }
textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.inputwrap { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.inputwrap input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; font-weight: 600; font-size: 15px; }
.inputwrap .ico { color: var(--faint); display: flex; }
.error { font-size: 12px; color: var(--red); font-weight: 700; }

.seg { display: flex; gap: 8px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.seg label, .seg a { flex: 1; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg input { display: none; }
.seg .red:has(input:checked), .seg a.active-red { background: var(--red); color: #fff; }
.seg .green:has(input:checked), .seg a.active-green { background: var(--green); color: #fff; }
.seg .navy:has(input:checked), .seg a.active { background: var(--navy); color: #fff; }
.seg.sm label, .seg.sm a { height: 40px; font-size: 13px; }

.typegrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.typegrid label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--card); color: var(--navy); border: 1px solid var(--border); font-size: 11px; font-weight: 700; cursor: pointer; }
.typegrid input { display: none; }
.typegrid label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .typegrid label:has(input:checked) { background: #F3F4F6; color: #14213D; }

.money { font-weight: 800; white-space: nowrap; }
.money.pos { color: var(--green); } .money.neg { color: var(--red); } .money.zero { color: var(--muted); }

.datebox { width: 44px; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: var(--bg); flex-shrink: 0; }
.datebox .d { font-size: 16px; font-weight: 800; color: var(--navy); line-height: 1; }
.datebox .m { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.datebox.overdue { background: var(--red-soft); } .datebox.overdue .d, .datebox.overdue .m { color: var(--red); }

.txrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; color: inherit; }
.txrow .t { font-size: 14px; font-weight: 800; color: var(--navy); }
.txrow .s { font-size: 12px; color: var(--muted); }

.list { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: inherit; }
.list .item:last-child { border-bottom: 0; }

.flash { padding: 12px 14px; border-radius: 14px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }

.bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; display: flex; }
.bar > span { height: 100%; display: block; }

.fab { position: fixed; right: 16px; bottom: 84px; height: 52px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--red); color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; box-shadow: var(--shadow); z-index: 15; }
@media (min-width: 560px) { .fab { right: calc(50% - 260px + 16px); } }

.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: flex; gap: 10px; }
.timeline .dotcol { display: flex; flex-direction: column; align-items: center; width: 14px; flex-shrink: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.timeline .line { flex: 1; width: 2px; background: var(--border); margin-top: 4px; }
.timeline .body { padding-bottom: 10px; font-size: 13px; }

.thumb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; height: 72px; border-radius: 12px; background: var(--navy-soft); border: 1px solid var(--border); color: var(--navy); font-size: 10.5px; font-weight: 700; text-align: center; padding: 4px; }
.thumb.add { background: transparent; border-style: dashed; border-color: var(--faint); color: var(--muted); cursor: pointer; }

/* Alt gezinme */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--border); }
.tabbar .inner { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 10.5px; font-weight: 700; color: var(--muted); position: relative; }
.tabbar a.active { color: var(--red); }
.tabbar a .badge { top: 0; right: calc(50% - 20px); }
.tabbar a.plus span.circle { width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: var(--shadow); }

/* Alt sayfa görünümü (ödeme yaptım vb.) */
.sheet { background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 16px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -12px 40px rgba(20,33,61,0.25); }
.handle { width: 44px; height: 5px; border-radius: 999px; background: #D1D5DB; margin: 0 auto; }

.donut { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

@media print {
  .topbar, .tabbar, .fab, .noprint { display: none !important; }
  .app { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; }
}
