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

:root {
  --accent: #4f6ef7;
  --accent-dark: #3a56d4;
  --text: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --bg: #fff;
  --surface: #f8f8f8;
  --danger: #d32f2f;
  --success: #2e7d32;
  --radius: 8px;
  --max-width: 560px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding: 24px 16px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
p  { margin-bottom: 12px; color: var(--muted); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background: var(--bg);
}

/* Forms */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="email"],
input[type="date"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}

input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* Day-of-week checkboxes */
.days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.day-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.day-label input[type="checkbox"] { display: none; }

.day-label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b71c1c; text-decoration: none; color: #fff; }
.btn-full { width: 100%; display: block; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error   { background: #fdecea; color: var(--danger); }
.alert-success { background: #e8f5e9; color: var(--success); }

/* Status badge */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-active      { background: #e8f5e9; color: var(--success); }
.badge-paused      { background: #fff8e1; color: #f57f17; }
.badge-unsubscribed { background: #f5f5f5; color: var(--muted); }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.nav-title { font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; }
.nav-title:hover { text-decoration: none; }
.nav-links { display: flex; gap: 12px; margin-left: auto; font-size: 0.9rem; }

/* History table */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
td:first-child { white-space: nowrap; color: var(--muted); font-size: 0.85rem; width: 110px; }

/* Divider */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--muted); font-size: 0.9rem; }
