/* Root Variables - Bridge Color Scheme */
:root {
  --primary-color: #1e3a8a;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #0ea5e9;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-bg: #0f172a;
  --sidebar-bg: #1e293b;
  --content-bg: #f1f5f9;
  --white: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--content-bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 280px;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
  width: 80px;
}

/* Sidebar Header */
.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  font-size: 36px;
  color: var(--secondary-color);
  transition: transform 0.3s ease;
}

.logo-icon:hover {
  transform: rotate(10deg) scale(1.1);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--white);
}

.logo-subtitle {
  font-size: 12px;
  color: var(--secondary-color);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Sidebar User Section */
.sidebar-user {
  padding: 25px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.user-avatar {
  font-size: 48px;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}

.user-company {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.user-role {
  margin-top: 5px;
}

.user-role .badge {
  font-size: 11px;
  padding: 4px 8px;
  background-color: var(--secondary-color) !important;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

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

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 10px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin: 5px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 15px 25px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  gap: 15px;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--secondary-color);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  padding-left: 30px;
}

.nav-link:hover::before {
  transform: scaleY(1);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-weight: 600;
}

.nav-link.active::before {
  transform: scaleY(1);
}

.nav-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-link span {
  font-size: 15px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-form {
  width: 100%;
}

.btn-logout {
  width: 100%;
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
}

.btn-logout:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-logout i {
  font-size: 18px;
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 80px;
}

/* Top Bar */
.top-bar {
  background: var(--white);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--content-bg);
  color: var(--primary-color);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-icon {
  position: relative;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s ease;
}

.notification-icon:hover {
  color: var(--primary-color);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger-color);
  color: var(--white);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 600;
}

/* Content Wrapper */
.content-wrapper {
  flex: 1;
  padding: 30px;
}

/* Main Footer */
.main-footer {
  background: var(--white);
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.separator {
  color: var(--border-color);
}

/* Authentication Layout */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--secondary-color) 100%);
  padding: 20px;
}

.auth-container {
  background: var(--white);
  padding: 50px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo i {
  font-size: 64px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.auth-logo h1 {
  font-size: 28px;
  color: var(--text-primary);
  font-weight: 700;
}

.auth-footer {
  text-align: center;
  margin-top: 30px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Card Styles */
.card {
  background: var(--white);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  padding: 20px 25px;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  font-size: 18px;
}

.card-body {
  padding: 25px;
}

/* Button Styles */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-secondary {
  background: var(--secondary-color);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
  background: var(--accent-color);
}

.btn-success {
  background: var(--success-color);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: var(--danger-color);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Form Styles */
.form-control,
.form-select {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Table Styles */
.table {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
}

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

.table tbody tr {
  transition: background 0.3s ease;
}

.table tbody tr:hover {
  background: var(--content-bg);
}

.table tbody td {
  padding: 16px;
  vertical-align: middle;
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: rgba(14, 165, 233, 0.1);
  color: #075985;
  border-left: 4px solid var(--secondary-color);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border-left: 4px solid var(--warning-color);
}

/* Badge Styles */
.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .footer-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .auth-container {
    padding: 30px;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: 15px;
  }

  .top-bar {
    padding: 15px;
  }

  .auth-container {
    padding: 20px;
  }
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary-light {
  background: rgba(30, 58, 138, 0.1);
}

.stat-card {
  background: var(--white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 5px;
}
/* Additional CSS for the updated layout - ADD THIS TO YOUR EXISTING site.css */

/* Top Bar Updates */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--content-bg);
  color: var(--primary-color);
}

/* User Dropdown in Top Bar */
.user-dropdown {
  position: relative;
}

.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-dropdown-toggle:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

.user-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-avatar-small i {
  font-size: 24px;
}

.user-info-small {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.user-name-small {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role-small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* User Dropdown Menu */
.user-dropdown-menu {
  min-width: 250px;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.dropdown-header {
  padding: 15px 20px;
  background: var(--content-bg);
}

.dropdown-user-info strong {
  font-size: 16px;
  color: var(--text-primary);
}

.dropdown-item {
  padding: 10px 20px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--content-bg);
  color: var(--primary-color);
}

.dropdown-item i {
  width: 20px;
}

.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

/* Notification Icon */
.notification-icon {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.notification-icon:hover {
  background: var(--content-bg);
}

.notification-icon i {
  font-size: 1.25rem;
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger-color);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-version {
  display: none;
}

.sidebar.collapsed .logo-container {
  justify-content: center;
}

.sidebar.collapsed .logo-icon {
  margin-right: 0;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 15px;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0;
  font-size: 20px;
}

/* Main Content Expanded State */
.main-content.expanded {
  margin-left: 80px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-version small {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Remove old sidebar user section styles if they exist */
.sidebar-user {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 80px;
  }

  .sidebar .logo-text,
  .sidebar .nav-link span,
  .sidebar .sidebar-version {
    display: none;
  }

  .sidebar .logo-container {
    justify-content: center;
  }

  .sidebar .logo-icon {
    margin-right: 0;
  }

  .sidebar .nav-link {
    justify-content: center;
    padding: 15px;
  }

  .sidebar .nav-link i {
    margin-right: 0;
    font-size: 20px;
  }

  .main-content {
    margin-left: 80px;
  }

  .page-heading {
    display: none;
  }

  .user-info-small {
    display: none;
  }

  .user-dropdown-toggle i.fa-chevron-down {
    display: none;
  }
}

@media (max-width: 576px) {
  .notification-icon {
    display: none;
  }

  .top-bar {
    padding: 0 15px;
  }
}

/* Smooth transitions */
.sidebar,
.main-content,
.logo-text,
.nav-link span {
  transition: all 0.3s ease;
}

/* Active nav link highlight */
.nav-link.active,
.nav-link:hover {
  background: var(--primary-color);
  color: white;
}

.nav-link.active i,
.nav-link:hover i {
  color: white;
}