/* ============================================================
   Tim & Leanne — Admin / Mission Control CSS
   ============================================================ */

:root {
  --bg: #0f1117;
  --bg-surface: #1a1d27;
  --bg-card: #21253a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf0;
  --text-muted: #7b82a0;
  --cognac: #c27a45;
  --cognac-pale: rgba(194, 122, 69, 0.15);
  --green: #3ecf6c;
  --green-pale: rgba(62, 207, 108, 0.12);
  --red: #e55151;
  --red-pale: rgba(229, 81, 81, 0.12);
  --yellow: #f0c040;
  --yellow-pale: rgba(240, 192, 64, 0.12);
  --blue: #5b8dee;
  --blue-pale: rgba(91, 141, 238, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --font: 'Inter', system-ui, sans-serif;
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--cognac); text-decoration: none; }
a:hover { opacity: 0.8; }
img { display: block; max-width: 100%; }

/* ============ LOGIN PAGE ============ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow);
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cognac-pale);
  border: 1.5px solid rgba(194, 122, 69, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-initials {
  font-size: 18px;
  font-weight: 600;
  color: var(--cognac);
  letter-spacing: 0.05em;
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.login-error {
  background: var(--red-pale);
  border: 1px solid rgba(229, 81, 81, 0.3);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 20px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-field input {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  width: 100%;
  transition: border-color var(--transition);
}

.login-field input:focus {
  outline: none;
  border-color: var(--cognac);
  box-shadow: 0 0 0 3px rgba(194, 122, 69, 0.2);
}

.login-btn {
  background: var(--cognac);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 13px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.login-btn:hover { opacity: 0.88; }

.login-hint {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
}

.login-hint code {
  font-family: 'Courier New', monospace;
  background: var(--bg-card);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ============ DASHBOARD HEADER ============ */

.admin-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cognac-pale);
  border: 1px solid rgba(194, 122, 69, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--cognac);
  flex-shrink: 0;
}

.admin-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.admin-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.admin-nav-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  opacity: 1;
}

.admin-export {
  color: var(--green);
  border-color: rgba(62, 207, 108, 0.25);
}

.admin-export:hover {
  background: var(--green-pale);
  color: var(--green);
}

.admin-logout {
  color: var(--red);
  border-color: rgba(229, 81, 81, 0.25);
}

.admin-logout:hover {
  background: var(--red-pale);
  color: var(--red);
}

/* ============ MAIN ============ */

.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.admin-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.admin-empty {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
  font-style: italic;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.section-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ STATS ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-num {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-yes .stat-num { color: var(--green); }
.stat-no .stat-num { color: var(--yellow); }
.stat-pending .stat-num { color: var(--red); }
.stat-cities .stat-num { color: var(--blue); }

/* ============ TABLE ============ */

.table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.table-search, .table-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  transition: border-color var(--transition);
}

.table-search { min-width: 200px; }
.table-filter { cursor: pointer; }

.table-search:focus, .table-filter:focus {
  border-color: var(--cognac);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rsvp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rsvp-table thead tr {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.rsvp-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.rsvp-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.rsvp-table tbody tr:last-child td { border-bottom: none; }

.rsvp-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.td-id { color: var(--text-muted); font-size: 12px; }
.td-name strong { color: var(--text); font-weight: 500; }
.td-email { display: block; font-size: 11px; color: var(--text-muted); }
.td-city { color: var(--text-muted); }
.td-none { color: var(--text-muted); }
.td-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.td-note { max-width: 260px; }
.note-preview { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.4; cursor: help; }
.note-status { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; }
.note-pending { background: var(--yellow-pale); color: var(--yellow); }
.note-published { background: var(--green-pale); color: var(--green); }
.note-hidden { background: var(--red-pale); color: var(--red); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-yes { background: var(--green-pale); color: var(--green); }
.badge-no { background: var(--yellow-pale); color: var(--yellow); }
.badge-published { background: var(--green-pale); color: var(--green); }
.badge-pending { background: var(--yellow-pale); color: var(--yellow); }
.badge-hidden { background: var(--red-pale); color: var(--red); }

/* ============ CITIES ============ */

.cities-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.city-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}

.city-name { font-size: 13px; color: var(--text); }
.city-count {
  background: var(--cognac-pale);
  color: var(--cognac);
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

/* ============ NOTES MODERATION ============ */

.notes-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.notes-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}

.notes-tab:hover { color: var(--text); }
.notes-tab.active { color: var(--cognac); border-bottom-color: var(--cognac); }

.notes-panel.hidden { display: none; }

.note-mod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.note-mod-card:last-child { margin-bottom: 0; }

.note-mod-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-mod-meta strong { color: var(--text); }

.note-mod-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 12px;
  font-style: italic;
}

.note-mod-actions {
  display: flex;
  gap: 8px;
}

.btn-mod {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.btn-publish {
  background: var(--green-pale);
  border-color: rgba(62, 207, 108, 0.3);
  color: var(--green);
}

.btn-publish:hover { opacity: 0.8; }

.btn-hide {
  background: var(--red-pale);
  border-color: rgba(229, 81, 81, 0.3);
  color: var(--red);
}

.btn-hide:hover { opacity: 0.8; }

.btn-unpublish:hover { color: var(--text); border-color: var(--border-strong); }

.btn-delete {
  background: var(--red-pale);
  border-color: rgba(229, 81, 81, 0.3);
  color: var(--red);
  padding: 4px 10px;
  font-size: 11px;
}
.btn-delete:hover { opacity: 0.8; }

.btn-delete-all {
  background: var(--red-pale);
  border: 1px solid rgba(229, 81, 81, 0.35);
  color: var(--red);
  border-radius: 100px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-delete-all:hover { opacity: 0.8; }

.section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.td-action {
  width: 60px;
  text-align: right;
  white-space: nowrap;
}
.td-action form { margin: 0; }

/* ============ LOG ============ */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-entry {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

.log-entry:hover { background: var(--bg-card); }

.log-time { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.log-msg { color: var(--text); }

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .admin-header-inner { flex-direction: column; align-items: flex-start; }
  .admin-nav { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .table-controls { flex-direction: column; align-items: stretch; }
  .table-search { min-width: 0; width: 100%; }
  .login-card { padding: 36px 24px; }
}

@media (max-width: 480px) {
  .admin-section { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* === Hey Tim greeting === */
.hey-tim {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.hey-tim-dot {
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 0.4; box-shadow: 0 0 0 0 rgba(62,207,108,0); } 50% { opacity: 1; box-shadow: 0 0 0 6px rgba(62,207,108,0.15); } }
.hey-tim-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-style: italic;
  color: var(--text);
}
.hey-tim-days {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* === Stat trend === */
.stat-trend {
  font-size: 0.72rem;
  color: var(--green);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}
.stat-tile.has-pending .stat-num { color: var(--yellow); }

/* === Two-column layout === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* === Status pills === */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-pill.in { background: var(--green-pale); color: var(--green); }
.status-pill.afar { background: var(--blue-pale); color: var(--blue); }
.status-pill.published { background: var(--green-pale); color: var(--green); }
.status-pill.hidden-pill { background: var(--red-pale); color: var(--red); }

/* === Note actions === */
.note-btn {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  margin-right: 0.5rem;
}
.note-btn.publish { border-color: var(--green); color: var(--green); }
.note-btn.publish:hover { background: var(--green-pale); }
.note-btn.hide { border-color: var(--red); color: var(--red); }
.note-btn.hide:hover { background: var(--red-pale); }
.note-btn.pending { border-color: var(--yellow); color: var(--yellow); }
.note-btn.pending:hover { background: var(--yellow-pale); }

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
}

/* stat sub-label */
.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
