/* ===== Reset & dasar ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* ===== Komponen umum ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-block {
  display: block;
  width: 100%;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.form-group input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-warning {
  background: #fffbeb;
  color: var(--warning);
  border: 1px solid #fde68a;
}

.hidden {
  display: none !important;
}

/* ===== Landing ===== */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.landing h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.landing .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 480px;
}

.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 640px;
  width: 100%;
}

.landing-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
  display: block;
  color: var(--text);
}

.landing-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.landing-card h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: var(--primary-dark);
}

.landing-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .landing-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== Dashboard pengawas ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.exam-list {
  list-style: none;
}

.exam-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.exam-list li:last-child {
  border-bottom: none;
}

.exam-list .exam-name {
  font-weight: 600;
}

.exam-list .exam-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.exam-list .exam-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-box {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  font-size: 0.9rem;
  word-break: break-all;
}

.share-box code {
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Tabel hasil */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #f9fafb;
  font-weight: 600;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-finished {
  background: #dcfce7;
  color: #166534;
}

.badge-violation {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.violation-row {
  cursor: pointer;
}

.violation-detail {
  background: #f9fafb;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.violation-detail ul {
  margin: 0;
  padding-left: 18px;
}

.rec-link {
  display: inline-block;
  margin: 2px 4px 2px 0;
  font-size: 0.8rem;
}

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

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.9rem;
}