:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.96);
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #ff6b35;
  --accent-soft: #ffb347;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-border: rgba(226, 232, 240, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  background-image:
    radial-gradient(circle at 50% 100%, rgba(253, 224, 71, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.4) 0%, transparent 70%),
    radial-gradient(circle at 50% 100%, rgba(244, 114, 182, 0.5) 0%, transparent 80%);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 60px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--header-border);
  background: var(--header-bg);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 6px;
}

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

.status {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  font-size: 13px;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.tab {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab.is-active {
  background: var(--card-strong);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(255, 107, 53, 0.15);
}

.panel {
  display: none;
  animation: fadeUp 0.4s ease;
}

.panel.is-active {
  display: block;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0 0 6px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.card h3 {
  margin: 0 0 12px;
}

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

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.period {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.pill {
  border: 1px solid rgba(255, 107, 53, 0.25);
  background: #fff5ee;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.pill.is-active {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 24px rgba(255, 107, 53, 0.2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-placeholder {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 235, 0.9));
  border: 1px solid rgba(255, 107, 53, 0.15);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(255, 107, 53, 0.12);
}

.kpi-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
}

.kpi-trend {
  font-size: 12px;
  color: var(--muted);
}

.kpi-trend.positive {
  color: #0f9d58;
}

.kpi-trend.negative {
  color: #d93025;
}

.list {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.list-item strong {
  font-weight: 600;
}

.orders {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 53, 0.14);
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-meta {
  display: grid;
  gap: 4px;
}

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

.button {
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 22px rgba(255, 107, 53, 0.2);
}

.button.ghost {
  border-color: rgba(20, 20, 30, 0.12);
  background: transparent;
}

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

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.details {
  min-height: 120px;
}

.details h4 {
  margin: 0 0 6px;
}

.details-grid {
  display: grid;
  gap: 12px;
}

.details-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(20, 20, 30, 0.15);
  font-family: inherit;
}

.field.actions {
  align-items: flex-end;
}

.output {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 16px;
  border-radius: 16px;
  min-height: 220px;
  white-space: pre-wrap;
  font-size: 13px;
}

.upload-card {
  display: grid;
  gap: 16px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 140px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 107, 53, 0.35);
  background: rgba(255, 245, 235, 0.6);
  cursor: pointer;
  position: relative;
  text-align: center;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.drop-subtitle {
  color: var(--muted);
  font-size: 13px;
}

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

.hint {
  font-size: 13px;
  color: var(--muted);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.file-list li {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.results {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.result-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.75);
}

.result-card.ok {
  border-color: rgba(15, 157, 88, 0.25);
}

.result-card.fail {
  border-color: rgba(217, 48, 37, 0.2);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

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

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

@media (max-width: 720px) {
  .app {
    padding: 18px 16px 80px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 24px;
    padding: 14px 16px;
  }

  .header-actions {
    width: 100%;
  }

  .status {
    width: 100%;
    text-align: center;
  }

  h1 {
    font-size: 22px;
  }

  .toolbar {
    align-items: stretch;
  }

  .order-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }
}
