/*
 * SalesPro UI Design System
 * Version: 1.0.0
 * Purpose: Reusable CSS foundation for modern, professional business web apps.
 *
 * Quick start:
 *   1. Save this file as salespro-design-system.css
 *   2. Include it in your HTML: <link rel="stylesheet" href="salespro-design-system.css">
 *   3. Use the class names shown in the examples at the bottom of this file.
 *
 * This file provides styling only. Charts, menus, filters, validation, and other
 * interactions still need to be implemented by your app/framework.
 */
 
/* =========================================================
   1. Design tokens
   ========================================================= */
:root {
  color-scheme: light;
 
  /* Brand */
  --sp-primary: #2478f5;
  --sp-primary-hover: #1768df;
  --sp-primary-soft: #eaf2ff;
  --sp-primary-border: #cfe0ff;
 
  /* Semantic colors */
  --sp-success: #10b981;
  --sp-success-soft: #e6faf2;
  --sp-warning: #f59e0b;
  --sp-warning-soft: #fff5df;
  --sp-danger: #ef4444;
  --sp-danger-soft: #fff0f0;
  --sp-purple: #8b5cf6;
  --sp-purple-soft: #f1eaff;
  --sp-orange: #fb923c;
  --sp-orange-soft: #fff0e2;
 
  /* Surfaces and text */
  --sp-bg: #f4f8fd;
  --sp-surface: #ffffff;
  --sp-surface-muted: #f8fbff;
  --sp-sidebar: #0e1d36;
  --sp-sidebar-2: #132846;
  --sp-text: #172b4d;
  --sp-text-muted: #71839f;
  --sp-text-soft: #91a0b7;
  --sp-border: #e4ecf6;
  --sp-border-strong: #d5e0ef;
 
  /* Typography */
  --sp-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sp-font-size: 14px;
  --sp-line-height: 1.5;
 
  /* Layout */
  --sp-sidebar-width: 248px;
  --sp-topbar-height: 68px;
  --sp-content-max: 1600px;
 
  /* Radius, shadows, spacing */
  --sp-radius-sm: 8px;
  --sp-radius-md: 12px;
  --sp-radius-lg: 16px;
  --sp-radius-xl: 20px;
  --sp-shadow-sm: 0 2px 8px rgb(28 56 96 / 4%);
  --sp-shadow-md: 0 8px 24px rgb(28 56 96 / 7%);
  --sp-shadow-lg: 0 16px 40px rgb(28 56 96 / 10%);
  --sp-space-1: 4px;
  --sp-space-2: 8px;
  --sp-space-3: 12px;
  --sp-space-4: 16px;
  --sp-space-5: 20px;
  --sp-space-6: 24px;
  --sp-space-8: 32px;
  --sp-transition: 180ms ease;
}
 
/* =========================================================
   2. Reset and global defaults
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}
 
html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
 
body {
  margin: 0;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: var(--sp-font);
  font-size: var(--sp-font-size);
  line-height: var(--sp-line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
 
button,
input,
select,
textarea {
  font: inherit;
}
 
button {
  cursor: pointer;
}
 
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
 
img,
svg {
  max-width: 100%;
}
 
img {
  display: block;
}
 
a {
  color: var(--sp-primary);
  text-decoration: none;
}
 
a:hover {
  color: var(--sp-primary-hover);
}
 
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
 
h1,
h2,
h3,
h4 {
  color: var(--sp-text);
  line-height: 1.25;
  letter-spacing: -0.025em;
}
 
h1 { margin-bottom: 8px; font-size: clamp(24px, 2vw, 30px); font-weight: 750; }
h2 { margin-bottom: 8px; font-size: 21px; font-weight: 720; }
h3 { margin-bottom: 8px; font-size: 16px; font-weight: 700; }
h4 { margin-bottom: 6px; font-size: 14px; font-weight: 700; }
 
p {
  color: var(--sp-text-muted);
}
 
/* Accessible keyboard focus */
:focus-visible {
  outline: 3px solid rgb(36 120 245 / 28%);
  outline-offset: 2px;
}
 
/* =========================================================
   3. Main application shell
   ========================================================= */
.sp-app {
  display: flex;
  min-height: 100vh;
}
 
.sp-sidebar {
  position: fixed;
  inset: 12px auto 12px 12px;
  z-index: 50;
  display: flex;
  width: var(--sp-sidebar-width);
  flex-direction: column;
  padding: 18px 12px;
  overflow-y: auto;
  color: #fff;
  background: linear-gradient(180deg, var(--sp-sidebar), #10223f 100%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
}
 
.sp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 26px;
  color: #fff;
}
 
.sp-brand__logo {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  background: var(--sp-primary);
  border-radius: 11px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgb(36 120 245 / 30%);
}
 
.sp-brand__name {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
 
.sp-brand__caption {
  display: block;
  margin-top: 2px;
  color: #a9bad2;
  font-size: 11px;
}
 
.sp-nav {
  display: grid;
  gap: 5px;
}
 
.sp-nav__label {
  padding: 12px 12px 6px;
  color: #8195b2;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
 
.sp-nav__link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: #c8d5e8;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  transition: color var(--sp-transition), background var(--sp-transition),
    transform var(--sp-transition);
}
 
.sp-nav__link:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}
 
.sp-nav__link:active {
  transform: translateY(1px);
}
 
.sp-nav__link.is-active {
  color: #fff;
  background: linear-gradient(100deg, #2c83ff, #1769e8);
  box-shadow: 0 6px 14px rgb(18 101 232 / 22%);
}
 
.sp-nav__icon {
  display: inline-grid;
  width: 19px;
  flex: 0 0 19px;
  place-items: center;
  font-size: 16px;
}
 
.sp-sidebar__bottom {
  margin-top: auto;
  padding-top: 18px;
}
 
.sp-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 2px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}
 
.sp-avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  place-items: center;
  color: #24549a;
  background: #dceaff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 750;
}
 
.sp-avatar--sm {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 10px;
}
 
.sp-avatar--lg {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  font-size: 14px;
}
 
.sp-profile__name {
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
 
.sp-profile__role {
  margin: 2px 0 0;
  color: #9eb0c9;
  font-size: 10px;
}
 
.sp-main {
  width: calc(100% - var(--sp-sidebar-width) - 24px);
  min-width: 0;
  margin-left: calc(var(--sp-sidebar-width) + 24px);
  padding: 12px 16px 24px 4px;
}
 
.sp-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: var(--sp-topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 10px 18px;
  background: rgb(255 255 255 / 92%);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-sm);
  backdrop-filter: blur(14px);
}
 
.sp-topbar__actions,
.sp-inline,
.sp-button-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
 
.sp-page {
  width: 100%;
  max-width: var(--sp-content-max);
  margin-inline: auto;
}
 
.sp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 2px 22px;
}
 
.sp-page-header__description {
  max-width: 720px;
  margin: 0;
  color: var(--sp-text-muted);
  font-size: 13px;
}
 
/* =========================================================
   4. Surfaces, cards, grids and KPI metrics
   ========================================================= */
.sp-card {
  min-width: 0;
  padding: 20px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-sm);
}
 
.sp-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
 
.sp-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
}
 
.sp-card__subtitle {
  margin: 5px 0 0;
  color: var(--sp-text-muted);
  font-size: 12px;
}
 
.sp-grid {
  display: grid;
  gap: 16px;
}
 
.sp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-grid--main-aside { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
 
.sp-kpi {
  position: relative;
  display: flex;
  min-height: 124px;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-sm);
}
 
.sp-kpi__icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: #fff;
  background: var(--sp-primary);
  border-radius: 14px;
  font-size: 19px;
}
 
.sp-kpi__icon--green { background: var(--sp-success); }
.sp-kpi__icon--purple { background: var(--sp-purple); }
.sp-kpi__icon--orange { background: var(--sp-orange); }
 
.sp-kpi__label {
  margin: 1px 0 6px;
  color: var(--sp-text-muted);
  font-size: 12px;
  font-weight: 550;
}
 
.sp-kpi__value {
  margin: 0;
  color: var(--sp-text);
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
 
.sp-kpi__change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  color: var(--sp-success);
  font-size: 11px;
  font-weight: 650;
}
 
.sp-kpi__change.is-negative {
  color: var(--sp-danger);
}
 
/* =========================================================
   5. Buttons and icon buttons
   ========================================================= */
.sp-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  color: var(--sp-text);
  background: #fff;
  border: 1px solid var(--sp-border-strong);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
  transition: transform var(--sp-transition), box-shadow var(--sp-transition),
    background var(--sp-transition), border-color var(--sp-transition);
}
 
.sp-btn:hover {
  background: #f8fbff;
  border-color: #b9cce5;
  box-shadow: var(--sp-shadow-sm);
}
 
.sp-btn:active {
  transform: translateY(1px);
}
 
.sp-btn--primary {
  color: #fff;
  background: var(--sp-primary);
  border-color: var(--sp-primary);
  box-shadow: 0 5px 12px rgb(36 120 245 / 18%);
}
 
.sp-btn--primary:hover {
  color: #fff;
  background: var(--sp-primary-hover);
  border-color: var(--sp-primary-hover);
}
 
.sp-btn--soft {
  color: var(--sp-primary);
  background: var(--sp-primary-soft);
  border-color: transparent;
}
 
.sp-btn--danger {
  color: var(--sp-danger);
  background: var(--sp-danger-soft);
  border-color: transparent;
}
 
.sp-btn--sm {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
}
 
.sp-btn--icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 16px;
}
 
/* =========================================================
   6. Inputs, filters and form layouts
   ========================================================= */
.sp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
 
.sp-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 160px;
}
 
.sp-search__icon {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--sp-text-soft);
  pointer-events: none;
  transform: translateY(-50%);
}
 
.sp-input,
.sp-select,
.sp-textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--sp-text);
  background: #fff;
  border: 1px solid var(--sp-border-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color var(--sp-transition), box-shadow var(--sp-transition);
}
 
.sp-search .sp-input {
  padding-left: 38px;
}
 
.sp-input::placeholder,
.sp-textarea::placeholder {
  color: #9aa9bd;
}
 
.sp-input:hover,
.sp-select:hover,
.sp-textarea:hover {
  border-color: #b9cce5;
}
 
.sp-input:focus,
.sp-select:focus,
.sp-textarea:focus {
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px rgb(36 120 245 / 11%);
}
 
.sp-input[aria-invalid="true"],
.sp-select[aria-invalid="true"],
.sp-textarea[aria-invalid="true"] {
  border-color: var(--sp-danger);
}
 
.sp-textarea {
  min-height: 96px;
  resize: vertical;
}
 
.sp-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
 
.sp-label {
  color: #425674;
  font-size: 12px;
  font-weight: 650;
}
 
.sp-help {
  margin: 0;
  color: var(--sp-text-muted);
  font-size: 11px;
}
 
.sp-error {
  margin: 0;
  color: var(--sp-danger);
  font-size: 11px;
}
 
.sp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}
 
.sp-form-grid .sp-field--full {
  grid-column: 1 / -1;
}
 
.sp-form-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
}
 
.sp-form-section__title {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sp-border);
  font-size: 14px;
  font-weight: 750;
}
 
.sp-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}
 
/* =========================================================
   7. Tables and data lists
   ========================================================= */
.sp-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
}
 
.sp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}
 
.sp-table th {
  padding: 13px 14px;
  color: #647894;
  background: #f7faff;
  border-bottom: 1px solid var(--sp-border);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}
 
.sp-table td {
  padding: 12px 14px;
  color: #354967;
  border-bottom: 1px solid #edf2f8;
  vertical-align: middle;
}
 
.sp-table tbody tr {
  transition: background var(--sp-transition);
}
 
.sp-table tbody tr:hover {
  background: #f8fbff;
}
 
.sp-table tbody tr:last-child td {
  border-bottom: 0;
}
 
.sp-table .is-right {
  text-align: right;
}
 
.sp-table .is-center {
  text-align: center;
}
 
.sp-table__person {
  display: flex;
  align-items: center;
  gap: 9px;
}
 
.sp-table__person-name {
  color: var(--sp-text);
  font-weight: 680;
}
 
.sp-table__person-meta {
  margin-top: 2px;
  color: var(--sp-text-muted);
  font-size: 10px;
}
 
/* =========================================================
   8. Status badges, tags and progress
   ========================================================= */
.sp-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 9px;
  color: #50627c;
  background: #edf2f8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
}
 
.sp-badge--success { color: #07865e; background: var(--sp-success-soft); }
.sp-badge--warning { color: #a56800; background: var(--sp-warning-soft); }
.sp-badge--danger { color: #c62f2f; background: var(--sp-danger-soft); }
.sp-badge--primary { color: #1768df; background: var(--sp-primary-soft); }
.sp-badge--purple { color: #7042d6; background: var(--sp-purple-soft); }
 
.sp-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: currentColor;
  border-radius: 50%;
}
 
.sp-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: #eaf0f8;
  border-radius: 99px;
}
 
.sp-progress__bar {
  height: 100%;
  background: var(--sp-primary);
  border-radius: inherit;
}
 
/* =========================================================
   9. Dashboard charts and product lists
   ========================================================= */
.sp-chart {
  position: relative;
  min-height: 220px;
  padding-top: 8px;
}
 
.sp-chart__placeholder {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 20px;
  color: var(--sp-text-muted);
  background:
    linear-gradient(to bottom, transparent 24%, #edf2f8 25%, transparent 25.5%),
    linear-gradient(to bottom, transparent 49%, #edf2f8 50%, transparent 50.5%),
    linear-gradient(to bottom, transparent 74%, #edf2f8 75%, transparent 75.5%);
  border-bottom: 1px solid var(--sp-border);
  border-radius: 8px;
  text-align: center;
}
 
.sp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--sp-text-muted);
  font-size: 11px;
}
 
.sp-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
 
.sp-legend__dot {
  width: 8px;
  height: 8px;
  background: var(--sp-primary);
  border-radius: 50%;
}
 
.sp-legend__dot--green { background: var(--sp-success); }
.sp-legend__dot--purple { background: var(--sp-purple); }
.sp-legend__dot--orange { background: var(--sp-orange); }
 
.sp-product-list {
  display: grid;
  gap: 0;
}
 
.sp-product-row {
  display: grid;
  grid-template-columns: 28px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f8;
}
 
.sp-product-row:last-child {
  border-bottom: 0;
}
 
.sp-product-row__rank {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #617590;
  background: #f0f5fb;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
}
 
.sp-product-row__image {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  background: #f3f7fc;
  border: 1px solid var(--sp-border);
  border-radius: 9px;
}
 
.sp-product-row__name {
  margin: 0;
  color: var(--sp-text);
  font-size: 12px;
  font-weight: 680;
}
 
.sp-product-row__meta {
  margin: 3px 0 0;
  color: var(--sp-text-muted);
  font-size: 10px;
}
 
.sp-product-row__value {
  color: var(--sp-text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
 
/* =========================================================
   10. Activity feed, pagination and empty states
   ========================================================= */
.sp-activity {
  display: grid;
  gap: 0;
}
 
.sp-activity__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #edf2f8;
}
 
.sp-activity__item:last-child {
  border-bottom: 0;
}
 
.sp-activity__icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--sp-primary);
  background: var(--sp-primary-soft);
  border-radius: 10px;
}
 
.sp-activity__title {
  margin: 0;
  color: var(--sp-text);
  font-size: 12px;
  font-weight: 680;
}
 
.sp-activity__meta {
  margin: 4px 0 0;
  color: var(--sp-text-muted);
  font-size: 10px;
}
 
.sp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
}
 
.sp-pagination__info {
  margin: 0;
  color: var(--sp-text-muted);
  font-size: 11px;
}
 
.sp-pagination__pages {
  display: flex;
  align-items: center;
  gap: 5px;
}
 
.sp-page-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #5c708d;
  background: #fff;
  border: 1px solid var(--sp-border);
  border-radius: 8px;
  font-size: 11px;
}
 
.sp-page-number.is-active {
  color: #fff;
  background: var(--sp-primary);
  border-color: var(--sp-primary);
}
 
.sp-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 30px;
  color: var(--sp-text-muted);
  text-align: center;
}
 
.sp-empty__icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  place-items: center;
  color: var(--sp-primary);
  background: var(--sp-primary-soft);
  border-radius: 16px;
  font-size: 22px;
}
 
/* =========================================================
   11. Utility classes
   ========================================================= */
.sp-muted { color: var(--sp-text-muted) !important; }
.sp-soft { color: var(--sp-text-soft) !important; }
.sp-primary-text { color: var(--sp-primary) !important; }
.sp-success-text { color: var(--sp-success) !important; }
.sp-danger-text { color: var(--sp-danger) !important; }
.sp-number { font-variant-numeric: tabular-nums; }
.sp-text-right { text-align: right; }
.sp-text-center { text-align: center; }
.sp-nowrap { white-space: nowrap; }
.sp-w-full { width: 100%; }
.sp-mt-1 { margin-top: 4px; }
.sp-mt-2 { margin-top: 8px; }
.sp-mt-3 { margin-top: 12px; }
.sp-mt-4 { margin-top: 16px; }
.sp-mt-6 { margin-top: 24px; }
.sp-mb-0 { margin-bottom: 0 !important; }
.sp-mb-3 { margin-bottom: 12px; }
.sp-mb-4 { margin-bottom: 16px; }
.sp-gap-2 { gap: 8px; }
.sp-gap-3 { gap: 12px; }
.sp-gap-4 { gap: 16px; }
.sp-hidden { display: none !important; }
 
/* =========================================================
   12. Responsive behavior
   ========================================================= */
@media (max-width: 1200px) {
  :root {
    --sp-sidebar-width: 220px;
  }
 
  .sp-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
 
  .sp-grid--main-aside {
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr);
  }
}
 
@media (max-width: 900px) {
  :root {
    --sp-sidebar-width: 72px;
  }
 
  .sp-sidebar {
    align-items: center;
    padding-inline: 8px;
  }
 
  .sp-brand {
    padding-inline: 0;
  }
 
  .sp-brand__name,
  .sp-brand__caption,
  .sp-nav__label,
  .sp-nav__link .sp-nav__text,
  .sp-profile__details {
    display: none;
  }
 
  .sp-nav {
    width: 100%;
  }
 
  .sp-nav__link {
    justify-content: center;
    padding-inline: 8px;
  }
 
  .sp-nav__icon {
    font-size: 18px;
  }
 
  .sp-profile {
    justify-content: center;
    padding-inline: 0;
  }
 
  .sp-main {
    padding-right: 8px;
  }
 
  .sp-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
 
  .sp-grid--main-aside {
    grid-template-columns: 1fr;
  }
}
 
@media (max-width: 640px) {
  :root {
    --sp-topbar-height: 58px;
  }
 
  .sp-sidebar {
    inset: auto 8px 8px;
    width: auto;
    height: 62px;
    flex-direction: row;
    justify-content: center;
    padding: 6px;
    overflow: visible;
    border-radius: 16px;
  }
 
  .sp-brand,
  .sp-sidebar__bottom,
  .sp-nav__label {
    display: none;
  }
 
  .sp-nav {
    display: flex;
    width: 100%;
    justify-content: space-around;
    gap: 3px;
  }
 
  .sp-nav__link {
    min-width: 42px;
    min-height: 44px;
    padding: 8px;
  }
 
  .sp-nav__link .sp-nav__text {
    display: none;
  }
 
  .sp-main {
    width: 100%;
    margin-left: 0;
    padding: 8px 8px 86px;
  }
 
  .sp-topbar {
    min-height: var(--sp-topbar-height);
    margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 12px;
  }
 
  .sp-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
 
  .sp-page-header .sp-button-group {
    flex-wrap: wrap;
  }
 
  .sp-card {
    padding: 15px;
    border-radius: 13px;
  }
 
  .sp-grid,
  .sp-grid--2,
  .sp-grid--3,
  .sp-grid--4,
  .sp-grid--main-aside {
    grid-template-columns: 1fr;
    gap: 12px;
  }
 
  .sp-kpi {
    min-height: 108px;
    padding: 16px;
  }
 
  .sp-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
 
  .sp-form-grid .sp-field--full {
    grid-column: auto;
  }
 
  .sp-toolbar {
    align-items: stretch;
  }
 
  .sp-toolbar > * {
    flex: 1 1 100%;
  }
 
  .sp-search {
    flex-basis: 100%;
  }
 
  .sp-form-actions {
    flex-direction: column-reverse;
  }
 
  .sp-form-actions .sp-btn {
    width: 100%;
  }
 
  .sp-topbar__actions .sp-topbar__hide-mobile {
    display: none;
  }
}
 
/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
 
/* =========================================================
   13. Minimal HTML usage example (remove this comment if desired)
 
   <div class="sp-app">
     <aside class="sp-sidebar">
       <div class="sp-brand">
         <div class="sp-brand__logo">S</div>
         <div>
           <p class="sp-brand__name">SalesPro</p>
           <span class="sp-brand__caption">Quản lý bán hàng</span>
         </div>
       </div>
       <nav class="sp-nav">
         <a class="sp-nav__link is-active" href="#">
           <span class="sp-nav__icon">⌂</span>
           <span class="sp-nav__text">Tổng quan</span>
         </a>
         <a class="sp-nav__link" href="#">
           <span class="sp-nav__icon">♙</span>
           <span class="sp-nav__text">Khách hàng</span>
         </a>
       </nav>
       <div class="sp-sidebar__bottom">
         <div class="sp-profile">
           <div class="sp-avatar">TN</div>
           <div class="sp-profile__details">
             <p class="sp-profile__name">Trương Nguyễn</p>
             <p class="sp-profile__role">Quản trị viên</p>
           </div>
         </div>
       </div>
     </aside>
 
     <main class="sp-main">
       <header class="sp-topbar">
         <div class="sp-search">
           <span class="sp-search__icon">⌕</span>
           <input class="sp-input" placeholder="Tìm kiếm..." />
         </div>
         <div class="sp-topbar__actions">
           <button class="sp-btn sp-btn--icon" aria-label="Thông báo">♧</button>
           <div class="sp-avatar">TN</div>
         </div>
       </header>
 
       <section class="sp-page">
         <div class="sp-page-header">
           <div>
             <h1>Tổng quan</h1>
             <p class="sp-page-header__description">
               Theo dõi tình hình kinh doanh của bạn.
             </p>
           </div>
           <button class="sp-btn sp-btn--primary">＋ Tạo đơn hàng</button>
         </div>
 
         <div class="sp-grid sp-grid--4">
           <article class="sp-kpi">
             <div class="sp-kpi__icon">↗</div>
             <div>
               <p class="sp-kpi__label">Tổng doanh thu</p>
               <p class="sp-kpi__value">186.450.000đ</p>
               <span class="sp-kpi__change">↑ 12,5% so với kỳ trước</span>
             </div>
           </article>
         </div>
 
         <article class="sp-card sp-mt-4">
           <div class="sp-card__header">
             <h3 class="sp-card__title">Danh sách khách hàng</h3>
             <button class="sp-btn sp-btn--primary">＋ Thêm khách hàng</button>
           </div>
           <div class="sp-table-wrap">
             <table class="sp-table">
               <thead>
                 <tr><th>Khách hàng</th><th>Email</th><th>Trạng thái</th></tr>
               </thead>
               <tbody>
                 <tr>
                   <td>Nguyễn Văn An</td>
                   <td>an@example.com</td>
                   <td><span class="sp-badge sp-badge--success">Hoạt động</span></td>
                 </tr>
               </tbody>
             </table>
           </div>
         </article>
       </section>
     </main>
   </div>
   ========================================================= */
