* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #18212f;
  --muted: #6d7787;
  --border: #e3e8ef;
  --primary: #2458c7;
  --primary-dark: #17439d;
  --success: #14804a;
  --danger: #c0392b;
  --warning: #a96b00;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(20, 30, 50, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--text);

  line-height: 1.5;
}


/* =========================================================
   TOP BAR
========================================================= */

.topbar {
  height: 64px;

  background: #0d1726;
  color: #ffffff;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;

  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-main {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.65;
}


/* =========================================================
   MAIN CONTAINER
========================================================= */

.container {
  width: 100%;
  max-width: 1180px;

  margin: 0 auto;

  padding: 30px 20px 60px;
}


/* =========================================================
   CARDS
========================================================= */

.card {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}


/* =========================================================
   AUTHENTICATION
========================================================= */

.auth-card {
  width: 100%;
  max-width: 560px;

  margin: 48px auto;

  padding: 34px;
}

.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 44px);

  line-height: 1.03;

  letter-spacing: -0.04em;

  margin: 10px 0 14px;
}

.hero p:not(.eyebrow) {
  color: var(--muted);

  font-size: 15px;

  line-height: 1.7;

  margin: 0;
}

.eyebrow {
  color: var(--primary);

  font-size: 11px;

  font-weight: 900;

  letter-spacing: 0.13em;

  margin: 0;
}


/* =========================================================
   TABS
========================================================= */

.tabs {
  display: flex;

  gap: 6px;

  background: #f0f3f7;

  padding: 5px;

  border-radius: 11px;

  margin: 24px 0;
}

.tab {
  flex: 1;

  border: 0;

  background: transparent;

  color: var(--muted);

  padding: 11px 14px;

  border-radius: 8px;

  cursor: pointer;

  font-weight: 800;

  font-size: 13px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: #ffffff;

  color: var(--primary);

  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.08);
}


/* =========================================================
   FORMS
========================================================= */

label {
  display: block;

  color: #475467;

  font-size: 12px;

  font-weight: 800;

  margin: 15px 0;
}

input,
select,
textarea {
  width: 100%;

  margin-top: 7px;

  padding: 12px 13px;

  border: 1px solid #d5dce5;

  border-radius: 9px;

  background: #ffffff;

  color: var(--text);

  font: inherit;

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(36, 88, 199, 0.12);
}

textarea {
  resize: vertical;
  min-height: 90px;
}


/* =========================================================
   BUTTONS
========================================================= */

button {
  font-family: inherit;
}

.primary,
.secondary {
  border: 0;

  border-radius: 9px;

  padding: 12px 16px;

  font-weight: 850;

  cursor: pointer;

  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.primary {
  background: var(--primary);

  color: #ffffff;

  width: 100%;

  margin-top: 8px;

  box-shadow:
    0 6px 16px rgba(36, 88, 199, 0.18);
}

.primary:hover {
  background: var(--primary-dark);

  transform: translateY(-1px);
}

.secondary {
  background: #eef1f5;

  color: #263142;
}

.secondary:hover {
  background: #e3e7ed;
}

button:active {
  transform: translateY(0);
}


/* =========================================================
   DASHBOARD HEADER
========================================================= */

.dashboard-head {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 18px;
}

.dashboard-head h1 {
  margin: 4px 0 0;

  font-size: clamp(25px, 5vw, 34px);

  letter-spacing: -0.03em;
}


/* =========================================================
   NAVIGATION
========================================================= */

.nav {
  display: flex;

  gap: 5px;

  overflow-x: auto;

  padding: 0 0 14px;

  margin-bottom: 24px;

  border-bottom: 1px solid var(--border);

  scrollbar-width: thin;
}

.nav-btn {
  flex: 0 0 auto;

  border: 0;

  background: transparent;

  color: #667085;

  padding: 10px 13px;

  border-radius: 9px;

  cursor: pointer;

  font-weight: 750;

  font-size: 13px;

  white-space: nowrap;
}

.nav-btn:hover {
  background: #eef2f7;

  color: var(--text);
}

.nav-btn.active {
  background: #eaf0ff;

  color: var(--primary);

  font-weight: 900;
}

#cartCount {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  min-width: 20px;

  height: 20px;

  padding: 0 5px;

  margin-left: 4px;

  border-radius: 999px;

  background: var(--primary);

  color: #ffffff;

  font-size: 10px;
}


/* =========================================================
   DASHBOARD STATS
========================================================= */

.stats {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 14px;
}

.stat {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 14px;

  padding: 19px;
}

.stat small {
  display: block;

  color: var(--muted);

  font-size: 12px;

  font-weight: 650;
}

.stat strong {
  display: block;

  font-size: 27px;

  line-height: 1;

  margin-top: 9px;

  letter-spacing: -0.03em;
}


/* =========================================================
   PRODUCT GRID
========================================================= */

.grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 16px;
}

.product {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 14px;

  overflow: hidden;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.product:hover {
  transform: translateY(-2px);

  box-shadow:
    0 14px 35px rgba(20, 30, 50, 0.09);
}

.product .photo {
  height: 190px;

  background:
    linear-gradient(
      135deg,
      #eef2f6,
      #f7f9fb
    );

  display: flex;

  align-items: center;

  justify-content: center;

  color: #7b8796;

  overflow: hidden;
}

.product .body {
  padding: 16px;
}

.product h3 {
  margin: 10px 0 5px;

  font-size: 17px;

  line-height: 1.2;
}

.price {
  font-size: 20px;

  font-weight: 950;

  letter-spacing: -0.02em;

  margin: 11px 0;
}

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

  font-size: 13px;
}


/* =========================================================
   PILLS
========================================================= */

.pill {
  display: inline-flex;

  align-items: center;

  background: #edf3ff;

  color: var(--primary);

  border-radius: 999px;

  padding: 5px 9px;

  font-size: 10px;

  line-height: 1;

  font-weight: 900;

  letter-spacing: 0.03em;
}


/* =========================================================
   MESSAGES
========================================================= */

.message {
  min-height: 20px;

  margin: 13px 0 0;

  color: var(--danger);

  font-size: 13px;

  line-height: 1.5;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
  position: fixed;

  right: 22px;

  bottom: 22px;

  max-width: 360px;

  background: #18212f;

  color: #ffffff;

  padding: 13px 16px;

  border-radius: 10px;

  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.2);

  font-size: 13px;

  font-weight: 700;

  opacity: 0;

  transform: translateY(12px);

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;

  z-index: 999;
}

.toast.show {
  opacity: 1;

  transform: translateY(0);
}


/* =========================================================
   PAGE SPACING
========================================================= */

.page {
  min-height: 300px;
}

.page > .card {
  margin-bottom: 16px;
}


/* =========================================================
   EMPTY STATES
========================================================= */

.empty-state {
  text-align: center;

  padding: 45px 20px;

  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);

  margin-bottom: 7px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

  .container {
    padding:
      25px 17px 50px;
  }

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

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

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

  .topbar {
    height: 58px;

    padding: 0 15px;
  }

  .brand-main {
    font-size: 17px;
  }

  .brand-sub {
    font-size: 11px;
  }

  .container {
    padding:
      20px 13px 40px;
  }

  .auth-card {
    margin: 25px auto;

    padding: 22px 18px;

    border-radius: 14px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .hero p:not(.eyebrow) {
    font-size: 14px;
  }

  .dashboard-head {
    align-items: flex-start;

    flex-direction: column;

    margin-bottom: 15px;
  }

  .dashboard-head .secondary {
    width: 100%;
  }

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

    gap: 9px;
  }

  .stat {
    padding: 14px;
  }

  .stat strong {
    font-size: 22px;
  }

  .nav {
    margin-left: -13px;
    margin-right: -13px;

    padding-left: 13px;
    padding-right: 13px;
  }

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

    gap: 12px;
  }

  .product .photo {
    height: 210px;
  }

  .primary,
  .secondary {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
  }

  .toast {
    left: 13px;

    right: 13px;

    bottom: 15px;

    max-width: none;
  }

}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 390px) {

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .auth-card {
    padding: 19px 15px;
  }

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

  .nav {
    margin-left: -10px;
    margin-right: -10px;

    padding-left: 10px;
    padding-right: 10px;
  }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 88, 199, 0.22);

  outline-offset: 1px;
}


/* =========================================================
   UTILITY
========================================================= */

.hidden {
  display: none !important;
}