* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

h1 {
  margin-bottom: 6px;
  font-size: 42px;
  line-height: 1.1;
}

.subtext {
  color: #4b5563;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.btn:hover {
  background: #f3f4f6;
}

.btn.primary {
  border: 0;
  color: #fff;
  background: #7c3f20;
}

.btn.primary:hover {
  background: #6a3419;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.status {
  font-size: 13px;
  color: #4b5563;
}

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

.stat-card {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 12px;
  background: #fcfdff;
}

.stat-card h3 {
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric {
  font-size: 24px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  font-size: 14px;
}

td.actions-cell {
  width: 110px;
}

.danger-btn {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

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

th {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
}

.status-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

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

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

.status-badge.missing {
  background: #fee2e2;
  color: #991b1b;
}

.verifier-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 18px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 20px;
}

.logo {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-size: 13px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  border-radius: 8px;
  padding: 8px 10px;
}

.sidebar-nav a:hover {
  background: #f3f4f6;
}

.sidebar-nav a.active {
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
}

.verifier-content {
  padding: 26px 28px;
}

.verifier-header {
  margin-bottom: 22px;
}

.verifier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

.verifier-grid.has-extracted {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  max-width: none;
  margin: 0;
}

.extracted-card[hidden] {
  display: none !important;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.upload-card {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  min-height: 330px;
}

.upload-icon {
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.upload-card h2 {
  font-size: 34px;
  line-height: 1.15;
  max-width: 600px;
}

.upload-card p {
  color: #6b7280;
}

.upload-card .status {
  min-height: 20px;
}

#insurance-file-input,
#fiscal-file-input,
#cibtp-file-input,
#probtp-file-input,
#kbis-file-input,
#artibag-file-input {
  display: none;
}

.badge {
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.extracted-card h2 {
  margin-bottom: 14px;
  font-size: 36px;
  line-height: 1.1;
}

.extracted-card .confirm-hint {
  margin-bottom: 14px;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.table-wrap a {
  color: #7c3f20;
  font-weight: 600;
  text-decoration: none;
}

.table-wrap a:hover {
  text-decoration: underline;
}

.preview-layout {
  max-width: 960px;
  margin: 0 auto;
}

.preview-pdf-card .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-pdf-card h2 {
  font-size: 22px;
  margin: 0;
}

.pdf-frame {
  width: 100%;
  height: min(82vh, 920px);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

@media (max-width: 1100px) {
  .pdf-frame {
    height: 65vh;
  }
}

.info-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.label,
.value {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.label {
  font-size: 13px;
  color: #6b7280;
  background: #fafafa;
  border-right: 1px solid #e5e7eb;
}

.value {
  font-weight: 600;
}

.info-grid .label:last-child,
.info-grid .value:last-child {
  border-bottom: 0;
}

.review-actions {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}

.review-actions-label {
  margin: 0 0 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.review-actions-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.review-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.review-btn-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.review-btn-icon svg {
  width: 20px;
  height: 20px;
}

.review-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.review-btn-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.review-btn-sub {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.review-btn-reject {
  background: #ffffff;
  border-color: #fecaca;
  color: #9f1239;
}

.review-btn-reject .review-btn-icon {
  background: #fff1f2;
  color: #be123c;
}

.review-btn-reject .review-btn-sub {
  color: #b4535a;
}

.review-btn-reject:hover:not(:disabled) {
  background: #fff1f2;
  border-color: #fda4af;
  box-shadow: 0 1px 3px rgba(159, 18, 57, 0.08);
}

.review-btn-approve {
  background: #ffffff;
  border-color: #bbf7d0;
  color: #166534;
}

.review-btn-approve .review-btn-icon {
  background: #dcfce7;
  color: #15803d;
}

.review-btn-approve .review-btn-sub {
  color: #15803d;
}

.review-btn-approve:hover:not(:disabled) {
  background: #f0fdf4;
  border-color: #86efac;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.1);
}

@media (max-width: 640px) {
  .review-actions-buttons {
    grid-template-columns: 1fr;
  }
}

.json-dump-section {
  margin-top: 20px;
}

.json-dump-section .eyebrow {
  margin-bottom: 8px;
}

.json-dump-box {
  margin: 0;
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #1e293b;
  user-select: text;
  cursor: default;
  overscroll-behavior: contain;
}

@media (max-width: 1100px) {
  .verifier-grid.has-extracted {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .verifier-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .upload-card h2,
  .extracted-card h2 {
    font-size: 28px;
  }
}
