 /* ============================================================
   PAGE LOADER — Delta Logo Loader
============================================================ */
#deltaLoader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f1117;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility .45s ease;
}

#deltaLoader:not(.loader-hide) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#deltaLoader.loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Outer ring track */
.loader-ring-track {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG spinner ring */
.loader-svg-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: loaderSpin 1.6s linear infinite;
}

.loader-svg-ring circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.loader-ring-bg {
  stroke: rgba(255,255,255,.06);
}

.loader-ring-fill {
  stroke: #FE0000;
  stroke-dasharray: 280;
  stroke-dashoffset: 70;
  filter: drop-shadow(0 0 8px rgba(254,0,0,.7));
}

@keyframes loaderSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Logo mark centered inside ring */
.loader-logo-mark {
  width: 64px;
  height: 58px;
  position: relative;
  z-index: 1;
  animation: loaderLogoPulse 1.6s ease-in-out infinite;
}

@keyframes loaderLogoPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(.93); opacity: .8; }
}

/* Brand name below */
.loader-brand {
  margin-top: 1.5rem;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #fff;
}
.loader-brand span { color: #FE0000; }

/* Tagline dots */
.loader-tagline {
  margin-top: .5rem;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Animated dots */
.loader-dots {
  display: flex;
  gap: 6px;
  margin-top: 1.75rem;
}
.loader-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #FE0000;
  display: inline-block;
  animation: loaderDotBounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(1) { animation-delay: 0s;    }
.loader-dots span:nth-child(2) { animation-delay: .2s;   background: rgba(254,0,0,.6); }
.loader-dots span:nth-child(3) { animation-delay: .4s;   background: rgba(254,0,0,.3); }

@keyframes loaderDotBounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40%           { transform: scale(1);  opacity: 1;  }
}

/* Progress bar at bottom */
.loader-progress-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FE0000, #ff6b6b, #FE0000);
  background-size: 200% 100%;
  animation: loaderProgressShimmer 1.4s ease-in-out infinite;
  width: 100%;
}
@keyframes loaderProgressShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mini inline page-transition loader (used by router) */
#pageTransitionBar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #FE0000, #ff6b6b);
  z-index: 99998;
  transition: width .3s ease;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(254,0,0,.6);
  pointer-events: none;
  opacity: 0;
}
#pageTransitionBar.active {
  opacity: 1;
}

/* ============================================================
   DESIGN SYSTEM — CSS Custom Properties (Light + Dark)
============================================================ */
:root {
  /* Brand */
  --delta-red:          #FE0000;
  --delta-red-dark:     #cc0000;
  --delta-red-light:    #ff4d4d;
  --delta-gray-dk:      #666666;
  --delta-gray-lt:      #B2B2B2;

  /* Semantic palette */
  /*--primary:            #FE0000;*/
  --primary:            #c52222;
  --primary-hover:      #cc0000;
  --primary-soft:       rgba(254,0,0,.1);
  --success:            #198754;
  --success-soft:       rgba(25,135,84,.12);
  --info:               #0dcaf0;
  --info-soft:          rgba(13,202,240,.12);
  --warning:            #ffc107;
  --warning-soft:       rgba(255,193,7,.12);
  --danger:             #dc3545;
  --danger-soft:        rgba(220,53,69,.12);

  /* Layout */
  --sidebar-w:          260px;
  --sidebar-collapsed-w:72px;
  --topnav-h:           62px;
  --transition:         .25s ease;

  /* Light theme tokens */
  --bg-body:            #f0f2f5;
  --bg-surface:         #ffffff;
  --bg-surface-2:       #f8f9fa;
  --bg-sidebar:         #1a1c2e;
  --bg-sidebar-hover:   rgba(254,0,0,.15);
  --bg-sidebar-active:  rgba(254,0,0,.22);
  --text-sidebar:       #c8cde8;
  --text-sidebar-active:#ffffff;
  --text-primary:       #1a1c2e;
  --text-secondary:     #6c757d;
  --text-muted:         #9da3af;
  --border-color:       #e2e6ea;
  --shadow-sm:          0 1px 4px rgba(0,0,0,.06);
  --shadow-md:          0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:          0 8px 32px rgba(0,0,0,.12);
  --card-radius:        14px;
  --input-bg:           #ffffff;
}

[data-theme="dark"] {
  --bg-body:            #0f1117;
  --bg-surface:         #1a1c2e;
  --bg-surface-2:       #22253a;
  --bg-sidebar:         #111322;
  --bg-sidebar-hover:   rgba(254,0,0,.18);
  --bg-sidebar-active:  rgba(254,0,0,.28);
  --text-sidebar:       #9da3c8;
  --text-sidebar-active:#ffffff;
  --text-primary:       #e8eaf0;
  --text-secondary:     #9da3c8;
  --text-muted:         #666a85;
  --border-color:       #2a2d42;
  --shadow-sm:          0 1px 4px rgba(0,0,0,.3);
  --shadow-md:          0 4px 20px rgba(0,0,0,.35);
  --shadow-lg:          0 8px 32px rgba(0,0,0,.45);
  --input-bg:           #22253a;
}

/* ============================================================
   GLOBAL RESETS & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  font-size: .9375rem;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--delta-gray-lt); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--delta-gray-dk); }

/* ============================================================
   PAGES SYSTEM (SPA-lite for demo)
============================================================ */
.page { display: none; }
.page.active { display: block; }

/* ============================================================
   LOGIN PAGE
============================================================ */
#loginPage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-body);
}
#loginPage.active { display: flex; align-items: center; justify-content: center; }

.login-wrap {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.75rem 2.5rem;
  border: 1px solid var(--border-color);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  /*gap: .75rem;*/
  /*margin-bottom: 1.75rem;*/
}

.login-logo svg { width: 52px; height: 48px; }

.login-brand {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.5px;
}

.login-brand span { color: var(--primary); }

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: .875rem;
  margin-bottom: 1rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: .8125rem;
  margin: .75rem 0;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.login-bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.login-bg-decoration::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254,0,0,.06) 0%, transparent 70%);
  top: -200px; left: -200px;
}
.login-bg-decoration::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254,0,0,.04) 0%, transparent 70%);
  bottom: -150px; right: -150px;
}
.login-wrap { position: relative; z-index: 1; }

/* ============================================================
   ADMIN SHELL
============================================================ */
#adminShell {
  display: none;
}
#adminShell.active {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: var(--topnav-h);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand-icon svg { width: 36px; height: 33px; flex-shrink: 0; }
.sidebar-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
  opacity: 1;
  transition: opacity var(--transition);
}
.sidebar-brand-text span { color: var(--delta-red); }
.sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; overflow: hidden; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: .9rem 1.3rem .35rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item-wrap { position: relative; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .62rem 1.25rem;
  color: var(--text-sidebar);
  border-radius: 0;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  border-right: 3px solid var(--primary);
}

.sidebar-link .nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.sidebar-link .nav-label {
  opacity: 1;
  transition: opacity var(--transition);
  flex: 1;
}
.sidebar.collapsed .nav-label { opacity: 0; }

.sidebar-link .nav-badge {
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: .15rem .5rem;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-link .nav-arrow {
  font-size: .75rem;
  transition: transform .2s, opacity var(--transition);
}
.sidebar.collapsed .nav-arrow { opacity: 0; }
.sidebar-link[aria-expanded="true"] .nav-arrow { transform: rotate(90deg); }

/* Submenu */
.sidebar-submenu {
  background: rgba(0,0,0,.2);
  overflow: hidden;
}
.sidebar.collapsed .sidebar-submenu { display: none !important; }

.sidebar-submenu .sidebar-link {
  padding-left: 3.3rem;
  font-size: .835rem;
  color: rgba(255,255,255,.5);
}
.sidebar-submenu .sidebar-link:hover { color: #fff; }
.sidebar-submenu .sidebar-link.active {
  color: var(--primary);
  border-right: none;
  background: transparent;
}
.sidebar-submenu .sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 2.1rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-footer-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.sidebar-footer-info { opacity: 1; transition: opacity var(--transition); }
.sidebar.collapsed .sidebar-footer-info { opacity: 0; }
.sidebar-footer-name { font-size: .82rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-footer-role { font-size: .72rem; color: var(--text-sidebar); }

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* Collapse toggle button */
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--text-secondary);
  font-size: .75rem;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition);
}
.sidebar-toggle-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   MAIN CONTENT AREA
============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.main-wrapper.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }

/* ============================================================
   TOP NAVBAR
============================================================ */
.topnav {
  height: var(--topnav-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.topnav-left { display: flex; align-items: center; gap: 1rem; flex: 1; }

.hamburger-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--bg-surface-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--primary-soft); color: var(--primary); }

.search-wrap {
  position: relative;
  max-width: 360px;
  flex: 1;
}
.search-wrap .search-icon {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: .48rem .85rem .48rem 2.4rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: .875rem;
  outline: none;
  transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.topnav-right { display: flex; align-items: center; gap: .5rem; }

.topnav-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--bg-surface-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  position: relative;
  transition: background var(--transition), color var(--transition);
}
.topnav-btn:hover { background: var(--primary-soft); color: var(--primary); }

.topnav-badge {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-surface);
}

/* Theme toggle */
.theme-toggle {
  width: 52px; height: 28px;
  border-radius: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  display: flex; align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
  position: relative;
}
[data-theme="dark"] .theme-toggle {
  background: var(--primary);
  border-color: var(--primary);
}
[data-theme="dark"] .theme-toggle::after { transform: translateX(24px); }
.theme-toggle-icon {
  position: absolute;
  font-size: .7rem;
  color: var(--text-muted);
}
.theme-toggle-icon.sun { left: 7px; }
.theme-toggle-icon.moon { right: 6px; }
[data-theme="dark"] .theme-toggle-icon { color: rgba(255,255,255,.6); }

/* User dropdown */
.user-menu-btn {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .6rem .3rem .3rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.user-menu-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
}
.user-name {
  font-size: .825rem;
  font-weight: 600;
  color: var(--text-primary);
}
.user-role-tag {
  font-size: .7rem;
  color: var(--text-muted);
}

/* Dropdowns */
.topnav-dropdown {
  min-width: 320px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}

.dropdown-header-bar {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: space-between;
}

.notif-item {
  display: flex;
  gap: .85rem;
  padding: .85rem 1.1rem;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-color);
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface-2); }
.notif-item.unread { background: var(--primary-soft); }

.notif-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.notif-text { font-size: .82rem; color: var(--text-primary); line-height: 1.4; }
.notif-time { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

.dropdown-footer-link {
  display: block;
  text-align: center;
  padding: .75rem;
  font-size: .82rem;
  color: var(--primary);
  font-weight: 600;
  border-top: 1px solid var(--border-color);
  transition: background var(--transition);
}
.dropdown-footer-link:hover { background: var(--primary-soft); }

/* ============================================================
   CONTENT AREA
============================================================ */
.content-area {
  position: relative;
  flex: 1;
  padding: 1.75rem 1.5rem;
  max-width: 100%;
}

.content-transition {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(15, 17, 23, 0.16);
  backdrop-filter: blur(10px);
  transition: opacity .24s ease, visibility .24s ease;
  z-index: 9998;
}

.content-transition.active {
  opacity: 1;
  visibility: visible;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}
.page-subtitle {
  font-size: .85rem;
  color: var(--text-secondary);
  margin: .25rem 0 0;
}

/* Breadcrumb */
.breadcrumb { margin: 0; }
.breadcrumb-item { font-size: .82rem; }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb-item+.breadcrumb-item::before { color: var(--text-muted); }

/* ============================================================
   STAT CARDS
============================================================ */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  padding: 1.4rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, background var(--transition);
  height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: .35rem;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: .7rem;
}
.stat-change {
  font-size: .78rem;
  font-weight: 600;
  display: flex; align-items: center; gap: .3rem;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   CHART CARDS
============================================================ */
.chart-card {
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  height: 100%;
  transition: background var(--transition), border-color var(--transition);
}

.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap; gap: .5rem;
}
.chart-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.chart-card-subtitle {
  font-size: .78rem;
  color: var(--text-secondary);
  margin: .1rem 0 0;
}

/* ============================================================
   GENERIC CARD
============================================================ */
.ui-card {
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}
.ui-card-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
}
.ui-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.ui-card-body { padding: 1.35rem; }
.ui-card-footer {
  padding: .9rem 1.35rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-2);
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

/* ============================================================
   TABLES
============================================================ */
.delta-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}
.delta-table thead th {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.delta-table tbody td {
  padding: .85rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.delta-table tbody tr:last-child td { border-bottom: none; }
.delta-table tbody tr:hover td { background: var(--bg-surface-2); }

.delta-table-wrap {
  overflow-x: auto;
  border-radius: var(--card-radius);
}

/* Avatar stack */
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: cover;
  font-size: .75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ============================================================
   BADGES
============================================================ */
.badge-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: #b8860b; }
.badge-info    { background: var(--info-soft);    color: #087990; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ============================================================
   PROGRESS BAR
============================================================ */
.progress-delta {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-surface-2);
  overflow: hidden;
}
.progress-delta .progress-bar {
  border-radius: 4px;
  transition: width .8s ease;
}

/* ============================================================
   ACTIVITY FEED
============================================================ */
.activity-item {
  display: flex;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }

.activity-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.activity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.activity-line-seg {
  width: 2px;
  flex: 1;
  background: var(--border-color);
  margin: 3px 0;
}
.activity-text { font-size: .845rem; color: var(--text-primary); line-height: 1.5; }
.activity-time { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ============================================================
   BUTTONS
============================================================ */
.btn-delta {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .52rem 1.1rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-delta-primary {
  background: var(--primary);
  color: #fff;
}
.btn-delta-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254,0,0,.3);
}
.btn-delta-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-delta-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-delta-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-delta-ghost:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ============================================================
   FORMS
============================================================ */
.delta-label{
  color: var(--text-secondary);
}
.form-label-delta {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .4rem;
  display: block;
}
.form-control-delta {
  width: 100%;
  padding: .58rem .9rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: .875rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control-delta::placeholder { color: var(--text-muted); }
.form-control-delta:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control-delta.is-valid { border-color: var(--success); }
.form-control-delta.is-invalid { border-color: var(--danger); }

.form-select-delta {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239da3af' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}
.form-select-delta.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 .25rem rgba(220,53,69,.14);
}
.form-control-delta.is-invalid,
.form-select-delta.is-invalid {
  box-shadow: 0 0 0 .25rem rgba(220,53,69,.14);
}
.invalid-feedback {
  display: block;
  margin-top: .35rem;
  font-size: .85rem;
  color: var(--danger);
}
.validation-summary {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid rgba(220,53,69,.18);
  background: rgba(220,53,69,.08);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.validation-summary .summary-icon {
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(220,53,69,.12);
  color: var(--danger);
}
.validation-summary .summary-icon .bi {
  font-size: 1.25rem;
}
.validation-summary .summary-content strong {
  display: block;
  margin-bottom: .25rem;
}
.validation-summary .summary-content p {
  margin-bottom: .6rem;
}
.validation-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}
.validation-summary ul li {
  margin-bottom: .35rem;
}

/* ============================================================
   MODALS
============================================================ */
.modal-delta .modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.modal-delta .modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.2rem 1.5rem;
}
.modal-delta .modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.modal-delta .modal-footer { border-top: 1px solid var(--border-color); }
.modal-delta .btn-close { filter: var(--btn-close-filter); }
[data-theme="dark"] .btn-close { filter: invert(1); }

/* ============================================================
   TOAST
============================================================ */
.toast-delta {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
}
.toast-delta .toast-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: .85rem;
  font-weight: 600;
}
.toast-delta .toast-body { color: var(--text-secondary); font-size: .84rem; }

/* ============================================================
   FOOTER
============================================================ */
.admin-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: .9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  transition: background var(--transition), border-color var(--transition);
}
.admin-footer a { color: var(--primary); }

/* ============================================================
   FORM PAGES
============================================================ */
.section-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.section-divider::before, .section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition), width var(--transition);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .sidebar-toggle-btn { display: none; }
  .search-wrap { max-width: 200px; }
}

@media (max-width: 575.98px) {
  .content-area { padding: 1.2rem 1rem; }
  .search-wrap { display: none; }
  .user-name, .user-role-tag { display: none; }
}

/* ============================================================
   TABS
============================================================ */
.nav-tabs-delta {
  border-bottom: 2px solid var(--border-color);
  gap: .25rem;
}
.nav-tabs-delta .nav-link {
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  padding: .65rem 1.1rem;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-tabs-delta .nav-link:hover { color: var(--text-primary); }
.nav-tabs-delta .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
  font-weight: 600;
}

/* ============================================================
   ACCORDION (override)
============================================================ */
.accordion-delta .accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px !important;
  margin-bottom: .5rem;
  overflow: hidden;
}
.accordion-delta .accordion-button {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: none;
}
.accordion-delta .accordion-button:not(.collapsed) {
  background: var(--primary-soft);
  color: var(--primary);
}
.accordion-delta .accordion-button::after {
  filter: var(--accord-icon-filter, none);
}
[data-theme="dark"] .accordion-delta .accordion-button::after { filter: invert(1); }
.accordion-delta .accordion-body {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: .875rem;
}

/* ============================================================
   UTILITIES
============================================================ */
.text-primary-delta { color: var(--primary) !important; }
.bg-primary-delta   { background: var(--primary) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.rounded-delta { border-radius: var(--card-radius) !important; }
.text-color { color: var(--text-primary) !important; }
.text-muted-delta { color: var(--text-muted) !important; }
.bg-surface { background: var(--bg-surface) !important; }
.border-delta { border-color: var(--border-color) !important; }

/* ============================================================
   SPARKLINE (mini inline chart preview)
============================================================ */
.sparkline-wrap { height: 50px; }

/* ============================================================
   WELCOME GRADIENT BANNER
============================================================ */
.welcome-banner {
  background: linear-gradient(135deg, #1a1c2e 0%, #2d1515 50%, #1a0505 100%);
  border-radius: var(--card-radius);
  padding: 1.75rem 2rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(254,0,0,.2);
}
.welcome-banner::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254,0,0,.15) 0%, transparent 70%);
}
.welcome-banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .35rem;
}
.welcome-banner-sub {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 1rem;
}

/* ============================================================
   QUICK ACTIONS
============================================================ */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.quick-action:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.quick-action-label { font-size: .76rem; font-weight: 600; color: var(--text-secondary); }

/* Online indicator */
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(25,135,84,.3);
}

/* ============================================================
   TABLES PAGE EXTRAS
============================================================ */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
}
.table-search {
  position: relative; flex: 1; max-width: 280px;
}
.table-search input {
  width: 100%;
  padding: .45rem .85rem .45rem 2.2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: .84rem;
  outline: none;
}
.table-search input:focus { border-color: var(--primary); }
.table-search .si {
  position: absolute; left: .7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: .85rem;
  pointer-events: none;
}

/* ============================================================
   PAGINATION
============================================================ */
.pagination-delta .page-link {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: .82rem;
  padding: .4rem .75rem;
  border-radius: 6px !important;
  margin: 0 2px;
}
.pagination-delta .page-link:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pagination-delta .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   SETTINGS PAGE
============================================================ */
.settings-section-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border-color);
}
.settings-item:last-child { border-bottom: none; }
.settings-item-label { font-size: .875rem; font-weight: 600; color: var(--text-primary); }
.settings-item-desc { font-size: .78rem; color: var(--text-secondary); margin-top: .1rem; }

.form-switch-delta .form-check-input {
  width: 40px; height: 22px;
  border-radius: 11px;
  background-color: var(--border-color);
  border: none;
  cursor: pointer;
}
.form-switch-delta .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-switch-delta .form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ============================================================
   PROFILE CARD
============================================================ */
.profile-cover {
  height: 120px;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  background: linear-gradient(135deg, #1a1c2e 0%, #3d0a0a 100%);
  position: relative;
}
.profile-avatar-wrap {
  position: absolute;
  bottom: -40px;
  left: 1.5rem;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 16px;
  border: 4px solid var(--bg-surface);
  background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}
.profile-online {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--success);
  border: 3px solid var(--bg-surface);
}
.profile-info { padding: 3.2rem 1.5rem 1.5rem; }
.profile-name { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: .1rem; }
.profile-role { font-size: .85rem; color: var(--text-secondary); }

/* ============================================================
   KANBAN BOARD (preview)
============================================================ */
.kanban-col {
  background: var(--bg-surface-2);
  border-radius: 12px;
  padding: 1rem;
  min-height: 200px;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .85rem;
}
.kanban-col-title { font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: .85rem;
  margin-bottom: .6rem;
  transition: box-shadow .2s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card-title { font-size: .84rem; font-weight: 600; color: var(--text-primary); margin-bottom: .4rem; }
.kanban-card-meta { font-size: .73rem; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; }

/* priority bars */
.priority-bar { width: 4px; height: 100%; border-radius: 2px; position: absolute; left: 0; top: 0; }
.kanban-card { position: relative; padding-left: 1.1rem; }