:root {
  --navy: #113b62;
  --deep-navy: #08294a;
  --flag-blue: #012169;
  --flag-red: #c8102e;
  --orange: #ef6b23;
  --gold: #f6c453;
  --ink: #162536;
  --muted: #607286;
  --line: #dbe4ee;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --soft-blue: #eaf1f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(1, 33, 105, 0.04), rgba(239, 107, 35, 0.03) 36%, transparent 72%),
    var(--soft);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--navy);
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(8, 41, 74, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-weight: 700;
}

.nav-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #d55416);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(239, 107, 35, 0.22);
}

.button.secondary {
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 420px);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  min-height: calc(92vh - 58px);
  padding: clamp(32px, 6vw, 80px) clamp(18px, 6vw, 80px);
  background:
    linear-gradient(120deg, #ffffff 0%, #eef4f9 100%);
}

.hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(46px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.process div {
  display: grid;
  gap: 8px;
  padding: 24px;
  background: #fff;
}

.process strong {
  color: var(--navy);
}

.process span,
.kit-card p,
small {
  color: var(--muted);
}

.section {
  padding: clamp(34px, 5vw, 72px) clamp(18px, 6vw, 80px);
}

.portal-shell {
  padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 56px) clamp(40px, 5vw, 72px);
}

.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(1, 33, 105, 0.98), rgba(17, 59, 98, 0.96)),
    var(--flag-blue);
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(8, 41, 74, 0.18);
}

.portal-hero.admin-hero {
  background:
    linear-gradient(135deg, rgba(8, 41, 74, 0.98), rgba(1, 33, 105, 0.96)),
    var(--deep-navy);
}

.portal-hero h1,
.portal-hero p {
  margin: 0;
}

.portal-hero h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.portal-hero p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.portal-hero .eyebrow {
  color: var(--gold);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 41, 74, 0.07);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--deep-navy);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.portal-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(8, 41, 74, 0.08);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbfe);
}

.panel-heading h2 {
  margin: 0;
  color: var(--deep-navy);
  font-size: 24px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section h1,
.section h2,
.auth-panel h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.kit-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kit-card span,
.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--navy);
  background: #e7eef5;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.kit-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
}

.kit-card .button {
  margin-top: auto;
}

.kit-cart-form {
  display: grid;
  grid-template-columns: 96px auto;
  gap: 10px;
  align-items: end;
  margin-top: auto;
  width: 100%;
}

.quantity-label {
  gap: 6px;
  font-size: 13px;
}

.quantity-label input {
  min-height: 38px;
}

.auth-panel,
.invoice {
  width: min(760px, calc(100% - 36px));
  margin: 44px auto;
  padding: clamp(22px, 4vw, 38px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-panel.wide {
  width: min(920px, calc(100% - 36px));
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}

.alert,
.success {
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 700;
}

.alert {
  color: #8f1d1d;
  background: #fff0f0;
}

.success {
  color: #17653b;
  background: #edfff5;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portal-panel .table-wrap {
  border: 0;
  border-radius: 0;
}

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

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

th {
  color: var(--deep-navy);
  background: var(--soft-blue);
  font-size: 13px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdff;
}

.inline-form {
  display: flex;
  gap: 8px;
  min-width: 230px;
}

.inline-form button {
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-weight: 800;
  padding: 0 12px;
}

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

.row-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.status {
  border: 1px solid transparent;
}

.status--invoice_sent {
  color: var(--flag-blue);
  background: #edf3ff;
  border-color: #d6e4ff;
}

.status--receipt_uploaded,
.status--payment_confirmed {
  color: #17653b;
  background: #edfff5;
  border-color: #ccefdc;
}

.status--packed {
  color: #8a5100;
  background: #fff6df;
  border-color: #ffe4a3;
}

.status--delivered {
  color: #174c63;
  background: #eaf8fb;
  border-color: #ccebf3;
}

.status--cancelled {
  color: #8f1d1d;
  background: #fff0f0;
  border-color: #ffd2d2;
}

.empty-state {
  padding: 34px 22px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--deep-navy);
  font-size: 24px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.invoice-head,
.invoice-grid,
.invoice-total {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.invoice-head img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.invoice h1 {
  margin: 0;
  color: var(--navy);
}

.invoice h2 {
  color: var(--navy);
  font-size: 18px;
}

.invoice-total {
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--navy);
  color: var(--navy);
  font-size: 24px;
}

.invoice-breakdown,
.cart-total {
  display: grid;
  justify-content: end;
  gap: 8px;
  margin-top: 18px;
  color: var(--deep-navy);
  text-align: right;
}

.cart-total {
  margin-bottom: 18px;
  font-size: 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--navy);
}

@media (max-width: 900px) {
  .hero,
  .process,
  .kit-grid,
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer,
  .invoice-head,
  .invoice-grid,
  .invoice-total,
  .portal-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    gap: 12px;
  }

  .hero,
  .process,
  .kit-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .brand span {
    font-size: 14px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .print-hide {
    display: none;
  }

  body {
    background: #fff;
  }

  .invoice {
    width: 100%;
    margin: 0;
    border: 0;
  }
}
