:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e6ed;
  --text: #1a2233;
  --text-muted: #667085;
  --primary: #2954e0;
  --primary-dark: #1e3fb0;
  --danger: #d92d20;
  --danger-bg: #fde9e7;
  --warn: #b54708;
  --warn-bg: #fef3e3;
  --success: #067647;
  --success-bg: #e5f7ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

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

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

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: #101828;
  color: #e4e7ec;
  flex-shrink: 0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding: 0 20px 20px;
  border-bottom: 1px solid #1f2937;
  margin-bottom: 12px;
}
.sidebar nav a {
  display: block;
  padding: 11px 20px;
  color: #cbd2e1;
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1a2437; text-decoration: none; color: #fff; }
.sidebar nav a.active {
  background: #1a2437;
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 600;
}
.sidebar .footer { margin-top: auto; padding: 12px 20px; font-size: 12px; color: #7f8ba3; }

.main { flex: 1; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .user { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 12px; }
.topbar button.link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0; }

.content { padding: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-body { padding: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.field label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
input, select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { outline: 2px solid #c7d4fb; border-color: var(--primary); }

button.btn {
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
button.btn:hover { background: var(--primary-dark); }
button.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
button.btn.secondary:hover { background: #f4f6f9; }
button.btn:disabled { opacity: 0.55; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }
tbody tr:hover { background: #fafbfd; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; }
.badge.high { color: var(--success); background: var(--success-bg); }
.badge.moderate { color: var(--warn); background: var(--warn-bg); }
.badge.low { color: var(--danger); background: var(--danger-bg); }
.badge.pending { color: var(--text-muted); background: #eef1f6; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--radius); width: 560px; max-width: 92vw;
  max-height: 88vh; overflow: auto; box-shadow: 0 20px 40px rgba(16,24,40,0.25);
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.compare-images { display: flex; gap: 16px; }
.compare-images figure { flex: 1; margin: 0; text-align: center; }
.compare-images img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.compare-images figcaption { margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 380px; max-width: 90vw; }
.login-card .brand { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-card .tagline { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.error-text { color: var(--danger); font-size: 13px; }
.hint { color: var(--text-muted); font-size: 12.5px; }

.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
