:root {
  /* Custom color palette */
  --primary-blue: #09427D;
  --primary-blue-dark: #072e54;
  --primary-blue-light: #0b5ba6;
  --gray-50: #fafbfc;
  --gray-100: #f5f6f8;
  --gray-200: #e5e9f2;
  --gray-300: #d1d9e0;
  --gray-400: #b9c3cd;
  --gray-500: #8a95a6;
  --gray-600: #6b7785;
  --gray-700: #4a5568;
  --gray-800: #364152;
  --gray-900: #1a202c;
  --success: #48bb78;
  --warning: #ed8936;
  --error: #f56565;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

/* Top Navigation */
.navbar {
  background-color: var(--primary-blue) !important;
  border-bottom: none;
  padding: 16px 0;
  height: 80px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.client-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar .container-fluid {
  padding: 0 24px;
}

.navbar-brand {
  color: var(--white) !important;
  font-weight: 600;
  font-size: 18px;
  display: flex !important;
  align-items: center !important;
  z-index: 1001 !important;
}

.navbar-brand img {
  display: block !important;
  max-height: 40px !important;
  width: auto !important;
}

.navbar-brand span {
  color: var(--white) !important;
  font-weight: 600 !important;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  margin: 0 8px;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--white) !important;
}

.navbar #navbar-notifications .dropdown-menu {
  max-height: 60vh;
}

.navbar #navbar-notifications .dropdown-menu.show {
  display: flex;
  flex-direction: column;
}

.navbar #navbar-notifications .dropdown-menu > .d-flex,
.navbar #navbar-notifications .dropdown-menu > .border-top {
  flex-shrink: 0;
}

#navbar-notifications-loading {
  flex: 0 0 auto;
}

#navbar-notifications-list {
  flex: 1 1 auto;
  overflow-y: auto;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Sidebar Layout */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding-top: 80px;
  z-index: 999;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--primary-blue);
  z-index: -1;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 0 0 0;
  margin: 0;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  margin: 4px 16px;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover {
  background: var(--gray-100);
  color: var(--gray-800);
  text-decoration: none;
}

.sidebar-menu a.active {
  background: var(--primary-blue);
  color: var(--white);
  text-decoration: none;
}

.sidebar-menu i {
  margin-right: 12px;
  width: 16px;
  text-align: center;
  font-size: 16px;
}

.main-content {
  margin-left: 280px;
  min-height: calc(100vh - 80px);
  padding: 32px;
  background-color: var(--gray-50);
}

.main-content.no-sidebar {
  margin-left: 0;
}

.hero-section {
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-light)) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Cards */
.card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background: var(--white);
  transition: all 0.2s ease;
}

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

.card-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  border-radius: 12px 12px 0 0 !important;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 16px;
  color: var(--gray-800);
}

.card-body {
  padding: 24px;
}

/* Tables: ensure dark text on light rows */
.table th,
.table td {
  color: var(--gray-800) !important;
}

.table thead th {
  background-color: var(--gray-100);
  border-bottom-color: var(--gray-200);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Buttons */
.btn {
  border-radius: 8px !important;
  font-weight: 500 !important;
  padding: 12px 20px !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

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

.btn-primary:hover {
  background-color: var(--primary-blue-dark) !important;
  border-color: var(--primary-blue-dark) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--gray-500) !important;
  color: var(--white) !important;
  border-color: var(--gray-500) !important;
}

.btn-secondary:hover {
  background-color: var(--gray-600) !important;
  border-color: var(--gray-600) !important;
  color: var(--white) !important;
}

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

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

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

.btn-primary:hover {
  background-color: hsl(var(--primary-dark)) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: white !important;
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: white;
}

.btn-secondary:hover {
  background-color: hsl(88, 50%, 43%);
}

.btn-outline-primary {
  border: 2px solid hsl(var(--primary));
  color: hsl(var(--primary));
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: hsl(var(--primary));
  color: white;
}

.btn-success {
  background-color: hsl(var(--success));
  color: white;
}

.btn-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--text));
}

.btn-danger {
  background-color: hsl(var(--error));
  color: white;
}

/* Forms */
.form-control {
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--white);
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-select {
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--white);
}

.form-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
  outline: none;
}

/* File upload */
.upload-area {
  border: 3px dashed hsl(var(--border));
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  background-color: hsl(var(--background));
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: hsl(var(--primary));
  background-color: rgba(var(--primary), 0.05);
}

.upload-area.dragover {
  border-color: hsl(var(--primary));
  background-color: rgba(var(--primary), 0.1);
}

.upload-icon {
  font-size: 3rem;
  color: hsl(var(--primary));
  margin-bottom: 1rem;
}

/* Progress bars */
.progress {
  height: 0.75rem;
  border-radius: 8px;
  background-color: hsl(var(--border));
}

.progress-bar {
  background-color: hsl(var(--primary));
  border-radius: 8px;
}

/* Badges */
.badge {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.badge-success {
  background-color: hsl(var(--success));
  color: white;
}

.badge-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--text));
}

.badge-info {
  background-color: hsl(var(--info));
  color: white;
}

.badge-secondary {
  background-color: hsl(var(--text-light));
  color: white;
}

/* Tables */
.table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table thead th {
  background-color: hsl(var(--primary));
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  border-color: hsl(var(--border));
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: hsl(var(--background));
}

/* Alerts */
.alert {
  border: none;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(var(--success), 0.1);
  color: hsl(var(--success));
  border-left: 4px solid hsl(var(--success));
}

.alert-warning {
  background-color: rgba(var(--warning), 0.1);
  color: hsl(45, 100%, 35%);
  border-left: 4px solid hsl(var(--warning));
}

.alert-danger {
  background-color: rgba(var(--error), 0.1);
  color: hsl(var(--error));
  border-left: 4px solid hsl(var(--error));
}

.alert-info {
  background-color: rgba(var(--info), 0.1);
  color: hsl(var(--info));
  border-left: 4px solid hsl(var(--info));
}

/* Dashboard specific styles */
.dashboard-card {
  text-align: center;
  padding: 2rem;
}

.dashboard-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: hsl(var(--primary));
  margin-bottom: 0.5rem;
}

.dashboard-label {
  color: hsl(var(--text-light));
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-container {
  position: relative;
  height: 400px;
  margin: 1rem 0;
}

/* Step Tabs */
.step-tab {
  color: var(--gray-500) !important;
  text-decoration: none !important;
  padding: 12px 24px !important;
  border: none !important;
  background: none !important;
  border-bottom: 2px solid transparent !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.step-tab.active {
  color: var(--primary-blue) !important;
  border-bottom-color: var(--primary-blue) !important;
}

.step-tab:hover {
  color: var(--gray-700) !important;
  text-decoration: none !important;
}

/* Wizard styles */
.wizard-container {
  max-width: 100%;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-navigation {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Profile image */
.profile-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

/* Notifications */
.notification-item {
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  transition: background-color 0.3s ease;
}

.notification-item:hover {
  background-color: hsl(var(--background));
}

.notification-item.unread {
  background-color: rgba(var(--info), 0.05);
  border-left: 4px solid hsl(var(--info));
}

/* Footer */
.footer {
  background-color: hsl(var(--text));
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .dashboard-number {
    font-size: 2rem;
  }
  
  .chart-container {
    height: 300px;
  }
  
  .upload-area {
    padding: 2rem 1rem;
  }
  
  .wizard-navigation {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Utility classes */
.text-primary { color: hsl(var(--primary)) !important; }
.text-secondary { color: hsl(var(--secondary)) !important; }
.text-success { color: hsl(var(--success)) !important; }
.text-warning { color: hsl(45, 100%, 35%) !important; }
.text-danger { color: hsl(var(--error)) !important; }
.text-info { color: hsl(var(--info)) !important; }

.bg-light { background-color: hsl(var(--background)) !important; }
.border-primary { border-color: hsl(var(--primary)) !important; }

.shadow-sm { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important; }
.shadow-lg { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--border));
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--text-light));
  border-radius: 4px;
}

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