/* ==============================================
   MSM ENGINEERING SL - INTERNAL APPLICATION STYLES
   Modern Dashboard & Admin Area
   ============================================== */

/* =============================================
   CSS VARIABLES - INHERITED FROM THEME
   ============================================== */
:root {
  /* MSM Corporate Colors */
  --msm-violet: #6B5B95;
  --msm-violet-light: #8E7CC3;
  --msm-violet-dark: #4a3d6e;
  --msm-blue: #00B4D8;
  --msm-blue-light: #48CAE4;
  --msm-blue-dark: #0077B6;
  --msm-gradient: linear-gradient(135deg, #6B5B95 0%, #00B4D8 100%);
  --msm-gradient-reverse: linear-gradient(135deg, #00B4D8 0%, #6B5B95 100%);

  /* UI Colors */
  --msm-success: #10b981;
  --msm-warning: #f59e0b;
  --msm-danger: #ef4444;
  --msm-info: #3b82f6;

  /* Neutrals */
  --msm-dark: #1e293b;
  --msm-gray-100: #f8fafc;
  --msm-gray-200: #e2e8f0;
  --msm-gray-300: #cbd5e1;
  --msm-gray-400: #94a3b8;
  --msm-gray-500: #64748b;
  --msm-gray-600: #475569;
  --msm-gray-700: #334155;
  --msm-gray-800: #1e293b;
  --msm-gray-900: #0f172a;

  /* Shadows */
  --msm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --msm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --msm-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --msm-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --msm-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Border Radius */
  --msm-radius-sm: 8px;
  --msm-radius: 12px;
  --msm-radius-lg: 16px;
  --msm-radius-xl: 20px;
  --msm-radius-2xl: 24px;

  /* Transitions */
  --msm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   BASE STYLES
   ============================================== */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--msm-gray-100);
}

/* ==============================================
   HEADER STYLES
   ============================================== */
.app-header {
  background: white !important;
  border-bottom: 1px solid var(--msm-gray-200) !important;
  box-shadow: var(--msm-shadow-sm) !important;
}

.app-header .navbar-brand {
  color: var(--msm-violet) !important;
  font-weight: 700;
}

.app-header .navbar-brand b {
  background: var(--msm-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-header .navbar-link {
  color: var(--msm-gray-600) !important;
  transition: var(--msm-transition);
}

.app-header .navbar-link:hover {
  color: var(--msm-violet) !important;
}

.app-header .navbar-link .badge {
  background: var(--msm-gradient) !important;
}

.app-header .navbar-user .image {
  background: var(--msm-gradient) !important;
  color: white !important;
  border-radius: 50%;
}

.app-header .form-control {
  border: 2px solid var(--msm-gray-200);
  border-radius: var(--msm-radius);
  transition: var(--msm-transition);
}

.app-header .form-control:focus {
  border-color: var(--msm-violet);
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.15);
}

/* ==============================================
   SIDEBAR STYLES
   ============================================== */
.app-sidebar {
  background: linear-gradient(180deg, var(--msm-gray-900) 0%, #1a1f36 100%) !important;
}

.app-sidebar .menu-profile-cover {
  background: var(--msm-gradient) !important;
}

.app-sidebar .menu-profile-image {
  background: var(--msm-gradient) !important;
  color: white !important;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.app-sidebar .menu-profile-info {
  color: white;
}

.app-sidebar .menu-profile-info small {
  color: var(--msm-blue-light);
}

.app-sidebar .menu-link {
  border-radius: var(--msm-radius-sm);
  margin: 2px 12px;
  transition: var(--msm-transition);
}

.app-sidebar .menu-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.app-sidebar .menu-link.active,
.app-sidebar .menu-item.active > .menu-link {
  background: var(--msm-gradient) !important;
}

.app-sidebar .menu-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--msm-radius-sm);
  margin-right: 12px;
}

.app-sidebar .menu-text {
  font-weight: 500;
}

.app-sidebar .menu-submenu .menu-link {
  margin-left: 56px;
}

.app-sidebar .menu-header {
  color: var(--msm-blue-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 20px 24px 10px;
}

/* Sidebar Minify Button */
.app-sidebar-minify-btn {
  background: var(--msm-gradient) !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* ==============================================
   CONTENT AREA
   ============================================== */
.app-content {
  background: var(--msm-gray-100);
  padding: 30px;
}

/* ==============================================
   STAT CARDS (Dashboard)
   ============================================== */
.msm-stat-card {
  background: white;
  border-radius: var(--msm-radius-lg);
  padding: 24px;
  box-shadow: var(--msm-shadow);
  border: 1px solid var(--msm-gray-200);
  transition: var(--msm-transition);
  position: relative;
  overflow: hidden;
}

.msm-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--msm-shadow-md);
}

.msm-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--msm-gradient));
}

.msm-stat-card.violet::before { --card-accent: var(--msm-violet); }
.msm-stat-card.blue::before { --card-accent: var(--msm-blue); }
.msm-stat-card.success::before { --card-accent: var(--msm-success); }
.msm-stat-card.warning::before { --card-accent: var(--msm-warning); }
.msm-stat-card.danger::before { --card-accent: var(--msm-danger); }

.msm-stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--msm-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  background: var(--icon-bg, var(--msm-gradient));
  box-shadow: 0 8px 20px rgba(107, 91, 149, 0.3);
}

.msm-stat-card.violet .stat-icon { --icon-bg: linear-gradient(135deg, #6B5B95 0%, #8E7CC3 100%); }
.msm-stat-card.blue .stat-icon { --icon-bg: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%); }
.msm-stat-card.success .stat-icon {
  --icon-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.msm-stat-card.warning .stat-icon {
  --icon-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}
.msm-stat-card.danger .stat-icon {
  --icon-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.msm-stat-card .stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--msm-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.msm-stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--msm-dark);
  line-height: 1.2;
}

.msm-stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 12px;
}

.msm-stat-card .stat-change.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--msm-success);
}

.msm-stat-card .stat-change.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--msm-danger);
}

.msm-stat-card .stat-sparkline {
  height: 50px;
  margin-top: 15px;
}

/* ==============================================
   PANEL / CARD STYLES
   ============================================== */
.msm-panel {
  background: white;
  border-radius: var(--msm-radius-lg);
  box-shadow: var(--msm-shadow);
  border: 1px solid var(--msm-gray-200);
  overflow: hidden;
}

.msm-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--msm-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.msm-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--msm-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.msm-panel-title i {
  width: 36px;
  height: 36px;
  background: var(--msm-gradient);
  border-radius: var(--msm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.msm-panel-actions {
  display: flex;
  gap: 8px;
}

.msm-panel-action {
  width: 32px;
  height: 32px;
  border-radius: var(--msm-radius-sm);
  border: none;
  background: var(--msm-gray-100);
  color: var(--msm-gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--msm-transition);
}

.msm-panel-action:hover {
  background: var(--msm-violet);
  color: white;
}

.msm-panel-body {
  padding: 24px;
}

/* ==============================================
   CHART CONTAINERS
   ============================================== */
.msm-chart-container {
  position: relative;
  height: 300px;
}

.msm-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ==============================================
   DATA TABLES
   ============================================== */
.msm-table-wrapper {
  background: white;
  border-radius: var(--msm-radius-lg);
  box-shadow: var(--msm-shadow);
  border: 1px solid var(--msm-gray-200);
  overflow: hidden;
}

.msm-table {
  width: 100%;
  border-collapse: collapse;
}

.msm-table thead {
  background: var(--msm-gray-50);
}

.msm-table th {
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--msm-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 2px solid var(--msm-gray-200);
}

.msm-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--msm-gray-700);
  border-bottom: 1px solid var(--msm-gray-100);
}

.msm-table tbody tr {
  transition: var(--msm-transition);
}

.msm-table tbody tr:hover {
  background: var(--msm-gray-50);
}

.msm-table tbody tr:last-child td {
  border-bottom: none;
}

/* DataTables Integration */
.dataTables_wrapper {
  padding: 20px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid var(--msm-gray-200);
  border-radius: var(--msm-radius);
  padding: 8px 12px;
  transition: var(--msm-transition);
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--msm-violet);
  outline: none;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.15);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: none !important;
  border-radius: var(--msm-radius-sm) !important;
  padding: 8px 14px !important;
  margin: 0 3px;
  transition: var(--msm-transition);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--msm-gradient) !important;
  color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
  background: var(--msm-gray-100) !important;
  color: var(--msm-violet) !important;
}

/* ==============================================
   BUTTONS
   ============================================== */
.msm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--msm-radius);
  border: none;
  cursor: pointer;
  transition: var(--msm-transition);
  text-decoration: none;
}

.msm-btn-primary {
  background: var(--msm-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(107, 91, 149, 0.3);
}

.msm-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(107, 91, 149, 0.4);
  color: white;
}

.msm-btn-secondary {
  background: white;
  color: var(--msm-violet);
  border: 2px solid var(--msm-gray-200);
}

.msm-btn-secondary:hover {
  border-color: var(--msm-violet);
  background: rgba(107, 91, 149, 0.05);
}

.msm-btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.msm-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.msm-btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.msm-btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ==============================================
   FORMS
   ============================================== */
.msm-form-group {
  margin-bottom: 24px;
}

.msm-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--msm-dark);
  margin-bottom: 8px;
}

.msm-form-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border: 2px solid var(--msm-gray-200);
  border-radius: var(--msm-radius);
  background: white;
  transition: var(--msm-transition);
}

.msm-form-input:focus {
  border-color: var(--msm-violet);
  outline: none;
  box-shadow: 0 0 0 4px rgba(107, 91, 149, 0.1);
}

.msm-form-input::placeholder {
  color: var(--msm-gray-400);
}

/* ==============================================
   MSM INPUT - Universal Form Input Styling
   ============================================== */
.msm-input,
.msm-select,
.msm-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid rgba(107, 91, 149, 0.3);
  border-radius: var(--msm-radius);
  background: rgba(15, 23, 42, 0.6);
  color: #f1f5f9;
  transition: var(--msm-transition);
}

.msm-input:focus,
.msm-select:focus,
.msm-textarea:focus {
  outline: none;
  border-color: var(--msm-violet);
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.msm-input::placeholder,
.msm-textarea::placeholder {
  color: #64748b;
}

.msm-input:hover,
.msm-select:hover,
.msm-textarea:hover {
  border-color: rgba(107, 91, 149, 0.5);
}

/* Light mode input styling */
[data-bs-theme="light"] .msm-input,
[data-bs-theme="light"] .msm-select,
[data-bs-theme="light"] .msm-textarea {
  background: white;
  color: var(--msm-dark);
  border-color: var(--msm-gray-200);
}

[data-bs-theme="light"] .msm-input:focus,
[data-bs-theme="light"] .msm-select:focus,
[data-bs-theme="light"] .msm-textarea:focus {
  background: white;
  border-color: var(--msm-violet);
}

[data-bs-theme="light"] .msm-input::placeholder,
[data-bs-theme="light"] .msm-textarea::placeholder {
  color: var(--msm-gray-400);
}

/* Light mode select option styling */
[data-bs-theme="light"] .msm-select option {
  background: white;
  color: var(--msm-dark);
}

[data-bs-theme="light"] .msm-select option:checked,
[data-bs-theme="light"] .msm-select option:hover {
  background: var(--msm-violet-light);
  color: var(--msm-violet);
}

/* Select dropdown styling */
.msm-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B5B95'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
  cursor: pointer;
}

/* Form labels for dark theme */
.msm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-bs-theme="light"] .msm-label {
  color: var(--msm-gray-700);
}

.msm-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 48px;
}

/* ==============================================
   STATUS BADGES
   ============================================== */
.msm-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

.msm-badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--msm-success);
}

.msm-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--msm-warning);
}

.msm-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--msm-danger);
}

.msm-badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--msm-info);
}

.msm-badge-violet {
  background: rgba(107, 91, 149, 0.1);
  color: var(--msm-violet);
}

/* ==============================================
   ALERTS
   ============================================== */
.msm-alert {
  padding: 16px 20px;
  border-radius: var(--msm-radius);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.msm-alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msm-alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--msm-success);
}

.msm-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--msm-warning);
}

.msm-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--msm-danger);
}

/* ==============================================
   ACTIVITY LIST
   ============================================== */
.msm-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.msm-activity-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--msm-gray-100);
}

.msm-activity-item:last-child {
  border-bottom: none;
}

.msm-activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.msm-activity-content {
  flex: 1;
}

.msm-activity-title {
  font-weight: 600;
  color: var(--msm-dark);
  margin-bottom: 4px;
}

.msm-activity-desc {
  font-size: 13px;
  color: var(--msm-gray-500);
}

.msm-activity-time {
  font-size: 12px;
  color: var(--msm-gray-400);
}

/* ==============================================
   QUICK STATS ROW
   ============================================== */
.msm-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* ==============================================
   PAGE HEADER
   ============================================== */
.msm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.msm-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--msm-dark);
  margin: 0;
}

.msm-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--msm-gray-500);
  margin-top: 8px;
}

.msm-page-breadcrumb a {
  color: var(--msm-violet);
  text-decoration: none;
}

/* ==============================================
   DARK MODE SUPPORT
   ============================================== */
[data-bs-theme="dark"] {
  --msm-gray-100: #1e293b;
  --msm-gray-200: #334155;
  --msm-gray-300: #475569;
  --msm-gray-700: #e2e8f0;
  --msm-gray-800: #f1f5f9;
  --msm-dark: #f8fafc;
}

[data-bs-theme="dark"] .msm-stat-card,
[data-bs-theme="dark"] .msm-panel,
[data-bs-theme="dark"] .msm-table-wrapper {
  background: #1e293b;
  border-color: #334155;
}

[data-bs-theme="dark"] .msm-table th {
  background: #0f172a;
  color: #94a3b8;
}

[data-bs-theme="dark"] .msm-table td {
  color: #e2e8f0;
  border-bottom-color: rgba(107, 91, 149, 0.15);
}

[data-bs-theme="dark"] .msm-table tbody tr:hover {
  background: rgba(107, 91, 149, 0.1);
}

/* Dark mode DataTables overrides */
[data-bs-theme="dark"] .dataTables_wrapper {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
  color: #94a3b8;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(107, 91, 149, 0.3);
  color: #f1f5f9;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select:focus,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--msm-violet);
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.2);
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(15, 23, 42, 0.5);
  --bs-table-hover-bg: rgba(107, 91, 149, 0.1);
  --bs-table-border-color: rgba(107, 91, 149, 0.15);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .table > thead {
  background: rgba(15, 23, 42, 0.8);
}

[data-bs-theme="dark"] .table > thead th {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  border-bottom-color: rgba(107, 91, 149, 0.2);
}

[data-bs-theme="dark"] .table > tbody > tr {
  background: transparent;
}

[data-bs-theme="dark"] .table > tbody > tr:nth-of-type(odd) {
  background: rgba(15, 23, 42, 0.3);
}

[data-bs-theme="dark"] .table > tbody > tr:hover {
  background: rgba(107, 91, 149, 0.15) !important;
}

[data-bs-theme="dark"] .table > tbody td {
  border-bottom-color: rgba(107, 91, 149, 0.1);
}

/* Override Bootstrap table row colors in dark mode */
[data-bs-theme="dark"] .table-danger,
[data-bs-theme="dark"] .table-warning,
[data-bs-theme="dark"] .table-success,
[data-bs-theme="dark"] .table-info,
[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .table-secondary {
  background: transparent !important;
  --bs-table-bg: transparent !important;
}

[data-bs-theme="dark"] .badge.bg-light {
  background: rgba(107, 91, 149, 0.2) !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .app-content {
  background: #0f172a;
}

/* Dark mode form sections */
[data-bs-theme="dark"] .form-section-title {
  color: var(--msm-violet-light);
  border-bottom-color: rgba(107, 91, 149, 0.3);
}

[data-bs-theme="dark"] .msm-form-label {
  color: #94a3b8;
}

/* Dark mode file upload zone */
[data-bs-theme="dark"] .file-upload-zone {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(107, 91, 149, 0.3);
}

[data-bs-theme="dark"] .file-upload-zone:hover {
  background: rgba(107, 91, 149, 0.1);
  border-color: var(--msm-violet);
}

[data-bs-theme="dark"] .file-upload-icon {
  color: #64748b;
}

/* Dark mode type selector */
[data-bs-theme="dark"] .type-option {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(107, 91, 149, 0.2);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .type-option:hover {
  border-color: var(--msm-violet);
  background: rgba(107, 91, 149, 0.1);
}

[data-bs-theme="dark"] .type-option.selected {
  border-color: var(--msm-violet);
  background: rgba(107, 91, 149, 0.2);
}

/* Dark mode panel overrides */
[data-bs-theme="dark"] .msm-panel {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(107, 91, 149, 0.2);
}

[data-bs-theme="dark"] .msm-panel-header {
  background: rgba(15, 23, 42, 0.5);
  border-bottom-color: rgba(107, 91, 149, 0.2);
}

[data-bs-theme="dark"] .msm-panel-title {
  color: #f1f5f9;
}

[data-bs-theme="dark"] .msm-panel-body {
  background: transparent;
}

[data-bs-theme="dark"] .msm-panel-footer {
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid rgba(107, 91, 149, 0.2);
  padding: 1rem 1.5rem;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 991px) {
  .msm-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .msm-quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .app-content {
    padding: 20px 15px;
  }

  .msm-quick-stats {
    grid-template-columns: 1fr;
  }

  .msm-stat-card .stat-value {
    font-size: 24px;
  }
}

/* ==============================================
   SPARKLINE CHARTS
   ============================================== */
.sparkline-container {
  display: inline-block;
  vertical-align: middle;
}

/* ApexCharts Sparkline Overrides */
.apexcharts-tooltip {
  background: var(--msm-dark) !important;
  border: none !important;
  border-radius: var(--msm-radius-sm) !important;
  box-shadow: var(--msm-shadow-md) !important;
}

.apexcharts-tooltip-title {
  background: var(--msm-violet) !important;
  border-bottom: none !important;
}

/* ==============================================
   WIDGET OVERRIDES (Legacy)
   ============================================== */
.widget.widget-stats {
  border-radius: var(--msm-radius-lg) !important;
  box-shadow: var(--msm-shadow) !important;
  border: none !important;
  overflow: hidden;
  transition: var(--msm-transition);
}

.widget.widget-stats:hover {
  transform: translateY(-4px);
  box-shadow: var(--msm-shadow-md) !important;
}

.widget.widget-stats.bg-blue {
  background: linear-gradient(135deg, #6B5B95 0%, #8E7CC3 100%) !important;
}

.widget.widget-stats.bg-info {
  background: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%) !important;
}

.widget.widget-stats.bg-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.widget.widget-stats.bg-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.widget.widget-stats .stats-icon {
  font-size: 48px;
  opacity: 0.15;
  right: 20px;
  top: 20px;
}

/* Panel Overrides */
.panel.panel-inverse {
  border-radius: var(--msm-radius-lg) !important;
  box-shadow: var(--msm-shadow) !important;
  border: 1px solid var(--msm-gray-200) !important;
  overflow: hidden;
}

.panel.panel-inverse .panel-heading {
  background: white !important;
  border-bottom: 1px solid var(--msm-gray-200) !important;
  padding: 16px 20px;
}

.panel.panel-inverse .panel-title {
  font-weight: 700 !important;
  color: var(--msm-dark) !important;
}

.panel.panel-inverse .panel-body {
  background: white !important;
  padding: 20px;
}

[data-bs-theme="dark"] .panel.panel-inverse .panel-heading,
[data-bs-theme="dark"] .panel.panel-inverse .panel-body {
  background: #1e293b !important;
}
