/* Basic reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--fg);
  transition: background .2s ease, color .2s ease;
}

:root {
  --bg: #0b0c10;
  --fg: #e5e7eb;
  --card: #111317;
  --muted: #9ca3af;
  --border: #262a33;
  --primary: #22c55e;
  --danger: #ef4444;
  --ghost: #374151;
  --accent: #3b82f6;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

.light {
  --bg: #f6f7fb;
  --fg: #0f172a;
  --card: #ffffff;
  --muted: #4b5563;
  --border: #e5e7eb;
  --primary: #16a34a;
  --danger: #dc2626;
  --ghost: #e5e7eb;
  --accent: #2563eb;
  --shadow: 0 8px 24px rgba(2,6,23,.1);
}

.app-header, .app-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 { margin: 0; font-size: 20px; }
.header-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 20px 20px; }

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

.timer { display: grid; gap: 12px; }
.timer-display { display: grid; gap: 6px; }
.label { color: var(--muted); font-size: 13px; }
.display { font-size: 42px; font-weight: 700; letter-spacing: 1px; }
.status { color: var(--muted); }
.timer-controls { display: flex; gap: 8px; flex-wrap: wrap; }

button {
  border: 1px solid var(--border);
  background: var(--ghost);
  color: var(--fg);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
button.primary { background: var(--primary); border-color: transparent; color: white; }
button.danger { background: var(--danger); border-color: transparent; color: white; }
button.ghost { background: transparent; }
button:disabled { opacity: .6; cursor: not-allowed; }

.note-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
}

.stats h2 { margin: 0 0 8px; font-size: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.stat { background: rgba(255,255,255,.02); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 18px; font-weight: 600; }

.table-header { display: flex; align-items: center; justify-content: space-between; }
.table-header h2 { margin: 0; font-size: 16px; }
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 10px 8px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255,255,255,.02); }

.app-footer { color: var(--muted); }

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
