:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --primary: #1246a0;
  --primary-dark: #0b3275;
  --border: #dbe3ef;
  --success: #0f8a5f;
  --danger: #b42318;
  --warning: #b54708;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-logo {
  width: 76px;
  height: 54px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 20px; margin-bottom: 3px; }
h2 { font-size: 42px; line-height: 1.1; margin: 18px 0; }
h3 { font-size: 24px; margin-bottom: 8px; }
h4 { font-size: 18px; margin-bottom: 6px; }

.topbar p, .muted { color: var(--muted); margin-bottom: 0; }

.admin-link {
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.container {
  width: min(1120px, 90%);
  margin: 36px auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.pill {
  display: inline-block;
  background: #e8f0ff;
  color: var(--primary);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.hero-card, .panel, .result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 28px rgba(16,24,40,.06);
}

.hero-card ul { margin-bottom: 0; padding-left: 20px; }
.hero-card li { margin: 8px 0; }

.form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 15px;
  background: #fff;
}

textarea {
  min-height: 105px;
  resize: vertical;
}

.upload-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  background: #f9fbff;
  border: 1px dashed #b9c7dc;
  padding: 18px;
  border-radius: 14px;
}

.camera-panel {
  background: #f9fbff;
  border: 1px dashed #b9c7dc;
  padding: 18px;
  border-radius: 14px;
}

.camera-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.video-box, .selfie-box {
  position: relative;
  min-height: 245px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

video, canvas {
  width: 100%;
  height: 245px;
  object-fit: cover;
}

#cameraPlaceholder, #selfiePlaceholder {
  position: absolute;
  color: var(--muted);
  font-weight: 700;
}

canvas { display: none; }

button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

button:hover, .admin-link:hover { background: var(--primary-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }

.secondary { background: #344054; }
.approve { background: var(--success); }
.reject { background: var(--danger); }
.review { background: var(--warning); }

.hidden { display: none !important; }

.result {
  margin-top: 24px;
  border-left: 6px solid var(--primary);
}

.case-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.case-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr .8fr .8fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef4ff;
  color: var(--primary);
  white-space: nowrap;
}

.badge.approved { background: #e8f8f1; color: var(--success); }
.badge.rejected { background: #fff1f0; color: var(--danger); }
.badge.review { background: #fff7ed; color: var(--warning); }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  background: #fbfcff;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

@media (max-width: 820px) {
  .topbar, .hero, .grid, .upload-group, .case-row, .detail-grid, .camera-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .camera-head {
    flex-direction: column;
  }

  h2 { font-size: 32px; }
}
