/**
 * MELODI ERP — Central Design System Components Stylesheet
 * Fully powered by Semantic Design Tokens & Modular Common Architecture
 */
@import url('/static/base/design_system/common.css');


/* ── 1. Boutons (Buttons) ─────────────────────────────────────────────────── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  height: var(--ds-btn-height-md);
  padding: 0 var(--ds-space-4);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-medium);
  line-height: 1;
  border-radius: var(--ds-btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ds-transition-fast);
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.ds-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ds-color-focus-ring);
}

.ds-btn:active:not(:disabled):not([disabled]) {
  transform: translateY(1px) scale(0.985);
}

.ds-btn:disabled,
.ds-btn[disabled],
.ds-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ds-btn-block,
.ds-btn-full {
  width: 100%;
}

/* Tailles */
.ds-btn-sm {
  height: var(--ds-btn-height-sm);
  padding: 0 var(--ds-space-3);
  font-size: var(--ds-font-size-xs);
  gap: 0.375rem;
}

.ds-btn-lg {
  height: var(--ds-btn-height-lg);
  padding: 0 var(--ds-space-6);
  font-size: var(--ds-font-size-base);
}

/* Variantes */
.ds-btn-primary {
  background-color: var(--ds-color-primary);
  color: var(--ds-color-primary-text);
  border-color: var(--ds-color-primary);
  box-shadow: var(--ds-shadow-xs);
}
.ds-btn-primary:hover {
  background-color: var(--ds-color-primary-hover);
  border-color: var(--ds-color-primary-hover);
  color: var(--ds-color-primary-text);
  box-shadow: var(--ds-shadow-sm);
}

.ds-btn-secondary {
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text);
  border-color: var(--ds-color-border);
}
.ds-btn-secondary:hover {
  background-color: var(--ds-color-surface-hover);
  border-color: var(--ds-color-border-strong);
  color: var(--ds-color-text);
}

.ds-btn-outline {
  background-color: transparent;
  color: var(--ds-color-primary);
  border-color: var(--ds-color-border-strong);
}
.ds-btn-outline:hover {
  background-color: var(--ds-color-primary-subtle, var(--ds-color-surface-subtle));
  border-color: var(--ds-color-primary);
  color: var(--ds-color-primary);
}

.ds-btn-ghost {
  background-color: transparent;
  color: var(--ds-color-text);
  border-color: transparent;
}
.ds-btn-ghost:hover {
  background-color: var(--ds-color-surface-hover);
  color: var(--ds-color-text);
}

.ds-btn-danger {
  background-color: var(--ds-color-danger);
  color: #ffffff;
  border-color: var(--ds-color-danger);
  box-shadow: var(--ds-shadow-xs);
}
.ds-btn-danger:hover {
  filter: brightness(0.92);
  color: #ffffff;
  box-shadow: var(--ds-shadow-sm);
}

.ds-btn-success {
  background-color: var(--ds-color-success);
  color: #ffffff;
  border-color: var(--ds-color-success);
  box-shadow: var(--ds-shadow-xs);
}
.ds-btn-success:hover {
  filter: brightness(0.92);
  color: #ffffff;
  box-shadow: var(--ds-shadow-sm);
}

.ds-btn-warning {
  background-color: var(--ds-color-warning);
  color: #ffffff;
  border-color: var(--ds-color-warning);
}
.ds-btn-warning:hover {
  filter: brightness(0.92);
  color: #ffffff;
}

.ds-btn-info {
  background-color: var(--ds-color-info);
  color: #ffffff;
  border-color: var(--ds-color-info);
}
.ds-btn-info:hover {
  filter: brightness(0.92);
  color: #ffffff;
}

/* ── 2. Badges ───────────────────────────────────────────────────────────── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  border-radius: var(--ds-radius-sm);
  border: 1px solid transparent;
  line-height: 1.3;
  white-space: nowrap;
}

.ds-badge-pill {
  border-radius: var(--ds-radius-full);
  padding: 0.2rem 0.65rem;
}

.ds-badge-dot::before,
span.ds-badge-dot {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.ds-badge-primary {
  background-color: var(--ds-color-primary-subtle, var(--ds-primitive-blue-100));
  color: var(--ds-color-primary);
  border-color: var(--ds-primitive-blue-200);
}
[data-theme="dark"] .ds-badge-primary,
[data-theme="nigth"] .ds-badge-primary {
  background-color: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.3);
}
.ds-badge-success {
  background-color: var(--ds-color-success-bg);
  color: var(--ds-color-success);
  border-color: var(--ds-color-success-border);
}
.ds-badge-warning {
  background-color: var(--ds-color-warning-bg);
  color: var(--ds-color-warning);
  border-color: var(--ds-color-warning-border);
}
.ds-badge-danger {
  background-color: var(--ds-color-danger-bg);
  color: var(--ds-color-danger);
  border-color: var(--ds-color-danger-border);
}
.ds-badge-info {
  background-color: var(--ds-color-info-bg);
  color: var(--ds-color-info);
  border-color: var(--ds-color-info-border);
}
.ds-badge-neutral {
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text-muted);
  border-color: var(--ds-color-border);
}

/* ── 3. Cartes (Cards) ───────────────────────────────────────────────────── */
.ds-card {
  background-color: var(--ds-color-surface);
  border: var(--ds-card-border);
  border-radius: var(--ds-card-radius);
  box-shadow: var(--ds-card-shadow);
  transition: box-shadow var(--ds-transition-fast), border-color var(--ds-transition-fast), transform var(--ds-transition-fast);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ds-card-interactive:hover {
  box-shadow: var(--ds-card-shadow-hover, var(--ds-shadow-md));
  border-color: var(--ds-color-border-strong);
  transform: translateY(-2px);
}

.ds-card-header {
  padding: var(--ds-space-4) var(--ds-space-5);
  border-bottom: 1px solid var(--ds-color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ds-space-3);
}

.ds-card-title {
  margin: 0;
  font-size: var(--ds-font-size-base);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  line-height: var(--ds-line-height-snug);
}

.ds-card-body {
  padding: var(--ds-space-5);
  color: var(--ds-color-text);
  flex: 1 1 auto;
}

.ds-card-footer {
  padding: var(--ds-space-3) var(--ds-space-5);
  border-top: 1px solid var(--ds-color-border-subtle);
  background-color: var(--ds-color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
}

@media (max-width: 639.98px) {
  .ds-card-header {
    padding: var(--ds-space-3) var(--ds-space-4);
  }
  .ds-card-body {
    padding: var(--ds-space-4);
  }
  .ds-card-footer {
    padding: var(--ds-space-3) var(--ds-space-4);
  }
}

/* ── 4. Stat Cards & KPI Widgets ─────────────────────────────────────────── */
.ds-stat-card {
  background-color: var(--ds-color-surface);
  border: var(--ds-card-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-5);
  box-shadow: var(--ds-card-shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-space-4);
  transition: transform var(--ds-transition-fast), box-shadow var(--ds-transition-fast), border-color var(--ds-transition-fast);
  height: 100%;
}

.ds-stat-card:hover,
.ds-kpi-widget:hover {
  box-shadow: var(--ds-shadow-md);
  border-color: var(--ds-color-border-strong);
  transform: translateY(-2px);
}

.ds-stat-label {
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-color-text-muted);
  margin-bottom: var(--ds-space-1);
}

.ds-stat-value,
.ds-kpi-value {
  font-size: var(--ds-font-size-2xl);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ds-stat-trend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  margin-top: var(--ds-space-2);
}

.ds-stat-trend.positive { color: var(--ds-color-success); }
.ds-stat-trend.negative { color: var(--ds-color-danger); }

.ds-stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--ds-radius-lg);
  background-color: var(--ds-color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--ds-color-border-subtle);
}

@media (max-width: 575.98px) {
  .ds-stat-card {
    padding: var(--ds-space-4);
  }
  .ds-stat-value,
  .ds-kpi-value {
    font-size: var(--ds-font-size-xl);
  }
  .ds-stat-icon-wrapper {
    width: 38px;
    height: 38px;
  }
}

/* ── 5. Data Tables & Base Tables ────────────────────────────────────────── */
.ds-data-table-container,
.ds-table-container,
.table-responsive {
  background-color: var(--ds-color-surface);
  border: var(--ds-card-border);
  border-radius: var(--ds-card-radius);
  box-shadow: var(--ds-card-shadow);
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ds-card .ds-data-table-container,
.ds-card .ds-table-container,
.ds-card .table-responsive {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.ds-data-table,
.ds-table,
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
}

.ds-data-table th,
.ds-table th,
.table th {
  background-color: var(--ds-table-header-bg);
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-color-border);
  white-space: nowrap;
}

.ds-data-table td,
.ds-table td,
.table td {
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-color-border-subtle);
  color: var(--ds-color-text);
  vertical-align: middle;
}

.ds-data-table tbody tr,
.ds-table tbody tr,
.table tbody tr {
  transition: background-color var(--ds-transition-fast);
}

.ds-data-table tbody tr:hover,
.ds-table-hover tbody tr:hover,
.table-hover tbody tr:hover {
  background-color: var(--ds-table-row-hover);
}

.ds-table-striped tbody tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--ds-color-surface-subtle);
}

.ds-table-borderless th,
.ds-table-borderless td,
.table-borderless th,
.table-borderless td {
  border: none !important;
}

.ds-data-table tbody tr:last-child td,
.ds-table tbody tr:last-child td,
.table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 767.98px) {
  .ds-data-table th,
  .ds-table th,
  .table th,
  .ds-data-table td,
  .ds-table td,
  .table td {
    padding: var(--ds-space-2) var(--ds-space-3);
    font-size: 0.8125rem;
  }

  /* Mode empilé sur mobile lorsque les cellules possèdent data-label */
  .ds-table-mobile-cards thead {
    display: none;
  }
  .ds-table-mobile-cards tbody tr {
    display: block;
    padding: var(--ds-space-3);
    border-bottom: 1px solid var(--ds-color-border);
  }
  .ds-table-mobile-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--ds-space-2);
    padding: var(--ds-space-1) 0;
    border-bottom: none;
    text-align: right;
  }
  .ds-table-mobile-cards tbody td::before {
    content: attr(data-label);
    font-weight: var(--ds-font-weight-semibold);
    font-size: var(--ds-font-size-xs);
    color: var(--ds-color-text-muted);
    text-align: left;
  }
}

/* ── 6. États vides, Erreurs & Succès (Empty / Error / Success States) ──── */
.ds-empty-state,
.ds-state-view,
.ds-access-denied {
  text-align: center;
  padding: var(--ds-space-10) var(--ds-space-6);
  background-color: var(--ds-color-surface);
  border: 1px dashed var(--ds-color-border-strong);
  border-radius: var(--ds-card-radius);
  color: var(--ds-color-text);
}

.ds-empty-icon,
.ds-state-icon {
  margin-bottom: var(--ds-space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--ds-radius-full);
  background-color: var(--ds-color-surface-subtle);
}

.ds-empty-title,
.ds-state-title {
  font-size: var(--ds-font-size-lg);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  margin-bottom: var(--ds-space-2);
}

.ds-empty-desc,
.ds-state-message {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text-muted);
  max-width: 440px;
  margin: 0 auto var(--ds-space-5);
  line-height: var(--ds-line-height-relaxed);
}

@media (max-width: 575.98px) {
  .ds-empty-state,
  .ds-state-view,
  .ds-access-denied {
    padding: var(--ds-space-8) var(--ds-space-4);
  }
}

/* ── 7. Alertes ──────────────────────────────────────────────────────────── */
.ds-alert,
.alert {
  padding: var(--ds-space-3) var(--ds-space-4);
  border-radius: var(--ds-radius-md);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-3);
  font-size: var(--ds-font-size-sm);
  line-height: 1.45;
  position: relative;
}

.ds-alert-title {
  font-weight: var(--ds-font-weight-semibold);
  margin-bottom: 2px;
}

.ds-alert-primary,
.alert-primary {
  background-color: var(--ds-color-primary-subtle, var(--ds-primitive-blue-50));
  border-color: var(--ds-primitive-blue-200);
  color: var(--ds-color-primary);
}
[data-theme="dark"] .ds-alert-primary,
[data-theme="dark"] .alert-primary {
  border-color: rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}
.ds-alert-success,
.alert-success {
  background-color: var(--ds-color-success-bg);
  border-color: var(--ds-color-success-border);
  color: var(--ds-color-success);
}
.ds-alert-warning,
.alert-warning {
  background-color: var(--ds-color-warning-bg);
  border-color: var(--ds-color-warning-border);
  color: var(--ds-color-warning);
}
.ds-alert-danger,
.alert-danger {
  background-color: var(--ds-color-danger-bg);
  border-color: var(--ds-color-danger-border);
  color: var(--ds-color-danger);
}
.ds-alert-info,
.alert-info {
  background-color: var(--ds-color-info-bg);
  border-color: var(--ds-color-info-border);
  color: var(--ds-color-info);
}

/* ── 8. Formulaires (Form Controls & Inputs) ─────────────────────────────── */
.ds-form-group,
.ds-form-field {
  margin-bottom: var(--ds-space-4);
}

.ds-form-label,
.ds-label {
  display: block;
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  margin-bottom: var(--ds-space-1);
  line-height: 1.4;
}

.ds-form-label .required-star,
.ds-label .required-star {
  color: var(--ds-color-danger);
  margin-left: 2px;
}

.ds-form-control,
.ds-input {
  width: 100%;
  height: var(--ds-input-height);
  padding: 0 var(--ds-space-3);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-input-radius);
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast), background-color var(--ds-transition-fast);
}

textarea.ds-form-control,
textarea.ds-input {
  height: auto;
  min-height: 88px;
  padding: var(--ds-space-2) var(--ds-space-3);
  line-height: 1.5;
  resize: vertical;
}

.ds-input-sm,
.ds-form-control-sm {
  height: var(--ds-input-height-sm, 32px);
  padding: 0 var(--ds-space-2);
  font-size: var(--ds-font-size-xs);
}

.ds-input-lg,
.ds-form-control-lg {
  height: var(--ds-input-height-lg, 48px);
  padding: 0 var(--ds-space-4);
  font-size: var(--ds-font-size-base);
}

.ds-form-control:hover:not(:disabled):not(:focus),
.ds-input:hover:not(:disabled):not(:focus),
.ds-select:hover:not(:disabled):not(:focus) {
  border-color: var(--ds-color-border-strong);
}

.ds-form-control:focus,
.ds-input:focus,
.ds-select:focus {
  outline: none;
  border-color: var(--ds-color-accent);
  box-shadow: 0 0 0 3px var(--ds-color-focus-ring);
}

.ds-form-control:disabled,
.ds-input:disabled,
.ds-select:disabled {
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.ds-form-control::placeholder,
.ds-input::placeholder {
  color: var(--ds-color-text-subtle);
}

.ds-input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.ds-input-icon {
  position: absolute;
  left: var(--ds-space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}

.ds-input-with-icon {
  padding-left: calc(var(--ds-space-6) + var(--ds-space-2)) !important;
}

.ds-input-error,
.ds-form-control.is-invalid {
  border-color: var(--ds-color-danger) !important;
}
.ds-input-error:focus,
.ds-form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25) !important;
}

.ds-form-hint,
.ds-field-help {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-muted);
  margin: var(--ds-space-1) 0 0 0;
}

.ds-form-error,
.ds-field-error {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-danger);
  font-weight: var(--ds-font-weight-medium);
  margin: var(--ds-space-1) 0 0 0;
}

.ds-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  margin-top: var(--ds-space-5);
  padding-top: var(--ds-space-4);
  border-top: 1px solid var(--ds-color-border-subtle);
}
.ds-form-actions-end { justify-content: flex-end; }
.ds-form-actions-start { justify-content: flex-start; }
.ds-form-actions-center { justify-content: center; }
.ds-form-actions-between { justify-content: space-between; }

@media (max-width: 575.98px) {
  .ds-form-actions .ds-btn {
    flex: 1 1 auto;
  }
}

/* ── 9. Avatars, Spinners, Dividers, Headings & Links ────────────────────── */
.ds-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius-full);
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text);
  font-weight: var(--ds-font-weight-semibold);
  font-size: var(--ds-font-size-xs);
  border: 1px solid var(--ds-color-border);
  overflow: hidden;
  flex-shrink: 0;
}
.ds-avatar-rounded { border-radius: var(--ds-radius-full); }
.ds-avatar-primary {
  background-color: var(--ds-color-primary);
  color: var(--ds-color-primary-text);
  border-color: transparent;
}
.ds-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ds-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.ds-avatar-lg { width: 48px; height: 48px; font-size: var(--ds-font-size-base); }
.ds-avatar-xl { width: 64px; height: 64px; font-size: var(--ds-font-size-xl); }

.ds-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ds-color-border-strong);
  border-top-color: var(--ds-color-primary);
  border-radius: 50%;
  animation: ds-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ds-spin {
  to { transform: rotate(360deg); }
}

.ds-divider {
  height: 1px;
  background-color: var(--ds-color-border);
  border: none;
  margin: var(--ds-space-6) 0;
}

.ds-heading {
  color: var(--ds-color-text);
  font-weight: var(--ds-font-weight-bold);
  line-height: var(--ds-line-height-tight);
  margin: 0 0 var(--ds-space-3) 0;
}
.ds-heading-1 { font-size: var(--ds-font-size-3xl); }
.ds-heading-2 { font-size: var(--ds-font-size-2xl); }
.ds-heading-3 { font-size: var(--ds-font-size-xl); }
.ds-heading-4 { font-size: var(--ds-font-size-lg); }
.ds-heading-5 { font-size: var(--ds-font-size-base); }
.ds-heading-6 { font-size: var(--ds-font-size-sm); }

.ds-link {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-1);
  color: var(--ds-color-accent);
  font-weight: var(--ds-font-weight-medium);
  text-decoration: none;
  transition: color var(--ds-transition-fast);
}
.ds-link:hover {
  color: var(--ds-color-accent-hover);
}
.ds-link-underline,
.ds-link:hover {
  text-decoration: underline;
}

/* ── 10. Layout, Responsive Grid & Structure ─────────────────────────────── */
.ds-container {
  width: 100%;
  max-width: var(--ds-breakpoint-2xl, 1400px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ds-space-4);
  padding-right: var(--ds-space-4);
}
.ds-container-fluid {
  max-width: 100%;
}

.ds-row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(-1 * var(--ds-row-gap, var(--ds-space-3)));
  margin-right: calc(-1 * var(--ds-row-gap, var(--ds-space-3)));
  row-gap: calc(2 * var(--ds-row-gap, var(--ds-space-3)));
}

.ds-col {
  flex: 0 0 auto;
  padding-left: var(--ds-row-gap, var(--ds-space-3));
  padding-right: var(--ds-row-gap, var(--ds-space-3));
  width: 100%;
}
.ds-col-1  { width: 8.333333%; }
.ds-col-2  { width: 16.666667%; }
.ds-col-3  { width: 25%; }
.ds-col-4  { width: 33.333333%; }
.ds-col-5  { width: 41.666667%; }
.ds-col-6  { width: 50%; }
.ds-col-7  { width: 58.333333%; }
.ds-col-8  { width: 66.666667%; }
.ds-col-9  { width: 75%; }
.ds-col-10 { width: 83.333333%; }
.ds-col-11 { width: 91.666667%; }
.ds-col-12 { width: 100%; }

@media (min-width: 576px) {
  .ds-col-sm-1  { width: 8.333333%; }
  .ds-col-sm-2  { width: 16.666667%; }
  .ds-col-sm-3  { width: 25%; }
  .ds-col-sm-4  { width: 33.333333%; }
  .ds-col-sm-5  { width: 41.666667%; }
  .ds-col-sm-6  { width: 50%; }
  .ds-col-sm-7  { width: 58.333333%; }
  .ds-col-sm-8  { width: 66.666667%; }
  .ds-col-sm-9  { width: 75%; }
  .ds-col-sm-10 { width: 83.333333%; }
  .ds-col-sm-11 { width: 91.666667%; }
  .ds-col-sm-12 { width: 100%; }
}

@media (min-width: 768px) {
  .ds-col-md-1  { width: 8.333333%; }
  .ds-col-md-2  { width: 16.666667%; }
  .ds-col-md-3  { width: 25%; }
  .ds-col-md-4  { width: 33.333333%; }
  .ds-col-md-5  { width: 41.666667%; }
  .ds-col-md-6  { width: 50%; }
  .ds-col-md-7  { width: 58.333333%; }
  .ds-col-md-8  { width: 66.666667%; }
  .ds-col-md-9  { width: 75%; }
  .ds-col-md-10 { width: 83.333333%; }
  .ds-col-md-11 { width: 91.666667%; }
  .ds-col-md-12 { width: 100%; }
}

@media (min-width: 992px) {
  .ds-col-lg-1  { width: 8.333333%; }
  .ds-col-lg-2  { width: 16.666667%; }
  .ds-col-lg-3  { width: 25%; }
  .ds-col-lg-4  { width: 33.333333%; }
  .ds-col-lg-5  { width: 41.666667%; }
  .ds-col-lg-6  { width: 50%; }
  .ds-col-lg-7  { width: 58.333333%; }
  .ds-col-lg-8  { width: 66.666667%; }
  .ds-col-lg-9  { width: 75%; }
  .ds-col-lg-10 { width: 83.333333%; }
  .ds-col-lg-11 { width: 91.666667%; }
  .ds-col-lg-12 { width: 100%; }
}

@media (min-width: 1200px) {
  .ds-col-xl-1  { width: 8.333333%; }
  .ds-col-xl-2  { width: 16.666667%; }
  .ds-col-xl-3  { width: 25%; }
  .ds-col-xl-4  { width: 33.333333%; }
  .ds-col-xl-5  { width: 41.666667%; }
  .ds-col-xl-6  { width: 50%; }
  .ds-col-xl-7  { width: 58.333333%; }
  .ds-col-xl-8  { width: 66.666667%; }
  .ds-col-xl-9  { width: 75%; }
  .ds-col-xl-10 { width: 83.333333%; }
  .ds-col-xl-11 { width: 91.666667%; }
  .ds-col-xl-12 { width: 100%; }
}

/* Grille CSS Responsive Mobile-First (.ds-grid & .ds-dashboard-grid) */
.ds-grid {
  display: grid;
  gap: var(--ds-space-4);
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.ds-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .ds-grid-cols-2,
  .ds-grid-cols-3,
  .ds-grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds-grid-cols-6,
  .ds-grid-cols-12 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .ds-grid-cols-2  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-grid-cols-3  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ds-grid-cols-4  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ds-grid-cols-6  { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ds-grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* Dashboard Grid & Spans */
.ds-dashboard-grid {
  display: grid;
  gap: var(--ds-space-4);
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .ds-dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .ds-grid-span-1, .ds-grid-span-2, .ds-grid-span-3 { grid-column: span 3 / span 3; }
  .ds-grid-span-4, .ds-grid-span-5, .ds-grid-span-6,
  .ds-grid-span-7, .ds-grid-span-8, .ds-grid-span-9,
  .ds-grid-span-10, .ds-grid-span-11, .ds-grid-span-12 { grid-column: span 6 / span 6; }
}

@media (min-width: 1024px) {
  .ds-dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .ds-grid-span-1  { grid-column: span 1 / span 1; }
  .ds-grid-span-2  { grid-column: span 2 / span 2; }
  .ds-grid-span-3  { grid-column: span 3 / span 3; }
  .ds-grid-span-4  { grid-column: span 4 / span 4; }
  .ds-grid-span-5  { grid-column: span 5 / span 5; }
  .ds-grid-span-6  { grid-column: span 6 / span 6; }
  .ds-grid-span-7  { grid-column: span 7 / span 7; }
  .ds-grid-span-8  { grid-column: span 8 / span 8; }
  .ds-grid-span-9  { grid-column: span 9 / span 9; }
  .ds-grid-span-10 { grid-column: span 10 / span 10; }
  .ds-grid-span-11 { grid-column: span 11 / span 11; }
  .ds-grid-span-12 { grid-column: span 12 / span 12; }
}

.ds-stack {
  display: flex;
}
.ds-stack-vertical { flex-direction: column; }
.ds-stack-horizontal { flex-direction: row; flex-wrap: wrap; }
.ds-align-start { align-items: flex-start; }
.ds-align-center { align-items: center; }
.ds-align-end { align-items: flex-end; }
.ds-align-stretch { align-items: stretch; }
.ds-justify-start { justify-content: flex-start; }
.ds-justify-center { justify-content: center; }
.ds-justify-end { justify-content: flex-end; }
.ds-justify-between { justify-content: space-between; }

.ds-gap-1 { gap: var(--ds-space-1); }
.ds-gap-2 { gap: var(--ds-space-2); }
.ds-gap-3 { gap: var(--ds-space-3); }
.ds-gap-4 { gap: var(--ds-space-4); }
.ds-gap-5 { gap: var(--ds-space-5); }
.ds-gap-6 { gap: var(--ds-space-6); }

.ds-spacer-y-1 { height: var(--ds-space-1); }
.ds-spacer-y-2 { height: var(--ds-space-2); }
.ds-spacer-y-3 { height: var(--ds-space-3); }
.ds-spacer-y-4 { height: var(--ds-space-4); }
.ds-spacer-y-6 { height: var(--ds-space-6); }
.ds-spacer-y-8 { height: var(--ds-space-8); }
.ds-spacer-x-1 { display: inline-block; width: var(--ds-space-1); }
.ds-spacer-x-2 { display: inline-block; width: var(--ds-space-2); }
.ds-spacer-x-3 { display: inline-block; width: var(--ds-space-3); }
.ds-spacer-x-4 { display: inline-block; width: var(--ds-space-4); }

.ds-section {
  margin-bottom: var(--ds-space-6);
}
.ds-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  margin-bottom: var(--ds-space-3);
}
.ds-section-title {
  font-size: var(--ds-font-size-lg);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-color-text);
  margin: 0;
}
.ds-section-subtitle {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-muted);
  margin: 0;
}

.ds-page-header {
  margin-bottom: var(--ds-space-6);
}
.ds-page-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
}
.ds-page-header-title-box {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
}
.ds-page-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--ds-radius-md);
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--ds-shadow-xs);
}
.ds-page-header-title {
  font-size: var(--ds-font-size-2xl);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-color-text);
  margin: 0;
  line-height: var(--ds-line-height-tight);
}
.ds-page-header-subtitle {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text-muted);
  margin: 2px 0 0 0;
}
.ds-page-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
}

@media (max-width: 575.98px) {
  .ds-page-header-title {
    font-size: var(--ds-font-size-xl);
  }
  .ds-page-header-actions {
    width: 100%;
  }
}

.ds-page-content {
  padding: var(--ds-space-4) 0;
}
.ds-page-footer {
  padding: var(--ds-space-4) 0;
  border-top: 1px solid var(--ds-color-border);
  margin-top: auto;
}
.ds-page-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
}

/* Tabs (Scrollable horizontalement sur mobile) */
.ds-tabs-nav {
  display: flex;
  gap: var(--ds-space-1);
  border-bottom: 1px solid var(--ds-color-border);
  margin-bottom: var(--ds-space-4);
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ds-tabs-nav::-webkit-scrollbar {
  display: none;
}
.ds-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--ds-space-2) var(--ds-space-4);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--ds-transition-fast);
  border-radius: var(--ds-radius-md) var(--ds-radius-md) 0 0;
}
.ds-tab-btn:hover {
  color: var(--ds-color-text);
  background-color: var(--ds-color-surface-hover);
}
.ds-tab-btn.active {
  color: var(--ds-color-primary);
  border-bottom-color: var(--ds-color-primary);
  font-weight: var(--ds-font-weight-semibold);
}

/* Accordion */
.ds-accordion-item {
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-md);
  margin-bottom: var(--ds-space-2);
  overflow: hidden;
  background-color: var(--ds-color-surface);
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}
.ds-accordion-item.open {
  border-color: var(--ds-color-border-strong);
  box-shadow: var(--ds-shadow-xs);
}
.ds-accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-4);
  background: transparent;
  border: none;
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--ds-transition-fast);
}
.ds-accordion-trigger:hover {
  background-color: var(--ds-color-surface-hover);
}
.ds-accordion-icon {
  display: inline-block;
  transition: transform var(--ds-transition-fast);
  color: var(--ds-color-text-muted);
}
.ds-accordion-item.open .ds-accordion-icon {
  transform: rotate(180deg);
}
.ds-accordion-body {
  padding: var(--ds-space-4);
  border-top: 1px solid var(--ds-color-border);
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  line-height: var(--ds-line-height-relaxed);
}

/* ── 11. Dropdown, Notification Center, Command Palette & Navigation ────── */
.ds-dropdown {
  position: relative;
  display: inline-block;
}
.ds-dropdown-menu {
  position: absolute;
  top: 100%;
  z-index: var(--ds-z-dropdown, 1000);
  display: none;
  min-width: 190px;
  max-width: calc(100vw - 1.5rem);
  padding: var(--ds-space-1) 0;
  margin-top: var(--ds-space-1);
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-lg);
  animation: ds-dropdown-fade 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ds-dropdown-fade {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ds-dropdown-menu.show {
  display: block;
}
.ds-dropdown-align-left { left: 0; }
.ds-dropdown-align-right { right: 0; }
.ds-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  width: 100%;
  padding: 0.45rem var(--ds-space-3);
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  transition: background-color var(--ds-transition-fast), color var(--ds-transition-fast);
  cursor: pointer;
}
.ds-dropdown-item:hover {
  background-color: var(--ds-color-surface-hover);
  color: var(--ds-color-primary);
}
.ds-dropdown-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.ds-dropdown-item-danger {
  color: var(--ds-color-danger);
}
.ds-dropdown-item-danger:hover {
  background-color: var(--ds-color-danger-subtle);
  color: var(--ds-color-danger);
}
.ds-dropdown-divider {
  height: 1px;
  background-color: var(--ds-color-border);
  margin: var(--ds-space-1) 0;
}

/* User Menu */
.ds-user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  padding: var(--ds-space-1) var(--ds-space-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-full);
  cursor: pointer;
  transition: all var(--ds-transition-fast);
}
.ds-user-menu-trigger:hover {
  background-color: var(--ds-color-surface-hover);
  border-color: var(--ds-color-border);
}
.ds-user-menu-name {
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  line-height: 1.15;
}
.ds-user-menu-role {
  font-size: 10px;
  color: var(--ds-color-text-muted);
}

/* Notification Center */
.ds-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ds-notification-menu {
  width: 340px;
  max-width: calc(100vw - 1.5rem);
  padding: 0;
  overflow: hidden;
}
.ds-notification-item {
  transition: background-color var(--ds-transition-fast);
}
.ds-notification-item:hover {
  background-color: var(--ds-color-surface-hover);
}
.ds-notification-item.unread {
  background-color: var(--ds-color-primary-subtle, rgba(59, 130, 246, 0.06));
}

/* Search Bar */
.ds-search-bar {
  width: 100%;
}
.ds-search-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.ds-search-icon {
  position: absolute;
  left: var(--ds-space-3);
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  opacity: 0.6;
}
.ds-search-input {
  width: 100%;
  height: var(--ds-btn-height-md);
  padding: 0 var(--ds-space-10) 0 calc(var(--ds-space-6) + var(--ds-space-2));
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-full);
  background-color: var(--ds-color-surface);
  color: var(--ds-color-text);
  transition: all var(--ds-transition-fast);
}
.ds-search-input:focus {
  outline: none;
  border-color: var(--ds-color-accent);
  box-shadow: 0 0 0 3px var(--ds-color-focus-ring);
}
.ds-search-shortcut {
  position: absolute;
  right: var(--ds-space-3);
  font-size: 10px;
  color: var(--ds-color-text-muted);
  pointer-events: none;
}
.ds-search-shortcut kbd {
  padding: 2px 5px;
  border-radius: var(--ds-radius-xs);
  background-color: var(--ds-color-surface-subtle);
  border: 1px solid var(--ds-color-border);
  font-family: var(--ds-font-mono);
  font-size: 10px;
}

/* Command Palette (⌘K) */
.ds-command-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--ds-z-modal, 1055);
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--ds-space-4) var(--ds-space-4);
}
.ds-command-palette-panel {
  width: 100%;
  max-width: 580px;
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--ds-shadow-2xl);
  overflow: hidden;
  animation: ds-dropdown-fade 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ds-command-palette-header {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-color-border);
}
.ds-command-palette-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--ds-font-size-base);
  color: var(--ds-color-text);
  font-family: var(--ds-font-sans);
}
.ds-command-palette-kbd {
  padding: 2px 6px;
  font-size: 10px;
  border-radius: var(--ds-radius-sm);
  background-color: var(--ds-color-surface-subtle);
  border: 1px solid var(--ds-color-border);
  color: var(--ds-color-text-muted);
}
.ds-command-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: var(--ds-space-2);
}
.ds-command-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-2) var(--ds-space-3);
  border-radius: var(--ds-radius-md);
  color: var(--ds-color-text);
  text-decoration: none;
  font-size: var(--ds-font-size-sm);
  transition: background-color var(--ds-transition-fast);
}
.ds-command-item:hover,
.ds-command-item:focus {
  background-color: var(--ds-color-surface-hover);
  outline: none;
}
.ds-command-item-title {
  font-weight: var(--ds-font-weight-medium);
}

/* Pagination */
.ds-pagination-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
  align-items: center;
}
.ds-pagination-item .ds-pagination-link,
.ds-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--ds-space-2);
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-color-border);
  background-color: var(--ds-color-surface);
  color: var(--ds-color-text);
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-medium);
  text-decoration: none;
  transition: all var(--ds-transition-fast);
}
.ds-pagination-ellipsis {
  border-color: transparent;
  background: transparent;
  color: var(--ds-color-text-muted);
}
.ds-pagination-item:not(.disabled):not(.active) .ds-pagination-link:hover {
  background-color: var(--ds-color-surface-hover);
  border-color: var(--ds-color-border-strong);
}
.ds-pagination-item.active .ds-pagination-link {
  background-color: var(--ds-color-primary);
  border-color: var(--ds-color-primary);
  color: var(--ds-color-primary-text);
  font-weight: var(--ds-font-weight-bold);
  box-shadow: var(--ds-shadow-xs);
}
.ds-pagination-item.disabled .ds-pagination-link {
  opacity: 0.45;
  pointer-events: none;
}

/* ── 12. Actions (Icons, Groups, Splits, Refresh) ────────────────────────── */
.ds-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ds-btn-height-md);
  height: var(--ds-btn-height-md);
  padding: 0;
  border-radius: var(--ds-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text);
  transition: all var(--ds-transition-fast);
  flex-shrink: 0;
}
.ds-icon-btn:hover:not(:disabled) {
  background-color: var(--ds-color-surface-hover);
  border-color: var(--ds-color-border);
}
.ds-icon-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.ds-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ds-icon-btn-sm { width: var(--ds-btn-height-sm); height: var(--ds-btn-height-sm); }
.ds-icon-btn-lg { width: var(--ds-btn-height-lg); height: var(--ds-btn-height-lg); }
.ds-icon-btn-ghost { background-color: transparent; }
.ds-icon-btn-ghost:hover:not(:disabled) { background-color: var(--ds-color-surface-hover); border-color: transparent; }
.ds-icon-btn-primary {
  background-color: var(--ds-color-primary);
  color: var(--ds-color-primary-text);
}
.ds-icon-btn-primary:hover:not(:disabled) {
  background-color: var(--ds-color-primary-hover);
}
.ds-icon-btn-danger {
  background-color: var(--ds-color-danger-subtle);
  color: var(--ds-color-danger);
}

.ds-refresh-btn.spinning .ds-refresh-icon {
  animation: ds-spin 0.7s linear infinite;
}

.ds-btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  border-radius: var(--ds-btn-radius);
  overflow: hidden;
  box-shadow: var(--ds-shadow-xs);
}
.ds-btn-group .ds-btn {
  border-radius: 0;
  border-right-width: 0;
}
.ds-btn-group .ds-btn:first-child {
  border-top-left-radius: var(--ds-btn-radius);
  border-bottom-left-radius: var(--ds-btn-radius);
}
.ds-btn-group .ds-btn:last-child {
  border-right-width: 1px;
  border-top-right-radius: var(--ds-btn-radius);
  border-bottom-right-radius: var(--ds-btn-radius);
}

.ds-split-btn {
  display: inline-flex;
  position: relative;
}
.ds-split-btn > .ds-btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.ds-split-btn-toggle {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding: 0 var(--ds-space-2) !important;
}

/* ── 13. Form Inputs, Switches, Checkboxes, Radios, Selects, Dropzones ──── */
.ds-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.ds-switch input { opacity: 0; width: 0; height: 0; }
.ds-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--ds-color-border-strong);
  transition: background-color var(--ds-transition-fast);
  border-radius: 22px;
}
.ds-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform var(--ds-transition-fast);
  border-radius: 50%;
  box-shadow: var(--ds-shadow-xs);
}
.ds-switch input:checked + .ds-switch-slider {
  background-color: var(--ds-color-primary);
}
.ds-switch input:focus-visible + .ds-switch-slider {
  box-shadow: 0 0 0 3px var(--ds-color-focus-ring);
}
.ds-switch input:checked + .ds-switch-slider:before {
  transform: translateX(16px);
}
.ds-switch-container {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
}
.ds-switch-label {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  cursor: pointer;
  user-select: none;
}

/* Checkbox & Radio Group */
.ds-checkbox-wrapper {
  display: inline-flex;
  align-items: flex-start;
}
.ds-checkbox-label,
.ds-radio-label {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--ds-space-2);
  cursor: pointer;
  user-select: none;
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
}
.ds-checkbox,
.ds-radio {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--ds-color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.ds-checkbox-custom,
.ds-radio-custom {
  display: none;
}
.ds-checkbox-text {
  display: flex;
  flex-direction: column;
}
.ds-checkbox-title,
.ds-radio-text {
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-text);
  line-height: 1.35;
}
.ds-checkbox-desc {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-muted);
  margin-top: 2px;
}

.ds-radio-options {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
}
.ds-radio-options.ds-radio-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
}

/* Select */
.ds-select {
  appearance: none;
  width: 100%;
  height: var(--ds-input-height);
  padding: 0 var(--ds-space-8) 0 var(--ds-space-3);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-input-radius);
  cursor: pointer;
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}
.ds-select-sm {
  height: var(--ds-input-height-sm, 32px);
  padding: 0 var(--ds-space-6) 0 var(--ds-space-2);
  font-size: var(--ds-font-size-xs);
}
.ds-select-arrow {
  position: absolute;
  right: var(--ds-space-3);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 11px;
  color: var(--ds-color-text-muted);
}

/* File Dropzone */
.ds-file-dropzone {
  border: 2px dashed var(--ds-color-border-strong);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-6) var(--ds-space-4);
  text-align: center;
  background-color: var(--ds-color-surface-subtle);
  cursor: pointer;
  transition: all var(--ds-transition-fast);
}
.ds-file-dropzone:hover,
.ds-file-dropzone.dragover {
  border-color: var(--ds-color-primary);
  background-color: var(--ds-color-primary-subtle, var(--ds-color-surface-hover));
}

/* Tag Input */
.ds-tag-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-1);
  padding: var(--ds-space-1) var(--ds-space-2);
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-input-radius);
  background-color: var(--ds-color-surface);
  min-height: var(--ds-input-height);
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}
.ds-tag-input-box:focus-within {
  border-color: var(--ds-color-accent);
  box-shadow: 0 0 0 3px var(--ds-color-focus-ring);
}
.ds-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-1);
}
.ds-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--ds-color-surface-subtle);
  color: var(--ds-color-text);
  border: 1px solid var(--ds-color-border);
  padding: 2px 8px;
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-medium);
}
.ds-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  color: var(--ds-color-text-muted);
}
.ds-tag-remove:hover {
  color: var(--ds-color-danger);
}
.ds-tag-input-field {
  border: none;
  outline: none;
  background: transparent;
  color: var(--ds-color-text);
  font-size: var(--ds-font-size-sm);
  flex-grow: 1;
  min-width: 110px;
  padding: 2px 4px;
}

/* ── 14. Data: Description List, Progress, Timeline, Tree View & ERP ────── */
.ds-dl {
  margin: 0;
}
.ds-dl-row {
  padding: var(--ds-space-2) 0;
  border-bottom: 1px solid var(--ds-color-border-subtle);
}
.ds-dl-row:last-child {
  border-bottom: none;
}
.ds-dl-horizontal .ds-dl-row {
  display: flex;
  align-items: baseline;
  gap: var(--ds-space-3);
}
.ds-dl-term {
  flex: 0 0 32%;
  font-weight: var(--ds-font-weight-medium);
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-muted);
}
.ds-dl-def {
  flex: 1 1 68%;
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
  margin: 0;
  word-break: break-word;
}

@media (max-width: 575.98px) {
  .ds-dl-horizontal .ds-dl-row {
    flex-direction: column;
    gap: 2px;
  }
  .ds-dl-term,
  .ds-dl-def {
    flex: 1 1 100%;
    width: 100%;
  }
}

.ds-progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--ds-color-surface-subtle);
  border-radius: var(--ds-radius-full);
  overflow: hidden;
}
.ds-progress-bar {
  height: 100%;
  border-radius: var(--ds-radius-full);
  transition: width 0.4s ease;
}
.ds-progress-bar-primary { background-color: var(--ds-color-primary); }
.ds-progress-bar-success { background-color: var(--ds-color-success); }
.ds-progress-bar-warning { background-color: var(--ds-color-warning); }
.ds-progress-bar-danger  { background-color: var(--ds-color-danger); }
.ds-progress-bar-info    { background-color: var(--ds-color-info); }

/* Timeline */
.ds-timeline {
  position: relative;
  padding-left: var(--ds-space-6);
}
.ds-timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 9px;
  width: 2px;
  background-color: var(--ds-color-border);
}
.ds-timeline-item {
  position: relative;
  margin-bottom: var(--ds-space-4);
}
.ds-timeline-item:last-child {
  margin-bottom: 0;
}
.ds-timeline-marker {
  position: absolute;
  left: calc(-1 * var(--ds-space-6) + 1px);
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--ds-color-surface);
  border: 2px solid var(--ds-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-timeline-marker-success { border-color: var(--ds-color-success); }
.ds-timeline-marker-warning { border-color: var(--ds-color-warning); }
.ds-timeline-marker-danger  { border-color: var(--ds-color-danger); }
.ds-timeline-marker-info    { border-color: var(--ds-color-info); }

/* Tree View */
.ds-tree-view {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text);
}
.ds-tree-root,
.ds-tree-sub {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.ds-tree-sub {
  padding-left: var(--ds-space-4);
  margin-left: var(--ds-space-2);
  border-left: 1px dashed var(--ds-color-border);
}
.ds-tree-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  padding: 0.35rem var(--ds-space-2);
  border-radius: var(--ds-radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--ds-transition-fast);
}
.ds-tree-item:hover {
  background-color: var(--ds-color-surface-hover);
}
.ds-tree-toggle,
.ds-tree-bullet {
  width: 14px;
  text-align: center;
  color: var(--ds-color-text-muted);
  font-size: 12px;
}

/* ERP Approval Tracker, Filter Bar, Record Header & Offline Banner */
.ds-approval-tracker {
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: var(--ds-space-2);
}
.ds-approval-step {
  min-width: 90px;
}
.ds-filter-bar,
.ds-record-header {
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-card-radius);
  box-shadow: var(--ds-shadow-xs);
}
.ds-offline-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--ds-z-toast, 1090);
  background-color: var(--ds-color-danger);
  color: #ffffff;
  box-shadow: var(--ds-shadow-lg);
}

/* ── 15. Dialogs, Drawers, Toasts & Skeletons ────────────────────────────── */
.ds-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: var(--ds-z-modal, 1055);
}
.ds-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  max-width: 100vw;
  background-color: var(--ds-color-surface);
  box-shadow: var(--ds-shadow-2xl);
  display: flex;
  flex-direction: column;
  animation: ds-drawer-slide 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ds-drawer-slide {
  from { opacity: 0.8; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ds-drawer-right { right: 0; border-left: 1px solid var(--ds-color-border); }
.ds-drawer-left  { left: 0; border-right: 1px solid var(--ds-color-border); }
.ds-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-4) var(--ds-space-5);
  border-bottom: 1px solid var(--ds-color-border);
}
.ds-drawer-title {
  margin: 0;
  font-size: var(--ds-font-size-lg);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
}
.ds-drawer-subtitle {
  margin: 2px 0 0 0;
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-muted);
}
.ds-drawer-body {
  padding: var(--ds-space-5);
  overflow-y: auto;
  flex-grow: 1;
  color: var(--ds-color-text);
}
.ds-drawer-footer {
  padding: var(--ds-space-3) var(--ds-space-5);
  border-top: 1px solid var(--ds-color-border);
  background-color: var(--ds-color-surface-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--ds-space-2);
}

.ds-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-4);
  background-color: var(--ds-color-surface);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-lg);
  border: 1px solid var(--ds-color-border);
  min-width: 280px;
  max-width: calc(100vw - 2rem);
}
.ds-toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ds-color-text-muted);
  margin-left: auto;
  padding: 0 2px;
}

.ds-skeleton {
  background: linear-gradient(90deg, var(--ds-color-surface-subtle) 25%, var(--ds-color-surface-hover) 50%, var(--ds-color-surface-subtle) 75%);
  background-size: 200% 100%;
  animation: ds-skeleton-pulse 1.5s infinite;
  border-radius: var(--ds-radius-sm);
}
.ds-skeleton-circle { border-radius: 50%; }
@keyframes ds-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}



/* ══════════════════════════════════════════════════════════════════════════════
   MELODI ERP — ZERO-BOOTSTRAP COMPREHENSIVE COMPATIBILITY & SYSTEM ENGINE
   Completely replaces Bootstrap 5 styles with semantic token-based styling.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 16. Box-Sizing & Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── 17. Complete Grid System ───────────────────────────────────────────────── */
.container,
.ds-container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ds-space-4, 1rem);
  padding-right: var(--ds-space-4, 1rem);
}

.container-fluid,
.ds-container-fluid {
  width: 100%;
  padding-left: var(--ds-space-4, 1.25rem);
  padding-right: var(--ds-space-4, 1.25rem);
}

.row,
.ds-row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(-0.5 * var(--ds-gutter-x, 1.5rem));
  margin-right: calc(-0.5 * var(--ds-gutter-x, 1.5rem));
}

.row > *,
.ds-row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-left: calc(var(--ds-gutter-x, 1.5rem) * 0.5);
  padding-right: calc(var(--ds-gutter-x, 1.5rem) * 0.5);
}

/* Base Columns (1 to 12) */
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { width: 8.333333%; }
.col-2 { width: 16.666667%; }
.col-3 { width: 25%; }
.col-4 { width: 33.333333%; }
.col-5 { width: 41.666667%; }
.col-6 { width: 50%; }
.col-7 { width: 58.333333%; }
.col-8 { width: 66.666667%; }
.col-9 { width: 75%; }
.col-10 { width: 83.333333%; }
.col-11 { width: 91.666667%; }
.col-12 { width: 100%; }

/* Responsive Breakpoints */
@media (min-width: 576px) {
  .col-sm-auto { flex: 0 0 auto; width: auto; }
  .col-sm-1 { width: 8.333333%; }
  .col-sm-2 { width: 16.666667%; }
  .col-sm-3 { width: 25%; }
  .col-sm-4 { width: 33.333333%; }
  .col-sm-5 { width: 41.666667%; }
  .col-sm-6 { width: 50%; }
  .col-sm-7 { width: 58.333333%; }
  .col-sm-8 { width: 66.666667%; }
  .col-sm-9 { width: 75%; }
  .col-sm-10 { width: 83.333333%; }
  .col-sm-11 { width: 91.666667%; }
  .col-sm-12 { width: 100%; }
}

@media (min-width: 768px) {
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-1 { width: 8.333333%; }
  .col-md-2 { width: 16.666667%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.333333%; }
  .col-md-5 { width: 41.666667%; }
  .col-md-6 { width: 50%; }
  .col-md-7 { width: 58.333333%; }
  .col-md-8 { width: 66.666667%; }
  .col-md-9 { width: 75%; }
  .col-md-10 { width: 83.333333%; }
  .col-md-11 { width: 91.666667%; }
  .col-md-12 { width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-1 { width: 8.333333%; }
  .col-lg-2 { width: 16.666667%; }
  .col-lg-3 { width: 25%; }
  .col-lg-4 { width: 33.333333%; }
  .col-lg-5 { width: 41.666667%; }
  .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.333333%; }
  .col-lg-8 { width: 66.666667%; }
  .col-lg-9 { width: 75%; }
  .col-lg-10 { width: 83.333333%; }
  .col-lg-11 { width: 91.666667%; }
  .col-lg-12 { width: 100%; }
}

@media (min-width: 1200px) {
  .col-xl-auto { flex: 0 0 auto; width: auto; }
  .col-xl-1 { width: 8.333333%; }
  .col-xl-2 { width: 16.666667%; }
  .col-xl-3 { width: 25%; }
  .col-xl-4 { width: 33.333333%; }
  .col-xl-5 { width: 41.666667%; }
  .col-xl-6 { width: 50%; }
  .col-xl-7 { width: 58.333333%; }
  .col-xl-8 { width: 66.666667%; }
  .col-xl-9 { width: 75%; }
  .col-xl-10 { width: 83.333333%; }
  .col-xl-11 { width: 91.666667%; }
  .col-xl-12 { width: 100%; }
}

/* Gutters */
.g-0 { --ds-gutter-x: 0; }
.g-1 { --ds-gutter-x: var(--ds-space-1, 0.25rem); }
.g-2 { --ds-gutter-x: var(--ds-space-2, 0.5rem); }
.g-3 { --ds-gutter-x: var(--ds-space-4, 1rem); }
.g-4 { --ds-gutter-x: var(--ds-space-6, 1.5rem); }
.g-5 { --ds-gutter-x: var(--ds-space-8, 3rem); }

.gy-1 > * { margin-top: var(--ds-space-1, 0.25rem); }
.gy-2 > * { margin-top: var(--ds-space-2, 0.5rem); }
.gy-3 > * { margin-top: var(--ds-space-4, 1rem); }
.gy-4 > * { margin-top: var(--ds-space-6, 1.5rem); }
.gy-5 > * { margin-top: var(--ds-space-8, 3rem); }

/* ── 18. Flexbox Utilities ──────────────────────────────────────────────────── */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-inline { display: inline !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-inline-flex { display: inline-flex !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
}

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-fill { flex: 1 1 auto !important; }
.flex-grow-0 { flex-grow: 0 !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-shrink-1 { flex-shrink: 1 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-evenly { justify-content: space-evenly !important; }

@media (min-width: 768px) {
  .justify-content-md-end { justify-content: flex-end !important; }
  .justify-content-md-between { justify-content: space-between !important; }
  .flex-md-row { flex-direction: row !important; }
}

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

@media (min-width: 768px) {
  .align-items-md-center { align-items: center !important; }
}

.align-self-auto { align-self: auto !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }
.align-self-center { align-self: center !important; }
.align-self-stretch { align-self: stretch !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: var(--ds-space-1, 0.25rem) !important; }
.gap-2 { gap: var(--ds-space-2, 0.5rem) !important; }
.gap-3 { gap: var(--ds-space-3, 1rem) !important; }
.gap-4 { gap: var(--ds-space-4, 1.5rem) !important; }
.gap-5 { gap: var(--ds-space-6, 3rem) !important; }

/* ── 19. Spacing Utilities ──────────────────────────────────────────────────── */
.m-0 { margin: 0 !important; }
.m-1 { margin: var(--ds-space-1, 0.25rem) !important; }
.m-2 { margin: var(--ds-space-2, 0.5rem) !important; }
.m-3 { margin: var(--ds-space-4, 1rem) !important; }
.m-4 { margin: var(--ds-space-6, 1.5rem) !important; }
.m-5 { margin: var(--ds-space-8, 3rem) !important; }
.m-auto { margin: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--ds-space-1, 0.25rem) !important; }
.mt-2 { margin-top: var(--ds-space-2, 0.5rem) !important; }
.mt-3 { margin-top: var(--ds-space-4, 1rem) !important; }
.mt-4 { margin-top: var(--ds-space-6, 1.5rem) !important; }
.mt-5 { margin-top: var(--ds-space-8, 3rem) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--ds-space-1, 0.25rem) !important; }
.mb-2 { margin-bottom: var(--ds-space-2, 0.5rem) !important; }
.mb-3 { margin-bottom: var(--ds-space-4, 1rem) !important; }
.mb-4 { margin-bottom: var(--ds-space-6, 1.5rem) !important; }
.mb-5 { margin-bottom: var(--ds-space-8, 3rem) !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: var(--ds-space-1, 0.25rem) !important; }
.ms-2 { margin-left: var(--ds-space-2, 0.5rem) !important; }
.ms-3 { margin-left: var(--ds-space-4, 1rem) !important; }
.ms-4 { margin-left: var(--ds-space-6, 1.5rem) !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: var(--ds-space-1, 0.25rem) !important; }
.me-2 { margin-right: var(--ds-space-2, 0.5rem) !important; }
.me-3 { margin-right: var(--ds-space-4, 1rem) !important; }
.me-4 { margin-right: var(--ds-space-6, 1.5rem) !important; }
.me-auto { margin-right: auto !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: var(--ds-space-1) !important; margin-right: var(--ds-space-1) !important; }
.mx-2 { margin-left: var(--ds-space-2) !important; margin-right: var(--ds-space-2) !important; }
.mx-3 { margin-left: var(--ds-space-4) !important; margin-right: var(--ds-space-4) !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: var(--ds-space-1) !important; margin-bottom: var(--ds-space-1) !important; }
.my-2 { margin-top: var(--ds-space-2) !important; margin-bottom: var(--ds-space-2) !important; }
.my-3 { margin-top: var(--ds-space-4) !important; margin-bottom: var(--ds-space-4) !important; }
.my-4 { margin-top: var(--ds-space-6) !important; margin-bottom: var(--ds-space-6) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--ds-space-1, 0.25rem) !important; }
.p-2 { padding: var(--ds-space-2, 0.5rem) !important; }
.p-3 { padding: var(--ds-space-4, 1rem) !important; }
.p-4 { padding: var(--ds-space-6, 1.5rem) !important; }
.p-5 { padding: var(--ds-space-8, 3rem) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: var(--ds-space-1) !important; }
.pt-2 { padding-top: var(--ds-space-2) !important; }
.pt-3 { padding-top: var(--ds-space-4) !important; }
.pt-4 { padding-top: var(--ds-space-6) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: var(--ds-space-1) !important; }
.pb-2 { padding-bottom: var(--ds-space-2) !important; }
.pb-3 { padding-bottom: var(--ds-space-4) !important; }
.pb-4 { padding-bottom: var(--ds-space-6) !important; }

.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: var(--ds-space-1) !important; }
.ps-2 { padding-left: var(--ds-space-2) !important; }
.ps-3 { padding-left: var(--ds-space-4) !important; }
.ps-4 { padding-left: var(--ds-space-6) !important; }

.pe-0 { padding-right: 0 !important; }
.pe-1 { padding-right: var(--ds-space-1) !important; }
.pe-2 { padding-right: var(--ds-space-2) !important; }
.pe-3 { padding-right: var(--ds-space-4) !important; }
.pe-4 { padding-right: var(--ds-space-6) !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: var(--ds-space-1) !important; padding-right: var(--ds-space-1) !important; }
.px-2 { padding-left: var(--ds-space-2) !important; padding-right: var(--ds-space-2) !important; }
.px-3 { padding-left: var(--ds-space-4) !important; padding-right: var(--ds-space-4) !important; }
.px-4 { padding-left: var(--ds-space-6) !important; padding-right: var(--ds-space-6) !important; }
.px-5 { padding-left: var(--ds-space-8) !important; padding-right: var(--ds-space-8) !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: var(--ds-space-1) !important; padding-bottom: var(--ds-space-1) !important; }
.py-2 { padding-top: var(--ds-space-2) !important; padding-bottom: var(--ds-space-2) !important; }
.py-3 { padding-top: var(--ds-space-4) !important; padding-bottom: var(--ds-space-4) !important; }
.py-4 { padding-top: var(--ds-space-6) !important; padding-bottom: var(--ds-space-6) !important; }
.py-5 { padding-top: var(--ds-space-8) !important; padding-bottom: var(--ds-space-8) !important; }

/* ── 20. Typography Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }

.text-muted { color: var(--ds-color-text-muted, #64748b) !important; }
.text-white { color: #ffffff !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.6) !important; }
.text-dark { color: var(--ds-color-text, #0f172a) !important; }
.text-primary { color: var(--ds-color-primary, #002a4e) !important; }
.text-secondary { color: var(--ds-color-text-muted, #64748b) !important; }
.text-success { color: var(--ds-color-success, #10b981) !important; }
.text-danger { color: var(--ds-color-danger, #ef4444) !important; }
.text-warning { color: var(--ds-color-warning, #f59e0b) !important; }
.text-info { color: var(--ds-color-info, #06b6d4) !important; }

.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

.small { font-size: var(--ds-font-size-sm, 0.875rem) !important; }
.x-small { font-size: var(--ds-font-size-xs, 0.75rem) !important; }
.lead { font-size: 1.15rem; font-weight: 300; }

.fs-1 { font-size: 2.25rem !important; }
.fs-2 { font-size: 1.75rem !important; }
.fs-3 { font-size: 1.5rem !important; }
.fs-4 { font-size: 1.25rem !important; }
.fs-5 { font-size: 1.125rem !important; }
.fs-6 { font-size: 0.95rem !important; }

.lh-1 { line-height: 1 !important; }
.lh-sm { line-height: 1.25 !important; }
.lh-base { line-height: 1.5 !important; }
.lh-lg { line-height: 1.8 !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-decoration-none { text-decoration: none !important; }

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

/* ── 21. Sizing & Positioning Utilities ─────────────────────────────────────── */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }
.min-vh-100 { min-height: 100vh !important; }

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* ── 22. Borders & Shadows ──────────────────────────────────────────────────── */
.border { border: 1px solid var(--ds-color-border, #e2e8f0) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--ds-color-border, #e2e8f0) !important; }
.border-bottom { border-bottom: 1px solid var(--ds-color-border, #e2e8f0) !important; }
.border-start { border-left: 1px solid var(--ds-color-border, #e2e8f0) !important; }
.border-end { border-right: 1px solid var(--ds-color-border, #e2e8f0) !important; }
.border-white { border-color: #ffffff !important; }

.rounded { border-radius: var(--ds-radius-md, 0.5rem) !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded-1 { border-radius: var(--ds-radius-sm, 0.25rem) !important; }
.rounded-2 { border-radius: var(--ds-radius-md, 0.5rem) !important; }
.rounded-3 { border-radius: var(--ds-radius-lg, 0.75rem) !important; }
.rounded-4 { border-radius: var(--ds-radius-xl, 1rem) !important; }
.rounded-5 { border-radius: 1.5rem !important; }
.rounded-pill { border-radius: 9999px !important; }
.rounded-circle { border-radius: 50% !important; }

.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--ds-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05)) !important; }
.shadow { box-shadow: var(--ds-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1)) !important; }
.shadow-lg { box-shadow: var(--ds-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1)) !important; }

/* ── 23. Complete Native Modals ─────────────────────────────────────────────── */
body.modal-open {
  overflow: hidden !important;
  padding-right: var(--ds-scrollbar-width, 0);
}

.modal,
.ds-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--ds-z-modal, 1050);
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show,
.ds-modal.show {
  display: block !important;
}

.modal-backdrop,
.ds-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: calc(var(--ds-z-modal, 1050) - 10);
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.15s linear;
}

.modal-backdrop.show,
.ds-modal-backdrop.show {
  opacity: 1 !important;
}

/* Standalone ConfirmDialog wrapper where .ds-modal-backdrop wraps .ds-modal-dialog */
.ds-modal-backdrop:has(.ds-modal-dialog) {
  z-index: var(--ds-z-modal, 1050);
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-4);
  overflow-y: auto;
}
.ds-modal-backdrop:has(.ds-modal-dialog) .ds-modal-dialog {
  width: 100%;
  margin: auto;
  transform: none;
  pointer-events: auto;
}

.modal-dialog,
.ds-modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 540px;
  pointer-events: none;
  transform: translateY(-20px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.show .modal-dialog,
.ds-modal.show .ds-modal-dialog {
  transform: none !important;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-sm, .ds-modal-sm { max-width: 400px; }
.modal-md, .ds-modal-md { max-width: 540px; }
.modal-lg, .ds-modal-lg { max-width: 800px; }
.modal-xl, .ds-modal-xl { max-width: 1140px; }

@media (max-width: 575.98px) {
  .modal-dialog,
  .ds-modal-dialog {
    margin: 0.75rem;
    max-width: calc(100vw - 1.5rem);
  }
  .modal-dialog-centered {
    min-height: calc(100% - 1.5rem);
  }
  .modal-header,
  .ds-modal-header,
  .modal-body,
  .ds-modal-body,
  .modal-footer,
  .ds-modal-footer {
    padding: var(--ds-space-3, 0.75rem) var(--ds-space-4, 1rem);
  }
}

.modal-content,
.ds-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--ds-color-surface, #ffffff);
  background-clip: padding-box;
  border: 1px solid var(--ds-color-border, #e2e8f0);
  border-radius: var(--ds-radius-xl, 1rem);
  box-shadow: var(--ds-shadow-2xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
  outline: 0;
  overflow: hidden;
}

.modal-header,
.ds-modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-space-4, 1rem) var(--ds-space-5, 1.25rem);
  border-bottom: 1px solid var(--ds-color-border, #e2e8f0);
}

.modal-title,
.ds-modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: var(--ds-font-size-lg, 1.125rem);
  font-weight: var(--ds-font-weight-semibold, 600);
  color: var(--ds-color-text, #0f172a);
}

.modal-body,
.ds-modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: var(--ds-space-5, 1.25rem);
  overflow-y: auto;
  color: var(--ds-color-text, #0f172a);
}

.modal-footer,
.ds-modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: var(--ds-space-4, 1rem) var(--ds-space-5, 1.25rem);
  border-top: 1px solid var(--ds-color-border, #e2e8f0);
  gap: var(--ds-space-2, 0.5rem);
}

.btn-close,
.ds-modal-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: var(--ds-color-text-muted, #64748b);
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.414 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: var(--ds-radius-sm, 0.25rem);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-close:hover,
.ds-modal-close:hover {
  opacity: 1;
}

.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ── 24. Native Nav & Tabs ──────────────────────────────────────────────────── */
.nav,
.ds-nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  gap: var(--ds-space-1, 0.25rem);
}

.nav-tabs {
  border-bottom: 1px solid var(--ds-color-border, #e2e8f0);
}

.nav-pills .nav-link {
  border-radius: var(--ds-radius-pill, 9999px);
}

.nav-fill .nav-item {
  flex: 1 1 auto;
  text-align: center;
}

.nav-link,
.ds-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-2, 0.5rem) var(--ds-space-4, 1rem);
  font-size: var(--ds-font-size-sm, 0.875rem);
  font-weight: var(--ds-font-weight-medium, 500);
  color: var(--ds-color-text-muted, #64748b);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-md, 0.5rem);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-link:hover,
.ds-tab-btn:hover {
  color: var(--ds-color-text, #0f172a);
  background-color: var(--ds-color-surface-hover, #f8fafc);
}

.nav-link.active,
.ds-tab-btn.active {
  color: var(--ds-color-primary, #002a4e);
  background-color: var(--ds-color-surface, #ffffff);
  border-color: var(--ds-color-border, #e2e8f0);
  font-weight: var(--ds-font-weight-semibold, 600);
}

.nav-pills .nav-link.active {
  background-color: var(--ds-color-primary, #002a4e) !important;
  color: #ffffff !important;
}

.tab-content,
.ds-tab-content {
  width: 100%;
}

.tab-pane,
.ds-tab-pane {
  display: none;
}

.tab-pane.active,
.ds-tab-pane.active {
  display: block !important;
}

.fade {
  transition: opacity 0.15s linear;
}

.fade:not(.show) {
  opacity: 0;
}

.fade.show {
  opacity: 1;
}

/* ── 25. Native Collapse ────────────────────────────────────────────────────── */
.collapse:not(.show) {
  display: none !important;
}

.collapsing {
  height: 0;
  overflow: hidden;
  transition: height 0.25s ease;
}

/* ── 26. Native Dropdowns ───────────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu,
.ds-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--ds-z-dropdown, 1000);
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: var(--ds-font-size-sm, 0.875rem);
  color: var(--ds-color-text, #0f172a);
  text-align: left;
  list-style: none;
  background-color: var(--ds-color-surface, #ffffff);
  background-clip: padding-box;
  border: 1px solid var(--ds-color-border, #e2e8f0);
  border-radius: var(--ds-radius-lg, 0.75rem);
  box-shadow: var(--ds-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

.dropdown-menu-end {
  left: auto;
  right: 0;
}

.dropdown-menu.show,
.ds-dropdown-menu.show {
  display: block !important;
}

.dropdown-item,
.ds-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.4rem 1rem;
  clear: both;
  font-weight: 400;
  color: var(--ds-color-text, #0f172a);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover,
.ds-dropdown-item:hover {
  background-color: var(--ds-color-surface-hover, #f8fafc);
  color: var(--ds-color-primary, #002a4e);
}

.dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid var(--ds-color-border, #e2e8f0);
}

/* ── 27. Native Badges & Subtle Colors ──────────────────────────────────────── */
.badge,
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--ds-radius-pill, 9999px);
}

.bg-primary { background-color: var(--ds-color-primary, #002a4e) !important; color: #ffffff !important; }
.bg-secondary { background-color: var(--ds-color-text-muted, #64748b) !important; color: #ffffff !important; }
.bg-success { background-color: var(--ds-color-success, #10b981) !important; color: #ffffff !important; }
.bg-danger { background-color: var(--ds-color-danger, #ef4444) !important; color: #ffffff !important; }
.bg-warning { background-color: var(--ds-color-warning, #f59e0b) !important; color: #212529 !important; }
.bg-info { background-color: var(--ds-color-info, #06b6d4) !important; color: #ffffff !important; }
.bg-light { background-color: var(--ds-color-surface-subtle, #f8fafc) !important; color: var(--ds-color-text, #0f172a) !important; }
.bg-dark { background-color: var(--ds-color-bg-dark, #001f3b) !important; color: #ffffff !important; }
.bg-white { background-color: var(--ds-color-surface, #ffffff) !important; color: var(--ds-color-text, #0f172a); }

/* Subtle Variants */
.bg-primary-subtle { background-color: var(--ds-color-primary-subtle, rgba(0, 42, 78, 0.1)) !important; }
.bg-success-subtle { background-color: var(--ds-color-success-subtle, rgba(16, 185, 129, 0.12)) !important; }
.bg-danger-subtle { background-color: var(--ds-color-danger-subtle, rgba(239, 68, 68, 0.12)) !important; }
.bg-warning-subtle { background-color: var(--ds-color-warning-subtle, rgba(245, 158, 11, 0.15)) !important; }
.bg-info-subtle { background-color: var(--ds-color-info-subtle, rgba(6, 182, 212, 0.12)) !important; }
.bg-secondary-subtle { background-color: rgba(100, 116, 139, 0.12) !important; }

.border-primary-subtle { border-color: rgba(0, 42, 78, 0.2) !important; }
.border-success-subtle { border-color: rgba(16, 185, 129, 0.25) !important; }
.border-danger-subtle { border-color: rgba(239, 68, 68, 0.25) !important; }
.border-warning-subtle { border-color: rgba(245, 158, 11, 0.3) !important; }
.border-info-subtle { border-color: rgba(6, 182, 212, 0.25) !important; }
.border-secondary-subtle { border-color: rgba(100, 116, 139, 0.2) !important; }

/* ── 28. Native Buttons & Groups ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ds-color-text, #0f172a);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.85rem;
  font-size: var(--ds-font-size-sm, 0.875rem);
  border-radius: var(--ds-radius-md, 0.5rem);
  transition: all 0.15s ease-in-out;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: var(--ds-font-size-xs, 0.75rem);
  border-radius: var(--ds-radius-sm, 0.375rem);
}

.btn-lg {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  border-radius: var(--ds-radius-lg, 0.625rem);
}

.btn-primary {
  background-color: var(--ds-color-primary, #002a4e);
  border-color: var(--ds-color-primary, #002a4e);
  color: #ffffff;
}
.btn-primary:hover {
  filter: brightness(1.1);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--ds-color-text-muted, #64748b);
  border-color: var(--ds-color-text-muted, #64748b);
  color: #ffffff;
}
.btn-secondary:hover {
  filter: brightness(1.1);
  color: #ffffff;
}

.btn-light {
  background-color: var(--ds-color-surface, #ffffff);
  border-color: var(--ds-color-border, #e2e8f0);
  color: var(--ds-color-text, #0f172a);
}
.btn-light:hover {
  background-color: var(--ds-color-surface-hover, #f8fafc);
  color: var(--ds-color-text, #0f172a);
}

.btn-dark {
  background-color: var(--ds-color-bg-dark, #001f3b);
  border-color: var(--ds-color-bg-dark, #001f3b);
  color: #ffffff;
}
.btn-dark:hover {
  filter: brightness(1.15);
  color: #ffffff;
}

.btn-danger {
  background-color: var(--ds-color-danger, #ef4444);
  border-color: var(--ds-color-danger, #ef4444);
  color: #ffffff;
}
.btn-danger:hover {
  filter: brightness(0.92);
  color: #ffffff;
}

.btn-outline-primary {
  color: var(--ds-color-primary, #002a4e);
  border-color: var(--ds-color-primary, #002a4e);
}
.btn-outline-primary:hover {
  background-color: var(--ds-color-primary, #002a4e);
  color: #ffffff;
}

.btn-outline-secondary {
  color: var(--ds-color-text-muted, #64748b);
  border-color: var(--ds-color-border, #e2e8f0);
}
.btn-outline-secondary:hover {
  background-color: var(--ds-color-surface-hover, #f8fafc);
  color: var(--ds-color-text, #0f172a);
}

.btn-outline-danger {
  color: var(--ds-color-danger, #ef4444);
  border-color: var(--ds-color-danger, #ef4444);
}
.btn-outline-danger:hover {
  background-color: var(--ds-color-danger, #ef4444);
  color: #ffffff;
}

.btn-group {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* ── 29. Native Forms & Inputs ──────────────────────────────────────────────── */
.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  font-size: var(--ds-font-size-sm, 0.875rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ds-color-text, #0f172a);
  background-color: var(--ds-color-surface, #ffffff);
  background-clip: padding-box;
  border: 1px solid var(--ds-color-border, #e2e8f0);
  border-radius: var(--ds-radius-md, 0.5rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ds-color-primary, #002a4e);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 42, 78, 0.15);
}

.form-control-sm,
.form-select-sm {
  padding: 0.25rem 0.6rem;
  font-size: var(--ds-font-size-xs, 0.75rem);
  border-radius: var(--ds-radius-sm, 0.375rem);
}

.form-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: var(--ds-font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--ds-color-text, #0f172a);
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: var(--ds-font-size-sm, 0.875rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ds-color-text-muted, #64748b);
  text-align: center;
  white-space: nowrap;
  background-color: var(--ds-color-surface-subtle, #f8fafc);
  border: 1px solid var(--ds-color-border, #e2e8f0);
}

.input-group > :not(:last-child):not(.dropdown-toggle) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > :not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}

.form-check-input {
  float: left;
  margin-left: -1.5em;
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: var(--ds-color-surface, #ffffff);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid var(--ds-color-border, #e2e8f0);
  appearance: none;
  cursor: pointer;
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25em;
}

.form-check-input:checked {
  background-color: var(--ds-color-primary, #002a4e);
  border-color: var(--ds-color-primary, #002a4e);
}

.form-switch .form-check-input {
  width: 2em;
  margin-left: -2.5em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  background-position: left center;
  border-radius: 2em;
  transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
  background-position: right center;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* ── 30. Native Spinners & Progress ─────────────────────────────────────────── */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: -0.125em;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: 0.75s linear infinite spinner-border-anim;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border-anim {
  to { transform: rotate(360deg); }
}

.progress {
  display: flex;
  height: 0.5rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: var(--ds-color-surface-subtle, #f1f5f9);
  border-radius: var(--ds-radius-pill, 9999px);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: var(--ds-color-primary, #002a4e);
  transition: width 0.4s ease;
}

/* ── 31. Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin-bottom: 0;
  list-style: none;
  font-size: var(--ds-font-size-sm, 0.875rem);
}

.breadcrumb-item + .breadcrumb-item::before {
  float: left;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  color: var(--ds-color-text-muted, #64748b);
  content: "/";
}

.breadcrumb-item.active {
  color: var(--ds-color-text-muted, #64748b);
}

/* ── 32. Offcanvas & Mobile Drawer (Zero-Bootstrap Native) ─────────────────── */
.offcanvas,
.ds-offcanvas {
  position: fixed;
  bottom: 0;
  z-index: var(--ds-z-modal, 1050);
  display: flex;
  flex-direction: column;
  max-width: 100%;
  color: var(--ds-color-text, #0f172a);
  visibility: hidden;
  background-color: var(--ds-color-surface, #ffffff);
  background-clip: padding-box;
  outline: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  box-shadow: var(--ds-shadow-2xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
}

.offcanvas-start,
.ds-offcanvas-start {
  top: 0;
  left: 0;
  width: var(--sidebar-width, 280px);
  border-right: 1px solid var(--ds-border-color, #e2e8f0);
  transform: translateX(-100%);
}

.offcanvas-end,
.ds-offcanvas-end {
  top: 0;
  right: 0;
  width: 400px;
  border-left: 1px solid var(--ds-border-color, #e2e8f0);
  transform: translateX(100%);
}

.offcanvas.show,
.ds-offcanvas.show {
  transform: none !important;
  visibility: visible !important;
}

.offcanvas-header,
.ds-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-space-4, 1rem) var(--ds-space-5, 1.25rem);
  border-bottom: 1px solid var(--ds-border-color, #e2e8f0);
}

.offcanvas-body,
.ds-offcanvas-body {
  flex-grow: 1;
  padding: var(--ds-space-4, 1rem);
  overflow-y: auto;
}

.offcanvas-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: calc(var(--ds-z-modal, 1050) - 1);
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.offcanvas-backdrop.show {
  opacity: 1;
}

body.offcanvas-open {
  overflow: hidden;
}

/* ── 33. Native Design System Sidebar (.ds-sidebar) ────────────────────────── */
.ds-sidebar {
  width: var(--sidebar-width, 280px);
  background-color: var(--ds-sidebar-bg, #1c1c1c);
  color: var(--ds-sidebar-text, #ffffff);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--ds-z-sticky, 900);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.ds-sidebar-brand {
  height: var(--header-height, 70px);
  display: flex;
  align-items: center;
  gap: var(--ds-space-3, 0.75rem);
  padding: 0 var(--ds-space-5, 1.25rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.ds-sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--ds-radius-md, 0.5rem);
  background: #ffffff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.ds-sidebar-brand-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ds-sidebar-brand-title {
  font-family: 'Inter', var(--ds-font-family, sans-serif);
  font-weight: 600;
  font-size: var(--ds-font-size-sm, 0.875rem);
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.ds-sidebar-brand-subtitle {
  font-size: 0.7rem;
  opacity: 0.65;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.ds-sidebar-menu {
  flex: 1;
  padding: var(--ds-space-4, 1rem) var(--ds-space-3, 0.75rem);
  overflow-y: auto;
  overflow-x: hidden;
}

.ds-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-1, 0.25rem);
}

.ds-sidebar-item {
  position: relative;
}

.ds-sidebar-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
  padding: var(--ds-space-2, 0.5rem) var(--ds-space-3, 0.75rem);
  border-radius: var(--ds-radius-md, 0.375rem);
  color: var(--ds-sidebar-link-color, #94a3b8) !important;
  text-decoration: none !important;
  font-size: var(--ds-font-size-sm, 0.875rem);
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
}

.ds-sidebar-link span {
  text-align: left !important;
}

.ds-sidebar-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.ds-sidebar-link.active {
  color: #ffffff !important;
  background-color: var(--ds-color-primary, #3b82f6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.ds-sidebar-icon {
  width: 20px;
  height: 20px;
  margin-right: var(--ds-space-3, 0.75rem);
  flex-shrink: 0;
  object-fit: contain;
}

.ds-sidebar-footer {
  padding: var(--ds-space-3, 0.75rem) var(--ds-space-4, 1rem);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.ds-sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius-md, 0.5rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--ds-border-color, #e2e8f0);
  color: var(--ds-color-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.ds-sidebar-toggle:hover {
  background: var(--ds-color-surface-subtle, #f8fafc);
  border-color: var(--ds-color-primary, #3b82f6);
  color: var(--ds-color-primary, #3b82f6);
}

/* Collapsed state */
body.sidebar-collapsed .ds-sidebar,
body.sidebar-collapsed #admin-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  pointer-events: none;
}

body.sidebar-collapsed #admin-main {
  margin-left: 0 !important;
}
