:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e2e2e6;
  --text: #1a1a1e;
  --text-muted: #6b6b74;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 8px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.container { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

nav.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
nav.topbar .container-wide { display: flex; align-items: center; gap: 1.5rem; }
nav.topbar .brand { font-weight: 700; color: var(--text); }
nav.topbar .spacer { flex: 1; }
nav.topbar a { color: var(--text-muted); font-size: 0.9rem; }
nav.topbar a.active { color: var(--text); font-weight: 600; }

main { padding: 2rem 0 4rem; }

h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.text-muted { color: var(--text-muted); }
.subtitle { color: var(--text-muted); margin: 0 0 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { resize: vertical; }
.help-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.errorlist { list-style: none; margin: 0.3rem 0 0; padding: 0; color: var(--danger); font-size: 0.85rem; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-scheduled { background: #fef3c7; color: #92400e; }
.badge-published { background: #dcfce7; color: #166534; }
.badge-live { background: #dcfce7; color: #166534; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-not_submitted { background: #f1f5f9; color: #475569; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

.auth-page { max-width: 380px; margin: 4rem auto; }
.auth-page .card { padding: 2rem; }

.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
