:root {
  --navy: #070b14;
  --navy2: #101827;
  --card: #161e30;
  --card2: #1c263c;
  --gold: #d4b45a;
  --gold2: #f0d78c;
  --line: rgba(255,255,255,.08);
  --text: #f4f1ea;
  --muted: #9aa6bf;
  --danger: #ff6b6b;
  --ok: #3dd6a4;
  --warn: #f5c15c;
  --pf: #6ea8ff;
  --gl: #c9a227;
  --tx: #3dd6c6;
  --hp: #ff7a59;
  --safe: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--navy); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; }
body { padding-top: var(--safe-top); min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
.app { max-width: 480px; margin: 0 auto; padding: 12px 14px calc(92px + var(--safe)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand h1 { font-size: 15px; margin: 0; letter-spacing: .04em; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin: 0 -14px 12px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.chip.on { background: #243049; border-color: var(--gold); color: var(--gold2); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 92px; text-align: left; }
.card .k { color: var(--muted); font-size: 12px; }
.card .n { font-size: 13px; margin-top: 4px; }
.card .v { font-size: 20px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.card.danger { border-color: rgba(255,107,107,.35); }
.card.ok { border-color: rgba(61,214,164,.25); }
.section { margin-top: 18px; }
.section h2 { font-size: 14px; margin: 0 0 10px; display: flex; justify-content: space-between; }
.overdue { background: #2a1518; border: 1px solid rgba(255,107,107,.3); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.overdue .ttl { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.overdue .meta { color: var(--muted); font-size: 12px; margin: 6px 0 10px; }
.row-btns { display: flex; gap: 8px; }
.btn { border: 0; border-radius: 12px; padding: 11px 12px; font-weight: 650; min-height: 44px; }
.btn.gold { background: var(--gold); color: #1a1406; }
.btn.ghost { background: #243049; color: var(--text); }
.btn.danger { background: #7a2430; color: #fff; }
.btn.full { width: 100%; }
.fab {
  position: fixed; right: 16px; bottom: calc(72px + var(--safe));
  background: var(--gold); color: #1a1406; border: 0; border-radius: 999px;
  height: 56px; padding: 0 18px; font-weight: 800; box-shadow: 0 8px 24px rgba(212,180,90,.35);
  z-index: 20;
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: rgba(7,11,20,.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe));
}
.nav button {
  background: none; border: 0; color: var(--muted); font-size: 11px;
  min-width: 64px; min-height: 48px; padding: 6px 4px;
}
.nav button.on { color: var(--gold2); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--navy2); width: 100%; max-width: 480px; max-height: 92dvh;
  overflow: auto; border-radius: 20px 20px 0 0; padding: 14px 14px calc(20px + var(--safe));
}
.sheet h3 { margin: 4px 0 12px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; background: #0d1422; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.search { width: 100%; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .d { aspect-ratio: 1; border-radius: 10px; background: var(--card); font-size: 11px; padding: 4px; border: 0; color: var(--text); }
.cal .d.today { outline: 1px solid var(--gold); }
.cal .d.has { background: #243049; }
.cal .d.over { background: #3a1a1e; }
.cal .d.paid { background: #163328; }
.hd { color: var(--muted); font-size: 10px; text-align: center; padding: 6px 0; }
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 380px; background: var(--card); padding: 22px; border-radius: 20px; border: 1px solid var(--line); }
.login-box h1 { margin: 8px 0 4px; font-size: 22px; }
.install { background: #1d2740; border: 1px dashed rgba(212,180,90,.4); border-radius: 14px; padding: 12px; font-size: 13px; color: var(--muted); margin: 12px 0; }
.muted { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #243049; }
.badge.urg { background: #5a1f28; }
.badge.atr { background: #7a2430; }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.alert-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; display: inline-block; margin-left: 4px; }
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login.hidden, .hidden { display: none !important; }
.login-box { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.login-box h1 { margin: 12px 0 4px; font-size: 20px; }
.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin: 0 0 10px;
}
.lang-switch button {
  min-height: 36px;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #243049;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}
.lang-switch button.on { background: var(--gold); color: #1a1406; border-color: var(--gold); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-week span { color: var(--muted); font-size: 10px; text-transform: uppercase; padding: 4px 0; }
.cal-days button { border: 0; background: var(--card); color: var(--text); border-radius: 10px; min-height: 40px; }
.cal-days button.past { opacity: .35; }
.cal-days button.taken { background: #2a1518; color: #ff8a8a; }
.cal-days button.mine { background: #243018; border: 1px solid var(--gold); color: var(--gold2); }
.cal-days button.sel { background: var(--gold); color: #1a1406; font-weight: 800; }
.banner { border-radius: 16px; padding: 12px; margin-bottom: 12px; font-size: 13px; }
.banner.warn { background: #2a2410; border: 1px solid rgba(245,193,92,.35); }
.banner.bad { background: #2a1518; border: 1px solid rgba(255,107,107,.35); }
.banner.ok { background: #14241c; border: 1px solid rgba(61,214,164,.3); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.check input { width: auto; }
.pill { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold2); }
