:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: #f1f5f9;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Landingpage ---------- */
.hero {
  background: radial-gradient(1200px 600px at 70% -10%, #3730a3 0%, var(--bg) 55%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 6vw, 80px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: #818cf8; box-shadow: 0 0 18px #818cf8; }
.nav-links { display: flex; gap: 12px; align-items: center; }

.hero-inner {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 20px clamp(20px, 6vw, 80px) 60px;
}
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -1px; }
.hero h1 span { color: #a5b4fc; }
.hero p.lead { margin-top: 20px; font-size: 19px; color: #cbd5e1; max-width: 520px; }
.hero-cta { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.badges { margin-top: 34px; display: flex; gap: 26px; flex-wrap: wrap; color: #94a3b8; font-size: 14px; }
.badges b { color: #e2e8f0; display: block; font-size: 22px; }

.mockup {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: blur(6px);
}
.mockup .timer-face {
  font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums;
  text-align: center; padding: 24px 0; letter-spacing: 1px;
}
.mockup .bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,0.12); margin: 10px 0; }
.mockup .bar.fill { background: linear-gradient(90deg,#818cf8,#6366f1); }
.mockup .row { display: flex; justify-content: space-between; color: #cbd5e1; font-size: 14px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.08); }

.features {
  background: #f8fafc;
  padding: clamp(50px, 8vw, 90px) clamp(20px, 6vw, 80px);
}
.features h2 { text-align: center; font-size: clamp(26px,3vw,38px); letter-spacing: -0.5px; }
.features .sub { text-align: center; color: var(--muted); margin-top: 10px; }
.feature-grid {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.feature {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.feature .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: #eef2ff; font-size: 22px; margin-bottom: 14px; }
.feature h3 { font-size: 18px; }
.feature p { color: var(--muted); margin-top: 8px; font-size: 15px; }

.footer { text-align: center; padding: 34px; color: var(--muted); background: #f8fafc; border-top: 1px solid var(--border); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .mockup { order: -1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; border-radius: 10px; padding: 12px 20px; font-weight: 600; font-size: 15px;
  transition: transform .05s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.18); }
.btn-light { background: #fff; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Auth-Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; color: var(--text); border-radius: 18px; width: 100%; max-width: 420px;
  padding: 30px; box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.modal h2 { font-size: 24px; }
.modal .tabs { display: flex; gap: 6px; background: #f1f5f9; padding: 5px; border-radius: 10px; margin: 18px 0 22px; }
.modal .tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 7px; font-weight: 600; color: var(--muted); }
.modal .tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

label.field { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #334155; }
label.field input, label.field select, .input {
  width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
label.field input:focus, .input:focus { outline: 2px solid #c7d2fe; border-color: var(--primary); }

.form-msg { font-size: 14px; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; display: none; }
.form-msg.error { display: block; background: #fef2f2; color: var(--danger); }
.form-msg.success { display: block; background: #f0fdf4; color: var(--success); }

/* ---------- App ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  background: #fff; border-bottom: 1px solid var(--border); padding: 14px clamp(16px,4vw,40px);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.app-header .brand { color: var(--text); }
.app-header .brand .dot { background: var(--primary); box-shadow: 0 0 12px rgba(79,70,229,.5); }
.user-box { display: flex; align-items: center; gap: 14px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; }
.user-name { font-size: 14px; font-weight: 600; }
.user-mail { font-size: 12px; color: var(--muted); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px clamp(16px,4vw,40px); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h3 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.timer-display { font-size: 52px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums;
  padding: 14px 0; letter-spacing: 1px; }
.timer-meta { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 16px; min-height: 20px; }
.timer-controls { display: flex; gap: 10px; }
.timer-controls .btn { flex: 1; }
.timer-fields { display: flex; gap: 10px; margin-bottom: 16px; }
.timer-fields > * { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td.dur { font-variant-numeric: tabular-nums; font-weight: 600; }
.proj-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.proj-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { border: none; background: transparent; font-size: 15px; padding: 5px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #f1f5f9; border-radius: 20px; padding: 6px 12px; font-size: 13px; }
.chip button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.section-title h2 { font-size: 20px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: var(--danger); }

.form-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-inline .full { grid-column: 1 / -1; }
