/* ETA Ops - Custom Styles */

/* CSS Variables for Theming */
:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --accent: linear-gradient(120deg, #2563eb, #7c3aed);
  --stroke: #e5e7eb;
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-subtle: rgba(59, 130, 246, 0.1);
  --success: #10b981;
  --success-dark: #065f46;
  --warning: #f59e0b;
  --warning-dark: #92400e;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: linear-gradient(120deg, #4f46e5, #22d3ee);
  --stroke: #1f2937;
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-subtle: rgba(96, 165, 250, 0.15);
  --success: #34d399;
  --success-dark: #10b981;
  --warning: #fbbf24;
  --warning-dark: #f59e0b;
}

/* Global Styles */
* {
  font-family: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Global Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 5px;
}

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

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) var(--bg);
}

/* App Layout */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--card);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Firefox Scrollbar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) var(--card);
}

.brand {
  margin-bottom: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.brand-logo-light {
  display: block;
  filter: brightness(0.2) saturate(100%);
  opacity: 0.75;
}

.brand-logo-dark {
  display: none;
}

:root[data-theme="dark"] .brand-logo-light {
  display: none;
}

:root[data-theme="dark"] .brand-logo-dark {
  display: block;
  opacity: 0.8;
  filter: brightness(0.92);
}

.brand-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.brand-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 2px;
}

:root[data-theme="dark"] .brand-divider {
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
}

.brand-tagline {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  line-height: 1.4;
}

.nav-section {
  flex: 1;
  overflow-y: auto;
}

.nav-section h6 {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-size: .7rem;
  margin-bottom: .4rem;
  margin-top: 1rem;
}

.nav-section h6:first-child {
  margin-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: 10px;
  transition: all .2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--stroke);
  background: radial-gradient(circle at 0 0, rgba(79, 70, 229, 0.08), rgba(34, 211, 238, 0.08));
  color: var(--text);
}

/* Navigation Group (for nested items) */
.nav-group {
  margin-bottom: 0.25rem;
}

.nav-submenu {
  margin-top: 0.25rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--stroke);
  margin-left: 0.85rem;
}

.nav-link-sub {
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
}

.nav-link-sub:hover,
.nav-link-sub.active {
  background: rgba(79, 70, 229, 0.05);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Action Buttons Row */
.sidebar-actions-row {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.25rem;
}

.sidebar-action-icon {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-action-icon:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.3);
  color: #6366f1;
  transform: translateY(-1px);
}

.sidebar-action-icon:active {
  transform: translateY(0);
}

/* Logout button special styling */
.sidebar-action-logout:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
}

/* User Profile Card */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(34, 211, 238, 0.05));
  border: 1px solid var(--stroke);
  transition: all 0.2s ease;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-user-role {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
}

/* Dark theme adjustments */
:root[data-theme="dark"] .sidebar-action-icon {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .sidebar-action-icon:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

:root[data-theme="dark"] .sidebar-user-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(34, 211, 238, 0.12));
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .sidebar-user-avatar {
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

:root[data-theme="dark"] .sidebar-action-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

/* Main Content Area */
.main {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Top Bar */
.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.pill {
  background: var(--card);
  border: 1px solid var(--stroke);
  padding: .4rem .8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Glass Card Effect */
.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: 16px;
}

/* Hero Section */
.hero {
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.12), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(124, 58, 237, 0.14), transparent 30%),
              var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* Status Indicators */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: #22c55e;
}

.status-dot.offline {
  background-color: #ef4444;
}

.status-dot.warning {
  background-color: #f59e0b;
}

/* Card Elements */
.card-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem;
}

/* Color utility classes */
.text-purple {
  color: #8b5cf6 !important;
}

:root[data-theme="dark"] .text-purple {
  color: #a78bfa !important;
}

/* Gradient Button */
.gradient-btn {
  background-image: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gradient-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
  color: #fff;
}

/* Shimmer Animation for Fancy Buttons */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Pulse Animation for Status Indicators */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translate(25%, 25%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translate(25%, 25%) scale(1.15);
  }
}

/* Map Placeholder */
.map-placeholder {
  height: 200px;
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .04),
    rgba(255, 255, 255, .04) 10px,
    rgba(0, 0, 0, .03) 10px,
    rgba(0, 0, 0, .03) 20px
  );
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .03em;
}

/* Table Styles */
.table {
  color: var(--text);
  border-color: var(--stroke);
}

.table thead {
  background: rgba(79, 70, 229, 0.05);
  border-color: var(--stroke);
}

.table thead th {
  color: var(--text);
  border-color: var(--stroke);
}

.table tbody tr {
  border-color: var(--stroke);
}

.table tbody td {
  color: var(--text);
  border-color: var(--stroke);
}

.table-hover tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

/* Dark Theme Table Overrides */
:root[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(124, 58, 237, 0.08);
  --bs-table-border-color: var(--stroke);
}

:root[data-theme="dark"] .table thead {
  background: rgba(124, 58, 237, 0.08);
}

:root[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: rgba(124, 58, 237, 0.08);
}

/* Card Styles */
.card {
  background-color: var(--card);
  border-color: var(--stroke);
}

.card-body {
  color: var(--text);
}

.card-header {
  background-color: rgba(79, 70, 229, 0.05);
  border-bottom-color: var(--stroke);
  color: var(--text);
}

.card-footer {
  background-color: rgba(79, 70, 229, 0.05);
  border-top-color: var(--stroke);
  color: var(--text);
}

:root[data-theme="dark"] .card-header,
:root[data-theme="dark"] .card-footer {
  background-color: rgba(124, 58, 237, 0.08);
}

:root[data-theme="dark"] .bg-light {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Badge Variants */
.badge-soft {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

:root[data-theme="dark"] .badge-soft {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.3);
}

/* Admin-Only Elements */
/* Admin elements are controlled by JavaScript based on user role */
.admin-only {
  display: none;
}

body.has-admin-role .admin-only {
  display: block;
}

body.has-admin-role .nav-link.admin-only {
  display: flex;
}

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Page Container */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* Form Enhancements */
.form-label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  background-color: var(--card);
  border-color: var(--stroke);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--card);
  border-color: #2563eb;
  color: var(--text);
}

/* Placeholder styles for dark theme */
.form-control::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-control::-webkit-input-placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-control::-moz-placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-control:-ms-input-placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Dark theme specific placeholder enhancement */
:root[data-theme="dark"] .form-control::placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

:root[data-theme="dark"] .form-control::-webkit-input-placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

:root[data-theme="dark"] .form-control::-moz-placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

:root[data-theme="dark"] .form-control:-ms-input-placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

/* Number input spinner arrows - remove for both themes */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Modal Enhancements */
.modal-content {
  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.modal-header {
  border-bottom-color: var(--stroke);
}

.modal-footer {
  border-top-color: var(--stroke);
}

/* Make close button visible in dark theme */
:root[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdown Menu */
.dropdown-menu {
  background-color: var(--card);
  border-color: var(--stroke);
}

.dropdown-item {
  color: var(--text);
}

.dropdown-item:hover {
  background-color: rgba(79, 70, 229, 0.08);
}

.dropdown-header {
  color: var(--muted);
}

.dropdown-divider {
  border-top-color: var(--stroke);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

/* Responsive */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }
}

/* Analytics Charts */
.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  gap: 0.5rem;
  padding: 1rem 0;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.chart-bar-container {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 80%;
  background: linear-gradient(180deg, #4f46e5, #7c3aed);
  border-radius: 8px 8px 0 0;
  min-height: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.chart-bar-value {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.chart-bar-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

/* Log Viewer */
.log-viewer {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1rem;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.log-viewer pre {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.log-viewer code {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Inactive/Disabled Items */
.table-row-inactive {
  opacity: 0.6;
  position: relative;
}

.table-row-inactive td {
  color: var(--muted) !important;
}

.table-row-inactive .badge {
  opacity: 0.7;
}

.table-row-inactive code {
  opacity: 0.7;
  color: var(--muted) !important;
}

.table-row-inactive strong {
  font-weight: 500;
  color: var(--muted) !important;
}

/* Inactive icon overlay */
.inactive-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inactive-indicator::after {
  content: "•";
  color: var(--muted);
  font-size: 1.2rem;
  opacity: 0.5;
}

/* Route Modal Styles */
.route-stops-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.route-stops-container::-webkit-scrollbar {
  width: 6px;
}

.route-stops-container::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.route-stops-container::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 3px;
}

.route-stops-container::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.stop-row {
  transition: all 0.2s ease;
  position: relative;
}

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

.stop-connector {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--stroke) 0%, transparent 100%);
}

/* Form Section Styling */
.glass {
  transition: all 0.3s ease;
}

.glass:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Input Groups */
.input-group-text {
  background-color: var(--card);
  border-color: var(--stroke);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

:root[data-theme="dark"] .input-group-text {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Time input helpers */
.input-group .form-control[pattern*="[0-9]"],
.input-group .time-input {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Clock icon styling in time inputs */
.input-group .input-group-text .bi-clock {
  color: var(--muted);
  font-size: 1rem;
}

:root[data-theme="dark"] .input-group .input-group-text .bi-clock {
  color: #9ca3af;
}

/* Time and Date Input Styling */
input[type="time"],
input[type="date"] {
  position: relative;
  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 0.5rem 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  padding: 0.25rem;
  border-radius: 4px;
}

input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: rgba(79, 70, 229, 0.1);
}

/* Dark theme time/date input fixes */
:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Time input text styling */
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="time"]::-webkit-datetime-edit-text {
  color: var(--muted);
  padding: 0 0.25rem;
}

input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field,
input[type="time"]::-webkit-datetime-edit-ampm-field {
  color: var(--text);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  background-color: transparent;
}

input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus,
input[type="time"]::-webkit-datetime-edit-ampm-field:focus {
  background-color: rgba(79, 70, 229, 0.15);
  outline: none;
  color: var(--text);
}

:root[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-hour-field:focus,
:root[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-minute-field:focus,
:root[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-ampm-field:focus {
  background-color: rgba(124, 58, 237, 0.25);
}

/* Date input text styling */
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
  color: var(--muted);
  padding: 0 0.125rem;
}

input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  background-color: transparent;
}

input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background-color: rgba(79, 70, 229, 0.15);
  outline: none;
  color: var(--text);
}

:root[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field:focus,
:root[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field:focus,
:root[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background-color: rgba(124, 58, 237, 0.25);
}

/* Dark theme badge fixes */
:root[data-theme="dark"] .badge.bg-light {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--text) !important;
  border: 1px solid var(--stroke);
}

:root[data-theme="dark"] .badge.text-dark {
  color: var(--text) !important;
}

/* Route Editor - Stops Table Styles */
#stopsTable {
  font-size: 0.9rem;
}

#stopsTable thead th {
  background-color: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--stroke);
  padding: 0.75rem 0.5rem;
}

#stopsTable tbody tr.stop-row {
  transition: background-color 0.15s ease;
}

#stopsTable tbody tr.stop-row:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

#stopsTable tbody tr.stop-row.dragging {
  opacity: 0.5;
}

#stopsTable tbody td {
  padding: 0.5rem;
  vertical-align: middle;
}

/* Inactive stop row styling */
#stopsTable tbody tr.stop-row.table-secondary {
  background-color: rgba(108, 117, 125, 0.08);
  opacity: 0.65;
}

#stopsTable tbody tr.stop-row.table-secondary:hover {
  background-color: rgba(108, 117, 125, 0.12);
}

#stopsTable tbody tr.stop-row.table-secondary .stop-number {
  opacity: 0.7;
}

/* Dark theme inactive stop row */
:root[data-theme="dark"] #stopsTable tbody tr.stop-row.table-secondary {
  background-color: rgba(156, 163, 175, 0.08);
  opacity: 0.6;
}

:root[data-theme="dark"] #stopsTable tbody tr.stop-row.table-secondary:hover {
  background-color: rgba(156, 163, 175, 0.15);
}

/* Compact time inputs in table */
.time-input-sm {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Drag handle styling */
#stopsTable .bi-grip-vertical {
  font-size: 1.2rem;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

#stopsTable tr:hover .bi-grip-vertical {
  opacity: 0.8;
}

/* Toast Notifications */
.toast-container {
  z-index: 1080 !important;
}

.toast {
  min-width: 320px;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-body {
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Toast color variants */
.toast.text-bg-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
}

.toast.text-bg-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
}

.toast.text-bg-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
}

.toast.text-bg-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: white !important;
}

/* Toast close button */
.toast .btn-close {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.toast .btn-close:hover {
  opacity: 1;
}

.toast .btn-close-white {
  filter: brightness(0) invert(1);
}

/* Dark theme toast enhancements */
:root[data-theme="dark"] .toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .toast.text-bg-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

:root[data-theme="dark"] .toast.text-bg-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

:root[data-theme="dark"] .toast.text-bg-warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

:root[data-theme="dark"] .toast.text-bg-info {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* Route Groups */
.group-chevron {
  transition: transform 0.2s ease;
}

/* Dark theme group badge fixes */
:root[data-theme="dark"] .badge.bg-light.text-dark {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--text) !important;
}

/* Searchable Select Dropdown Theming */
.searchable-select-menu {
  background-color: var(--card) !important;
  border-color: var(--stroke) !important;
}

.searchable-select-search {
  background-color: var(--bg) !important;
  border-color: var(--stroke) !important;
}

.searchable-select-search .input-group-text {
  background-color: var(--card) !important;
  border-color: var(--stroke) !important;
  color: var(--text) !important;
}

.searchable-select-search .form-control {
  background-color: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--stroke) !important;
}

.searchable-select-option {
  border-color: var(--stroke) !important;
  color: var(--text) !important;
}

.searchable-select-option:not(.active):hover {
  background-color: rgba(79, 70, 229, 0.08) !important;
}

:root[data-theme="dark"] .searchable-select-option:not(.active):hover {
  background-color: rgba(99, 102, 241, 0.15) !important;
}

:root[data-theme="dark"] .searchable-select-menu {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Day selection buttons */
.day-button:hover {
  background: rgba(79, 70, 229, 0.05) !important;
  border-color: rgba(79, 70, 229, 0.2) !important;
}

:root[data-theme="dark"] .day-button:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
}

/* Route sections row - force side-by-side layout using Grid */
.route-sections-row {
  display: grid !important;
  grid-template-columns: 35% 65% !important;
  gap: 1rem !important;
  width: 100% !important;
}

.route-section-left,
.route-section-right {
  min-width: 0 !important;
  width: 100% !important;
}

/* Day schedule cards - Compact List */
.day-schedule-card {
  transition: all 0.2s ease;
}

.day-schedule-card:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
  border-color: #6366f1 !important;
}

:root[data-theme="dark"] .day-schedule-card:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25) !important;
}

.day-schedule-card .time-input {
  transition: all 0.15s ease;
}

.day-schedule-card .time-input:not(:disabled):hover {
  background: rgba(99, 102, 241, 0.05) !important;
}

.day-schedule-card .time-input:not(:disabled):focus {
  background: rgba(99, 102, 241, 0.08) !important;
  outline: 2px solid rgba(99, 102, 241, 0.3);
  outline-offset: 0;
}

.day-schedule-card .time-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.day-card-clickable {
  cursor: pointer;
  user-select: none;
}

/* Pulse animation for active indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Day schedule checkboxes - checked state */
.day-checkbox:checked {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
}

.day-checkbox:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

/* Time inputs in day schedules */
.day-schedule-row .time-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

.day-schedule-row .time-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg) !important;
}

/* Departure time inputs - enhanced green theme */
.day-schedule-row .departure-time-input:not(:disabled):hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 0 0.15rem rgba(16, 185, 129, 0.1) !important;
}

.day-schedule-row .departure-time-input:not(:disabled):focus {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.15) !important;
}

/* Deadline time inputs - enhanced yellow theme */
.day-schedule-row .deadline-time-input:not(:disabled):hover {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.1) !important;
}

.day-schedule-row .deadline-time-input:not(:disabled):focus {
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15) !important;
}

/* Day schedules container */
.day-schedules-container {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .day-schedules-container {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Quick actions buttons hover states */
#toggleAllDays:hover,
#copyScheduleBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

:root[data-theme="dark"] #toggleAllDays:hover,
:root[data-theme="dark"] #copyScheduleBtn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Glass effect for route config cards */
.glass {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.7) !important;
}

:root[data-theme="dark"] .glass {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* AD search dropdown items */
.ad-search-result-item {
  transition: background-color 0.15s ease;
}

.ad-search-result-item:hover {
  background-color: rgba(79, 70, 229, 0.08) !important;
}

:root[data-theme="dark"] .ad-search-result-item:hover {
  background-color: rgba(99, 102, 241, 0.12) !important;
}

/* AD search dropdown user name - ensure visibility in dark theme on hover */
:root[data-theme="dark"] .ad-search-result-item:hover .ad-user-name {
  color: rgba(255, 255, 255, 0.95) !important;
}

:root[data-theme="dark"] .ad-search-result-item:hover .ad-user-title {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Form help text - ensure visibility in dark theme */
:root[data-theme="dark"] .form-text {
  color: rgba(255, 255, 255, 0.65) !important;
}

/* View mode toggle buttons - light theme */
.btn-group .btn-check:checked + label.btn-outline-secondary,
.btn-group .btn-check:active + label.btn-outline-secondary,
.btn-group .btn-check:checked + label.btn.btn-outline-secondary,
.btn-group .btn-check:active + label.btn.btn-outline-secondary {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #fff !important;
}

/* View mode toggle buttons - dark theme adaptation */
:root[data-theme="dark"] .btn-group label.btn-outline-secondary {
  --bs-btn-color: rgba(255, 255, 255, 0.75);
  --bs-btn-border-color: rgba(255, 255, 255, 0.25);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-focus-shadow-rgb: 130, 138, 145;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.1);
  --bs-btn-active-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: rgba(255, 255, 255, 0.25);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.1);
  --bs-gradient: none;
  background-color: transparent !important;
}

:root[data-theme="dark"] .btn-group .btn-check:not(:checked) + label.btn-outline-secondary {
  background-color: transparent !important;
}

:root[data-theme="dark"] .btn-group .btn-check:checked + label.btn-outline-secondary,
:root[data-theme="dark"] .btn-group .btn-check:active + label.btn-outline-secondary {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

:root[data-theme="dark"] .btn-group label.btn-outline-secondary:active,
:root[data-theme="dark"] .btn-group label.btn-outline-secondary.active,
:root[data-theme="dark"] .btn-group label.btn-outline-secondary:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Form switch toggle styling - dark theme adaptation */
:root[data-theme="dark"] .form-switch .form-check-input {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  /* Temporary: bright white circle indicator */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

:root[data-theme="dark"] .form-switch .form-check-input:checked {
  background-color: #6366f1;
  border-color: #6366f1;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

:root[data-theme="dark"] .form-switch .form-check-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

/* Regular checkbox styling - dark theme adaptation */
:root[data-theme="dark"] .form-check-input[type="checkbox"]:not(.form-switch .form-check-input) {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.25);
}

:root[data-theme="dark"] .form-check-input[type="checkbox"]:not(.form-switch .form-check-input):checked {
  background-color: #6366f1;
  border-color: #6366f1;
}

:root[data-theme="dark"] .form-check-input[type="checkbox"]:not(.form-switch .form-check-input):focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* Border styling for dark theme */
:root[data-theme="dark"] .border-top,
:root[data-theme="dark"] .border-bottom,
:root[data-theme="dark"] .border-start,
:root[data-theme="dark"] .border-end,
:root[data-theme="dark"] .border {
  border-color: var(--stroke) !important;
}

/* Settings Page Container */
.settings-container {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--stroke);
}

/* Settings Tabs Header */
.settings-tabs-header {
  background: var(--card);
  border-bottom: 1px solid var(--stroke);
  padding: 0;
}

.settings-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.settings-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.settings-tabs .nav-item {
  margin: 0;
  flex-shrink: 0;
}

.settings-tabs .nav-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.settings-tabs .nav-link i {
  font-size: 1.125rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tabs .nav-link span {
  display: block;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state */
.settings-tabs .nav-link:hover {
  color: var(--text);
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.05));
}

.settings-tabs .nav-link:hover i {
  transform: translateY(-2px);
}

/* Active state */
.settings-tabs .nav-link.active {
  color: #6366f1;
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.08));
  border-bottom-color: #6366f1;
}

.settings-tabs .nav-link.active i {
  transform: scale(1.1);
}

/* Settings Content Area */
.settings-content {
  padding: 1.5rem;
  min-height: 300px;
  background: var(--card);
}

/* Tab content transitions */
.tab-content {
  animation: fadeInUp 0.3s ease;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

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

/* Dark theme adjustments */
:root[data-theme="dark"] .settings-tabs .nav-link:hover {
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.12));
}

:root[data-theme="dark"] .settings-tabs .nav-link.active {
  color: #818cf8;
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.15));
  border-bottom-color: #818cf8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .settings-tabs .nav-link {
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
  }

  .settings-tabs .nav-link i {
    font-size: 1rem;
  }

  .settings-content {
    padding: 1rem;
  }
}

/* Developer Page Styles */
.dev-page-header {
  background: linear-gradient(to right, #f8fafc, #f1f5f9);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.dev-page-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

.dev-page-title {
  font-weight: 700;
  font-size: 1.75rem;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.dev-page-subtitle {
  color: #64748b;
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.dev-tabs-container {
  display: inline-flex;
  background: white;
  padding: 4px;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  gap: 4px;
}

/* Dark theme support for developer page */
:root[data-theme="dark"] .dev-page-header {
  background: linear-gradient(to right, rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.3));
  border-color: var(--stroke);
}

:root[data-theme="dark"] .dev-page-title {
  color: var(--text);
}

:root[data-theme="dark"] .dev-page-subtitle {
  color: var(--muted);
}

:root[data-theme="dark"] .dev-tabs-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
}

/* Search field styles */
.search-field-wrapper {
  position: relative;
  min-width: 250px;
  flex-grow: 1;
}

.search-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
}

.search-field-input {
  padding: 8px 12px 8px 36px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border-radius: 12px !important;
  font-size: 0.9rem !important;
  border: 0 !important;
  color: var(--text) !important;
}

.search-field-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: none !important;
  border: none !important;
  color: var(--muted) !important;
}

:root[data-theme="dark"] .search-field-input {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text) !important;
}

:root[data-theme="dark"] .search-field-input::placeholder {
  color: var(--muted) !important;
  opacity: 0.6;
}

/* ========================================
   USERS LIST LAYOUT
   ======================================== */

.users-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ========================================
   USER CARD V2 - CLEAN & MODERN
   ======================================== */

.user-card-v2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.user-card-v2:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .user-card-v2:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Avatar */
.user-card-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.user-card-initials {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

/* Main Content */
.user-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.user-card-email {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.user-card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Badges V2 */
.badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-v2 i {
  font-size: 0.75rem;
}

.badge-v2-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-v2-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-v2-secondary {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge-v2-info {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-v2-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Actions */
.user-card-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  .user-card-v2 {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }

  .user-card-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .user-card-initials {
    font-size: 0.9375rem;
  }

  .user-card-main {
    flex: 1 1 calc(100% - 88px);
  }

  .user-card-name {
    font-size: 0.875rem;
  }

  .user-card-email {
    font-size: 0.75rem;
  }

  .badge-v2 {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
  }

  .user-card-actions {
    order: 2;
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .user-card-actions .btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
  }

  .user-card-actions .btn i {
    font-size: 0.875rem;
  }

  .user-card-badges {
    flex: 1 1 100%;
    order: 3;
  }
}

/* Legacy user list styles (keep for backward compatibility) */
.user-list-item {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--stroke);
}

.user-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

:root[data-theme="dark"] .user-list-item:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.user-list-item-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.user-list-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.user-list-info {
  flex: 1;
  min-width: 0;
}

.user-list-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-list-email {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-list-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-list-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
}

.user-list-badge i {
  font-size: 0.875rem;
}

.user-list-item-content .btn-group {
  margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-list-item-content {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }

  .user-list-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 1rem;
  }

  .user-list-info {
    flex: 1 1 calc(100% - 70px);
    min-width: 0;
  }

  .user-list-badges {
    flex: 1 1 100%;
    order: 3;
  }

  .user-list-item-content .btn-group {
    order: 2;
    margin-left: 0;
  }
}

/* ========================================
   ROLES LIST LAYOUT
   ======================================== */

.roles-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-list-item {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--stroke);
}

.role-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

:root[data-theme="dark"] .role-list-item:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.role-list-item-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.role-list-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.role-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 200px;
}

.role-list-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.role-list-id {
  font-size: 0.75rem;
  color: var(--muted);
}

.role-list-id code {
  background: rgba(100, 116, 139, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

:root[data-theme="dark"] .role-list-id code {
  background: rgba(255, 255, 255, 0.05);
}

.role-list-description {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-list-item-content .btn-group {
  margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .role-list-item-content {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }

  .role-list-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 1.25rem;
  }

  .role-list-info {
    flex: 1 1 calc(100% - 70px);
    min-width: 0;
  }

  .role-list-description {
    flex: 1 1 100%;
    order: 3;
    white-space: normal;
  }

  .role-list-item-content .btn-group {
    order: 2;
    margin-left: 0;
  }
}
