/* Wolvox Mobil — mobil öncelikli tek sayfa uygulama */
:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --info: #0e7490;
  --info-soft: #cffafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 8px rgba(15, 23, 42, .04);
  --topbar: 56px;
  --nav: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
svg.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.icon.sm { width: 18px; height: 18px; }

/* ------------------------------------------------------------ iskelet */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  height: calc(var(--topbar) + var(--safe-top)); padding: var(--safe-top) 8px 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar h1 { flex: 1; margin: 0 6px; font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .company { font-size: 12px; color: var(--muted); font-weight: 500; display: block; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:active { background: var(--surface-alt); }

main { padding: 14px 14px calc(var(--nav) + var(--safe-bottom) + 24px); max-width: 760px; margin: 0 auto; }
main.no-nav { padding-bottom: calc(var(--safe-bottom) + 24px); }
main.has-action { padding-bottom: calc(var(--nav) + var(--safe-bottom) + 96px); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  height: calc(var(--nav) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.bottomnav a.active { color: var(--accent); }

/* ------------------------------------------------------------ kartlar / listeler */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card.flush { padding: 0; overflow: hidden; }
.section-title { margin: 18px 4px 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface); width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:active { background: var(--surface-alt); }
.item .title { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); }
.item .amount { font-weight: 650; text-align: right; white-space: nowrap; }
.item.static { cursor: default; }
.item.static:active { background: var(--surface); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-alt); color: var(--muted); white-space: nowrap; }
.badge.blue { background: var(--accent-soft); color: var(--accent-dark); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.teal { background: var(--info-soft); color: var(--info); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); cursor: pointer; text-align: left; }
.tile svg.icon { color: var(--accent); width: 26px; height: 26px; }
.tile b { font-size: 15px; }
.tile span { font-size: 12.5px; color: var(--muted); }

.hero { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border: 0; }
.hero h2 { color: rgba(255,255,255,.8); }
.hero .big { font-size: 28px; font-weight: 750; letter-spacing: -.01em; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.totals .grand { font-size: 18px; font-weight: 750; }

/* ------------------------------------------------------------ form */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); outline: none; font-size: 16px; /* iOS yakınlaştırmasın */
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.picker { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; cursor: pointer; text-align: left; }
.picker.filled { border-style: solid; border-color: var(--border); background: var(--surface); color: var(--text); font-weight: 500; }

.search { position: sticky; top: calc(var(--topbar) + var(--safe-top)); z-index: 10; margin: -14px -14px 12px; padding: 10px 14px; background: var(--bg); }
.search .wrap { position: relative; }
.search svg.icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 42px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 650; font-size: 16px; cursor: pointer; }
.btn:active { background: var(--accent-dark); }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--border); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + var(--safe-bottom)); z-index: 15;
  padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border);
}
.actionbar .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.no-nav ~ .actionbar, .actionbar.no-nav { bottom: var(--safe-bottom); }

.fab { position: fixed; right: 18px; bottom: calc(var(--nav) + var(--safe-bottom) + 18px); z-index: 15; display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 27px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 6px 18px rgba(37, 99, 235, .35); cursor: pointer; }

/* ------------------------------------------------------------ durumlar */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg.icon { width: 40px; height: 40px; margin-bottom: 8px; color: #cbd5e1; }
.error-box { padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14px; margin-bottom: 12px; white-space: pre-line; }
.info-box { padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: 14px; margin-bottom: 12px; white-space: pre-line; }
.spinner { width: 28px; height: 28px; margin: 40px auto; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; top: calc(var(--topbar) + var(--safe-top) + 10px); z-index: 60; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s ease-out; }
.toast.error { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ------------------------------------------------------------ alt pencere (sheet) */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 760px; max-height: 92vh; display: flex; flex-direction: column; background: var(--bg); border-radius: 18px 18px 0 0; padding-bottom: var(--safe-bottom); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); } }
.sheet header { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 16px; background: var(--surface); border-radius: 18px 18px 0 0; border-bottom: 1px solid var(--border); }
.sheet header h3 { flex: 1; margin: 0; font-size: 16px; }
.sheet .body { overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.sheet .foot { padding: 10px 14px 14px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 10px; }
.sheet .foot .btn { flex: 1; }
.dialog { width: calc(100% - 40px); max-width: 420px; margin: auto; background: var(--surface); border-radius: 16px; padding: 20px; animation: up .2s ease-out; }
.overlay.center { align-items: center; }
.dialog h3 { margin: 0 0 8px; font-size: 17px; }
.dialog p { margin: 0 0 18px; color: var(--muted); white-space: pre-line; }
.dialog .row { justify-content: flex-end; }

.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 52px; min-height: 46px; border: 0; background: var(--surface-alt); font-size: 22px; font-weight: 600; cursor: pointer; }
.stepper input { flex: 1; min-width: 0; border: 0; text-align: center; font-size: 18px; font-weight: 650; outline: none; min-height: 46px; }

/* ------------------------------------------------------------ giriş */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--safe-top)) 22px calc(24px + var(--safe-bottom)); max-width: 420px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand .logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; }
.brand b { font-size: 21px; display: block; }

@media (min-width: 700px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .sheet { border-radius: 18px; margin-bottom: 4vh; }
  .overlay { align-items: center; }
}
