/*
 * ============================================================================
 * LuxIran Analytics — Design System v2.0
 * A comprehensive, production-ready design system
 * ============================================================================
 */

/* ============================================================================
 * 1. DESIGN TOKENS / CSS CUSTOM PROPERTIES
 * ============================================================================ */
:root {
  /* --- Brand Colors --- */
  --brand-primary: #6C5CE7;
  --brand-primary-light: #A29BFE;
  --brand-primary-dark: #5A4BD1;
  --brand-primary-bg: rgba(108, 92, 231, 0.08);
  --brand-primary-bg-hover: rgba(108, 92, 231, 0.14);

  --brand-secondary: #C02F64;
  --brand-secondary-light: #E05A8B;

  /* --- Semantic Colors --- */
  --color-success: #00C48C;
  --color-success-light: rgba(0, 196, 140, 0.10);
  --color-success-dark: #00A877;

  --color-warning: #FFAA00;
  --color-warning-light: rgba(255, 170, 0, 0.10);
  --color-warning-dark: #E69800;

  --color-danger: #FF6B6B;
  --color-danger-light: rgba(255, 107, 107, 0.10);
  --color-danger-dark: #EE5A5A;

  --color-info: #48BFE3;
  --color-info-light: rgba(72, 191, 227, 0.10);
  --color-info-dark: #36A8D0;

  /* --- Neutral Colors --- */
  --color-text-primary: #2D3436;
  --color-text-secondary: #636E72;
  --color-text-muted: #B2BEC3;
  --color-text-inverse: #FFFFFF;

  --color-bg-body: #F8F9FC;
  --color-bg-card: #FFFFFF;
  --color-bg-elevated: #FFFFFF;
  --color-bg-hover: #F1F0FF;
  --color-bg-active: #E8E5FF;
  --color-bg-subtle: #F4F5F8;

  --color-border: #E9ECEF;
  --color-border-light: #F1F3F5;
  --color-border-focus: var(--brand-primary);

  /* --- Typography --- */
  --font-family: 'font-primary', 'font-regular', 'font-medium', 'font-bold', 'font-demi-bold', 'font-extra-bold', 'font-light', 'font-ultra-light', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.7rem;
  --font-size-sm: 0.8rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* --- Spacing --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* --- Border Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 10px 25px rgba(108, 92, 231, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 4px 14px rgba(108, 92, 231, 0.25);

  /* --- Transitions --- */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-Index Scale --- */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================================================
 * 2. GLOBAL RESETS & BASE
 * ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-body);
}

::selection {
  background-color: var(--brand-primary-bg-hover);
  color: var(--brand-primary-dark);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================================
 * 3. TYPOGRAPHY
 * ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.fw-normal { font-weight: var(--font-weight-normal) !important; }
.fw-medium { font-weight: var(--font-weight-medium) !important; }
.fw-semibold { font-weight: var(--font-weight-semibold) !important; }
.fw-bold { font-weight: var(--font-weight-bold) !important; }

.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-md { font-size: var(--font-size-md) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }
.text-3xl { font-size: var(--font-size-3xl) !important; }

.text-primary-custom { color: var(--brand-primary) !important; }
.text-success-custom { color: var(--color-success) !important; }
.text-warning-custom { color: var(--color-warning) !important; }
.text-danger-custom { color: var(--color-danger) !important; }
.text-info-custom { color: var(--color-info) !important; }

/* ============================================================================
 * 4. CARDS — Modern, Clean Design
 * ============================================================================ */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base);
  /* transform removed from transition — it creates stacking contexts that
     trap z-index children like datepicker popups */
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-5) var(--space-6);
}

.card-body {
  padding: var(--space-6);
}

/* Card hover effect (optional class) */
.card-interactive:hover {
  box-shadow: var(--shadow-card-hover);
}

/* Stat Card */
.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  background: var(--stat-accent, var(--brand-primary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}

.stat-card .stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card .stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.stat-card .stat-trend {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-2);
}

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

/* ============================================================================
 * 5. BUTTONS — Modern & Accessible
 * ============================================================================ */
.btn {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary {
  background: var(--brand-primary);
  color: var(--color-text-inverse);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--color-success);
  color: var(--color-text-inverse);
  border-color: var(--color-success);
}

.btn-success:hover {
  background: var(--color-success-dark);
  border-color: var(--color-success-dark);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background: var(--brand-primary);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
}

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

.btn-outline-success:hover {
  background: var(--color-success);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
}

.btn-label-primary {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  border-color: transparent;
}

.btn-label-primary:hover {
  background: var(--brand-primary-bg-hover);
}

.btn-label-secondary {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-label-secondary:hover {
  background: var(--color-border);
}

/* Button sizes */
.btn-sm {
  font-size: var(--font-size-xs);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
}

.btn-lg {
  font-size: var(--font-size-md);
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-lg);
}

/* Icon button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* ============================================================================
 * 6. BADGES — Status & Labels
 * ============================================================================ */
.badge {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 0.3em 0.75em;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.badge-danger {
  background: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.badge-info {
  background: var(--color-info-light);
  color: var(--color-info-dark);
}

.badge-secondary {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
}

/* Dot badge */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  display: inline-block;
}

.badge-dot.success { background: var(--color-success); }
.badge-dot.warning { background: var(--color-warning); }
.badge-dot.danger { background: var(--color-danger); }
.badge-dot.info { background: var(--color-info); }

/* ============================================================================
 * 7. FORMS — Clean & Accessible
 * ============================================================================ */
.form-control,
.form-select {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background-color: var(--color-bg-card);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.6;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
  outline: none;
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* Input group */
.input-group-text {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  background-color: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  padding: 0.5rem 0.875rem;
}

/* Form validation */
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--color-success);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--color-danger);
}

.invalid-feedback {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* ============================================================================
 * 8. TABLES — Modern Data Display
 * ============================================================================ */
.table {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.table > thead {
  background: var(--color-bg-subtle);
}

.table > thead th {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
  vertical-align: middle;
}

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

.table > tbody > tr:hover {
  background-color: var(--color-bg-hover) !important;
}

.table > tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

/* Striped */
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.01);
}

/* DataTables override */
.dataTables_wrapper .dataTables_filter input {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  padding: 0.45rem 0.85rem;
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
  outline: none;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  padding: 0.35rem 0.65rem;
  padding-inline-end: 1.75rem;
  font-size: var(--font-size-sm);
  min-width: 65px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--color-border) !important;
  margin: 0 2px;
  transition: all var(--transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--brand-primary-bg) !important;
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-primary);
}

/* ============================================================================
 * 9. NAVBAR — Clean & Professional
 * ============================================================================ */
.layout-navbar {
  background: var(--color-bg-card) !important;
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  min-height: 60px;
  z-index: var(--z-fixed);
}

.app-brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-brand-text {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

/* User dropdown avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: var(--color-success);
  border: 2px solid var(--color-bg-card);
  border-radius: 50%;
}

/* Navbar dropdown */
.navbar-dropdown .dropdown-menu {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  min-width: 220px;
  margin-top: var(--space-2);
}

.navbar-dropdown .dropdown-item {
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-dropdown .dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--brand-primary);
}

/* ============================================================================
 * 10. HORIZONTAL MENU — Modern Navigation
 * ============================================================================ */
.layout-menu-horizontal {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-xs);
}

.menu-horizontal .menu-inner {
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0;
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.menu-horizontal .menu-item {
  position: relative;
}

.menu-horizontal .menu-item .menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 1rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.menu-horizontal .menu-item .menu-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  border-radius: 2px;
  transition: width var(--transition-base);
}

.menu-horizontal .menu-item .menu-link:hover {
  color: var(--brand-primary);
  background: var(--brand-primary-bg);
}

.menu-horizontal .menu-item .menu-link:hover::before {
  width: 60%;
}

.menu-horizontal .menu-item .menu-link.active {
  color: var(--brand-primary);
  background: var(--brand-primary-bg);
  font-weight: var(--font-weight-semibold);
}

.menu-horizontal .menu-item .menu-link.active::before {
  width: 100%;
  background: var(--brand-primary);
}

.menu-horizontal .menu-item .menu-link .menu-icon {
  font-size: 1.15rem;
  transition: transform var(--transition-base);
}

.menu-horizontal .menu-item:hover .menu-link .menu-icon {
  transform: scale(1.1);
}

/* Logo alignment — lower logo to align vertically with menu items */
.navbar-brand.app-brand {
  padding-top: 2px;
  padding-bottom: 2px;
}

.navbar-brand.app-brand .app-brand-logo svg {
  margin-top: 2px;
}

/* Mobile menu improvements */
@media (max-width: 1199.98px) {
  .layout-menu-horizontal .menu-inner {
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2);
  }

  .layout-menu-horizontal .menu-item .menu-link {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
  }

  .layout-menu-horizontal .menu-item .menu-link::before {
    display: none;
  }

  .layout-menu-horizontal .menu-item .menu-link.active {
    background: var(--brand-primary-bg);
    border-inline-start: 3px solid var(--brand-primary);
  }
}

/* ============================================================================
 * 11. FOOTER
 * ============================================================================ */
.content-footer {
  border-top: 1px solid var(--color-border-light);
  background: transparent;
}

.content-footer .text-center {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================================================
 * 12. FILTER CARDS — Compact & Functional
 * ============================================================================ */
.filter-card {
  border: 1px solid var(--color-border-light) !important;
}

.filter-card .card-header {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.filter-card .card-header h6 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

/* ============================================================================
 * 13. EMPTY STATES
 * ============================================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 2rem;
  color: var(--color-text-muted);
}

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

.empty-state-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  max-width: 360px;
  margin: 0 auto;
}

/* ============================================================================
 * 14. LOADING STATES
 * ============================================================================ */
.loading-skeleton {
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-border-light) 50%, var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-circle {
  border-radius: var(--radius-full);
}

/* Spinner */
.spinner-custom {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--brand-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

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

/* ============================================================================
 * 15. TOASTS / NOTIFICATIONS
 * ============================================================================ */
.toast-custom {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-lg);
}

/* ============================================================================
 * 16. MODALS — Refined
 * ============================================================================ */
.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-5) var(--space-6);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-4) var(--space-6);
}

/* ============================================================================
 * 17. OFFCANVAS — Modern Side Panel
 * ============================================================================ */
.offcanvas {
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-xl);
  z-index: 1055 !important;
}

/* Ensure offcanvas backdrop is above everything */
.offcanvas-backdrop {
  z-index: 1050 !important;
}

/* Bootstrap 5 adds padding-right to body for scrollbar compensation.
   In RTL layout this causes a horizontal shift. Override it. */
body.offcanvas-open {
  overflow: hidden !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Prevent any transform on layout wrappers when offcanvas is open,
   as transforms create new stacking contexts */
body.offcanvas-open .layout-wrapper,
body.offcanvas-open .layout-page,
body.offcanvas-open .content-wrapper,
body.offcanvas-open .layout-container {
  transform: none !important;
}

.offcanvas-header {
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-5) var(--space-6);
}

.offcanvas-body {
  padding: var(--space-6);
  overflow-y: auto;
}

/* ============================================================================
 * 18. TOOLTIP — Custom
 * ============================================================================ */
.tooltip-inner {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: var(--color-text-primary);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  max-width: 280px;
}

/* ============================================================================
 * 19. DROPDOWN MENUS
 * ============================================================================ */
.dropdown-menu {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  overflow: hidden;
}

.dropdown-item {
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  color: var(--color-text-primary);
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--brand-primary);
}

.dropdown-item.active {
  background: var(--brand-primary);
  color: var(--color-text-inverse);
}

.dropdown-divider {
  border-color: var(--color-border-light);
  margin: var(--space-1) 0;
}

/* ============================================================================
 * 20. ANIMATIONS & MICRO-INTERACTIONS
 * ============================================================================ */

/* Fade in up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-scale-in {
  animation: scaleIn 0.25s ease-out forwards;
}

/* Slide in from right (RTL) */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-slide-in {
  animation: slideInRight 0.3s ease-out forwards;
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }
.stagger-6 { animation-delay: 0.3s; opacity: 0; }

/* Hover lift */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

/* Pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================================
 * 21. SCROLLBAR — Minimal & Clean
 * ============================================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================================================
 * 22. RESPONSIVE UTILITIES
 * ============================================================================ */

/* Hide on mobile, show on desktop */
@media (max-width: 767.98px) {
  .d-none-mobile {
    display: none !important;
  }
}

/* Show on mobile, hide on desktop */
@media (min-width: 768px) {
  .d-none-desktop {
    display: none !important;
  }
}

/* Card padding responsive */
@media (max-width: 767.98px) {
  .card-body {
    padding: var(--space-4);
  }

  .card-header {
    padding: var(--space-3) var(--space-4);
  }
}

/* Table responsive */
@media (max-width: 767.98px) {
  .table-responsive {
    border-radius: var(--radius-lg);
  }
}

/* ============================================================================
 * 23. BREADCRUMB
 * ============================================================================ */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: var(--font-size-xs);
}

.breadcrumb-item a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--brand-primary);
}

.breadcrumb-item.active {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* ============================================================================
 * 24. PROGRESS BAR
 * ============================================================================ */
.progress {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 6px;
}

.progress-bar {
  background: var(--brand-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================================================
 * 25. DATA-TABLES BUTTON STYLE OVERRIDE
 * ============================================================================ */
.dt-button-collection {
  max-width: 95vw !important;
  padding: var(--space-3) !important;
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--color-border-light) !important;
  box-shadow: var(--shadow-xl) !important;
  background: var(--color-bg-card) !important;
}

@media (min-width: 768px) {
  .dt-button-collection.two-column {
    width: 580px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
}

.dt-button-collection .dt-button.buttons-columnVisibility,
.dt-button-collection .dt-button.dropdown-item.buttons-columnVisibility {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3) !important;
  margin: 3px !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--color-border-light) !important;
  background: var(--color-bg-card) !important;
  color: var(--color-text-secondary) !important;
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-medium) !important;
  transition: all var(--transition-fast) !important;
  cursor: pointer;
}

.dt-button-collection .dt-button.buttons-columnVisibility.active {
  background: var(--brand-primary-bg) !important;
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  font-weight: var(--font-weight-semibold) !important;
}

.dt-button-collection .dt-button.buttons-columnVisibility.active::after {
  content: "\ea5e";
  font-family: "tabler-icons" !important;
  font-size: 1rem;
  font-weight: bold;
}

.dt-button-collection .dt-button.buttons-columnVisibility:not(.active)::after {
  content: "\eb3f";
  font-family: "tabler-icons" !important;
  opacity: 0.3;
  color: var(--color-text-muted);
}

.dt-button-collection .dt-button.buttons-columnVisibility:hover {
  background: var(--color-bg-hover) !important;
  border-color: var(--brand-primary) !important;
  transform: translateY(-1px);
}

.dt-button-collection .dt-button.btn-restore-column {
  grid-column: span 2;
  background: transparent !important;
  color: var(--color-danger) !important;
  border: 1px dashed var(--color-danger) !important;
  margin-top: var(--space-2) !important;
  justify-content: center !important;
  font-weight: var(--font-weight-semibold) !important;
  border-radius: var(--radius-md) !important;
}

@media (max-width: 767px) {
  .dt-button-collection .dt-button.btn-restore-column {
    grid-column: span 1;
  }
}

/* ============================================================================
 * 26. MISC UTILITY CLASSES
 * ============================================================================ */
.border-light-custom {
  border: 1px solid var(--color-border-light) !important;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
}

.rounded-custom {
  border-radius: var(--radius-xl) !important;
}

.shadow-custom {
  box-shadow: var(--shadow-card) !important;
}

.shadow-custom-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Status badge colors for orders */
.badge-processing { background-color: var(--color-warning-light); color: #8a6d3b; }
.badge-completed { background-color: var(--color-success-light); color: var(--color-success-dark); }
.badge-on-hold { background-color: var(--color-info-light); color: #0277bd; }
.badge-pws-in-stock { background-color: rgba(149, 128, 210, 0.15); color: #4527a0; }
.badge-pws-packaged { background-color: var(--color-bg-subtle); color: var(--color-text-secondary); }
.badge-pws-courier { background-color: rgba(176, 190, 197, 0.25); color: #263238; }
.badge-pws-post { background-color: var(--color-info-light); color: #01579b; }
.badge-cancelled { background-color: var(--color-danger-light); color: var(--color-danger-dark); }

/* Text currency style */
.text-currency {
  font-weight: var(--font-weight-bold);
  color: var(--color-success-dark);
}

/* Brand color override */
.text-primary {
  color: var(--brand-primary) !important;
}

.bg-primary {
  background-color: var(--brand-primary) !important;
}

/* ============================================================================
 * 27. PERSIAN DATE PICKER OVERRIDES — pdp-picker & pdp-time
 *
 * Root cause: animation keyframes (fadeInUp, scaleIn, slideInRight) used
 * non-"none" transform values (e.g. translateY(0)) in their "to" state.
 * Per CSS spec, any non-none transform creates a stacking context that
 * traps all z-index descendants — including the datepicker popup.
 * Fixed by changing "to" transforms to "none" in all keyframes.
 * The overrides below are defense-in-depth.
 * ============================================================================ */

/* --- pdp-picker: ensure calendar popup always renders on top --- */
.datepicker-container,
.datepicker-plot-area,
.pdp-container,
.pdp-component,
.pdp-dropdown,
.pdp-panel,
.pdp-wrapper,
.pdp-picker {
  z-index: 100000 !important;
}

/* Ensure #app containers don't clip the datepicker */
.card > .card-body > #app,
.card > .card-body form > .row > div > #app {
  position: relative;
  z-index: auto;
}

/* --- pdp-time: modern, professional styling --- */
.pdp-picker .pdp-time,
.pdp-picker .pdp-time-container {
  padding: var(--space-3) !important;
}

.pdp-picker .pdp-time .hour,
.pdp-picker .pdp-time .minute {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-1);
  background-color: var(--color-bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 40px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
  font-family: var(--font-family);
}

.pdp-picker .pdp-time .hour:hover,
.pdp-picker .pdp-time .minute:hover {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-bg);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
  transform: translateY(-1px);
}

.pdp-picker .pdp-time .hour:focus-within,
.pdp-picker .pdp-time .minute:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}

.pdp-picker .pdp-time .hour button,
.pdp-picker .pdp-time .minute button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdp-picker .pdp-time .hour button:hover,
.pdp-picker .pdp-time .minute button:hover {
  background: var(--brand-primary-bg-hover);
  transform: scale(1.15);
}

.pdp-picker .pdp-time .hour svg,
.pdp-picker .pdp-time .minute svg {
  width: 14px;
  height: 14px;
  fill: var(--color-text-secondary);
  transition: fill var(--transition-fast);
}

.pdp-picker .pdp-time .hour button:hover svg,
.pdp-picker .pdp-time .minute button:hover svg {
  fill: var(--brand-primary);
}

/* pdp-range: time separator label */
.pdp-range .pdp-time:nth-child(2)::before {
  content: "\23F0\00A0 انتخابگر اول شروع و دوم پایان";
  display: block;
  text-align: center;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  margin-top: var(--space-3);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.pdp-range .pdp-time:nth-child(2) {
  margin-top: 25px;
}

/* pdp-picker calendar day cells — modern hover */
.pdp-picker .pdp-day {
  border-radius: var(--radius-md) !important;
  transition: all var(--transition-fast) !important;
}

.pdp-picker .pdp-day:hover:not(.pdp-day-disable) {
  background: var(--brand-primary-bg) !important;
  transform: scale(1.08);
}

.pdp-picker .pdp-day.pdp-day-selected {
  background: var(--brand-primary) !important;
  color: var(--color-text-inverse) !important;
  box-shadow: var(--shadow-primary);
}

.pdp-picker .pdp-day.pdp-day-in-range {
  background: var(--brand-primary-bg) !important;
  color: var(--brand-primary) !important;
  border-radius: 0 !important;
}

/* pdp-picker header — modern */
.pdp-picker .pdp-header {
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-3) var(--space-4);
}

.pdp-picker .pdp-header .pdp-month,
.pdp-picker .pdp-header .pdp-year {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* Mobile: ensure picker is full-width and centered */
@media (max-width: 575.98px) {
  .pdp-picker .pdp-dropdown {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
}

/* ============================================================================
 * 28. TABLE SORT ICONS — Stable Alignment
 * ============================================================================ */
.table > thead th a {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Ensure sort icon doesn't shift header content */
.table > thead th a i {
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

/* Ensure consistent column padding */
.table > thead > tr > th,
.table > tbody > tr > td {
  white-space: nowrap;
}

/* ============================================================================
 * 29. PRICE FILTER & ACTIVE FILTER CHIPS
 * ============================================================================ */
#activeFiltersChipsContainer {
  border-bottom: 1px solid var(--color-border-light);
}

#activeFiltersChips .badge {
  transition: all var(--transition-fast);
}

#activeFiltersChips .badge:hover {
  opacity: 0.8;
  transform: scale(0.95);
}

#priceColumnSelect,
#priceOperatorSelect {
  min-height: 36px;
}

.price-input {
  direction: ltr !important;
  text-align: right;
}

/* Column visibility button enhancements */
.dt-button-collection .dt-button.buttons-columnVisibility.active::before {
  content: "\ea5e";
  font-family: "tabler-icons";
  font-size: 0.85rem;
  margin-inline-end: 0.5rem;
  color: var(--brand-primary);
}

.dt-button-collection .dt-button.buttons-columnVisibility:not(.active)::before {
  content: "\eb3f";
  font-family: "tabler-icons";
  font-size: 0.85rem;
  margin-inline-end: 0.5rem;
  opacity: 0.3;
  color: var(--color-text-muted);
}

/* Override the ::after pseudo-elements from before since we now use ::before */
.dt-button-collection .dt-button.buttons-columnVisibility.active::after,
.dt-button-collection .dt-button.buttons-columnVisibility:not(.active)::after {
  content: none;
}

/* ============================================================================
 * 30. RESPONSIVE PAGE-SPECIFIC OVERRIDES
 * ============================================================================ */

/* Stats grid responsive */
@media (max-width: 575.98px) {
  .stat-card .stat-value {
    font-size: var(--font-size-xl);
  }

  .stat-card {
    padding: var(--space-4);
  }
}

/* Filter form responsive */
@media (max-width: 767.98px) {
  .filter-card .card-body .row {
    gap: var(--space-3);
  }

  .filter-card .card-body .row > div {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Content wrapper */
.content-wrapper {
  background: var(--color-bg-body);
}

.container-p-y {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* ============================================================================
 * 31. DASHBOARD UI/UX ENHANCEMENTS — Cards, Tables, Micro-interactions
 * ============================================================================ */

/* --- Card hover: subtle lift and shadow --- */
.card.border-light-custom {
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card.border-light-custom:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(108, 92, 231, 0.15);
}

/* --- Card header interactive --- */
.card-header {
  transition: background-color var(--transition-fast);
}

/* --- Table row hover: enhanced visibility --- */
.table > tbody > tr {
  cursor: default;
}

.table > tbody > tr:hover > td {
  background-color: var(--color-bg-hover) !important;
  transition: background-color var(--transition-fast);
}

.table > tbody > tr:hover > td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.table > tbody > tr:hover > td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* --- Sort header hover --- */
.table > thead th a:hover {
  color: var(--brand-primary) !important;
}

.table > thead th a {
  transition: color var(--transition-fast);
}

/* --- Badge hover micro-interaction --- */
.badge {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.badge:hover {
  transform: scale(1.05);
}

/* --- Button icon hover: rotate/glow --- */
.btn-icon:hover {
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}

.btn-icon.btn-outline-primary:hover {
  background: var(--brand-primary-bg);
}

.btn-icon.btn-outline-success:hover {
  background: var(--color-success-light);
}

/* --- Active filter chips: professional pill style --- */
#activeFiltersChips .badge {
  cursor: pointer;
  user-select: none;
}

#activeFiltersChips .badge:active {
  transform: scale(0.95);
}

/* --- Stat card number counter effect --- */
.stat-card .stat-value {
  transition: color var(--transition-base);
}

.stat-card:hover .stat-value {
  color: var(--brand-primary-dark);
}

/* --- Empty state illustration fade-in --- */
.empty-state .empty-state-icon {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* --- Form select dropdown modern --- */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636E72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  padding-inline-start: 0.875rem;
  padding-inline-end: 2rem;
}

[dir='rtl'] .form-select {
  background-position: right 0.75rem center;
  padding-inline-start: 0.875rem;
  padding-inline-end: 2rem;
}

/* --- Smooth page transition on body --- */
body {
  opacity: 0;
  animation: fadeIn 0.25s ease-out 0.05s forwards;
}

/* --- Table striped subtle contrast --- */
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(248, 249, 252, 0.5);
}

/* --- Table responsive polish --- */
.table-responsive {
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

/* --- Datepicker filter card polish --- */
.card .card-body form .row.g-3 {
  align-items: flex-end;
}

/* --- Filter info bar: subtle animation --- */
.mt-3.p-3.rounded-custom {
  transition: background-color var(--transition-fast);
}

.mt-3.p-3.rounded-custom:hover {
  background-color: rgba(108, 92, 231, 0.04);
}

/* --- Comparison page: sparkline and stat cards --- */
.stat-card .sparkline {
  margin-top: var(--space-2);
}

/* --- User dropdown: smooth open --- */
.navbar-dropdown .dropdown-menu {
  animation: fadeInUp 0.2s ease-out;
  transform-origin: top;
}

/* --- Offcanvas: smooth slide-in --- */
.offcanvas {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Subtle number emphasis in tables --- */
.table .fw-bold {
  letter-spacing: -0.01em;
}

/* --- Badge inside table cells: vertical centering --- */
.table .badge {
  vertical-align: middle;
}

/* --- Button loading state --- */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-inline-start: 0.5rem;
  flex-shrink: 0;
}

/* --- Navbar scroll shadow --- */
.layout-navbar.scrolled {
  box-shadow: var(--shadow-md);
}

/* ============================================================================
 * 32. MERGE & AGGREGATE MODE
 * ============================================================================ */

/* Merged table styling */
#mergedTable {
  font-size: var(--font-size-sm);
}

#mergedTable thead th {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
  vertical-align: middle;
  background: var(--color-bg-subtle);
}

#mergedTable tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

#mergedTable tbody tr {
  transition: background-color var(--transition-fast);
}

#mergedTable tbody tr:hover {
  background-color: var(--color-bg-hover) !important;
}

#mergedTable tfoot tr {
  border-top: 2px solid var(--brand-primary) !important;
}

#mergedTable tfoot td {
  padding: var(--space-3) var(--space-4);
  font-weight: var(--font-weight-bold);
}

/* Merge toggle card */
#mergeCard .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Merge summary stat cards */
#mergeSummary .stat-card {
  padding: var(--space-4);
}

#mergeSummary .stat-card .stat-label {
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-1);
}

/* Smooth transitions for merge mode */
#mergeControls,
#mergeSummary,
#mergedTableContainer {
  transition: opacity 0.2s ease;
}

/* Merge mode active indicator */
#mergeStatusBadge {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================================
 * 33. USERS PAGE — Brand Badges, Bulk Actions, Warning Banners
 * ============================================================================ */

/* Brand count badge in users table */
.brand-count-badge {
  font-size: 0.65rem;
  padding: 0.25em 0.6em;
  min-width: 40px;
  text-align: center;
  font-weight: var(--font-weight-semibold);
}

/* Brand pill badge in users table */
.brand-badge {
  font-size: 0.65rem;
  padding: 0.2em 0.55em;
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-light);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.brand-badge:hover {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
}

/* Bulk actions sticky bar */
.bulk-actions-bar {
  background: var(--color-bg-card);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.2s ease-out;
}

/* Warning banner */
.alert-brand-warning {
  background: var(--color-warning-light);
  border: 1px solid rgba(255, 170, 0, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-brand-warning .alert-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

/* Select checkbox in DataTable */
.select-checkbox-col {
  width: 40px !important;
  text-align: center !important;
}

.select-all-checkbox,
.row-checkbox {
  cursor: pointer;
  width: 17px;
  height: 17px;
  accent-color: var(--brand-primary);
}

/* ============================================================================
 * 34. USER DROPDOWN — Enhanced
 * ============================================================================ */

.navbar-dropdown .dropdown-menu {
  animation: dropdownShow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
}

@keyframes dropdownShow {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.navbar-dropdown .dropdown-item {
  transition: all var(--transition-fast), padding-inline var(--transition-fast);
}

.navbar-dropdown .dropdown-item:hover {
  padding-inline-start: calc(var(--space-4) + 4px);
}

/* Navbar dropdown trigger hover */
.navbar-nav .dropdown-user > a:hover {
  background: var(--color-bg-hover);
}

/* ============================================================================
 * 35. BRAND ICON COLORS — Dashboard Unique Icons
 * ============================================================================ */

.brand-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-icon-circle:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
 * 36. SWEETALERT2 — RTL & Typography Alignment
 * ============================================================================ */
.swal2-popup {
  font-family: var(--font-family);
  direction: rtl;
  text-align: right;
  border-radius: var(--radius-xl);
}

.swal2-title {
  text-align: right !important;
  font-weight: var(--font-weight-semibold) !important;
  color: var(--color-text-primary) !important;
}

.swal2-html-container {
  text-align: right !important;
  direction: rtl;
  font-size: var(--font-size-sm) !important;
  color: var(--color-text-secondary) !important;
}

.swal2-confirm {
  border-radius: var(--radius-md);
  font-family: var(--font-family);
}

.swal2-cancel {
  border-radius: var(--radius-md);
  font-family: var(--font-family);
}

/* Custom classes applied by the app's Swal mixin (users page) */
.swal2-rtl,
.swal2-rtl .swal2-title,
.swal2-rtl .swal2-html-container {
  direction: rtl;
  text-align: right;
}

