:root {
  --bg-base: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text-primary: #0f172a;
  --text-muted: #475569;
  --line: #dbe3ef;
  --brand: #ff7a18;
  --brand-soft: #fff1e5;
  --accent: #0ea5e9;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 122, 24, 0.18) 0%, rgba(255, 122, 24, 0) 38%),
    radial-gradient(circle at 90% 20%, rgba(14, 165, 233, 0.18) 0%, rgba(14, 165, 233, 0) 42%),
    linear-gradient(180deg, #f9fafd 0%, #eef2f9 100%);
  color: var(--text-primary);
}

.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.11) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.11) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 25%, transparent 72%);
  z-index: -2;
}

.bg-orb {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 999px;
  filter: blur(56px);
  opacity: 0.4;
  pointer-events: none;
  z-index: -3;
}

.bg-orb-a {
  top: -120px;
  left: -140px;
  background: #ff7a18;
}

.bg-orb-b {
  right: -140px;
  top: 22%;
  background: #38bdf8;
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(9px);
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  color: #b45309;
  background: var(--brand-soft);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 14px;
  font-weight: 700;
  transition: all 200ms ease;
}

.primary-btn {
  padding: 0.72rem 1rem;
  background: linear-gradient(135deg, #ff7a18 0%, #f97316 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.35);
}

.secondary-btn {
  padding: 0.72rem 1rem;
  border: 1px solid #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.secondary-btn:hover {
  border-color: #fdba74;
  background: #ffedd5;
}

.ghost-btn {
  padding: 0.72rem 1rem;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  background: #f8fafc;
}

.ghost-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.drop-zone {
  border: 2px dashed #f59e0b;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  transition: all 220ms ease;
}

.drop-zone.dragging {
  border-color: #0ea5e9;
  background: linear-gradient(180deg, #e0f2fe 0%, #ffffff 100%);
  transform: scale(1.01);
}

.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-group {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.filter-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.filter-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #475569;
}

.input-field {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: white;
  padding: 0.62rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: all 180ms ease;
}

.input-field:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.option-grid {
  max-height: 170px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 0.5rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border-radius: 10px;
  border: 1px solid #dbe3ef;
  padding: 0.38rem 0.5rem;
  background: white;
  font-size: 0.82rem;
  transition: all 160ms ease;
}

.option-pill:hover {
  border-color: #94a3b8;
}

.option-pill label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  cursor: pointer;
}

.option-count {
  font-size: 0.74rem;
  color: #64748b;
}

.metric-card {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.82);
  padding: 1rem;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.metric-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #64748b;
  font-weight: 700;
}

.metric-value {
  margin-top: 0.35rem;
  font-family: "Sora", sans-serif;
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
}

.table-shell {
  border: 1px solid #dbe3ef;
  background: white;
}

#tableBody tr:nth-child(even) {
  background: #f8fafc;
}

#tableBody tr:hover {
  background: #e0f2fe;
}

.table-address {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-waiting {
  background: #fef3c7;
  color: #92400e;
}

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

.status-default {
  background: #e2e8f0;
  color: #334155;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
}

.link-chip:hover {
  border-color: #0ea5e9;
  color: #0c4a6e;
  background: #e0f2fe;
}

.details-btn {
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.32rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #9a3412;
  background: #fff7ed;
  transition: all 170ms ease;
}

.details-btn:hover {
  border-color: #fdba74;
  background: #ffedd5;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 360px;
  border-radius: 14px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
  padding: 0.8rem 1rem;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.18);
  z-index: 40;
}

.toast.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  width: min(920px, 95vw);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.3);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-body {
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-detail-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.modal-detail-item {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: white;
  padding: 0.65rem 0.75rem;
}

.modal-detail-label {
  margin: 0;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 700;
}

.modal-detail-value {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #0f172a;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.modal-link-block {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.8rem;
}

.modal-link-title {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  font-weight: 700;
}

@media (max-width: 768px) {
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.animate-rise {
  animation: rise 0.5s ease both;
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
