:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --color-bg: #f8f9fa;
  --color-card: #ffffff;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-primary: #faa732;
  --color-primary-hover: #f89b0e;
  --color-accent: #0f172a;
  --color-border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8f9fa 0%, #eef1f6 100%);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-tap-highlight-color: rgba(250, 167, 50, 0.2);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 1000;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  outline: none;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand img {
  width: 180px;
  height: 36px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.top-nav {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
}

.top-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.top-link:hover,
.top-link:focus-visible {
  background: rgba(15, 23, 42, 0.05);
}

.top-bar button {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
  touch-action: manipulation;
}

.top-bar button.secondary:hover {
  background: rgba(15, 23, 42, 0.05);
}

.panel {
  max-width: 960px;
  margin: 2.5rem auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0 1.5rem;
}

.login-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem 4rem;
}

.card {
  background: var(--color-card);
  padding: 2rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stat-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

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

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

.stat-badge-cost {
  margin-left: auto;
  background: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid rgba(14, 116, 144, 0.15);
  justify-content: flex-end;
  text-align: right;
}

.admin-history-card .stat-badge-cost {
  margin-left: 0;
  justify-content: flex-start;
  text-align: left;
}

.stat-total {
  font-weight: 600;
  color: var(--color-muted);
}

.card h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.25rem 2.5rem;
}

.login-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.login-header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 600;
}

.login-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.upload-form,
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.upload-form label,
.login-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.upload-form input[type='email'],
.login-form input[type='text'],
.login-form input[type='password'] {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
}

.upload-form input:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(250, 167, 50, 0.2);
}

.upload-form button,
.login-form button {
  padding: 0.8rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  width: 100%;
  touch-action: manipulation;
}

.upload-form button:hover,
.login-form button:hover {
  background: var(--color-primary-hover);
}

.upload-form button:active,
.login-form button:active {
  transform: scale(0.98);
}

.upload-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.is-loading {
  position: relative;
  pointer-events: none;
}

button.is-loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-inline-start: 0.6rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  opacity: 0.8;
  animation: spin 0.8s linear infinite;
}

button.secondary {
  background: #fff;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(15, 23, 42, 0.05);
}

.login-form .consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text);
}

.login-form .consent input[type='checkbox'] {
  margin-top: 0.25rem;
}

.login-form .consent-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.dropzone {
  border: 2px dashed rgba(15, 23, 42, 0.15);
  border-radius: 14px;
  padding: 1.15rem 1.5rem;
  text-align: center;
  color: var(--color-muted);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  position: relative;
  touch-action: manipulation;
}

.dropzone.hover {
  border-color: var(--color-primary);
  background: rgba(250, 167, 50, 0.08);
  color: var(--color-primary);
}

.dropzone.loaded {
  border-style: solid;
  color: var(--color-accent);
  background: rgba(15, 23, 42, 0.03);
}

.dropzone small {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.status {
  color: var(--color-primary);
  font-weight: 500;
}

.status.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.status.is-loading::before {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  padding: 1.5rem;
}
.modal {
  background: var(--color-card);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(15,23,42,0.25);
}
.modal h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}
.modal p {
  margin: 0 0 1rem 0;
  color: var(--color-muted);
}
.modal-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.modal-open {
  overflow: hidden;
}

/* Admin small delete (aspa) */
.admin-actions {
  display: inline-flex;
  align-items: center;
}
.delete-job {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  border: 1px solid transparent;
}
.delete-job {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  min-width: 84px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
  position: relative; /* needed so tooltip ::after positions relative to button */
}
.delete-job.danger:hover {
  background: rgba(185,28,28,0.06);
}

.delete-job:hover {
  background: rgba(15,23,42,0.04);
}

/* Permanent delete button: red background, white text (alert) */
.delete-job.permanent {
  background: #b91c1c; /* red */
  color: #fff !important;
  border: none !important;
}
.delete-job.permanent:hover {
  background: #991b1b;
}

.delete-job:active {
  transform: translateY(1px);
}

/* Ensure actions column buttons (Download, Cancel) align and have same min width */
.actions-column button,
.actions-column .delete-job {
  min-width: 84px;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
}

/* Override the generic history button style for the admin delete button so it stays white */
.history td .delete-job.secondary {
  background: #fff !important;
  color: #b91c1c !important; /* red text */
  border: 1px solid rgba(185,28,28,0.12) !important;
}

/* Modifier to color text in danger red while keeping white background */
.danger-text {
  color: #b91c1c !important;
  border-color: rgba(185,28,28,0.12) !important;
}

/* Make footer signature indicate clickability without changing visual style */
.site-footer div[tabindex] {
  cursor: pointer;
}

/* Admin delete tooltip: show small tooltip below the button on hover */
/* Remove per-button tooltip — tooltips are removed by request. */

/* Ensure action-column delete buttons are not constrained to small squares */
.history .actions-column .delete-job {
  width: auto !important;
  height: auto !important;
}

/* Ensure permanent delete is always visible: red background and white text */
.actions-column .delete-job.permanent,
.history .actions-column .delete-job.permanent {
  background: #b91c1c !important; /* red */
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 16px rgba(185,28,28,0.12);
}

/* Ensure action buttons match top-bar sizing exactly */
.actions-column button,
.actions-column .delete-job,
.top-bar button,
.history-export {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}

/* Ensure admin delete matches header/logout button sizing exactly */
.actions-column button,
.actions-column .delete-job,
.top-bar button,
.history-export {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}

/* Primary variant for modal confirm to follow primary style but with red text */
.modal .primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
}

.modal .primary.danger-text {
  background: #fff;
  color: #b91c1c;
  border: 1px solid rgba(185,28,28,0.12);
}

/* Make modal buttons match header/logout size and spacing */
.modal .modal-controls button {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  font-weight: 500;
  cursor: pointer;
}

.modal .modal-controls button + button {
  margin-left: 12px; /* match header spacing between Export CSV and Logout */
}

/* Small inline progress bar used in history table */
.history td.progress-cell {
  /* keep td as table-cell (do not change display) */
  vertical-align: middle;
  white-space: nowrap;
}
.history .progress-bar {
  width: 64px; /* smaller to avoid table deformation */
  min-width: 64px;
  height: 8px;
  background: linear-gradient(90deg, rgba(15,23,42,0.06), rgba(15,23,42,0.04));
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.history .progress-bar > .fill {
  height: 100%;
  width: 0%;
  transition: width 300ms ease;
  background: linear-gradient(90deg, #10b981, #059669); /* default vivid green */
}
.history .progress-label {
  font-size: 0.82rem;
  color: var(--color-muted);
  min-width: 32px;
  text-align: right;
}

/* Status dot */
.history .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
}
.history td.status-cell {
  width: 140px; /* allow space for dot + username */
  text-align: left;
  white-space: nowrap;
}

.history .status-username {
  margin-left: 0.5rem;
  font-size: 0.92rem;
  color: var(--color-muted);
  vertical-align: middle;
}

.history .status-cell .status-dot[title],
.history .progress-bar[title] {
  cursor: default;
}

.history .status-cell .status-dot:hover,
.history .progress-bar:hover .fill {
  filter: brightness(1.05) saturate(1.05);
}

/* Align all table cells vertically to the middle so progress bars sit evenly */
.history td,
.history thead th {
  vertical-align: middle;
}

/* Ensure progress bar behaves like an inline-block element so baseline alignment is stable */
.history .progress-bar {
  display: inline-block;
  vertical-align: middle;
}
.history .progress-label {
  vertical-align: middle;
  display: inline-block;
  line-height: 1;
  margin: 0;
  font-size: 0.82rem;
}

/* Tooltip for header */
.history thead th.progress-header {
  position: relative;
}
.history thead th.progress-header[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -2.4rem;
  background: rgba(15,23,42,0.95);
  color: #fff;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
}

.status.hidden,
.error.hidden {
  display: none;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: rgba(31, 41, 55, 0.55);
  font-size: 0.85rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.pricing-note {
  font-size: 0.75rem;
  color: rgba(31, 41, 55, 0.7);
  font-variant-numeric: tabular-nums;
}

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 280px;
  font-size: 0.9rem;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.partner-logo {
  height: 24px;
  width: auto;
}

.history-badges {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-export {
  margin-inline-start: auto;
  align-self: flex-start;
}

/* Two-row history header: top row contains title (left) and actions/badges (right). Bottom row contains filters left-aligned. */
.history-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.history-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.history-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.history-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
.history-export,
.top-bar button {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}

.admin-history-card .history-right {
  /* Keep admin header actions laid out in a row by default; filters row will
     explicitly control layout so filters render inline and right-aligned. */
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

/* Ensure top row items (title left / actions right) remain on a single line for admin cards */
.admin-history-card .history-top .history-right {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.admin-history-card .history-actions {
  align-self: flex-end;
}

.admin-history-card .history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}
.history-filters-row {
  display: flex;
  justify-content: flex-end; /* align the right column to the right */
  gap: 12px;
  align-items: center;
}
.history-filters-row .history-left {
  display: none; /* left column unused for filters row layout */
}
.history-filters-row .history-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.history-filter {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

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

.admin-history-card .history-filter {
  /* Render admin filters inline (label + control) matching user panel.
     Keep a compact appearance but allow column layout on very small screens. */
  display: inline-flex;
  flex-direction: row;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.75);
}

.admin-history-card .history-filter span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Hide visible captions in admin filters; frontend now uses aria-labels for accessibility */
.admin-history-card .history-filter span {
  display: none;
}

.admin-history-card .history-filter select,
.admin-history-card .history-filter input[type='date'] {
  min-width: 120px;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
}

.admin-history-card .history-filter input[type='date'] {
  min-width: 140px;
}

/* Responsive: on very small screens stack filters vertically to avoid overflow */
@media (max-width: 640px) {
  .history-filters-row .history-right,
  .admin-history-card .history-filter {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .admin-history-card .history-filter select,
  .admin-history-card .history-filter input[type='date'] {
    min-width: 100%;
  }
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
.dropzone:focus-visible,
.history button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.dropzone:focus-visible {
  box-shadow: 0 0 0 4px rgba(250, 167, 50, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }

  .toast.visible {
    transform: translateY(0);
  }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.history-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.history-actions button {
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-accent);
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, transform 0.1s ease;
}

.history-actions button:hover,
.history-actions button:focus-visible {
  background: rgba(15, 23, 42, 0.05);
}

.history-header select {
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-weight: 500;
}

/* Unified filter control styling: ensure selects/inputs used as filters look consistent
   across admin and normal user views. Use a subtle white card background and
   slightly stronger border to improve contrast and perceived affordance. */
.history-filters-row select,
.history-filters-row input[type='date'],
.admin-history-card .history-filter select,
.admin-history-card .history-filter input[type='date'],
.history-range-select {
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.history-range-select {
  min-width: 160px;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
}

.history {
  width: 100%;
  border-collapse: collapse;
}

.history th.id,
.history td.id {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  white-space: nowrap;
  width: 6.5rem;
}

.history th,
.history td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.history th {
  text-align: left;
  font-weight: 600;
  color: var(--color-muted);
}

.history td button {
  padding: 0.45rem 0.9rem;
  border: none;
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, transform 0.1s ease;
}

.history td button:hover {
  background: var(--color-primary-hover);
}

.history td button:active {
  transform: scale(0.98);
}

.history td.empty {
  text-align: center;
  color: var(--color-muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline li small {
  display: block;
  margin-top: 0.1rem;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-border);
}

.timeline-dot.status-completed {
  background: #16a34a;
}

.timeline-dot.status-processing {
  background: #2563eb;
}

.timeline-dot.status-failed {
  background: #dc2626;
}

.timeline-dot.status-pending {
  background: #f59e0b;
}

.timeline-dot.status-expired {
  background: #6b7280;
}

.timeline-empty {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.badge-processing {
  background: #e0e7ff;
  color: #312e81;
}

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

.badge-expired {
  background: #f3f4f6;
  color: #374151;
}

.login-card {
  max-width: 430px;
  margin: 5rem auto;
  background: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.95) 100%);
  padding: 2.75rem;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.login-header h1 {
  margin: 0;
  font-size: 1.7rem;
  color: var(--color-accent);
}

.login-header p {
  margin: 0.5rem 0 1.5rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.consent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.consent-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.error {
  color: #b91c1c;
  margin: 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }
  .panel {
    padding: 0 1rem 3rem;
  }
  .history-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
