@import "https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap";

:root {
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', monospace;

  --ink: #17151c;
  --muted: #6f6b73;
  --muted-2: #a09ca5;
  --purple: #8b5cf6;
  --purple-deep: #7c3aed;
  --purple-tint: #f3eeff;
  --pink: #ffdbe1;
  --green: #d8f3df;
  --line: #d8d3cb;
  --line-soft: #ece8e1;
  --white: #fffdf9;
  --surface: #f7f4ee;
  --yellow: #ffd66b;
  --lavender: #ece6ff;

  --success: #2f9e5a;
  --success-tint: #e6f6ec;
  --danger: #e0475a;
  --danger-tint: #fceced;
  --warning: #d98c1f;
  --warning-tint: #fdf2e3;
  --sale: #ff5d7a;
  --info: #3b82c4;
  --info-tint: #e9f2fa;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-hard: 5px 5px 0 var(--ink);
  --shadow-soft: 0 18px 40px -18px rgba(23, 21, 28, 0.35);
  --shadow-sm: 0 1px 2px rgba(23, 21, 28, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(23, 21, 28, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(23, 21, 28, 0.28);
  --shadow-focus: 0 0 0 3px rgba(139, 92, 246, 0.22);

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.18s;
  --dur-base: 0.3s;
  --dur-slow: 0.6s;

  --sidebar-width: 248px;
  --sidebar-collapsed: 72px;
  --topbar-height: 68px;

  --z-header: 30;
  --z-dropdown: 35;
  --z-fab: 40;
  --z-tooltip: 50;
  --z-toast: 60;
  --z-modal: 70;
  --z-sidebar: 80;
  --z-mobile: 90;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body { min-height: 100vh; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, video { max-width: 100%; display: block; }
svg { display: block; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
::selection { background: var(--purple); color: #fff; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.92) translateY(16px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.25); } 50% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes accordionOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tooltipIn { from { opacity: 0; transform: translateY(4px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.dashboard-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--dur-base) var(--ease-out);
  overflow-y: auto;
  border-right: 1.5px solid var(--ink);
}

.sidebar.expanded { width: var(--sidebar-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 24px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar.expanded .sidebar-header {
  padding: 22px 18px;
  justify-content: center;
}

.logo-img { height: 32px; width: auto; flex-shrink: 0; }
.sidebar.expanded .logo-img { height: 28px; }

.sidebar-content {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
}

.nav-section { margin-bottom: 4px; }

.nav-section-title {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted-2);
  margin: 18px 12px 8px;
  display: block;
}

.sidebar.expanded .nav-section-title { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-2);
  margin-bottom: 2px;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text { transition: opacity var(--dur-fast); }

.sidebar.expanded .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--purple);
  color: #fff;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
}

.sidebar.expanded .nav-item .badge { display: none; }

.nav-item-parent { margin-bottom: 2px; }
.nav-parent-toggle { cursor: pointer; }

.parent-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform var(--dur-fast);
}

.sidebar.expanded .parent-arrow { display: none; }

.nav-children {
  margin-left: 20px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-item-child {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  text-decoration: none;
  transition: all var(--dur-fast);
  font-size: 13px;
}

.nav-item-child i {
  width: 20px;
  font-size: 14px;
  color: var(--muted);
}

.nav-item-child:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item-child.active {
  background: var(--purple);
  color: #fff;
}

.nav-item-child.active i { color: #fff; }

.sidebar.expanded .nav-children { display: none !important; }

.sidebar.expanded .nav-parent-toggle .nav-text,
.sidebar.expanded .nav-parent-toggle .parent-arrow { display: none; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-footer .upgrade-card {
  background: var(--purple);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-hard);
}

.sidebar-footer .upgrade-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #fff;
}

.sidebar-footer .upgrade-card p {
  margin: 0 0 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.sidebar-footer .upgrade-card .btn {
  background: var(--white);
  color: var(--ink);
  border-color: var(--ink);
  width: 100%;
  justify-content: center;
}

.sidebar-footer .upgrade-card .btn:hover {
  background: var(--lavender);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
}

.sidebar.expanded .sidebar-footer .upgrade-card { display: none; }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--purple);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 1.5px solid var(--white);
}

.user-details { overflow: hidden; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}

.user-email {
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.expanded .user-details { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.06em;
  white-space: nowrap;
  overflow: hidden;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 20px;
  transform: rotate(-8deg);
  flex-shrink: 0;
}

.brand__name { font-size: 24px; color: #fff; }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 21, 28, 0.45);
  backdrop-filter: blur(4px);
  z-index: var(--z-mobile);
  display: none;
  opacity: 0;
  transition: opacity var(--dur-base);
}

.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  background: var(--ink);
  color: #fff;
  z-index: calc(var(--z-mobile) + 1);
  transform: translateX(-100%);
  transition: transform var(--dur-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-right: 1.5px solid var(--ink);
}

.mobile-sidebar.active { transform: translateX(0); }

.mobile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  height: var(--topbar-height);
}

.mobile-logo-img { height: 32px; width: auto; }

.mobile-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: all var(--dur-fast);
}

.mobile-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--purple);
}

.mobile-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
}

.mobile-sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin var(--dur-base) var(--ease-out);
  background: var(--white);
}

.sidebar.expanded ~ .main-content { margin-left: var(--sidebar-collapsed); }

.top-header {
  height: var(--topbar-height);
  border-bottom: 1.5px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  background: rgba(255, 253, 249, 0.85);
  backdrop-filter: blur(10px);
  z-index: var(--z-header);
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.mobile-menu-btn {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  font-size: 18px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  color: var(--ink);
}

.mobile-menu-btn:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.05em;
  margin: 0;
  color: var(--ink);
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 38px;
  font-size: 13px;
  background: var(--white);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  font-family: var(--font);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--shadow-focus);
}

.topbar-search input::placeholder { color: var(--muted-2); }

.topbar-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--muted-2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-icon-link {
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 17px;
  position: relative;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
  color: var(--ink);
}

.header-icon-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--purple-tint);
}

.header-icon-link .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: var(--sale);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--purple);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  transition: transform var(--dur-fast);
}

.header-avatar:hover { transform: scale(1.08); }

.content-wrapper {
  padding: 28px;
  flex: 1;
}

.page-card {
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 24px;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.page-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hard);
  border-color: var(--purple);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-head__left h1 {
  font-size: 30px;
  letter-spacing: -0.05em;
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--ink);
}

.page-head__left p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-head__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
  background: var(--white);
  color: var(--ink);
  white-space: nowrap;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity var(--dur-base);
  pointer-events: none;
}

.btn:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hard);
}

.btn:hover::after { opacity: 1; animation: shimmer 0.9s linear; }
.btn:active { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }

.btn--primary {
  background: var(--purple);
  color: #fff;
  border-color: var(--ink);
}

.btn--dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  transform: none;
}

.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn--danger:hover {
  background: var(--danger);
  border-color: var(--ink);
  color: #fff;
}

.btn--small {
  padding: 7px 14px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.stat-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hard);
  border-color: var(--purple);
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 14px;
  background: var(--purple-tint);
  border: 1.5px solid var(--ink);
  color: var(--purple);
}

.stat-card__icon--purple { background: var(--purple-tint); color: var(--purple); }
.stat-card__icon--yellow { background: #fff5d6; color: var(--warning); }
.stat-card__icon--pink { background: var(--pink); color: var(--sale); }
.stat-card__icon--green { background: var(--success-tint); color: var(--success); }

.stat-card__label {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 6px 0 8px;
  color: var(--ink);
}

.stat-card__change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
}

.stat-card__change--up { color: var(--success); }
.stat-card__change--down { color: var(--danger); }

.stat-card__doodle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  font-size: 60px;
  opacity: 0.03;
  transform: rotate(-15deg);
  pointer-events: none;
}

.dash-card {
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.dash-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hard);
  border-color: var(--purple);
}

.dash-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dash-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.dash-card__link {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-fast), transform var(--dur-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dash-card__link:hover {
  color: var(--purple);
  transform: translateX(4px);
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  color: var(--muted-2);
}

.empty-state h3 {
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
  color: var(--ink);
  font-weight: 600;
}

.empty-state p {
  margin-bottom: var(--space-2);
  color: var(--muted);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.dashboard-footer {
  padding: var(--space-5) var(--space-6);
  text-align: center;
  border-top: 1.5px solid var(--line-soft);
  background: var(--white);
  color: var(--muted);
  font-size: 0.875rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: #fff;
}

.badge--sale { background: var(--sale); }
.badge--new { background: var(--purple); }
.badge--soldout { background: var(--muted); }
.badge--low-stock { background: var(--warning); }
.badge--success { background: var(--success-tint); color: var(--success); }
.badge--info { background: var(--info-tint); color: var(--info); }
.badge--outline { background: transparent; border: 1.5px solid currentColor; color: var(--ink); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1.5px solid transparent;
}

.alert--info { background: var(--info-tint); color: var(--info); border-color: currentColor; }
.alert--success { background: var(--success-tint); color: var(--success); border-color: currentColor; }
.alert--warning { background: var(--warning-tint); color: var(--warning); border-color: currentColor; }
.alert--danger { background: var(--danger-tint); color: var(--danger); border-color: currentColor; }
.alert__icon { flex: none; }
.alert__text { color: var(--ink); flex: 1; }
.alert__close { flex: none; opacity: 0.6; }
.alert__close:hover { opacity: 1; }

.text-gradient {
  background: linear-gradient(100deg, var(--sale), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.bg-gradient { background: linear-gradient(100deg, var(--sale), var(--purple)); }
.bg-gradient-light { background: linear-gradient(160deg, var(--purple-tint), var(--white)); }

.text-muted { color: var(--muted); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }

.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.u-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.u-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field__label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.field__label--required::after { content: " *"; color: var(--danger); }

.field__control {
  font: inherit;
  font-size: var(--text-base);
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  width: 100%;
}

.field__control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--shadow-focus);
}

.field__control::placeholder { color: var(--muted-2); }

.field__control--error { border-color: var(--danger); }
.field__control--error:focus { box-shadow: 0 0 0 3px rgba(224, 71, 90, 0.18); }
.field__control:disabled { background: var(--surface); color: var(--muted-2); cursor: not-allowed; }

textarea.field__control { resize: vertical; min-height: 110px; }

.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--danger); }

.field__select-wrap { position: relative; }

.field__select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select.field__control { appearance: none; padding-right: 36px; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox__input { position: absolute; opacity: 0; width: 0; height: 0; }

.checkbox__box {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast), transform var(--dur-fast);
  flex: none;
}

.checkbox__input:checked + .checkbox__box { background: var(--purple); border-color: var(--purple); }

.checkbox__input:checked + .checkbox__box::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox__label { font-size: 14px; }

.radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.radio__input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio__circle {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  transition: border-color var(--dur-fast);
}

.radio__input:checked + .radio__circle { border-color: var(--purple); }

.radio__input:checked + .radio__circle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--purple);
}

.radio__label { font-size: 14px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch__input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__track {
  width: 42px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--line);
  position: relative;
  transition: background var(--dur-fast);
  flex: none;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring);
}

.switch__input:checked + .switch__track { background: var(--purple); }
.switch__input:checked + .switch__track::after { transform: translateX(18px); }
.switch__label { font-size: 14px; }

.search { position: relative; }

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search__input.field__control { padding-left: 40px; }

.file-upload {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  text-align: center;
  color: var(--muted);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.file-upload:hover,
.file-upload--dragover {
  border-color: var(--purple);
  background: var(--purple-tint);
}

.file-upload__icon { font-size: 28px; margin-bottom: 8px; }
.file-upload__text { font-size: 14px; }
.file-upload__hint { font-size: 12px; margin-top: 4px; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty__btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--white);
  font-size: 16px;
  transition: background var(--dur-fast);
}

.qty__btn:hover { background: var(--lavender); }

.qty__value {
  width: 38px;
  text-align: center;
  font-family: var(--mono);
  font-size: 14px;
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  padding: 8px 0;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  border: 1.5px solid var(--white);
  background: var(--surface);
}

.avatar--sm { width: 28px; height: 28px; }
.avatar--md { width: 40px; height: 40px; }
.avatar--lg { width: 56px; height: 56px; }

.avatar__initials {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-tint);
}

.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -10px; }
.avatar-group .avatar:first-child { margin-left: 0; }

.bar-track {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: rgba(23, 21, 28, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(100deg, var(--sale), var(--purple));
  transform-origin: left;
  animation: barGrow 1s var(--ease-out) both;
}

.skeleton {
  background: linear-gradient(90deg, rgba(23, 21, 28, 0.06) 25%, rgba(23, 21, 28, 0.12) 37%, rgba(23, 21, 28, 0.06) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text { height: 14px; width: 100%; }
.skeleton--title { height: 22px; width: 60%; }
.skeleton--image { width: 100%; aspect-ratio: 4/5; border-radius: var(--radius-md); }
.skeleton--button { height: 44px; width: 140px; border-radius: var(--radius-sm); }
.skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }

.divider {
  height: 1.5px;
  background: var(--ink);
  opacity: 0.12;
  margin: 3rem 0;
  border: none;
}

.divider--dashed {
  background: none;
  border-top: 1.5px dashed var(--line);
  opacity: 1;
}

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

@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
  }

  .sidebar.expanded {
    width: var(--sidebar-width);
    transform: translateX(-100%);
  }

  .sidebar.expanded.sidebar--open {
    transform: translateX(0);
  }

  .sidebar.expanded .sidebar-header,
  .sidebar.expanded .nav-text,
  .sidebar.expanded .nav-section-title,
  .sidebar.expanded .upgrade-card,
  .sidebar.expanded .user-details {
    display: flex;
    opacity: 1;
    width: auto;
  }

  .sidebar.expanded .sidebar-header {
    padding: 22px 24px;
    justify-content: flex-start;
  }

  .sidebar.expanded .nav-text {
    opacity: 1;
    width: auto;
  }

  .sidebar--open {
    transform: translateX(0) !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .topbar-search {
    display: none;
  }

  .top-header {
    padding: 0 18px;
  }

  .content-wrapper {
    padding: 18px;
  }
}

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

  .page-head {
    flex-direction: column;
  }

  .page-head__actions {
    width: 100%;
  }

  .page-head__actions .btn {
    flex: 1;
    justify-content: center;
  }

  .page-title {
    font-size: 24px;
  }

  .content-wrapper {
    padding: 14px;
  }

  .page-card,
  .dash-card {
    padding: 16px;
  }
}

@media print {
  .sidebar,
  .top-header,
  .mobile-menu-btn,
  .loading-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .content-wrapper {
    padding: 0;
  }

  .page-card,
  .dash-card {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
