/* Color-1.css - Complete UI Overhaul (Phase 7.5 - Safe Mode Stability) */
:root {
  --theme-deafult: #EB5858;
  --theme-secondary: #2c323f;

  /* Sidebar Branding */
  --sidebar-gradient-start: #EB5858;
  --sidebar-gradient-end: #0f172a;

  --header-bg: #ffffff;
  --body-bg: #f8fafc;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --card-radius: 16px;
}

/* 1. Global & Typography */
body {
  background-color: var(--body-bg) !important;
  color: #334155 !important;
  font-family: 'Outfit', 'Montserrat', sans-serif !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #0f172a;
  font-weight: 700 !important;
}

/* 2. Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #EB5858 0%, #ff7b7b 100%) !important;
  border: none !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 25px -5px rgba(235, 88, 88, 0.3), 0 10px 10px -5px rgba(235, 88, 88, 0.2) !important;
  margin-bottom: 30px !important;
  overflow: hidden;
}

.welcome-banner h2 {
  color: #fff !important;
  margin-bottom: 5px !important;
}

.welcome-banner p {
  color: rgba(255, 255, 255, 0.9) !important;
}

.welcome-banner .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* 3. Sidebar - LOCKED GEOMETRY */
.page-wrapper .page-body-wrapper .sidebar-wrapper {
  background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%) !important;
  border-right: none !important;
  box-shadow: 10px 0 40px rgba(235, 88, 88, 0.2);
  /* STRICT WIDTH - NO ANIMATION ON PARENT */
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  overflow-x: hidden !important;
  transition: none !important;
  /* Disable width animation on container */
}

/* Padding for Sidebar Main (Logo Removed) */
.page-wrapper .page-body-wrapper .sidebar-wrapper .sidebar-main {
  padding-top: 30px !important;
}

/* Logo Area */
.page-wrapper .page-body-wrapper .sidebar-wrapper .logo-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  padding: 30px 20px !important;
  text-align: center !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.page-wrapper .page-body-wrapper .sidebar-wrapper .logo-wrapper img {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  max-height: 50px;
}

/* Link Container - STATIC */
.sidebar-link {
  color: rgba(255, 255, 255, 0.85) !important;
  margin: 8px 15px !important;
  padding: 14px 20px !important;
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  border-left: 4px solid transparent !important;
  /* Prepare for border hover */
  background: transparent;
  display: flex !important;
  align-items: center;
  position: relative;
  z-index: 2;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
  /* Only paint changes */
  transform: none !important;
  width: auto !important;
  box-sizing: border-box !important;
}

/* Hover State - NO MOVEMENT, JUST HIGHLIGHT */
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  transform: none !important;
  padding: 14px 20px !important;
  /* Ensure padding never changes */
  border-left: 4px solid #fff !important;
  /* VISUAL CUE instead of movement */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Active State */
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-left: 4px solid #fff !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  font-weight: 600;
}

/* Children - STATIC (No Motion) */
.sidebar-link svg,
.sidebar-link span {
  transition: none !important;
  /* Disable motion */
  pointer-events: auto !important;
  /* Restore interaction */
  transform: none !important;
  /* Force static */
}

/* Icon Styles */
.sidebar-link svg {
  stroke: #fff !important;
  fill: none !important;
  width: 20px;
  height: 20px;
  margin-right: 15px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.sidebar-link.active svg {
  opacity: 1;
  stroke-width: 2.5px;
}

.sidebar-link .fa-angle-right {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* === SUBMENU DESIGN (Static) === */
.sidebar-submenu {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 12px !important;
  margin: 0 15px 15px 15px !important;
  padding: 12px 0 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-submenu li {
  position: relative;
  padding: 0 !important;
}

.sidebar-submenu li a {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.9rem !important;
  padding: 10px 20px 10px 45px !important;
  display: block;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease !important;
  text-decoration: none;
  letter-spacing: 0.3px;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 10px;
}

/* Hover: Background Only */
.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05);
  padding-left: 45px !important;
  /* STATIC padding */
}

/* Tree Dot Indicator - STATIC POSITION */
.sidebar-submenu li a::before {
  content: '';
  position: absolute;
  left: 25px;
  /* Fixed position */
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  /* No motion */
}

/* Highlight Dot on hover */
.sidebar-submenu li a:hover::before,
.sidebar-submenu li a.active::before {
  background-color: #fff;
  /* Do NOT move left/right */
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  width: 6px;
  height: 6px;
}

/* 4. Dashboard Widgets */
.dashboard-default .col-lg-3 .card {
  border: none !important;
  border-radius: 20px !important;
  background: #fff !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-default .col-lg-3 .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  border-bottom: 4px solid var(--theme-deafult) !important;
}

.dashboard-default .card-header {
  background: transparent !important;
  border: none !important;
  padding: 25px !important;
}

.dashboard-default .card h4 {
  font-size: 2rem !important;
  font-weight: 800;
  color: #1e293b;
  margin-top: 10px;
}

.dashboard-default .static-widget img {
  opacity: 0.15;
  filter: grayscale(100%);
  width: 80px;
  height: 80px;
  position: absolute;
  right: 10px;
  bottom: 10px;
}

/* 5. Header Bar */
.page-header {
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  z-index: 99;
}

/* 6. Forms & Login */
.login-card {
  background: #f1f5f9 !important;
}

.login-main {
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.form-control:focus {
  border-color: var(--theme-deafult) !important;
  box-shadow: 0 0 0 3px rgba(235, 88, 88, 0.2) !important;
}

/* 7. Buttons */
.btn-primary {
  background: var(--theme-deafult) !important;
  box-shadow: 0 10px 15px -3px rgba(235, 88, 88, 0.4) !important;
  border-radius: 10px !important;
  padding: 12px 30px;
}

.btn-primary:hover {
  background-color: #d64545 !important;
  transform: translateY(-1px);
}

/* 8. Tables */
.table thead th {
  background-color: #f8fafc !important;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
}

/* 4. Dashboard Cards Overhaul */
.dashboard-card {
  border: none !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease !important;
  overflow: hidden;
  position: relative;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px -4px rgba(235, 88, 88, 0.2) !important;
}

.dashboard-card .card-body {
  padding: 24px !important;
}

.dashboard-card .label-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  display: block;
}

.dashboard-card .value-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0;
  letter-spacing: -0.5px;
}

/* Icon Box */
.dashboard-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-icon-box i {
  width: 24px;
  height: 24px;
  stroke-width: 2.5px;
}

/* Soft Colors */
.bg-soft-primary {
  background: rgba(235, 88, 88, 0.1);
  color: #EB5858;
}

.bg-soft-secondary {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.bg-soft-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.bg-soft-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.bg-soft-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.bg-soft-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bg-soft-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.bg-soft-pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.bg-soft-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

/* Soft Colors */
.bg-soft-primary {
  background: rgba(235, 88, 88, 0.1);
  color: #EB5858;
}

.bg-soft-secondary {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.bg-soft-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.bg-soft-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.bg-soft-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.bg-soft-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bg-soft-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.bg-soft-pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

/* 5. Modern Login Page */
.login-page-wrapper {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Abstract Background Shapes */
.login-page-wrapper::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(235, 88, 88, 0.4) 0%, rgba(235, 88, 88, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.login-page-wrapper::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.modern-login-card {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  padding: 40px !important;
  width: 100%;
  max-width: 450px;
  position: relative;
  z-index: 1;
}

.modern-login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.modern-login-logo img {
  height: 50px;
  /* Adjust based on logo needs */
  object-fit: contain;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  text-align: center;
  color: #64748b;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.modern-input-group {
  margin-bottom: 24px;
}

.modern-input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modern-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  color: #1e293b;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.modern-input:focus {
  border-color: #EB5858;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(235, 88, 88, 0.1);
  outline: none;
}

.btn-modern-primary {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #EB5858 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(235, 88, 88, 0.3);
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(235, 88, 88, 0.4);
}

.btn-modern-primary:active {
  transform: translateY(0);
}

/* 6. Floating Labels (Login Form Refinement) */
.floating-label-group {
  position: relative;
  margin-bottom: 24px;
}

.floating-label-group .modern-input {
  height: 58px;
  padding: 24px 16px 8px 16px;
}

.floating-label-group label {
  position: absolute;
  top: 18px;
  left: 16px;
  font-size: 1rem;
  color: #64748b;
  pointer-events: none;
  transition: all 0.2s ease;
  font-weight: 500;
  text-transform: none;
  /* Override uppercase if set previously */
  letter-spacing: normal;
}

/* Float State */
.floating-label-group .modern-input:focus~label,
.floating-label-group .modern-input:not(:placeholder-shown)~label,
.floating-label-group select.modern-input:valid~label,
.floating-label-group select.modern-input:focus~label {
  top: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #EB5858;
}

/* Specific fix for Select (always has value? usually yes if 'Select Role' is value='')
   If option value="" is selected, we want it to NOT float if using :valid?
   Actually, required select is :valid only if value != "".
   So if default is "", it won't be :valid. Perfect.
*/

/* 7. Split Screen Login Layout */
.split-login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.split-left-panel {
  flex: 1;
  background: linear-gradient(135deg, #EB5858 0%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 40px;
}

.split-left-panel::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  top: 0;
  left: 0;
}

.split-right-panel {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  max-width: 800px;
  /* Limit form width */
}

/* On Mobile, hide Left Panel */
@media (max-width: 900px) {
  .split-left-panel {
    display: none;
  }

  .split-right-panel {
    flex: 1;
    width: 100%;
    max-width: 100%;
  }
}

/* Classic Labels (Reverting Floating Labels for Split Layout) */
.classic-label-group {
  margin-bottom: 24px;
}

.classic-label-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classic-label-group .modern-input {
  height: 52px;
  padding: 0 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
}

.classic-label-group .modern-input:focus {
  background: #ffffff;
  border-color: #EB5858;
}

.split-login-content {
  width: 100%;
  max-width: 420px;
}

.split-brand-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.split-brand-content h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.split-brand-content p {
  font-size: 1.25rem;
  opacity: 0.9;
}

/* 8. User Type Toggle (Login Form Refinement) */
.user-type-selector {
  display: flex;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.toggle-option {
  flex: 1;
  text-align: center;
  position: relative;
  cursor: pointer;
  margin-bottom: 0 !important;
  /* Override label margin */
}

.toggle-option input {
  display: none;
}

.toggle-option span {
  display: block;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.3s ease;
}

.toggle-option:hover span {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.5);
}

.toggle-option input:checked+span {
  background: #ffffff;
  color: #EB5858;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
}

/* --- NEW MODERN DASHBOARD STYLES --- */

/* 1. Dashboard Hero */
.dashboard-hero {
  background: linear-gradient(135deg, #EB5858 0%, #0f172a 100%);
  border: none;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 24px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 20px rgba(235, 88, 88, 0.2);
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 16px;
  opacity: 0.8;
  margin: 0;
  font-weight: 400;
  color: #e2e8f0;
}

.hero-date {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

/* 2. Modern Stat Cards (KPIs) */
.stat-card-modern {
  border: none;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 24px;
  overflow: hidden;
}

.stat-card-modern:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.stat-card-modern .card-body {
  display: flex;
  align-items: center;
  padding: 24px;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}

.stat-icon i {
  width: 28px;
  height: 28px;
  stroke-width: 2px;
}

.stat-content .stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #0f172a;
}

.stat-content .stat-label {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* 3. Content Database List */
.content-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar refinement */
.content-list-wrapper::-webkit-scrollbar {
  width: 5px;
}

.content-list-wrapper::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

.content-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  transition: background 0.2s ease;
}

.content-item:hover {
  background: #eff6ff;
}

.content-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
}

.content-icon i {
  width: 20px;
  height: 20px;
}

.content-info h6 {
  margin: 0 0 4px 0;
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
}

.content-info span {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* 4. Chart & Progress Styles */
.chart-container {
  position: relative;
  width: 100%;
}

.quick-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.progress-thin {
  height: 6px;
  border-radius: 10px;
  background-color: #f1f5f9;
}

/* Card Header Tweaks */
.card-header h5 {
  font-weight: 700;
  color: #0f172a;
  font-size: 18px;
}