*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --burgundy: #7B2D42; --burgundy-light: #9E3D57; --burgundy-faint: #F7EEF1;
  --bg: #FAF9F7; --white: #fff; --ink: #1A1A1A; --muted: #8A7E7E; --border: #E8E0E0;
  --ok: #2E7D4F; --warn: #B8860B; --danger: #C0392B;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; }

#loginScreen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box {
  background: white; border-radius: 20px; padding: 48px 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1); width: 100%; max-width: 380px; text-align: center;
}
.login-icon { font-size: 48px; margin-bottom: 16px; }
.login-box h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-box p { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.login-box input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 16px; text-align: center; margin-bottom: 16px; outline: none;
}
.login-box input:focus { border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(123,45,66,0.1); }
.login-btn {
  width: 100%; padding: 14px; background: var(--burgundy); color: white;
  border: none; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer;
}
.login-btn:hover { background: var(--burgundy-light); }
.login-err { color: var(--danger); font-size: 13px; margin-top: 12px; display: none; }

#dashboard { display: none; }
.topbar {
  background: white; border-bottom: 1px solid var(--border); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { font-size: 15px; font-weight: 800; color: var(--burgundy); white-space: nowrap; }
.topbar-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.topbar-nav a { font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.topbar-nav a:hover { color: var(--burgundy); }
.logout-btn {
  font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
@media (max-width: 480px) {
  .topbar { flex-direction: column; align-items: flex-start; }
}
.main { padding: 24px; max-width: 1100px; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.stat-num { font-size: 32px; font-weight: 800; color: var(--burgundy); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.card { background: white; border-radius: 16px; padding: 24px; box-shadow: 0 2px 16px rgba(0,0,0,0.05); margin-bottom: 20px; }
.card h2 { font-size: 15px; font-weight: 800; margin-bottom: 14px; }

.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-btn {
  padding: 7px 16px; border-radius: 100px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); background: white; color: var(--muted); cursor: pointer;
}
.filter-btn.active { border-color: var(--burgundy); background: var(--burgundy-faint); color: var(--burgundy); }

.table-wrap { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--burgundy-faint); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #E8F5E9; color: var(--ok); }
.badge-warn { background: #FDF6E3; color: var(--warn); }
.badge-danger { background: #FDECEA; color: var(--danger); }
.badge-muted { background: #F0EDED; color: var(--muted); }

.btn { padding: 10px 18px; background: var(--burgundy); color: white; border: none; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--burgundy-light); }
.btn-outline { background: white; color: var(--burgundy); border: 1.5px solid var(--burgundy); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

textarea, select, input[type=text] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 14px; outline: none;
}
textarea:focus, select:focus, input[type=text]:focus { border-color: var(--burgundy); }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: white; border-radius: 16px; padding: 28px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-box h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.modal-close { float: right; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.qa-block { margin-bottom: 14px; }
.qa-q { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.qa-a { font-size: 14px; }

.alert-red { background: #FDECEA; color: var(--danger); border: 1.5px solid #F5B7B1; border-radius: 12px; padding: 14px 18px; font-size: 13px; margin-bottom: 20px; }
.muted { color: var(--muted); }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; }
