:root {
  color-scheme: light;
  --bg: #fafafc;
  --ink: #18181b;
  --muted: #71717a;
  --line: rgba(24, 24, 27, 0.08);
  --accent: #6063ee;
  --danger: #dc2626;
  --ok: #15803d;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(193, 219, 255, 0.58), transparent 32rem),
    radial-gradient(circle at 82% 6%, rgba(225, 224, 255, 0.7), transparent 34rem),
    radial-gradient(circle at 52% 92%, rgba(185, 245, 255, 0.35), transparent 30rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
label:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid rgba(96, 99, 238, 0.28);
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-panel,
.table-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(34px) saturate(1.35);
  -webkit-backdrop-filter: blur(34px) saturate(1.35);
}

.upload-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 2px 4px 0;
}

.panel-title,
.panel-desc,
h2,
p {
  margin-top: 0;
}

.panel-title {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.panel-desc {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  border: 1px dashed rgba(96, 99, 238, 0.32);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(96, 99, 238, 0.08), rgba(255, 255, 255, 0.58));
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: rgba(96, 99, 238, 0.66);
  background: linear-gradient(180deg, rgba(96, 99, 238, 0.15), rgba(255, 255, 255, 0.76));
  transform: translateY(-1px);
}

.upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  box-shadow: inset 0 1px 0 white, 0 14px 34px rgba(96, 99, 238, 0.12);
}

.upload-icon svg {
  width: 30px;
  height: 30px;
}

.drop-title {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.drop-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.meta-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meta-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.status-text {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.status-text.is-error {
  color: var(--danger);
}

.status-text.is-ok {
  color: var(--ok);
}

.table-card {
  min-width: 0;
  overflow: hidden;
}

.table-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.045em;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.table-summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #52525b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 16px;
  background: #18181b;
  color: white;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 15px 34px rgba(24, 24, 27, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.export-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(24, 24, 27, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.export-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.table-wrap {
  overflow: auto;
  max-height: min(64vh, 680px);
  border-top: 1px solid var(--line);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(250, 250, 252, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #52525b;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #27272a;
  font-size: 14px;
  line-height: 1.55;
}

td:first-child,
th:first-child {
  width: 72px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
th:nth-child(2),
th:nth-child(3),
th:nth-child(4) {
  width: 142px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.subtitle-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-row td {
  height: 220px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 760px) {
  .panel-heading,
  .table-headline {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-desc {
    max-width: none;
    text-align: left;
  }

  .table-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .drop-zone {
    min-height: 210px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .upload-panel,
  .table-card {
    border-radius: 24px;
  }
}
