@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --green:#16a34a;
  --green-bg:#dcfce7;
  --red:#dc2626;
  --red-bg:#fee2e2;
  --amber:#d97706;
  --amber-bg:#fef3c7;
  --radius:14px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Vazirmatn', Tahoma, sans-serif;
  direction:rtl;
  -webkit-text-size-adjust:100%;
  padding-bottom:70px;
}
a{color:inherit; text-decoration:none;}

.container{ max-width:640px; margin:0 auto; padding:16px; }

.topbar{
  background:var(--card);
  border-bottom:1px solid var(--border);
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky; top:0; z-index:10;
}
.topbar h1{ font-size:17px; margin:0; font-weight:700; }
.topbar .user-chip{ font-size:13px; color:var(--muted); }
.topbar .logout-link{ font-size:13px; color:var(--red); }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
}

.section-label{ font-size:13px; color:var(--muted); font-weight:600; margin:18px 0 8px; }

.btn{
  display:inline-block;
  background:var(--primary);
  color:#fff;
  border:none;
  border-radius:10px;
  padding:10px 16px;
  font-size:14.5px;
  font-weight:600;
  cursor:pointer;
  font-family:inherit;
}
.btn:hover{ background:var(--primary-dark); }
.btn.secondary{ background:#fff; color:var(--text); border:1px solid var(--border); }
.btn.danger{ background:var(--red); }
.btn.danger.outline{ background:#fff; color:var(--red); border:1px solid var(--red-bg); }
.btn.sm{ padding:6px 12px; font-size:13px; border-radius:8px; }
.btn.block{ display:block; width:100%; text-align:center; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.input, .select, textarea.input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:14.5px;
  font-family:inherit;
  background:#fff;
  color:var(--text);
}
textarea.input{ resize:vertical; min-height:70px; }
label.field-label{ display:block; font-size:13px; color:var(--muted); margin-bottom:6px; font-weight:600; }
.field{ margin-bottom:14px; }

.row-gap{ display:flex; gap:8px; }
.row-gap > *{ flex:1; }

.flash{ padding:12px 14px; border-radius:10px; margin-bottom:14px; font-size:14px; }
.flash.ok{ background:var(--green-bg); color:#166534; }
.flash.err{ background:var(--red-bg); color:#991b1b; }

.tabs{ display:flex; gap:6px; overflow-x:auto; padding-bottom:4px; margin-bottom:14px; }
.tabs a{
  white-space:nowrap;
  padding:8px 14px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
  font-size:13.5px;
  color:var(--muted);
  font-weight:600;
}
.tabs a.active{ background:var(--primary); color:#fff; border-color:var(--primary); }

.list{ list-style:none; margin:0; padding:0; }
.list li{ padding:12px 0; border-bottom:1px solid var(--border); }
.list li:last-child{ border-bottom:none; }

.cat-block{ margin-bottom:16px; }
.cat-title{ font-weight:700; font-size:14.5px; margin-bottom:8px; }
.cat-item-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 0; border-bottom:1px solid var(--border);
}
.cat-item-row:last-child{ border-bottom:none; }
.cat-item-row .item-title{ flex:1; min-width:140px; font-size:14.5px; }
.cat-item-row .item-title.done{ text-decoration:line-through; color:var(--muted); }
.assign-select{ font-size:12.5px; max-width:130px; padding:6px 8px; }

.chk{ width:20px; height:20px; accent-color:var(--primary); flex-shrink:0; }

.status-chip{
  display:inline-block; font-size:12px; padding:3px 10px; border-radius:999px; font-weight:600;
}
.status-chip.green{ background:var(--green-bg); color:#166534; }
.status-chip.red{ background:var(--red-bg); color:#991b1b; }
.status-chip.amber{ background:var(--amber-bg); color:#92400e; }
.status-chip.muted{ background:#f1f5f9; color:var(--muted); }

.trip-sum-card{ text-align:center; padding:22px 16px; }
.trip-sum-label{ font-size:13px; color:var(--muted); margin-bottom:6px; }
.trip-sum-amount{ font-size:26px; font-weight:700; color:var(--primary); }

.trip-row{ padding:12px 0; border-bottom:1px solid var(--border); }
.trip-row:last-child{ border-bottom:none; }
.trip-row-main{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.trip-route{ font-size:14.5px; font-weight:600; }
.trip-amount{ font-size:14.5px; font-weight:700; color:var(--primary); white-space:nowrap; }
.trip-row-sub{ margin-top:4px; }
.trip-date{ font-size:12.5px; color:var(--muted); }

.food-item{ margin-bottom:14px; }
.food-title{ font-weight:700; font-size:14.5px; margin-bottom:4px; }
.food-ingredients{ margin:0; padding-right:18px; font-size:13.5px; color:var(--muted); }
.food-ingredients li{ padding:2px 0; border:none; }

.report-card{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.report-head{ display:flex; justify-content:space-between; align-items:center; }
.report-name{ font-weight:700; font-size:14.5px; }
.report-sum{ font-weight:700; color:var(--primary); }

.bottom-nav{
  position:fixed; bottom:0; left:0; right:0;
  background:#fff; border-top:1px solid var(--border);
  display:flex; justify-content:space-around;
  padding:8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index:20;
}
.bottom-nav a{ font-size:12px; color:var(--muted); text-align:center; font-weight:600; flex:1; padding:6px 2px; }
.bottom-nav a.active{ color:var(--primary); }

.empty-state{ text-align:center; color:var(--muted); padding:30px 10px; font-size:14px; }

.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.login-box{ width:100%; max-width:360px; }
.login-box h1{ text-align:center; font-size:19px; margin-bottom:22px; }

.small-muted{ font-size:12.5px; color:var(--muted); }
.inline-confirm{ background:var(--amber-bg); padding:10px; border-radius:10px; margin-top:8px; }
