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

:root {
  --bg:      #0f0f17;
  --bg2:     #1a1a2e;
  --card:    #16213e;
  --primary: #e94560;
  --success: #0f9b58;
  --text:    #eaeaea;
  --muted:   #7a7a9a;
  --border:  #2a2a4a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Login ─────────────────────────────────────────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
}

.login-card h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

.field { margin-bottom: 1rem; }

input[type="text"],
input[type="password"] {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: var(--primary); }

.btn-primary {
  width: 100%;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.85rem;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.85; }

.error-msg {
  background: #e9456018;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.8rem;
}

/* ── Smoke page ────────────────────────────────────────────────────────────── */

.smoke-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.smoke-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
}

.link-muted {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.link-muted:hover,
.btn-ghost:hover { color: var(--text); }

.smoke-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.smoke-btn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  box-shadow: 0 8px 40px #e9456044;
  cursor: pointer;
  font-size: 5rem;
  height: 200px;
  width: 200px;
  line-height: 1;
  transition: transform 0.12s ease, background-color 0.3s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.smoke-btn:active { transform: scale(0.91); }

.smoke-btn.success {
  background: var(--success);
  box-shadow: 0 8px 40px #0f9b5844;
}

.today-count {
  color: var(--muted);
  font-size: 1.25rem;
}

.today-count .count-num {
  color: var(--text);
  font-size: 2.25rem;
  font-weight: 700;
  margin-right: 0.3rem;
}

/* ── Dashboard ─────────────────────────────────────────────────────────────── */

.dash-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.dash-header h1 { font-size: 1.3rem; }

.dash-header nav { display: flex; gap: 0.75rem; align-items: center; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.dash-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card h2 {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.today-big {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.today-big .big-num {
  color: var(--primary);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.unit { color: var(--muted); font-size: 1.1rem; }

.smoke-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
}

.smoke-list li {
  align-items: center;
  background: var(--bg2);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
}

.entry-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.45;
  padding: 0.15rem 0.25rem;
  transition: opacity 0.2s;
}

.del-btn:hover { opacity: 1; }

.chart-wrap {
  height: 220px;
  position: relative;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
