/* ==========================================================================
 * Hypertronic Platform UI v1
 * File: platform-ui.css
 *
 * Purpose:
 * - Unify Customer Dashboard, Mission Control, and Booking.
 * - Reduce visual noise and repeated explanatory copy.
 * - Improve mobile usability without changing backend behavior.
 * ========================================================================== */

:root {
  --ht-ink: #0f172a;
  --ht-muted: #64748b;
  --ht-line: #dbe3ef;
  --ht-soft: #f7f9fc;
  --ht-blue: #2563eb;
  --ht-blue-dark: #1d4ed8;
  --ht-green: #15803d;
  --ht-green-soft: #ecfdf3;
  --ht-amber: #92400e;
  --ht-amber-soft: #fff8e6;
  --ht-red: #b91c1c;
  --ht-red-soft: #fff1f2;
  --ht-white: #ffffff;
  --ht-shadow:
    0 18px 54px rgba(15, 23, 42, 0.07);
}

body {
  background:
    linear-gradient(
      180deg,
      #f8fbff 0,
      #ffffff 280px
    );
}

.app-header,
.wizard-header {
  border-bottom:
    1px solid rgba(203, 213, 225, 0.85);
  background:
    rgba(248, 250, 252, 0.94);
}

.app-nav,
.wizard-header .nav {
  min-height: 78px;
}

.brand img {
  width: 42px;
  height: 42px;
}

.brand-copy strong {
  font-size: 1.08rem;
}

.brand-copy span {
  font-size: 0.68rem;
}

.page-shell {
  padding-top: 34px;
}

.hero-row {
  align-items: center;
  margin-bottom: 22px;
}

.hero-row h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4.5vw, 3.35rem);
}

.hero-row p {
  max-width: 690px;
  margin-top: 12px;
}

.account-summary {
  min-width: 230px;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--ht-green-soft);
  color: #166534;
  font-size: 0.72rem;
  font-weight: 850;
}

.live-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.13);
}

.metrics-grid {
  gap: 12px;
}

.metric-card {
  min-height: 112px;
  padding: 17px 18px;
  border-radius: 18px;
  box-shadow:
    0 8px 28px rgba(15, 23, 42, 0.035);
}

.metric-card strong {
  margin-top: 10px;
  font-size: 1.85rem;
}

.content-grid {
  grid-template-columns:
    minmax(0, 1fr)
    300px;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  border-radius: 20px;
  box-shadow: var(--ht-shadow);
}

.panel-header {
  padding: 18px 20px;
}

.panel-header p {
  max-width: 620px;
}

.side-card {
  border-radius: 18px;
  background:
    rgba(247, 249, 252, 0.86);
}

.side-card + .side-card {
  margin-top: 12px;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quick-action a {
  flex: 0 0 auto;
}

.data-table tbody tr {
  transition:
    background 0.16s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.status-pill {
  white-space: nowrap;
}

.status-pill.pending_ticket,
.status-pill.waiting_ticket {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.cancelled,
.status-pill.expired,
.status-pill.failed {
  background: #fee2e2;
  color: #991b1b;
}

.table-empty-row td {
  padding: 34px 18px;
  color: var(--ht-muted);
  text-align: center;
}

.approval-item {
  background: #ffffff;
}

.site-footer {
  margin-top: 44px;
  background: rgba(248, 250, 252, 0.9);
}

.footer-grid {
  min-height: 112px;
}

.footer-copy {
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
 * Booking shell alignment
 * ----------------------------------------------------------------------- */

.wizard-shell {
  padding-top: 28px;
}

.wizard-container {
  width: min(900px, 100%);
}

.wizard-progress {
  margin-bottom: 18px;
}

.wizard-card {
  min-height: 560px;
  padding: 42px;
  border-radius: 24px;
  box-shadow: var(--ht-shadow);
}

.step-copy {
  margin-bottom: 28px;
}

.step-copy h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.step-copy p {
  max-width: 620px;
}

.account-chip {
  border-color: var(--ht-line);
  background: rgba(255, 255, 255, 0.82);
}

.communication-policy {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.communication-policy strong {
  color: #1e3a8a;
}

.support-note {
  color: var(--ht-muted);
}

.success-dialog-content p {
  max-width: 390px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
 * Mobile
 * ----------------------------------------------------------------------- */

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    display: grid;
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .dashboard-side .side-card + .side-card {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(
      100% - 24px,
      1180px
    );
  }

  .app-nav,
  .wizard-header .nav {
    min-height: 68px;
    padding-block: 10px;
  }

  .brand-copy span,
  .account-copy span {
    display: none;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-link,
  .ghost-button,
  .primary-button {
    min-height: 40px;
    padding-inline: 14px;
    font-size: 0.82rem;
  }

  .hero-row {
    margin-bottom: 18px;
  }

  .hero-row h1 {
    font-size: 2.25rem;
  }

  .account-summary {
    width: 100%;
    min-width: 0;
  }

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

  .metric-card {
    min-height: 104px;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    padding: 10px;
  }

  .data-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--ht-line);
    border-radius: 16px;
    padding: 11px 13px;
    background: #ffffff;
  }

  .data-table tr:last-child {
    margin-bottom: 0;
  }

  .data-table td {
    display: grid;
    grid-template-columns:
      104px 1fr;
    gap: 12px;
    border: 0;
    padding: 7px 0;
    white-space: normal;
  }

  .data-table td::before {
    content:
      attr(data-label);
    color: var(--ht-muted);
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .table-empty-row td {
    display: block;
    padding: 26px 12px;
  }

  .table-empty-row td::before {
    content: none;
  }

  .wizard-shell {
    padding:
      18px 12px 42px;
  }

  .wizard-progress {
    grid-template-columns:
      repeat(4, 1fr);
    gap: 6px;
  }

  .progress-line {
    display: none;
  }

  .progress-step strong {
    font-size: 0.66rem;
  }

  .wizard-card {
    min-height: 0;
    padding: 28px 20px;
    border-radius: 20px;
  }

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

  .wizard-actions {
    flex-direction: column-reverse;
  }

  .wizard-actions button,
  .wizard-next,
  .secondary-button {
    width: 100%;
  }

  .account-chip {
    gap: 8px;
    padding:
      7px 8px 7px 12px;
  }

  .account-copy strong {
    max-width: 130px;
  }

  .site-footer {
    margin-top: 32px;
  }
}

@media (max-width: 460px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .nav-actions .nav-link {
    display: none;
  }

  .hero-row h1 {
    font-size: 2rem;
  }
}
