/* ============================================
   BASE & VARIABLES
   ============================================ */
:root {
  /* Original Brand Colors */
  --brand-primary: #8b1f3a;
  --brand-secondary: #5b2f72;
  --brand-gradient: linear-gradient(135deg, #8b1f3a 0%, #5b2f72 100%);
  --brand-gradient-hover: linear-gradient(135deg, #9b2844 0%, #673688 100%);
  
  /* Semantic Colors */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* Grayscale */
  --dark: #1e293b;
  --light: #f8fafc;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Layout - Reduced sidebar width */
  --sidebar-width: 240px;
  --header-height: 64px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-collapsed-width: 76px;
}

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

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin-bottom: 0;
}

/* ============================================
   APP WRAPPER LAYOUT
   ============================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: var(--gray-50);
}

/* ============================================
   SIDEBAR - More Compact
   ============================================ */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--brand-gradient);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1040;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.brand-content {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.7rem;
  opacity: 0.8;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-section-title i {
  font-size: 0.85rem;
}

.nav-section-caret {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.nav-section-body {
  padding-top: 0.25rem;
}

.nav-section.is-collapsed .nav-section-body {
  display: none;
}

.nav-section.is-collapsed .nav-section-caret {
  transform: rotate(-90deg);
}

.nav-section-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.625rem 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
  margin-bottom: 0.25rem;
  position: relative;
}

.nav-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(3px);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: none;
  color: white;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.15);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.6875rem;
  opacity: 0.8;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.app-wrapper.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width);
}

.app-wrapper.sidebar-collapsed .brand-content,
.app-wrapper.sidebar-collapsed .nav-link span,
.app-wrapper.sidebar-collapsed .nav-section-title span,
.app-wrapper.sidebar-collapsed .nav-section-caret,
.app-wrapper.sidebar-collapsed .nav-badge,
.app-wrapper.sidebar-collapsed .user-info,
.app-wrapper.sidebar-collapsed .user-profile .bi-three-dots-vertical {
  display: none;
}

.app-wrapper.sidebar-collapsed .nav-link,
.app-wrapper.sidebar-collapsed .nav-section-toggle {
  justify-content: center;
}

.app-wrapper.sidebar-collapsed .nav-link i,
.app-wrapper.sidebar-collapsed .nav-section-title i {
  margin: 0;
}

.app-wrapper.sidebar-collapsed .sidebar-header,
.app-wrapper.sidebar-collapsed .user-profile {
  justify-content: center;
}

/* ============================================
   RTL LAYOUT OVERRIDES
   ============================================ */
html[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

html[dir="rtl"] .app-sidebar {
  left: auto;
  right: 0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

html[dir="rtl"] .app-main {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

html[dir="rtl"] .app-wrapper.sidebar-collapsed .app-main {
  margin-left: 0;
  margin-right: var(--sidebar-collapsed-width);
}

html[dir="rtl"] .nav-link:hover {
  transform: translateX(-3px);
}

html[dir="rtl"] .nav-badge {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .notification-item.is-unread {
  border-left: 0;
  border-right: 3px solid var(--brand-primary);
}

.app-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-toggle-sidebar {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.125rem;
  display: none;
  transition: var(--transition);
}

.btn-toggle-sidebar:hover {
  background: var(--gray-100);
}

.btn-toggle-compact {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-toggle-compact:hover {
  background: var(--gray-100);
}

.header-breadcrumb {
  flex: 1;
}

.header-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
}

.header-spacer {
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.culture-switcher {
  margin: 0;
}

.culture-switcher .form-select {
  min-width: 124px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--gray-300);
  font-weight: 600;
  color: var(--gray-700);
  background-color: #fff;
  cursor: pointer;
  text-align: start;
  text-align-last: start;
  padding-inline-start: 0.875rem;
  padding-inline-end: 2rem;
}

.culture-switcher .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1);
}

.culture-switcher .form-select option {
  text-align: start;
}

html[dir="rtl"] .culture-switcher .form-select {
  direction: rtl;
  background-position: left 0.75rem center;
  padding-inline-start: 0.875rem;
  padding-inline-end: 2rem;
}

html[dir="ltr"] .culture-switcher .form-select {
  direction: ltr;
  background-position: right 0.75rem center;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 8px;
  color: var(--gray-600);
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.notifications-dropdown {
  min-width: 320px;
  max-width: 380px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}

.notifications-dropdown .list-group-item {
  border: 0;
  border-bottom: 1px solid var(--gray-200);
}

.notifications-dropdown .list-group-item:last-child {
  border-bottom: 0;
}

.notifications-header {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.notifications-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  padding: 0.85rem 1rem;
  transition: var(--transition);
}

.notification-item:hover {
  background: var(--gray-50);
}

.notification-item.is-unread {
  background: rgba(13, 110, 253, 0.06);
  border-left: 3px solid var(--brand-primary);
}

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

.notification-severity {
  text-transform: capitalize;
  font-size: 0.675rem;
  letter-spacing: 0.02em;
}

.badge-soft {
  background: var(--gray-100);
  color: var(--gray-700);
}

.notification-severity.severity-info {
  background: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
}

.notification-severity.severity-success {
  background: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.notification-severity.severity-warning {
  background: rgba(255, 193, 7, 0.2);
  color: #b58100;
}

.notification-severity.severity-danger {
  background: rgba(220, 53, 69, 0.18);
  color: #dc3545;
}

.notification-item.is-unread .badge-soft:not([class*="severity-"]) {
  background: rgba(13, 110, 253, 0.15);
  color: var(--brand-primary);
}

/* ============================================
   CONDITION FORM TWEAKS
   ============================================ */
.condition-form .rule-row {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.condition-form .rule-row .form-control,
.condition-form .rule-row .form-select {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  min-height: 42px;
}

.condition-form .rule-row .form-control:focus,
.condition-form .rule-row .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.12);
}

.condition-form .rule-row .btn-outline-danger {
  border-width: 2px;
  border-radius: 10px;
}

.condition-form .nav-tabs {
  border-bottom: 1px solid var(--gray-200);
}

.condition-form .nav-tabs .nav-link {
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-bottom: 0;
  margin-right: 0.35rem;
  border-radius: 10px 10px 0 0;
  padding: 0.5rem 0.9rem;
}

.condition-form .nav-tabs .nav-link:hover {
  background: var(--gray-200);
}

.condition-form .nav-tabs .nav-link.active {
  background: white;
  color: var(--gray-900);
  border-color: var(--gray-300);
  box-shadow: 0 -1px 0 white inset;
}

.condition-form .tab-content {
  background: white;
  border: 1px solid var(--gray-200);
  border-top: 0;
  border-radius: 0 12px 12px 12px;
  padding: 1rem;
}

.condition-details .nav-tabs {
  border-bottom: 1px solid var(--gray-200);
}

.condition-details .nav-tabs .nav-link {
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-bottom: 0;
  margin-right: 0.35rem;
  border-radius: 10px 10px 0 0;
  padding: 0.5rem 0.9rem;
}

.condition-details .nav-tabs .nav-link:hover {
  background: var(--gray-200);
}

.condition-details .nav-tabs .nav-link.active {
  background: white;
  color: var(--gray-900);
  border-color: var(--gray-300);
  box-shadow: 0 -1px 0 white inset;
}

.condition-details .tab-content {
  background: white;
  border: 1px solid var(--gray-200);
  border-top: 0;
  border-radius: 0 12px 12px 12px;
  padding: 1rem;
}

.notification-empty {
  padding: 1rem;
}

.notification-category-filters {
  background: var(--gray-50);
}

.notification-category-filters .form-check {
  margin-bottom: 0.5rem;
}

.notification-category-filters .form-check:last-child {
  margin-bottom: 0;
}

.notification-category-filters .form-check-label {
  font-weight: 500;
  cursor: pointer;
}

.btn-header {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-header:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.app-footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 0.75rem 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.show {
    transform: translateX(0);
  }

  html[dir="rtl"] .app-sidebar {
    transform: translateX(100%);
  }

  html[dir="rtl"] .app-sidebar.show {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .app-main {
    margin-left: 0;
  }

  html[dir="rtl"] .app-main {
    margin-right: 0;
  }

  .btn-toggle-sidebar {
    display: block;
  }

  .btn-toggle-compact {
    display: none;
  }

  .app-content {
    padding: 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .header-title {
    font-size: 1.125rem;
  }
}

/* ============================================
   LOGIN LAYOUT - Simple & Clean
   ============================================ */
.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  padding: 2rem 1rem;
}

.auth-language-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  z-index: 1060;
}

html[dir="rtl"] .auth-language-bar {
  right: 1rem;
  left: auto;
}

.auth-language-bar .culture-switcher .form-select {
  min-width: 130px;
  background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 576px) {
  .auth-language-bar {
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
  }

  html[dir="rtl"] .auth-language-bar {
    right: 0.75rem;
    left: auto;
  }

  .auth-language-bar .culture-switcher .form-select {
    min-width: 112px;
  }
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--brand-gradient);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(139, 31, 58, 0.3);
}

.login-card h2 {
  font-size: 1.5rem;
  color: var(--gray-900);
}

.login-card .form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.login-card .form-control {
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  transition: var(--transition);
}

.login-card .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1);
}

.login-card .btn-primary {
  background: var(--brand-gradient);
  border: none;
  border-radius: 10px;
  padding: 0.875rem;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: var(--transition);
}

.login-card .btn-primary:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 31, 58, 0.3);
}

html[dir="rtl"] .login-card {
  text-align: right;
}

html[dir="rtl"] .login-card .text-center {
  text-align: center !important;
}

html[dir="rtl"] .login-card .form-control {
  text-align: right;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  border: none;
  font-size: 0.875rem;
  --bs-btn-focus-shadow-rgb: 139, 31, 58;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
  background: var(--brand-gradient);
  color: white;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 31, 58, 0.3);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover {
  background: var(--brand-primary);
  color: white;
}

.btn:focus,
.btn:focus-visible,
.btn-check:focus + .btn,
.btn-check:checked + .btn:focus,
.btn.active:focus,
.btn.show:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(139, 31, 58, 0.25) !important;
}

.btn.is-invalid:focus,
.btn.is-invalid:focus-visible {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2) !important;
}

.btn-cta {
  background: var(--brand-gradient);
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(91, 47, 114, 0.2);
  transition: var(--transition);
}

.btn-cta:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 47, 114, 0.3);
}

.btn-outline-cta {
  border-radius: 8px;
  border: 2px solid rgba(139, 31, 58, 0.3);
  color: var(--brand-primary);
  background: transparent;
  padding: 0.625rem 1rem;
  font-weight: 600;
  transition: var(--transition);
}

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

/* ============================================
   CARDS & COMPONENTS
   ============================================ */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Menu Cards */
.menu-card {
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.menu-card .menu-select {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 10;
  accent-color: var(--brand-primary);
}

html[dir="rtl"] .menu-card .menu-select {
  left: auto;
  right: 10px;
}

.menu-card__media {
  height: 180px;
  background: var(--gray-100);
  overflow: hidden;
}

.menu-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-card__placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  gap: 0.5rem;
}

.menu-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.badge {
  border-radius: 5px;
  padding: 0.25rem 0.625rem;
  font-weight: 600;
  font-size: 0.7rem;
}

/* Dashboard Cards */
.home-nav-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.home-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-primary);
}

.home-nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--brand-gradient);
  color: white;
  flex-shrink: 0;
}

.home-nav-card h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--gray-900);
}

.home-nav-card p {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin: 0;
}

.home-nav-card > i {
  margin-left: auto;
  color: var(--gray-400);
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* Quick Tiles */
.quick-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.quick-tile:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: white;
}

.quick-title {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.quick-tile small {
  display: block;
  color: var(--gray-600);
  font-size: 0.8125rem;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: rgba(139, 31, 58, 0.1);
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: var(--transition);
}

.link-chip:hover {
  background: var(--brand-primary);
  color: white;
}

/* ============================================
   DASHBOARD COMPONENTS
   ============================================ */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.05) 0%, rgba(91, 47, 114, 0.05) 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card__icon--primary {
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.1) 0%, rgba(139, 31, 58, 0.05) 100%);
  color: var(--brand-primary);
}

.stat-card__icon--success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--success);
}

.stat-card__icon--info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  color: var(--info);
}

.stat-card__icon--warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: var(--warning);
}

.stat-card__content {
  flex: 1;
  min-width: 0;
}

.stat-card__label {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Module Cards */
.module-card {
  display: block;
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  height: 100%;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-primary);
}

.module-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.module-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: white;
}

.module-card__icon--primary {
  background: var(--brand-gradient);
}

.module-card__icon--success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.module-card__icon--info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.module-card__icon--warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.module-card__icon--purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.module-card__icon--teal {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.module-card__icon--indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.module-card__icon--danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.module-card__arrow {
  color: var(--gray-400);
  font-size: 1.125rem;
  transition: var(--transition);
}

.module-card:hover .module-card__arrow {
  color: var(--brand-primary);
  transform: translateX(3px);
}

.module-card__content {
  color: inherit;
}

.module-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
}

.module-card__desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-bottom: 0;
  line-height: 1.4;
}

/* Action Items */
.action-item {
  display: block;
  padding: 0.875rem;
  border-radius: 10px;
  background: var(--gray-50);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.action-item:hover {
  background: var(--gray-100);
  transform: translateX(3px);
}

.action-item__number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  gap: 0.25rem;
}

.pagination .page-link {
  border: none;
  border-radius: 6px;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  transition: var(--transition);
  font-size: 0.875rem;
}

.pagination .page-link:hover {
  background: var(--gray-100);
}

.pagination .page-item.active .page-link {
  background: var(--brand-gradient);
  color: white;
}

/* Forms */
.form-control,
.form-select {
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  transition: var(--transition);
  font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

html[dir="rtl"] .form-select {
  direction: rtl;
  text-align: start;
  text-align-last: start;
  background-position: left 0.75rem center;
  padding-inline-start: 0.875rem;
  padding-inline-end: 2rem;
}

html[dir="rtl"] .form-select option {
  direction: rtl;
  text-align: start;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* Dropdowns */
.dropdown-menu {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 6px;
  padding: 0.5rem 0.875rem;
  transition: var(--transition);
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background: var(--gray-100);
}

/* Alerts */
.alert {
  border: none;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
}

/* ============================================
   VOUCHER MANAGEMENT
   ============================================ */
.voucher-hero {
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.06) 0%, rgba(91, 47, 114, 0.06) 100%);
  border: 1px solid var(--gray-200);
}

.voucher-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.voucher-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.voucher-meta {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.voucher-meta__item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.voucher-meta__label {
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  font-weight: 600;
}

.voucher-meta__value {
  color: var(--gray-800);
  font-weight: 600;
  text-align: right;
}

.voucher-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.voucher-metric {
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(139, 31, 58, 0.06);
}

.voucher-metric__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.voucher-metric__value {
  font-weight: 700;
  color: var(--gray-900);
}

.voucher-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.voucher-detail-item {
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

.voucher-detail-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.voucher-detail-value {
  font-weight: 600;
  color: var(--gray-900);
}

.voucher-side-card.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.voucher-assign-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}

.voucher-code .form-control {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.select-search {
  display: grid;
  gap: 0.5rem;
}

.select-search__input {
  border-radius: 10px;
}

.select-search__select[multiple] {
  min-height: 150px;
}

.select-search__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.select-search__count {
  font-weight: 600;
  color: var(--gray-600);
}

.conditions-picker .select-search__select[multiple] {
  min-height: 220px;
}

.conditions-picker .list-group-item {
  border-color: var(--gray-200);
}

.voucher-benefit-row {
  background: #fff;
  border-color: var(--gray-200) !important;
}

/* ============================================
   ORDER MANAGEMENT
   ============================================ */
.order-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.03) 0%, rgba(91, 47, 114, 0.03) 100%);
}

.order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.order-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.order-card__meta {
  text-align: right;
}

.order-bulk-toolbar {
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.order-bulk-toolbar .card-body {
  padding: 1rem 1.25rem;
}

.order-bulk-toolbar .form-label {
  margin-bottom: 0.3rem;
  line-height: 1;
}

.order-bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  margin-top: 1.1rem;
}

.order-bulk-toggle:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.order-bulk-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.order-bulk-toggle__box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--gray-300);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}

.order-bulk-toggle__box i {
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition);
}

.order-bulk-toggle__input:checked + .order-bulk-toggle__box {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.order-bulk-toggle__input:checked + .order-bulk-toggle__box i {
  opacity: 1;
  transform: scale(1);
}

.order-bulk-toggle__text {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.order-bulk-toolbar .form-select,
.order-bulk-toolbar .form-control {
  border-radius: 10px;
  border: 2px solid var(--gray-200);
  background: white;
}

.order-bulk-toolbar .form-select:focus,
.order-bulk-toolbar .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.12);
}

.order-bulk-btn {
  min-width: 170px;
}

.order-bulk-select {
  width: 160px;
  max-width: 100%;
}

.order-bulk-note {
  width: 200px;
  max-width: 100%;
}

.order-select {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 5;
  background: white;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: var(--transition);
}

html[dir="rtl"] .order-select {
  left: auto;
  right: 12px;
}

.order-select:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.order-select:hover {
  border-color: var(--brand-primary);
}

.order-card .card-body {
  padding-left: 2.5rem;
}

html[dir="rtl"] .order-card .card-body {
  padding-left: 1rem;
  padding-right: 2.5rem;
}

.order-status-form .input-group {
  width: auto;
  flex-wrap: nowrap;
}

.order-inline-select {
  width: 90px;
}

@media (max-width: 768px) {
  .order-bulk-select,
  .order-bulk-note {
    width: 100%;
  }

  .order-card .card-body {
    padding-left: 2rem;
  }

  html[dir="rtl"] .order-card .card-body {
    padding-left: 1rem;
    padding-right: 2rem;
  }

  .order-status-form .input-group {
    width: 100%;
  }

  .order-inline-select {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .order-card .card-body {
    padding-left: 1.75rem;
  }

  html[dir="rtl"] .order-card .card-body {
    padding-left: 1rem;
    padding-right: 1.75rem;
  }
}

/* ============================================
   ORDER REPORTS - Chart.js Integration
   ============================================ */
.chart-container {
  position: relative;
  min-height: 280px;
  width: 100%;
}

.chart-container canvas {
  border-radius: 8px;
}

/* Legacy CSS Chart (fallback if JS disabled) */
.order-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 0.5rem;
  align-items: end;
  min-height: 260px;
  padding: 1.5rem 1rem 0.75rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 1) 0%, rgba(241, 245, 249, 1) 100%);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

.order-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to top, var(--gray-200) 1px, transparent 1px);
  background-size: 100% 25%;
  pointer-events: none;
  opacity: 0.5;
}

.order-chart-shell {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.5rem;
  align-items: end;
}

.order-chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-500);
  text-align: right;
  padding-bottom: 2.5rem;
}

.order-chart__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  z-index: 1;
}

.order-chart__bar {
  width: 100%;
  max-width: 48px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.25rem;
  color: white;
  font-size: 0.6rem;
  font-weight: 600;
  position: relative;
  box-shadow: 0 4px 12px rgba(139, 31, 58, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-chart__value {
  opacity: 0;
  font-size: 0.55rem;
}

.order-chart__bar:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(139, 31, 58, 0.35);
}

.order-chart__bar:hover .order-chart__value {
  opacity: 1;
}

.order-chart__bar::after {
  content: attr(data-value);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.order-chart__bar::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--gray-800);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.order-chart__bar:hover::after,
.order-chart__bar:hover::before {
  opacity: 1;
}

.order-chart__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-700);
  text-align: center;
  white-space: nowrap;
}

.order-chart__meta {
  font-size: 0.65rem;
  color: var(--gray-500);
  text-align: center;
}
.order-total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.order-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(139, 31, 58, 0.08);
  color: var(--gray-700);
  font-size: 0.75rem;
  font-weight: 600;
}

.order-chip-link {
  text-decoration: none;
  color: var(--brand-primary);
}

.order-chip-link:hover {
  background: var(--brand-primary);
  color: white;
}

.order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.order-status-form {
  flex: 1;
  min-width: 260px;
}

.order-status-form .input-group {
  width: 100%;
}

.order-status-form .form-select {
  min-width: 140px;
}

.order-detail-card {
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

.order-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.order-detail-value {
  font-weight: 600;
  color: var(--gray-900);
}

.order-item-list .list-group-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.order-status-list .list-group-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.order-note {
  background: rgba(59, 130, 246, 0.08);
  color: var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
}

.order-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--brand-primary);
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
}

/* ============================================
   DISCOUNT CONDITIONS CARD
   ============================================ */
.discount-conditions-card .card-header {
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.04) 0%, rgba(91, 47, 114, 0.04) 100%);
}

.condition-select-wrapper select.form-select {
  border-radius: 10px;
  border: 2px solid var(--gray-200);
  min-height: 180px;
}

.condition-select-wrapper select.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1);
}

.condition-select-wrapper select.form-select option {
  padding: 0.5rem 0.75rem;
}

.condition-select-wrapper select.form-select option:checked {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
}

.selected-conditions-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
}

.selected-condition-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}

.selected-condition-item:last-child {
  border-bottom: none;
}

.selected-condition-item:hover {
  background: var(--gray-50);
}

.selected-condition-info {
  flex: 1;
  min-width: 0;
}

.selected-condition-name {
  font-size: 0.875rem;
  color: var(--gray-900);
}

.selected-condition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.selected-condition-meta .badge {
  font-size: 0.65rem;
  font-weight: 600;
}

.no-conditions-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  min-height: 180px;
}

.no-conditions-placeholder i {
  font-size: 2rem;
  color: var(--gray-300);
  margin-bottom: 0.5rem;
}

.no-conditions-placeholder p {
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0;
}

.no-conditions-placeholder small {
  color: var(--gray-500);
}

/* Badge subtle variants */
.bg-info-subtle {
  background-color: rgba(59, 130, 246, 0.15) !important;
}

.text-info {
  color: #3b82f6 !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .selected-conditions-list {
    max-height: 200px;
    margin-top: 1rem;
  }
  
  .no-conditions-placeholder {
    min-height: 120px;
    padding: 1.5rem 1rem;
  }
}

/* ============================================
   CONDITION PICKER COMPONENT
   ============================================ */
.condition-picker {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.condition-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.04) 0%, rgba(91, 47, 114, 0.04) 100%);
  border-bottom: 1px solid var(--gray-200);
}

.condition-picker__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.condition-picker__title i {
  font-size: 1.25rem;
  color: var(--brand-primary);
}

.condition-picker__body {
  padding: 1.25rem;
}

.condition-picker__search {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.condition-search-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.condition-search-input {
  border-radius: 10px !important;
  padding-left: 1rem;
  border: 2px solid var(--gray-200);
  transition: var(--transition);
}

.condition-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1);
}

.condition-search-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-500);
  padding: 0 0.25rem;
}

.condition-search-count {
  font-weight: 600;
  color: var(--gray-600);
}

.condition-selected-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(139, 31, 58, 0.1);
  color: var(--brand-primary);
  font-weight: 600;
}

.condition-select {
  border-radius: 10px !important;
  border: 2px solid var(--gray-200) !important;
  min-height: 200px;
  transition: var(--transition);
}

.condition-select:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(139, 31, 58, 0.1) !important;
}

.condition-select option {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin: 2px 4px;
}

.condition-select option:checked {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
}

.condition-picker__help {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.condition-picker__help kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
}

/* Condition Preview Panel */
.condition-picker__preview {
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.condition-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
}

.condition-preview-list {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  padding: 0.5rem;
}

.condition-preview-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.condition-preview-item:last-child {
  margin-bottom: 0;
}

.condition-preview-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(139, 31, 58, 0.1);
}

.condition-preview-content {
  flex: 1;
  min-width: 0;
}

.condition-preview-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}

.condition-preview-name strong {
  font-size: 0.875rem;
  color: var(--gray-900);
}

.condition-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.condition-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.condition-tag--match {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.condition-tag--rules {
  background: rgba(107, 114, 128, 0.1);
  color: var(--gray-600);
}

.condition-preview-desc {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.condition-preview-action {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.condition-preview-action:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

/* Empty State */
.condition-picker__empty {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--gray-50);
  border-radius: 10px;
  border: 2px dashed var(--gray-200);
}

.condition-picker__empty i {
  font-size: 2.5rem;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
  display: block;
}

.condition-picker__empty p {
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.condition-picker__empty small {
  color: var(--gray-500);
  font-size: 0.8125rem;
}

/* Badge utilities */
.badge-sm {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
}

.bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.15) !important;
}

.bg-secondary-subtle {
  background-color: rgba(107, 114, 128, 0.15) !important;
}

/* Card variant for condition picker */
.card.condition-picker-card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card.condition-picker-card .card-header {
  background: linear-gradient(135deg, rgba(139, 31, 58, 0.04) 0%, rgba(91, 47, 114, 0.04) 100%);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
}

.card.condition-picker-card .card-body {
  padding: 1.25rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .selected-conditions-list {
    max-height: 200px;
    margin-top: 1rem;
  }
  
  .no-conditions-placeholder {
    min-height: 120px;
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 767.98px) {
  .condition-picker__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .condition-picker__body {
    padding: 1rem;
  }
}

/* Responsive Typography */
@media (max-width: 576px) {
  /* ...existing code... */
