:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --border: #d1d5db;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #eef6ff 0%, transparent 30%), var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  line-height: 1.6;
}

button, input, select {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.eyebrow {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 8px;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 3rem);
  max-width: 720px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
.file-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button {
  background: var(--accent);
  color: white;
}

.file-upload {
  background: white;
  color: var(--text);
  border-color: var(--border);
  position: relative;
  overflow: hidden;
}

.file-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.button:hover,
.file-upload:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 22px;
}

.search-input label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-input input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}

.search-input input::placeholder {
  color: var(--muted);
}

.results-panel {
  margin-bottom: 28px;
}

.results-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: 220px;
}

.result-card {
  display: grid;
  gap: 18px;
}

.result-card-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.result-card-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.result-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: start;
}

.result-row span {
  color: var(--muted);
  font-size: 0.95rem;
}

.result-row p,
.result-row strong {
  margin: 0;
  color: var(--text);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--muted);
  font-size: 1rem;
}

.data-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}


.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: rgba(15, 23, 42, 0.04) 0px 8px 24px;
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--text);
}

.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.table-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.table-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.table-header p {
  margin: 0;
  color: var(--muted);
}

.table-wrapper {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-soft);
}

tbody tr:hover {
  background: #f9fbff;
}

.status-chip {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-chip.valid {
  background: #dbeafe;
  color: #1e40af;
}

.status-chip.expired {
  background: #fee2e2;
  color: #991b1b;
}

.help-panel {
  margin-top: 32px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 24px;
  padding: 24px;
}

.help-panel h3 {
  margin-top: 0;
}

code {
  background: rgba(15, 23, 42, 0.04);
  padding: 0.2rem 0.4rem;
  border-radius: 0.35rem;
}

@media (max-width: 980px) {
  .search-panel {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 24px);
    padding: 24px 0 48px;
  }

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

  th,
  td {
    padding: 14px 10px;
  }
}
