:root {
  --bg: #f3efe6;
  --surface: rgba(255, 251, 245, 0.86);
  --surface-strong: #fffdf9;
  --ink: #201815;
  --muted: #6d5f58;
  --line: rgba(32, 24, 21, 0.12);
  --line-strong: rgba(32, 24, 21, 0.2);
  --brand: #0d5c63;
  --brand-soft: rgba(13, 92, 99, 0.12);
  --pending: #7c7f87;
  --pending-soft: #edf0f3;
  --dispatched: #d29a00;
  --dispatched-soft: #fff6cc;
  --reached: #1f8a4c;
  --reached-soft: #dff6e7;
  --danger: #b93d3d;
  --shadow: 0 24px 70px rgba(59, 37, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 92, 99, 0.16), transparent 26%),
    radial-gradient(circle at right top, rgba(210, 154, 0, 0.14), transparent 20%),
    linear-gradient(180deg, #fffbf4 0%, var(--bg) 100%);
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.02;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.page-shell {
  padding: 28px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(560px, 100%);
  padding: 32px;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-form {
  margin-top: 24px;
}

.google-btn {
  min-width: 240px;
}

.topbar {
  width: min(1280px, 100%);
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-copy {
  color: var(--muted);
  font-weight: 700;
}

.hero,
.layout-grid {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-stats,
.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  border-radius: 36px;
  padding: clamp(28px, 5vw, 54px);
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 800;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  max-width: 11ch;
}

.hero-text {
  margin-top: 18px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-stats {
  border-radius: 32px;
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: stretch;
}

.hero-card {
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero-card span,
.hero-card small {
  color: var(--muted);
}

.hero-card strong {
  display: block;
  margin: 6px 0;
  font-size: 2.4rem;
}

.hero-card.pending {
  background: linear-gradient(180deg, rgba(124, 127, 135, 0.14), rgba(255, 255, 255, 0.72));
}

.hero-card.dispatched {
  background: linear-gradient(180deg, rgba(210, 154, 0, 0.18), rgba(255, 255, 255, 0.72));
}

.hero-card.reached {
  background: linear-gradient(180deg, rgba(31, 138, 76, 0.16), rgba(255, 255, 255, 0.72));
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel {
  border-radius: 32px;
  padding: 24px;
}

.panel-dashboard {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-head h2 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.panel-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 800;
}

.panel-chip.secondary {
  background: rgba(210, 154, 0, 0.14);
  color: #946500;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field input:focus,
.field select:focus,
.primary-btn:focus {
  border-color: rgba(13, 92, 99, 0.46);
  box-shadow: 0 0 0 4px rgba(13, 92, 99, 0.12);
}

.field-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.primary-btn,
.secondary-btn,
.whatsapp-btn {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.whatsapp-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 14px 18px;
  background: linear-gradient(135deg, #0d5c63, #06383d);
  color: #f7fffe;
  box-shadow: 0 18px 34px rgba(13, 92, 99, 0.24);
}

.secondary-btn {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.whatsapp-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-message {
  flex: 1;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.dashboard-head {
  align-items: end;
}

.dashboard-tools {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.tool-field {
  min-width: 220px;
}

.dashboard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.live-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dispatched);
  box-shadow: 0 0 0 7px rgba(210, 154, 0, 0.1);
}

.subtle-text {
  color: var(--muted);
  font-size: 0.94rem;
}

.setup-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(185, 61, 61, 0.08);
  border: 1px solid rgba(185, 61, 61, 0.14);
  color: #8e2d2d;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

thead {
  background: rgba(255, 255, 255, 0.92);
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 800;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.56);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
}

.status-pending {
  background: var(--pending-soft);
  color: var(--pending);
}

.status-dispatched {
  background: var(--dispatched-soft);
  color: #8b6500;
}

.status-reached {
  background: var(--reached-soft);
  color: var(--reached);
}

.whatsapp-btn {
  padding: 10px 14px;
  background: #22c55e;
  color: white;
}

.whatsapp-btn:hover {
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.24);
}

.muted-cell {
  color: var(--muted);
}

.empty-state {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
}

.row-pending {
  background: linear-gradient(90deg, rgba(124, 127, 135, 0.04), transparent 32%);
}

.row-dispatched {
  background: linear-gradient(90deg, rgba(210, 154, 0, 0.08), transparent 38%);
}

.row-reached {
  background: linear-gradient(90deg, rgba(31, 138, 76, 0.08), transparent 38%);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 1100px) {
  .hero,
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .hero-copy,
  .hero-stats,
  .panel {
    border-radius: 24px;
  }

  .field-grid,
  .dashboard-meta,
  .form-actions,
  .panel-head,
  .topbar {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-tools {
    flex-direction: column;
  }

  .tool-field {
    min-width: 100%;
  }

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