:root {
  --xf-blue: #295ff5;
  --xf-blue-dark: #1a4cd4;
  --xf-blue-light: #5a83f7;
  --xf-blue-ultra: #e8efff;
  --xf-sidebar-bg: #0b0e1a;
  --xf-sidebar-border: rgba(255,255,255,0.06);
  --xf-sidebar-width: 265px;
  --xf-sidebar-collapsed: 72px;
  --xf-topbar-h: 66px;
  --xf-radius: 14px;
  --xf-radius-sm: 10px;
  --xf-shadow: 0 4px 24px rgba(41,95,245,0.10);
  --xf-shadow-md: 0 8px 40px rgba(0,0,0,0.13);
  --xf-transition: 0.28s cubic-bezier(0.4,0,0.2,1);

  /* Light mode tokens */
  --xf-bg: #f0f4ff;
  --xf-surface: #ffffff;
  --xf-surface-2: #f5f7ff;
  --xf-border: #e4ebff;
  --xf-text: #0d1329;
  --xf-text-muted: #6b7a99;
  --xf-topbar-bg: rgba(255,255,255,0.85);
}

[data-bs-theme="dark"] {
  --xf-bg: #080c18;
  --xf-surface: #10162a;
  --xf-surface-2: #161d35;
  --xf-border: #1e2849;
  --xf-text: #e8eeff;
  --xf-text-muted: #7a88b0;
  --xf-topbar-bg: rgba(11,14,26,0.92);
  --xf-blue-ultra: rgba(41,95,245,0.12);
  --xf-shadow: 0 4px 24px rgba(41,95,245,0.18);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--xf-bg);
  color: var(--xf-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--xf-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--xf-blue); }

/* ===== LOGIN PAGE ===== */
.login-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0b0f22 0%, #0d1a4a 50%, #1e3ecc 100%);
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
}

/* Animated floating orbs */
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
}

.login-bg-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(61, 114, 252, 0.3);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.login-bg-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(107, 144, 253, 0.2);
  bottom: -8%;
  left: -5%;
  animation-delay: -3s;
}

.login-bg-orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(138, 172, 254, 0.15);
  top: 40%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* Centered card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--xf-surface);
  border-radius: 20px;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.login-card-logo-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card-logo {
  height: 64px;
  object-fit: contain;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
  color: var(--xf-text);
  text-align: center;
}

.login-desc {
  color: var(--xf-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  text-align: center;
}



.role-tabs {
  display: flex;
  background: var(--xf-surface-2);
  border-radius: var(--xf-radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 2rem;
}

.role-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--xf-text-muted);
  cursor: pointer;
  transition: all var(--xf-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.role-tab.active {
  background: var(--xf-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(61,114,252,0.35);
}

.xf-input-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.xf-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--xf-text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.xf-input-group .xf-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1.5px solid var(--xf-border);
  border-radius: var(--xf-radius-sm);
  background: var(--xf-surface);
  color: var(--xf-text);
  font-size: 0.9rem;
  transition: all var(--xf-transition);
  outline: none;
}

.xf-input-group .xf-input:focus {
  border-color: var(--xf-blue);
  box-shadow: 0 0 0 3px rgba(41,95,245,0.12);
}

.xf-input-group .xf-input-icon {
  position: absolute;
  left: 0.85rem;
  bottom: 0.78rem;
  color: var(--xf-text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.xf-input-group .xf-input-eye {
  position: absolute;
  right: 0.75rem;
  bottom: 0.68rem;
  background: none;
  border: none;
  color: var(--xf-text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 1rem;
}

.btn-xf-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--xf-blue);
  color: #fff;
  border: none;
  border-radius: var(--xf-radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--xf-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(61,114,252,0.3);
}

.btn-xf-primary:hover {
  background: var(--xf-blue-dark);
  box-shadow: 0 6px 24px rgba(61,114,252,0.45);
  transform: translateY(-1px);
}

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

.login-demo-box {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--xf-surface-2);
  border: 1px solid var(--xf-border);
  border-radius: var(--xf-radius-sm);
  font-size: 0.8rem;
  color: var(--xf-text-muted);
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--xf-sidebar-width);
  height: 100vh;
  background:
    linear-gradient(
      to bottom,
      rgba(8,14,42,0.97)  0%,
      rgba(8,14,42,0.94) 45%,
      rgba(6,11,32,0.82) 72%,
      rgba(4, 8,24,0.60) 100%
    ),
    url('../assets/img/hero-vtc-1.png') center 55% / cover no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width var(--xf-transition);
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  padding: 1.25rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-decoration: none;
  white-space: nowrap;
  min-height: 66px;
  background: rgba(8,14,42,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-logo {
  height: 46px;
  object-fit: contain;
  min-width: 140px;
  transition: opacity var(--xf-transition);
}

.sidebar-logo-icon {
  height: 32px;
  width: 32px;
  min-width: 32px;
  object-fit: contain;
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  padding: 1rem 1.2rem 0.3rem;
  white-space: nowrap;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.62rem 1rem;
  margin: 2px 8px;
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--xf-transition);
  position: relative;
  white-space: nowrap;
}

.sidebar-link i {
  font-size: 1.05rem;
  min-width: 20px;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(61,114,252,0.18);
  color: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(61,114,252,0.90), rgba(61,114,252,0.65));
  color: #fff;
  box-shadow: 0 4px 16px rgba(61,114,252,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--xf-blue);
  border-radius: 2px;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background var(--xf-transition);
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user-card:hover {
  background: rgba(255,255,255,0.11);
}

.sidebar-user-info {
  min-width: 0;
  transition: opacity var(--xf-transition);
}

.sidebar-user-info .name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
}

/* COLLAPSED SIDEBAR */
#sidebar.collapsed {
  width: var(--xf-sidebar-collapsed);
}

#sidebar.collapsed .sidebar-link span,
#sidebar.collapsed .nav-section-label,
#sidebar.collapsed .sidebar-badge,
#sidebar.collapsed .sidebar-user-info,
#sidebar.collapsed .sidebar-logo {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

#sidebar.collapsed .sidebar-logo-icon {
  display: block;
}

#sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.62rem;
  margin: 2px 8px;
}

#sidebar.collapsed .sidebar-link.active::before {
  display: none;
}

#sidebar.collapsed .sidebar-brand {
  justify-content: center;
}

/* ===== MAIN CONTENT ===== */
#mainContent {
  margin-left: var(--xf-sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--xf-transition);
  display: flex;
  flex-direction: column;
}

#mainContent.expanded {
  margin-left: var(--xf-sidebar-collapsed);
}

/* ===== TOPBAR ===== */
.xf-topbar {
  height: var(--xf-topbar-h);
  background: var(--xf-topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--xf-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--xf-text);
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--xf-border);
  background: var(--xf-surface);
  color: var(--xf-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--xf-transition);
  font-size: 1.05rem;
  text-decoration: none;
}

.topbar-icon-btn:hover {
  border-color: var(--xf-blue);
  color: var(--xf-blue);
  background: var(--xf-blue-ultra);
}

/* ===== AVATAR ===== */
.xf-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--xf-blue), #5a83f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.xf-avatar.lg {
  width: 68px;
  height: 68px;
  min-width: 68px;
  font-size: 1.4rem;
  border-radius: 50%;
}

.xf-avatar.sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.65rem;
}

/* ===== CARDS ===== */
.xf-card {
  background: var(--xf-surface);
  border: 1px solid var(--xf-border);
  border-radius: var(--xf-radius);
  padding: 1.5rem;
  transition: box-shadow var(--xf-transition), transform var(--xf-transition);
}

.xf-card:hover {
  box-shadow: var(--xf-shadow);
}

.xf-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--xf-shadow-md);
}

/* ===== STAT CARD ===== */
.xf-stat-card {
  background: var(--xf-surface);
  border: 1px solid var(--xf-border);
  border-radius: var(--xf-radius);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: all var(--xf-transition);
}

.xf-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--xf-shadow-md);
}

.xf-stat-card .accent-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--xf-radius) var(--xf-radius) 0 0;
}

.xf-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ===== PLATFORM CARD ===== */
.xf-platform-card {
  background: var(--xf-surface);
  border: 1.5px solid var(--xf-border);
  border-radius: var(--xf-radius);
  overflow: hidden;
  transition: all var(--xf-transition);
}

.xf-platform-card:hover {
  border-color: var(--xf-blue);
  transform: translateY(-3px);
  box-shadow: var(--xf-shadow-md);
}

.xf-platform-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ===== CHART BARS ===== */
.xf-chart {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.xf-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.xf-chart-col:hover .xf-bar {
  filter: brightness(1.18);
}

.chart-value-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--xf-text-muted);
  white-space: nowrap;
  min-height: 16px;
}

.xf-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.xf-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--xf-blue-light), var(--xf-blue));
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xf-bar.xf-bar-highlight {
  background: linear-gradient(180deg, #60efb0, #10b981);
  box-shadow: 0 -2px 12px rgba(16,185,129,0.35);
}

.xf-bar.xf-bar-dim {
  opacity: 0.45;
}

.xf-bar.green {
  background: linear-gradient(180deg, #34d186, #059669);
}

.xf-bar.purple {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.xf-chart-label {
  font-size: 0.65rem;
  color: var(--xf-text-muted);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  padding-top: 3px;
  border-top: 1px solid var(--xf-border);
  width: 100%;
}

/* ===== PLATFORM LOGO IMAGES ===== */
.platform-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  border-radius: inherit;
}

.platform-badge-img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  vertical-align: middle;
}

/* ===== BADGES ===== */
.xf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.xf-badge-blue { background: rgba(41,95,245,0.12); color: var(--xf-blue); }
.xf-badge-green { background: rgba(16,185,129,0.12); color: #059669; }
.xf-badge-yellow { background: rgba(245,158,11,0.12); color: #d97706; }
.xf-badge-red { background: rgba(239,68,68,0.12); color: #dc2626; }
.xf-badge-gray { background: rgba(107,114,128,0.12); color: #6b7280; }
.xf-badge-purple { background: rgba(124,58,237,0.12); color: #7c3aed; }

[data-bs-theme="dark"] .xf-badge-green { color: #34d186; }
[data-bs-theme="dark"] .xf-badge-yellow { color: #fbbf24; }
[data-bs-theme="dark"] .xf-badge-red { color: #f87171; }
[data-bs-theme="dark"] .xf-badge-purple { color: #a78bfa; }

/* ===== STATUS DOT ===== */
.xf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.xf-dot-green { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.xf-dot-gray { background: #9ca3af; }
.xf-dot-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.xf-dot-yellow { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }

/* ===== PROGRESS ===== */
.xf-progress {
  height: 6px;
  background: var(--xf-surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.xf-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--xf-blue-light), var(--xf-blue));
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== TABLE ===== */
.xf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.xf-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--xf-text-muted);
  padding: 0 1rem 0.75rem;
  border-bottom: 1.5px solid var(--xf-border);
  white-space: nowrap;
}

.xf-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--xf-border);
  color: var(--xf-text);
  vertical-align: middle;
}

.xf-table tr:last-child td {
  border-bottom: none;
}

.xf-table tbody tr {
  transition: background var(--xf-transition);
}

.xf-table tbody tr:hover {
  background: var(--xf-surface-2);
}

/* ===== FORM INPUTS ===== */
.xf-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--xf-text);
  margin-bottom: 0.4rem;
  display: block;
}

.xf-form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--xf-border);
  border-radius: var(--xf-radius-sm);
  background: var(--xf-surface);
  color: var(--xf-text);
  font-size: 0.875rem;
  transition: all var(--xf-transition);
  outline: none;
}

.xf-form-control:focus {
  border-color: var(--xf-blue);
  box-shadow: 0 0 0 3px rgba(41,95,245,0.1);
}

.xf-form-control:disabled {
  background: var(--xf-surface-2);
  color: var(--xf-text-muted);
  cursor: not-allowed;
}

/* ===== BUTTONS ===== */
.btn-xf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--xf-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--xf-transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-xf-primary {
  background: var(--xf-blue);
  color: #fff;
  border-color: var(--xf-blue);
  box-shadow: 0 4px 12px rgba(41,95,245,0.3);
}

.btn-xf-primary:hover {
  background: var(--xf-blue-dark);
  border-color: var(--xf-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(41,95,245,0.4);
  color: #fff;
}

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

.btn-xf-outline:hover {
  background: var(--xf-blue-ultra);
  color: var(--xf-blue);
}

.btn-xf-ghost {
  background: var(--xf-surface-2);
  color: var(--xf-text);
  border-color: var(--xf-border);
}

.btn-xf-ghost:hover {
  background: var(--xf-border);
  color: var(--xf-text);
}

.btn-xf-danger {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  border-color: rgba(239,68,68,0.2);
}

.btn-xf-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.btn-xf-success {
  background: rgba(16,185,129,0.1);
  color: #059669;
  border-color: rgba(16,185,129,0.2);
}

.btn-xf-success:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.btn-xf-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
}

.btn-xf-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* ===== PAGE HEADER ===== */
.xf-page-header {
  margin-bottom: 2rem;
}

.xf-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--xf-text);
  margin-bottom: 0.25rem;
}

.xf-page-sub {
  color: var(--xf-text-muted);
  font-size: 0.875rem;
}

/* ===== DOC CARD ===== */
.xf-doc-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--xf-surface);
  border: 1.5px solid var(--xf-border);
  border-radius: var(--xf-radius);
  transition: all var(--xf-transition);
}

.xf-doc-card:hover {
  border-color: var(--xf-blue);
  background: var(--xf-blue-ultra);
}

/* ===== MODAL ===== */
.modal-content {
  background: var(--xf-surface) !important;
  border: 1px solid var(--xf-border) !important;
  border-radius: calc(var(--xf-radius) + 4px) !important;
  box-shadow: var(--xf-shadow-md) !important;
}

.modal-header, .modal-footer {
  border-color: var(--xf-border) !important;
}

/* ===== PAYFIT BADGE ===== */
.xf-payfit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--xf-blue), #5a83f7);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ===== DIVIDER ===== */
.xf-divider {
  border: none;
  border-top: 1px solid var(--xf-border);
}

/* ===== ALERT ===== */
.xf-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--xf-radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.875rem;
}

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

.xf-alert-info {
  background: rgba(41,95,245,0.08);
  border: 1px solid rgba(41,95,245,0.2);
  color: var(--xf-blue);
}

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

.xf-alert-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #991b1b;
}

[data-bs-theme="dark"] .xf-alert-warning { color: #fbbf24; }
[data-bs-theme="dark"] .xf-alert-info { color: #7aa0ff; }
[data-bs-theme="dark"] .xf-alert-success { color: #34d186; }
[data-bs-theme="dark"] .xf-alert-danger { color: #f87171; }

/* ===== MOBILE OVERLAY ===== */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 1039;
  opacity: 0;
  transition: opacity var(--xf-transition);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1199.98px) {
  :root { --xf-sidebar-width: 240px; }
}

@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
    width: var(--xf-sidebar-width) !important;
    transition: transform var(--xf-transition);
  }

  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.4);
  }

  #mainContent {
    margin-left: 0 !important;
  }

  #sidebarOverlay {
    display: block;
    pointer-events: none;
  }

  #sidebarOverlay.active {
    opacity: 1;
    pointer-events: all;
  }

  #sidebar.collapsed .sidebar-link span,
  #sidebar.collapsed .nav-section-label,
  #sidebar.collapsed .sidebar-badge,
  #sidebar.collapsed .sidebar-user-info,
  #sidebar.collapsed .sidebar-logo {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
  }

  #sidebar.collapsed .sidebar-link {
    justify-content: flex-start !important;
    padding: 0.62rem 1rem !important;
  }

  #sidebar.collapsed .sidebar-logo { display: block !important; }
  #sidebar.collapsed .sidebar-logo-icon { display: none !important; }

  .login-card { padding: 2rem 1.5rem 1.5rem; border-radius: 16px; }
  .login-title { font-size: 1.35rem; }
}

@media (max-width: 575.98px) {
  .xf-page-title { font-size: 1.25rem; }
  .xf-topbar { padding: 0 1rem; }
  main { padding: 1rem !important; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.xf-fade-in {
  animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.xf-fade-in:nth-child(1) { animation-delay: 0.05s; }
.xf-fade-in:nth-child(2) { animation-delay: 0.10s; }
.xf-fade-in:nth-child(3) { animation-delay: 0.15s; }
.xf-fade-in:nth-child(4) { animation-delay: 0.20s; }

/* ===== UTILITY ===== */
.text-xf-blue { color: var(--xf-blue); }
.bg-xf-blue { background: var(--xf-blue); color: #fff; }
.border-xf { border-color: var(--xf-border) !important; }
.rounded-xf { border-radius: var(--xf-radius) !important; }
.surface-2 { background: var(--xf-surface-2); }

/* ===== DROPDOWN ===== */
.dropdown-menu {
  background: var(--xf-surface) !important;
  border: 1px solid var(--xf-border) !important;
  border-radius: var(--xf-radius-sm) !important;
  box-shadow: var(--xf-shadow-md) !important;
  padding: 0.4rem !important;
}

.dropdown-item {
  color: var(--xf-text) !important;
  font-size: 0.85rem !important;
  border-radius: 7px;
  padding: 0.5rem 0.75rem !important;
  transition: all var(--xf-transition) !important;
}

.dropdown-item:hover {
  background: var(--xf-blue-ultra) !important;
  color: var(--xf-blue) !important;
}

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

.dropdown-divider {
  border-color: var(--xf-border) !important;
  margin: 0.25rem 0 !important;
}

/* ===== FORM CHECK (SWITCH) ===== */
.form-check-input:checked {
  background-color: var(--xf-blue) !important;
  border-color: var(--xf-blue) !important;
}

/* ===== FILTER TABS ===== */
.xf-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.xf-filter-tab {
  padding: 0.38rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--xf-border);
  background: transparent;
  color: var(--xf-text-muted);
  cursor: pointer;
  transition: all var(--xf-transition);
}

.xf-filter-tab:hover {
  border-color: var(--xf-blue);
  color: var(--xf-blue);
  background: var(--xf-blue-ultra);
}

.xf-filter-tab.active {
  background: var(--xf-blue);
  border-color: var(--xf-blue);
  color: #fff;
  box-shadow: 0 3px 10px rgba(41,95,245,0.3);
}

/* ===== REQUEST CARD ===== */
.xf-request-card {
  background: var(--xf-surface);
  border: 1.5px solid var(--xf-border);
  border-radius: var(--xf-radius);
  padding: 1.25rem;
  transition: all var(--xf-transition);
}

.xf-request-card:hover {
  border-color: var(--xf-blue);
  box-shadow: var(--xf-shadow);
}

.xf-request-card.urgent {
  border-left: 3px solid #ef4444;
}

/* ═══════════════════════════════════════════════
   SHARED: Driver Status Components
   ═══════════════════════════════════════════════ */

/* Status dot (green pulse / red) */
.drv-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.drv-status-dot--active {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: statusPulse 2s ease infinite;
}
.drv-status-dot--arret {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0.08); }
}

/* ═══════════════════════════════════════════════
   ARRÊT MODAL (shared dashboard + profile)
   ═══════════════════════════════════════════════ */

/* Overlay backdrop */
.arret-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.arret-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Modal card */
.arret-modal {
  background: var(--xf-surface);
  border: 1px solid var(--xf-border);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.arret-overlay--visible .arret-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.arret-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.arret-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--xf-text);
  margin: 0;
  line-height: 1.3;
}
.arret-modal-sub {
  font-size: 0.8rem;
  color: var(--xf-text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.5;
}
.arret-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--xf-border);
  background: var(--xf-surface);
  color: var(--xf-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.arret-close:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239,68,68,0.06);
}

/* Help link */
.arret-help-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--xf-text);
  cursor: pointer;
  margin-bottom: 1rem;
}
.arret-help-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(41,95,245,0.1);
  color: #295ff5;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Reason cards */
.arret-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}
.arret-reason-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--xf-border);
  border-radius: 14px;
  background: var(--xf-surface);
  color: var(--xf-text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.arret-reason-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--xf-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--xf-text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}
.arret-reason-card:hover {
  border-color: #295ff5;
  background: rgba(41,95,245,0.02);
}
.arret-reason-card:hover .arret-reason-icon {
  background: rgba(41,95,245,0.1);
  color: #295ff5;
}
.arret-reason-card--selected {
  border-color: #295ff5;
  background: rgba(41,95,245,0.04);
}
.arret-reason-card--selected .arret-reason-icon {
  background: rgba(41,95,245,0.12);
  color: #295ff5;
}

/* Field (textarea) */
.arret-field {
  margin-bottom: 0.85rem;
}
.arret-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--xf-text);
  margin-bottom: 0.4rem;
}
.arret-field-input {
  width: 100%;
  border: 1.5px solid var(--xf-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--xf-text);
  background: var(--xf-surface);
  transition: border-color 0.2s;
  resize: none;
}
.arret-field-input:focus {
  outline: none;
  border-color: #295ff5;
  box-shadow: 0 0 0 3px rgba(41,95,245,0.1);
}
.arret-field-input::placeholder {
  color: var(--xf-text-muted);
  font-weight: 400;
}

/* Info line */
.arret-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--xf-text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.arret-info strong {
  color: var(--xf-text);
  font-weight: 800;
}
.arret-info > i {
  margin-top: 0.15rem;
  flex-shrink: 0;
  color: #295ff5;
}

/* Footer buttons */
.arret-modal-footer {
  display: flex;
  gap: 0.75rem;
}
.arret-cancel-btn {
  flex: 1;
  padding: 0.8rem;
  border: 1.5px solid var(--xf-border);
  border-radius: 12px;
  background: var(--xf-surface);
  color: var(--xf-text);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.arret-cancel-btn:hover {
  border-color: var(--xf-text-muted);
  background: var(--xf-surface-2);
}
.arret-submit-btn {
  flex: 1;
  padding: 0.8rem;
  border: none;
  border-radius: 12px;
  background: var(--xf-surface-2);
  color: var(--xf-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: not-allowed;
  transition: all 0.25s;
}
.arret-submit-btn:not(:disabled) {
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239,68,68,0.18);
}
.arret-submit-btn:not(:disabled):hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239,68,68,0.28);
}

/* Scrollbar inside modal */
.arret-modal::-webkit-scrollbar { width: 4px; }
.arret-modal::-webkit-scrollbar-thumb { background: var(--xf-border); border-radius: 4px; }

@media (max-width: 575.98px) {
  .arret-overlay { padding: 0; align-items: flex-end; }
  .arret-modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    padding: 1.35rem;
    transform: translateY(100%);
  }
  .arret-overlay--visible .arret-modal {
    transform: translateY(0);
  }
  .arret-modal-title { font-size: 1.05rem; }
  .arret-reason-card { padding: 0.8rem 0.95rem; font-size: 0.82rem; }
  .arret-reason-icon { width: 32px; height: 32px; font-size: 0.9rem; }
}
