:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e2ec;
  --soft: #f3f6f8;
  --paper: #ffffff;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --green: #16a34a;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, var(--soft) 42%, #eef3f7 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(20px, 6vw, 68px);
  background:
    linear-gradient(100deg, rgba(8, 20, 30, 0.92), rgba(8, 20, 30, 0.60)),
    url("https://images.unsplash.com/photo-1558618666-fcd25c85cd64?auto=format&fit=crop&w=1800&q=82") center/cover;
}

.login-copy {
  max-width: 760px;
  color: #fff;
}

.login-copy h1 {
  max-width: 760px;
  margin: 18px 0 24px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

.login-subtitle {
  max-width: 620px;
  margin: -10px 0 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

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

.login-copy .eyebrow,
.hero-band .eyebrow,
.hero-band p {
  color: rgba(255, 255, 255, 0.84);
}

.app-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.app-logo.large {
  width: 64px;
  height: 64px;
  background: #fff;
  color: var(--brand);
}

.login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  padding: 10px 12px;
  backdrop-filter: blur(12px);
}

.login-card,
.panel,
.metric-card,
.tyre-card,
.request-card,
.inventory-card,
.suggested-card {
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 430px);
  padding: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-radius: 8px;
  background: #edf3f8;
  padding: 5px;
  margin-bottom: 18px;
}

.auth-toggle button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-toggle button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.auth-credential-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.auth-credential-board article {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  padding: 14px;
  backdrop-filter: blur(12px);
}

.auth-credential-board small,
.auth-credential-board span {
  display: block;
  color: rgba(255, 255, 255, 0.75);
}

.auth-credential-board strong {
  display: block;
  color: #fff;
  font-size: 20px;
  margin: 4px 0;
}

.auth-note {
  margin: 14px 0 0;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
}

.btn,
.form-control,
.form-select {
  border-radius: 8px;
}

.form-control,
.form-select {
  border-color: #d8e1ea;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.16);
}

.btn-brand {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  font-weight: 800;
}

.btn-soft {
  border: 0;
  background: #e7f3f2;
  color: var(--brand-dark);
  font-weight: 800;
}

.btn-soft:hover {
  background: #d6ece9;
  color: var(--brand-dark);
}

.credential-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.credential-grid button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.credential-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 38px);
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand-row,
.topbar-actions,
.button-row,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  border-radius: 999px;
  padding: 8px 12px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 850;
  text-transform: capitalize;
}

.role-badge.admin {
  background: #ecfdf5;
  color: #047857;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 38px) 78px;
}

.hero-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.95), rgba(37, 99, 235, 0.84)),
    url("https://images.unsplash.com/photo-1519003722824-194d4455a60c?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
  padding: clamp(20px, 4vw, 34px);
  min-height: 186px;
}

.hero-band.retailer {
  background:
    linear-gradient(120deg, rgba(18, 36, 54, 0.95), rgba(15, 118, 110, 0.78)),
    url("https://images.unsplash.com/photo-1617900906639-cab7adceb499?auto=format&fit=crop&w=1600&q=82") center/cover;
}

.hero-band h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.hero-band p {
  max-width: 660px;
  margin: 0;
}

.hero-mini-grid {
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 126px;
  display: grid;
  gap: 7px;
  padding: 17px;
}

.metric-icon {
  min-width: 38px;
  width: fit-content;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: #1d4ed8;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.metric-card.tone-green .metric-icon {
  background: #dcfce7;
  color: #166534;
}

.metric-card.tone-amber .metric-icon {
  background: #fef3c7;
  color: #92400e;
}

.metric-card.tone-blue .metric-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.metric-card.tone-dark .metric-icon {
  background: #e2e8f0;
  color: #17202a;
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1;
}

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

.hero-band .metric-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title.compact {
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 4px;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  text-transform: capitalize;
}

.status-pill.in_stock,
.status-pill.accepted {
  background: #dcfce7;
  color: #166534;
}

.status-pill.low_stock,
.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.out_of_stock,
.status-pill.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.progress-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.progress-row b {
  color: var(--brand-dark);
}

.progress-track {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eef4;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--blue));
}

.insight-list,
.brand-list,
.timeline,
.retailer-grid,
.suggested-grid,
.catalogue-grid,
.inventory-grid {
  display: grid;
  gap: 10px;
}

.insight-list article,
.brand-list article,
.retailer-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px;
}

.insight-list b {
  min-width: 40px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  padding: 8px;
  text-align: center;
}

.insight-list span,
.brand-list span,
.retailer-grid span,
.request-value span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 10px;
}

.timeline span {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 99px;
  background: #94a3b8;
}

.timeline span.pending {
  background: var(--amber);
}

.timeline span.accepted {
  background: var(--green);
}

.timeline span.rejected {
  background: var(--red);
}

.timeline p {
  margin: 2px 0;
  color: var(--muted);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) auto;
  align-items: center;
  gap: 10px;
}

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

.inventory-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px;
  border-left: 5px solid #94a3b8;
}

.inventory-card.in_stock {
  border-left-color: var(--green);
}

.inventory-card.low_stock {
  border-left-color: var(--amber);
}

.inventory-card.out_of_stock {
  border-left-color: var(--red);
}

.inventory-main h3,
.suggested-card h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.inventory-main p,
.suggested-card p {
  margin: 0;
  color: var(--muted);
}

.inventory-numbers {
  text-align: right;
}

.inventory-numbers strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.inventory-numbers span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-numbers b {
  display: block;
  margin-top: 8px;
}

.inventory-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tyre-card,
.request-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.tyre-card.in_stock {
  border-left: 5px solid var(--green);
}

.tyre-card.low_stock {
  border-left: 5px solid var(--amber);
}

.tyre-card.out_of_stock {
  border-left: 5px solid var(--red);
}

.request-widget,
.request-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.request-widget input {
  width: 92px;
}

.request-value {
  min-width: 96px;
  text-align: right;
}

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

.suggested-card {
  padding: 15px;
}

.suggested-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

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

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-chips button {
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
  color: var(--ink);
  font-weight: 800;
}

.quick-chips span {
  color: var(--red);
}

.notification-feed article {
  display: flex;
  gap: 10px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.stock-preview-panel {
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 12px 14px;
  font-size: 14px;
}

.stock-preview-panel.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.stock-preview-panel.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.stock-preview-panel.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

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

.detail-grid article,
.detail-request {
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.detail-grid span,
.detail-request span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong,
.detail-request b {
  display: block;
  margin-top: 3px;
}

.notification-feed strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.toast-box {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: calc(100vw - 36px);
  box-shadow: var(--shadow);
}

.mobile-nav {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 7px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.20);
  backdrop-filter: blur(14px);
}

.mobile-nav a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mobile-nav a:active,
.mobile-nav a:hover {
  background: #e7f3f2;
  color: var(--brand-dark);
}

@media (max-width: 1180px) {
  .inventory-grid,
  .suggested-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .hero-band,
  .topbar,
  .tyre-card,
  .request-card,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .hero-actions,
  .request-actions {
    justify-content: flex-start;
  }

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

  .inventory-table {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }
}

@media (max-width: 640px) {
  .workspace {
    gap: 14px;
    padding-inline: 12px;
  }

  .login-screen {
    padding: 18px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-card,
  .panel {
    padding: 15px;
  }

  .credential-grid,
  .auth-credential-board,
  .hero-mini-grid,
  .inventory-grid,
  .suggested-grid {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

  .topbar .h4 {
    font-size: 18px;
  }

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

  .request-widget,
  .inventory-actions,
  .suggested-card > div {
    align-items: stretch;
    flex-direction: column;
  }

  .request-widget input,
  .request-widget button,
  .inventory-actions .btn,
  .suggested-card .btn {
    width: 100%;
  }

  .request-value {
    text-align: left;
  }
}
