/* FamiPay — telefon öncelikli sade arayüz */
:root{
  --bg:#f4f6f8; --card:#fff; --ink:#16232e; --muted:#6b7a88; --line:#e3e8ee;
  --navy:#0f2b46; --navy-2:#1b3f63;
  --pos:#0e8a54; --pos-bg:#e7f6ee;
  --neg:#c0392b; --neg-bg:#fdeceb;
  --warn:#8a6100; --warn-bg:#fff5da;
  --accent:#1f6feb;
  --r:14px; --shadow:0 1px 2px rgba(16,35,54,.06), 0 4px 14px rgba(16,35,54,.05);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust:100%;
  padding-bottom:calc(72px + env(safe-area-inset-bottom));
}
body.auth{padding-bottom:0; background:var(--navy)}
a{color:var(--accent); text-decoration:none}

/* ---------- üst çubuk ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:calc(10px + env(safe-area-inset-top)) 16px 10px;
  background:var(--navy); color:#fff;
}
.brand{color:#fff; font-weight:700; letter-spacing:.3px; font-size:18px}
.topbar-right{display:flex; align-items:center; gap:10px}
.who{font-size:13px; opacity:.8}
.icon-btn{color:#fff; font-size:19px; line-height:1; padding:6px}

.wrap{max-width:760px; margin:0 auto; padding:14px 14px 24px}

/* ---------- uyarı balonları ---------- */
.flashes{display:grid; gap:8px; margin-bottom:12px}
.flash{padding:11px 13px; border-radius:12px; font-size:14.5px}
.flash.ok{background:var(--pos-bg); color:var(--pos)}
.flash.error{background:var(--neg-bg); color:var(--neg)}

/* ---------- kartlar ---------- */
.card{background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; margin-bottom:14px}
.card h2{margin:0 0 12px; font-size:16px; letter-spacing:.2px}
.card h2 .sub{font-weight:400; color:var(--muted); font-size:13px}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px}
.card-head h2{margin:0}

.muted{color:var(--muted)}
.small{font-size:13px}
.pos{color:var(--pos)}
.neg{color:var(--neg)}
.center{text-align:center}
.right{text-align:right}
.nowrap{white-space:nowrap}

/* ---------- ay gezinme ---------- */
.monthbar{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px}
.monthbar .m{font-weight:700; font-size:17px}
.monthbar a{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%; background:#fff; color:var(--ink);
  box-shadow:var(--shadow); font-size:18px
}

/* ---------- özet kutuları ---------- */
.tiles{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px}
.tile{background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); padding:13px 14px}
.tile .lbl{font-size:12.5px; color:var(--muted); margin-bottom:4px}
.tile .val{font-size:20px; font-weight:700; letter-spacing:-.3px}
.tile .alt{font-size:12.5px; color:var(--muted); margin-top:2px}
.tile.wide{grid-column:1 / -1}
.tile.pos .val{color:var(--pos)}
.tile.neg .val{color:var(--neg)}

/* ---------- listeler ---------- */
.list{list-style:none; margin:0; padding:0}
.list li{
  display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px;
  padding:11px 0; border-bottom:1px solid var(--line);
}
.list li:last-child{border-bottom:0}
.list .main{flex:1 1 auto; min-width:0; display:block; color:inherit}
.list .t1{font-weight:600; font-size:15px; overflow-wrap:anywhere}
.list .t2{font-size:12.5px; color:var(--muted); margin-top:2px}
.list .amt{flex:0 0 auto; text-align:right; font-weight:700; white-space:nowrap; font-size:15px}
.list .amt .alt{display:block; font-weight:400; font-size:12px; color:var(--muted)}
/* Düğmeler dar ekranda alt satıra insin, isim kesilmesin */
.list .btn-row{flex:1 0 100%; justify-content:flex-end; margin-top:2px}
.list form.inline{flex:0 0 auto}

.pill{display:inline-block; padding:2px 8px; border-radius:999px; font-size:11.5px; font-weight:600}
.pill.wait{background:var(--warn-bg); color:var(--warn)}
.pill.bank{background:#e8eefc; color:#22509c}
.pill.person{background:#f0ebfa; color:#5b3ea8}
.pill.off{background:#eceff2; color:var(--muted)}

.progress{height:6px; border-radius:99px; background:var(--line); overflow:hidden; margin-top:7px}
.list .progress{flex:1 0 100%; margin-top:4px}
.progress i{display:block; height:100%; background:var(--pos)}

/* ---------- formlar ---------- */
label{display:block; font-size:13px; color:var(--muted); margin:0 0 5px}
input,select,textarea,button{font:inherit; color:inherit}
input[type=text],input[type=number],input[type=date],input[type=month],input[type=password],select,textarea{
  width:100%; padding:12px 13px; border:1px solid var(--line); border-radius:12px;
  background:#fff; appearance:none; -webkit-appearance:none;
}
input:focus,select:focus,textarea:focus{outline:2px solid #cfe0ff; border-color:#9dc0ff}
.field{margin-bottom:13px}
.row{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.row-3{display:grid; grid-template-columns:2fr 1fr; gap:10px}
.hint{font-size:12px; color:var(--muted); margin-top:5px}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:13px 18px; border-radius:12px; border:0; cursor:pointer;
  background:var(--navy); color:#fff; font-weight:600; font-size:15.5px;
}
.btn:active{transform:translateY(1px)}
.btn.block{width:100%}
.btn.ghost{background:#fff; color:var(--ink); box-shadow:inset 0 0 0 1px var(--line)}
.btn.danger{background:var(--neg)}
.btn.ok{background:var(--pos)}
.btn.sm{padding:8px 12px; font-size:13.5px; border-radius:10px}
.btn-row{display:flex; gap:9px; flex-wrap:wrap}
.btn-row.split{margin-bottom:6px}
.btn-row.split .btn{flex:1}
form.inline{display:inline}

.seg{display:flex; background:#eceff3; border-radius:12px; padding:4px; gap:4px; margin-bottom:14px}
.seg a,.seg label{
  flex:1; text-align:center; padding:9px 6px; border-radius:9px; font-size:14.5px;
  color:var(--muted); font-weight:600; cursor:pointer; margin:0
}
.seg a.on,.seg input:checked + span{background:#fff; color:var(--ink); box-shadow:var(--shadow)}
.seg input{display:none}
.seg span{display:block; padding:9px 6px; border-radius:9px; text-align:center}

/* ---------- tablo (rapor) ---------- */
.tablewrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
table{border-collapse:collapse; width:100%; font-size:13.5px}
th,td{padding:9px 10px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--line)}
th:first-child,td:first-child{text-align:left; position:sticky; left:0; background:#fff}
thead th{color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.4px}

/* ---------- alt sekmeler ---------- */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:30;
  display:grid; grid-template-columns:repeat(6,1fr); align-items:end;
  background:#fff; border-top:1px solid var(--line);
  padding:7px 4px calc(7px + env(safe-area-inset-bottom));
}
.tabbar a{
  min-width:0; display:flex; flex-direction:column; align-items:center; gap:3px;
  font-size:11px; color:var(--muted); padding:4px 0;
}
.tabbar a.on{color:var(--navy); font-weight:700}
.tabbar .ic{font-size:17px; line-height:1}
.tabbar .add{
  background:var(--navy); color:#fff; width:52px; height:52px; border-radius:50%;
  font-size:28px; font-weight:300; justify-self:center; align-self:center;
  align-items:center; justify-content:center; margin-top:-18px;
  box-shadow:0 6px 16px rgba(15,43,70,.35);
}

/* ---------- giriş ekranı ---------- */
.login{
  min-height:100dvh; display:flex; flex-direction:column; align-items:center;
  justify-content:center; padding:24px;
}
.login .box{background:#fff; border-radius:18px; padding:26px 22px; width:100%; max-width:360px; box-shadow:0 10px 40px rgba(0,0,0,.25)}
.login h1{margin:0 0 4px; font-size:26px; letter-spacing:.5px; text-align:center}
.login .tag{text-align:center; color:var(--muted); font-size:13.5px; margin-bottom:20px}

.empty{text-align:center; color:var(--muted); padding:22px 8px; font-size:14.5px}

@media (min-width:640px){
  .tiles{grid-template-columns:repeat(4,1fr)}
  .tile.wide{grid-column:span 2}
}

/* ---------- hedef ekranı ---------- */
.verdict{
  font-size:19px; line-height:1.35; font-weight:600; padding:14px 0 6px;
}
.verdict.pos{color:var(--pos)} .verdict.neg{color:var(--neg)}
.tile.goal .val{font-size:18px}

.goalcard{display:block; color:inherit}
.goalcard .verdict{padding:6px 0}
