/* =============================================================
   SuperEntries.com — Main stylesheet
   ============================================================= */

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

:root {
  --brand:       #1a4f96;
  --brand-dark:  #0f3270;
  --brand-light: #e8f0fb;
  --accent:      #e85d26;
  --text:        #1a1a1a;
  --text2:       #555;
  --text3:       #888;
  --border:      rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.18);
  --surface:     #f4f6fa;
  --card:        #ffffff;
  --radius:      10px;
  --shadow:      0 1px 4px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: var(--brand-dark);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 18px; font-weight: 700; color: white; text-decoration: none; letter-spacing: -.3px; }
.logo span { color: #f4a261; }
.topbar-sep { width: 1px; height: 20px; background: rgba(255,255,255,.2); }
.nav-links { display: flex; gap: 2px; }
.nav-link { color: rgba(255,255,255,.75); text-decoration: none; font-size: 13px; padding: 6px 12px; border-radius: 6px; transition: all .12s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); color: white; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(255,255,255,.8); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #3a72c8; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: white; flex-shrink: 0; }

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 24px 20px; }
.page-wrap.wide { max-width: 1300px; }
.page-wrap.narrow { max-width: 560px; }
.site-footer { background: var(--brand-dark); color: rgba(255,255,255,.6); font-size: 12px; padding: 14px 20px; margin-top: auto; }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-header { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 18px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .12s; background: var(--card); color: var(--text); font-family: inherit; }
.btn:hover { background: #f0f2f5; }
.btn-primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: #153e7a; color: white; }
.btn-accent  { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { background: #c44e1d; color: white; }
.btn-danger  { background: white; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-ghost   { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f0f2f5; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.required { color: #dc2626; }
.form-control { width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 14px; font-family: inherit; color: var(--text); background: white; outline: none; transition: border-color .12s; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,79,150,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fff1f2; color: #991b1b; border: 1px solid #fecdd3; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); background: var(--surface); }
.table td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbff; }

/* ── Page header ──────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 600; }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ── Stats row ────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-num { font-size: 26px; font-weight: 600; color: var(--brand); }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 52px); display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface); }
.auth-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.auth-logo { text-align: center; font-size: 22px; font-weight: 700; color: var(--brand-dark); margin-bottom: 24px; }
.auth-logo span { color: var(--accent); }
.auth-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--text2); margin-bottom: 22px; }
.auth-footer { text-align: center; font-size: 12px; color: var(--text2); margin-top: 18px; }
.auth-footer a { color: var(--brand); text-decoration: none; }

/* ── Deadline banner ──────────────────────────────────────── */
.deadline-banner { background: var(--brand); color: white; padding: 10px 18px; display: flex; align-items: center; gap: 12px; font-size: 13px; border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap; }
.deadline-banner.warning { background: #92400e; }
.deadline-banner.urgent  { background: #991b1b; }
.countdown { display: flex; gap: 6px; align-items: center; }
.count-unit { background: rgba(255,255,255,.2); border-radius: 5px; padding: 4px 8px; text-align: center; min-width: 44px; }
.count-num { font-size: 18px; font-weight: 600; display: block; line-height: 1; }
.count-lbl { font-size: 9px; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }

/* ── Save bar ─────────────────────────────────────────────── */
.save-bar { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.save-dot.saved   { background: #15803d; }
.save-dot.unsaved { background: #d97706; }
.save-dot.saving  { background: #1d4ed8; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

/* ── Misc ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .nav-links { display: none; }
}
