/* ==========================================================================
   Arendare.ro - Modern Admin UI
   ========================================================================== */

/* Brand Colors */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #7c6ae6;
  --secondary-color: #764ba2;
  --accent-color: #4f46e5;

  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #06b6d4;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-bg: #1e1e2d;
  --sidebar-text: #a2a3b7;
  --sidebar-active: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-accent: var(--primary-color);

  --topbar-height: 60px;
}

/* ==========================================================================
   Global Overrides
   ========================================================================== */

body {
  font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Bootstrap Primary Color Overrides */
.btn-primary {
  background: var(--primary-gradient) !important;
  border: none !important;
  color: white !important;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
}

.btn-primary:focus, .btn-primary:active {
  background: var(--primary-gradient) !important;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

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

.text-primary {
  color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.app-wrapper {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
  overflow: hidden;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.sidebar-brand-icon {
  font-size: 1.4rem;
  margin-right: 0.65rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand-text {
  letter-spacing: -0.025em;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

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

.sidebar-menu-section {
  margin-bottom: 0.5rem;
}

.sidebar-menu-label {
  display: block;
  padding: 0.75rem 1.5rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-menu-item i {
  width: 20px;
  text-align: center;
  margin-right: 0.75rem;
  font-size: 0.9rem;
}

.sidebar-menu-item:hover {
  color: #fff;
  background: var(--sidebar-hover-bg);
}

.sidebar-menu-item.active {
  color: var(--sidebar-active);
  background: rgba(102, 126, 234, 0.12);
  border-left-color: var(--sidebar-accent);
}

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

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s;
}

.sidebar-footer-btn:hover {
  color: #fff;
}

.sidebar-footer-btn i {
  width: 20px;
  text-align: center;
  margin-right: 0.65rem;
}

.sidebar-version {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
}

/* ===== Main content area ===== */

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

.app-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1020;
}

.topbar-hamburger {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-700);
  cursor: pointer;
  padding: 0.25rem;
}

.app-topbar .breadcrumb {
  font-size: 0.85rem;
  background: none;
}

.app-topbar .breadcrumb-item a {
  color: var(--gray-600);
  text-decoration: none;
}

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

.app-topbar .breadcrumb-item.active {
  color: var(--gray-800);
  font-weight: 600;
}

.topbar-lang-btn {
  display: flex;
  align-items: center;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-lang-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-user-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Sidebar Overlay (mobile) ===== */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

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

/* ===== Responsive sidebar ===== */

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

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

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

/* ==========================================================================
   Cards & Components
   ========================================================================== */

.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}

/* Only interactive cards lift on hover */
.card-interactive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.card-header {
  background: var(--gray-50) !important;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 12px 12px 0 0 !important;
  padding: 1.25rem;
}

.card-header h3, .card-header h4, .card-header h5 {
  color: var(--gray-800);
  font-weight: 600;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background: var(--gray-100) !important;
  color: var(--gray-700) !important;
  border: none !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 0.75rem;
}

.table tbody td {
  padding: 0.875rem 0.75rem;
  border-color: var(--gray-200);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: var(--gray-50);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(102, 126, 234, 0.03);
}

/* ===== Table Wrapper ===== */

.table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.table-toolbar .table-search {
  position: relative;
  max-width: 280px;
  flex: 1;
}

.table-toolbar .table-search input {
  padding-left: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  font-size: 0.85rem;
  height: 36px;
}

.table-toolbar .table-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
  font-size: 0.8rem;
}

.table-toolbar .record-count {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.table-wrapper .table {
  margin-bottom: 0;
  box-shadow: none;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control, .form-select {
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15) !important;
}

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

.is-invalid {
  border-color: var(--danger-color) !important;
}

.invalid-feedback {
  color: var(--danger-color);
  font-weight: 500;
}

/* ===== Form Sections ===== */

.form-section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
}

.form-section-title i {
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  transition: all 0.3s ease;
  letter-spacing: 0.025em;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--success-color) !important;
  border-color: var(--success-color) !important;
}

.btn-warning {
  background-color: var(--warning-color) !important;
  border-color: var(--warning-color) !important;
}

.btn-danger {
  background-color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
}

.btn-info {
  background-color: var(--info-color) !important;
  border-color: var(--info-color) !important;
}

.btn-outline-primary {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
  background: var(--primary-gradient) !important;
  border-color: var(--primary-color) !important;
  color: white !important;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  border: none;
  border-radius: 8px;
  font-weight: 500;
  padding: 1rem 1.25rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.1);
  color: #0891b2;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

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

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

/* ===== Soft Badges ===== */

.badge-soft-success {
  background-color: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}

.badge-soft-danger {
  background-color: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}

.badge-soft-warning {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

.badge-soft-info {
  background-color: rgba(6, 182, 212, 0.12) !important;
  color: #0891b2 !important;
}

.badge-soft-primary {
  background-color: rgba(102, 126, 234, 0.12) !important;
  color: var(--primary-dark) !important;
}

.badge-soft-secondary {
  background-color: rgba(107, 114, 128, 0.12) !important;
  color: var(--gray-700) !important;
}

/* ==========================================================================
   Dashboard Stat Cards
   ========================================================================== */

.stat-card {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  border-left: 4px solid transparent;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.stat-card-blue {
  border-left-color: var(--primary-color);
}

.stat-card-green {
  border-left-color: var(--success-color);
}

.stat-card-cyan {
  border-left-color: var(--info-color);
}

.stat-card-orange {
  border-left-color: var(--warning-color);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  margin-right: 1rem;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: var(--primary-gradient);
}

.stat-icon-green {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.stat-icon-cyan {
  background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
}

.stat-icon-orange {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* Legacy dashboard icons (kept for backward compat) */
.dashboard-stat-icon {
  background: var(--primary-gradient) !important;
}

.dashboard-stat-icon.bg-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.dashboard-stat-icon.bg-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%) !important;
}

.dashboard-stat-icon.bg-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.15rem;
}

.page-header p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 1rem);
  right: 1.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.app-toast {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
  background: #fff;
  border-left: 4px solid transparent;
}

.app-toast.toast-hiding {
  animation: toastSlideOut 0.3s ease forwards;
}

.toast-success {
  border-left-color: var(--success-color);
}

.toast-danger {
  border-left-color: var(--danger-color);
}

.toast-warning {
  border-left-color: var(--warning-color);
}

.toast-info {
  border-left-color: var(--info-color);
}

.toast-icon {
  font-size: 1.1rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--success-color);
}

.toast-danger .toast-icon {
  color: var(--danger-color);
}

.toast-warning .toast-icon {
  color: var(--warning-color);
}

.toast-info .toast-icon {
  color: var(--info-color);
}

.app-toast .toast-body {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
}

.toast-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--gray-600);
  cursor: pointer;
  margin-left: 0.5rem;
  padding: 0 0.25rem;
  line-height: 1;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gray-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-state-icon i {
  font-size: 1.75rem;
  color: var(--gray-600);
}

.empty-state h5 {
  color: var(--gray-700);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-600);
  max-width: 340px;
  margin: 0 auto 1rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Dropdown Menu
   ========================================================================== */

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: 12px;
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--primary-color);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

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

.rounded-lg {
  border-radius: 12px !important;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Loading spinner on buttons */
.btn-loading .btn-text {
  display: none;
}

.btn-loading .btn-spinner {
  display: inline-block !important;
}

.btn-spinner {
  display: none;
}

/* ==========================================================================
   Tom-select overrides
   ========================================================================== */

.ts-wrapper.form-select,
.ts-wrapper.form-control {
  padding: 0 !important;
  border: 2px solid var(--gray-200) !important;
}

.ts-wrapper .ts-control {
  border: none !important;
  border-radius: 8px;
  padding: 0.6rem 1rem !important;
  min-height: 42px;
}

.ts-wrapper.focus .ts-control {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15) !important;
}

.ts-wrapper.focus {
  border-color: var(--primary-color) !important;
}

.ts-dropdown .option.active {
  background-color: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
  .app-content {
    padding: 1rem;
  }

  .toast-container {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }

  .table {
    font-size: 0.875rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   Page-specific Styles
   ========================================================================== */

/* Dashboard */
.dashboard-header h1 {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Quick action cards */
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
  color: var(--gray-700);
  background: #fff;
  height: 100%;
}

.quick-action-card:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.quick-action-card i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.quick-action-card span {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Login/Register Pages */
.auth-page {
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.auth-card {
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-header {
  background: var(--primary-gradient);
  color: white;
  padding: 2rem;
  text-align: center;
}

.auth-body {
  padding: 2rem;
}

.btn-auth {
  background: var(--primary-gradient);
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.form-control-auth, .form-select-auth {
  border-radius: 50px;
  border: 2px solid var(--gray-200);
  padding: 12px 20px;
}

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

.form-control-auth:focus, .form-select-auth:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

[data-bs-theme="dark"] {
  --gray-50: #1a1d23;
  --gray-100: #1f2937;
  --gray-200: #374151;
  --gray-300: #4b5563;
  --gray-600: #9ca3af;
  --gray-700: #d1d5db;
  --gray-800: #e5e7eb;
  --gray-900: #f9fafb;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

  --sidebar-bg: #0d1117;
}

[data-bs-theme="dark"] body {
  background-color: #111827;
  color: var(--gray-800);
}

[data-bs-theme="dark"] .app-topbar {
  background: #1f2937;
  border-bottom-color: #374151;
}

[data-bs-theme="dark"] .topbar-lang-btn {
  border-color: #374151;
  color: #d1d5db;
}

[data-bs-theme="dark"] .topbar-user-btn {
  border-color: #374151;
  color: #d1d5db;
}

[data-bs-theme="dark"] .card {
  background-color: #1f2937;
  border-color: #374151;
}

[data-bs-theme="dark"] .card-header {
  background-color: #1a1d23 !important;
  border-bottom-color: #374151;
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: #1f2937;
  --bs-table-border-color: #374151;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .table thead th {
  background: #1a1d23 !important;
  color: #9ca3af !important;
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background-color: #374151;
}

[data-bs-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(102, 126, 234, 0.08);
}

[data-bs-theme="dark"] .table-wrapper {
  background: #1f2937;
}

[data-bs-theme="dark"] .table-toolbar {
  border-bottom-color: #374151;
}

[data-bs-theme="dark"] .table-toolbar .table-search input {
  background: #1a1d23;
  border-color: #374151;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1a1d23;
  border-color: #374151;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1a1d23;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .form-label {
  color: #d1d5db;
}

[data-bs-theme="dark"] .form-section {
  border-bottom-color: #374151;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1f2937;
  border-color: #374151;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #d1d5db;
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: #374151;
  color: var(--primary-color);
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: #374151;
}

[data-bs-theme="dark"] .dropdown-header {
  color: #9ca3af;
}

[data-bs-theme="dark"] .alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

[data-bs-theme="dark"] .alert-info {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

[data-bs-theme="dark"] .auth-card {
  background: #1f2937;
}

[data-bs-theme="dark"] .auth-body {
  background: #1f2937;
}

[data-bs-theme="dark"] .stat-card {
  background: #1f2937;
}

[data-bs-theme="dark"] .app-toast {
  background: #1f2937;
}

[data-bs-theme="dark"] .app-toast .toast-body {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .quick-action-card {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

[data-bs-theme="dark"] .quick-action-card:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

[data-bs-theme="dark"] .empty-state-icon {
  background: #374151;
}

[data-bs-theme="dark"] .empty-state-icon i {
  color: #9ca3af;
}

[data-bs-theme="dark"] .badge-soft-success {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
}

[data-bs-theme="dark"] .badge-soft-danger {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}

[data-bs-theme="dark"] .badge-soft-warning {
  background-color: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}

[data-bs-theme="dark"] .badge-soft-info {
  background-color: rgba(6, 182, 212, 0.18) !important;
  color: #22d3ee !important;
}

[data-bs-theme="dark"] .badge-soft-primary {
  background-color: rgba(102, 126, 234, 0.18) !important;
  color: #818cf8 !important;
}

[data-bs-theme="dark"] .badge-soft-secondary {
  background-color: rgba(107, 114, 128, 0.18) !important;
  color: #9ca3af !important;
}

/* Dark mode - Tom Select */
[data-bs-theme="dark"] .ts-wrapper.form-select,
[data-bs-theme="dark"] .ts-wrapper.form-control {
  border-color: #374151 !important;
}

[data-bs-theme="dark"] .ts-wrapper .ts-control {
  background: #1a1d23;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .ts-dropdown {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .ts-dropdown .option {
  color: #d1d5db;
}

[data-bs-theme="dark"] .ts-dropdown .option.active {
  background-color: rgba(102, 126, 234, 0.15);
  color: #818cf8;
}

/* Dark mode - Modal */
[data-bs-theme="dark"] .modal-content {
  background: #1f2937;
  border-color: #374151;
}

[data-bs-theme="dark"] .modal-header {
  border-bottom-color: #374151;
}

[data-bs-theme="dark"] .modal-footer {
  border-top-color: #374151;
}
