/* ==========================================================================
   Bank-Grade DPDP Compliance Scanner Design System
   Aesthetic: Clean Financial Navy, Slate, Crisp High-Contrast Badges
   ========================================================================== */

:root {
  --bg-app: #f4f6f9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  
  --border-subtle: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --brand-navy: #0f2744;
  --brand-blue: #1d4ed8;
  --brand-blue-hover: #1e40af;
  --brand-blue-light: #eff6ff;
  
  --status-confirmed-bg: #fef2f2;
  --status-confirmed-text: #991b1b;
  --status-confirmed-border: #fecaca;
  --status-confirmed-pill: #dc2626;
  
  --status-suspected-bg: #fffbeb;
  --status-suspected-text: #92400e;
  --status-suspected-border: #fde68a;
  --status-suspected-pill: #d97706;

  --status-clean-bg: #f0fdf4;
  --status-clean-text: #166534;
  --status-clean-border: #bbf7d0;
  --status-clean-pill: #16a34a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background-color: var(--brand-navy);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Company logo card — white plate so a dark wordmark stays legible on the
   dark header. The image itself comes from /api/branding/logo at runtime. */
.brand-logo {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.brand-logo-img {
  height: 40px;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  color: #e2e8f0;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-airgapped {
  background-color: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Main Content Layout */
.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 1.75rem auto;
  padding: 0 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Card & Panels */
.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tabs */
.tabs-nav {
  display: flex;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.tab-btn.active {
  background-color: #ffffff;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2.75rem 1.5rem;
  text-align: center;
  background-color: #fafbfd;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--brand-blue);
  background-color: var(--brand-blue-light);
}

/* Visually hidden rather than display:none. A display:none file input is
   ignored by programmatic .click() in some browsers (Safari) and cannot be
   reached by keyboard, which is what made the drop zone appear dead. */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The whole zone is the affordance, so say so. */
.drop-zone {
  cursor: pointer;
}

.drop-zone-icon {
  width: 64px;
  height: 64px;
  background-color: #e2e8f0;
  color: var(--brand-navy);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: transform 0.2s ease;
}

.drop-zone:hover .drop-zone-icon {
  transform: translateY(-3px);
  background-color: #dbeafe;
  color: var(--brand-blue);
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.browse-link {
  color: var(--brand-blue);
  text-decoration: underline;
  cursor: pointer;
}

.drop-support {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.drop-security-note {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
}

/* Raw Text Input */
.direct-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.raw-textarea {
  width: 100%;
  min-height: 140px;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
  background-color: #f8fafc;
}

.raw-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.direct-actions {
  display: flex;
  justify-content: flex-end;
}

/* Quick Samples Bar */
.samples-bar {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.samples-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sample-btn {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.sample-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.badge-format {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-format.xlsx { background-color: #dcfce7; color: #15803d; }
.badge-format.docx { background-color: #dbeafe; color: #1d4ed8; }
.badge-format.rtf  { background-color: #fef3c7; color: #b45309; }
.badge-format.txt  { background-color: #f1f5f9; color: #475569; }
.badge-format.pdf  { background-color: #fee2e2; color: #b91c1c; }
.badge-format.mar  { background-color: #fae8ff; color: #86198f; }
.badge-format.dl   { background-color: #e0e7ff; color: #3730a3; }

/* Progress Card */
.progress-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3.5px solid #e2e8f0;
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr; }
}

.summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scan-id-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background-color: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.status-indicator-wrap {
  margin-bottom: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-badge.confirmed {
  background-color: var(--status-confirmed-bg);
  color: var(--status-confirmed-text);
  border: 1px solid var(--status-confirmed-border);
}

.status-badge.suspected {
  background-color: var(--status-suspected-bg);
  color: var(--status-suspected-text);
  border: 1px solid var(--status-suspected-border);
}

.status-badge.clean {
  background-color: var(--status-clean-bg);
  color: var(--status-clean-text);
  border: 1px solid var(--status-clean-border);
}

.status-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-badge.confirmed .status-icon-dot { background-color: var(--status-confirmed-pill); }
.status-badge.suspected .status-icon-dot { background-color: var(--status-suspected-pill); }
.status-badge.clean .status-icon-dot { background-color: var(--status-clean-pill); }

.compliance-summary-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

/* Risk Score Bar */
.risk-score-container {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.risk-score-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.risk-bar-track {
  height: 10px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.risk-bar-fill.high { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.risk-bar-fill.medium { background: #f59e0b; }
.risk-bar-fill.low { background: #10b981; }

.risk-score-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.risk-level-badge {
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.risk-level-badge.critical { background-color: #fee2e2; color: #b91c1c; }
.risk-level-badge.high { background-color: #ffedd5; color: #c2410c; }
.risk-level-badge.medium { background-color: #fef3c7; color: #b45309; }
.risk-level-badge.none { background-color: #dcfce7; color: #15803d; }

/* Metadata Card */
.meta-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.meta-item-full {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.item-label {
  color: var(--text-muted);
  font-weight: 500;
}

.item-value {
  color: var(--text-primary);
  font-weight: 600;
}

.hash-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background-color: #f1f5f9;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #334155;
  word-break: break-all;
  border: 1px solid var(--border-subtle);
}

/* KPI Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-direct { background-color: #fee2e2; color: #dc2626; }
.icon-financial { background-color: #ffedd5; color: #ea580c; }
.icon-contact { background-color: #e0e7ff; color: #4338ca; }
.icon-special { background-color: #f1f5f9; color: #475569; }

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-number {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Action Toolbar */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--brand-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-blue-hover);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

/* Findings Table */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-filter-bar {
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 240px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.filter-select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  background-color: #ffffff;
}

.findings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.findings-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.findings-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.findings-table tr:hover {
  background-color: #f8fafc;
}

.entity-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.entity-badge.AADHAAR { background-color: #fee2e2; color: #b91c1c; }
.entity-badge.PAN { background-color: #ffedd5; color: #c2410c; }
.entity-badge.BANK_ACCOUNT, .entity-badge.CREDIT_DEBIT_CARD { background-color: #fef3c7; color: #b45309; }
.entity-badge.PHONE_NUMBER, .entity-badge.EMAIL_ADDRESS { background-color: #e0e7ff; color: #4338ca; }
.entity-badge.PERSON_NAME { background-color: #f1f5f9; color: #334155; }
.entity-badge.MINOR_CHILD_DATA { background-color: #fae8ff; color: #86198f; }

.masked-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #1e293b;
  background-color: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: #eff6ff;
  color: #1e40af;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.method-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* Footer */
.app-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Company copyright line */
.footer-copyright {
  max-width: 1280px;
  margin: 0.9rem auto 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Batch, Email and Audit views
   ========================================================================== */

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kpi-box {
  flex: 1 1 120px;
  background-color: var(--bg-app, #f8fafc);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kpi-box.kpi-critical { border-color: #fca5a5; background-color: #fef2f2; }
.kpi-box.kpi-warn     { border-color: #fcd34d; background-color: #fffbeb; }
.kpi-box.kpi-ok       { border-color: #86efac; background-color: #f0fdf4; }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Status pill — compact variant of the hero status badge, for table rows */
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pill.confirmed { background-color: #fee2e2; color: #b91c1c; }
.status-pill.suspected { background-color: #fef3c7; color: #b45309; }
.status-pill.clean     { background-color: #dcfce7; color: #15803d; }
.status-pill.failed    { background-color: #e2e8f0; color: #475569; }

.entity-chip {
  display: inline-block;
  background-color: #eef2ff;
  color: #4338ca;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  margin: 0.1rem 0.1rem 0.1rem 0;
  white-space: nowrap;
}

.chip-muted { color: var(--text-muted); font-size: 0.72rem; }

.chip-error {
  display: inline-block;
  background-color: #fee2e2;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
}

.cell-strong   { font-weight: 600; color: var(--text-primary); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-entities { max-width: 380px; }
.cell-mono     { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.74rem; }
.cell-muted    { color: var(--text-muted); text-align: center; padding: 1.5rem 0; }

.audit-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.audit-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.audit-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  max-width: 640px;
  line-height: 1.5;
}

.audit-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-danger-outline {
  background-color: transparent;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.btn-danger-outline:hover { background-color: #fef2f2; }

/* Header chip for a degraded capability (e.g. no OCR engine installed) */
.badge-warn {
  border-color: rgba(251, 191, 36, 0.5) !important;
  color: #fcd34d !important;
}

.hidden {
  display: none !important;
}

/* Print Styles */
@media print {
  .app-header, .upload-section, .actions-bar, .app-footer, .table-filter-bar {
    display: none !important;
  }
  .main-content {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }
  .panel-card, .summary-card, .table-container {
    box-shadow: none;
    border: 1px solid #000000;
  }
}

/* Explicit picker buttons. Relying on a label inside a drop zone left the
   obvious click target dead, so each zone now has a real button. */
.pick-btn {
  margin: 0.25rem 0.25rem 0.9rem;
}

/* Failures were raised with alert(), which browsers can suppress — the scan
   then looked like it did nothing at all. Errors are shown on the page now. */
.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: var(--status-confirmed-bg);
  border: 1px solid var(--status-confirmed-border);
  color: var(--status-confirmed-text);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.error-banner-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
}

.build-stamp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.75;
}
