:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #0284c7;
  --accent: #10b981;
  --danger: #ef4444;
  --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 2rem; }
.hidden { display: none !important; }
.container { max-width: 640px; margin: 0 auto; padding: 1rem; }

.sync-banner { background: #b45309; color: #fffbeb; text-align: center; padding: 0.45rem 0.8rem; font-size: 0.84rem; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem; margin-bottom: 1rem; }
.login-card { margin-top: 3rem; }
.brand-header { text-align: center; margin-bottom: 1.5rem; }
.app-logo { width: 72px; height: 72px; margin-bottom: 0.5rem; }
.subtitle { color: var(--muted); font-size: 0.9rem; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0.3rem; }
input, select { width: 100%; padding: 0.7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1rem; }

.btn { padding: 0.65rem 1rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #064e3b; width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.full-width { width: 100%; margin-top: 1rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; font-size: 1.1rem; }
.badge { background: var(--surface-2); padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.78rem; margin-left: 0.4rem; }

.tabbar { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 0.85rem; background: none; border: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; cursor: pointer; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--primary); }

.reco-bar { margin-bottom: 1rem; }
.reco-box { margin-top: 0.6rem; padding: 0.8rem; border-radius: 10px; background: #064e3b; border: 1px solid var(--accent); color: #ecfdf5; font-size: 0.92rem; }

.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-weekdays div { font-size: 0.78rem; color: var(--muted); padding-bottom: 0.3rem; }
.cal-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; min-height: 58px; padding: 4px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; position: relative; }
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.today { border: 2px solid #fff; }
.cal-cell.past { opacity: 0.65; }
.cal-cell.holiday { border-color: #f43f5e; }
.cal-cell.pending-sync { outline: 2px dashed #f59e0b; }
.day-num { font-size: 0.82rem; font-weight: 700; text-align: left; }
.holiday-dot { font-size: 0.62rem; color: #fb7185; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-pill { font-size: 0.68rem; font-weight: 700; padding: 2px 4px; border-radius: 4px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.legend { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.9rem; font-size: 0.82rem; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

.participants-box { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.3rem; }
.part-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg); padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); }
.part-checks { display: flex; gap: 0.9rem; font-size: 0.88rem; }
.part-checks label { margin: 0; display: flex; align-items: center; gap: 0.3rem; color: var(--text); cursor: pointer; }
.part-checks input { width: auto; }

.stats-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; background: var(--bg); border-radius: 8px; margin-top: 0.5rem; border: 1px solid var(--border); }
.score-pos { color: var(--accent); font-weight: 700; }
.score-neg { color: #fbbf24; font-weight: 700; }
.dev-item { padding: 0.65rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 460px; padding: 1.2rem; max-height: 92vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.modal-actions button { flex: 1; }

.holiday-banner { background: #4c0519; border: 1px solid #f43f5e; color: #ffe4e6; padding: 0.5rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 0.6rem; }
.lock-banner { background: #422006; border: 1px solid #f59e0b; color: #fef3c7; padding: 0.5rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 0.6rem; }
.error-msg { color: #fca5a5; font-size: 0.88rem; margin-top: 0.6rem; }
.info-msg { color: #6ee7b7; font-size: 0.88rem; margin-top: 0.6rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
.topbar-actions { display: flex; gap: 0.4rem; }
