/* ==========================================================================
   CoClean Enterprise Operations Command - Production SaaS Stylesheet
   Stitch "Obsidian Orbit" Design System: Unified Space Grotesk, 
   compact executive viewport density, high-contrast dark & light themes.
   ========================================================================== */

:root {
  /* Unified Brand Typography */
  --font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Brand Accents */
  --primary-blue: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --primary-glow: rgba(59, 130, 246, 0.35);

  --accent-cyan: #0ea5e9;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  /* Sidebar Tokens */
  --sidebar-bg: #090e1d;
  --sidebar-surface: #10182f;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-heading: #64748b;

  /* Light Theme Surface & Text Tokens */
  --dash-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  --topbar-bg: #ffffff;
  --topbar-border: #e2e8f0;
  --search-bg: #f1f5f9;
  --search-border: #e2e8f0;
  --hover-row: #f8fafc;
  --shadow-card: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 26px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.06);

  /* Compact Scale */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-pill: 0px;
}

/* ==========================================================================
   STITCH "OBSIDIAN ORBIT" DARK THEME (HIGH-CONTRAST PRODUCTION GRADE)
   ========================================================================== */
body.theme-dark {
  --dash-bg: #0b1120;
  --card-bg: #131e36;
  --card-border: #22304d;
  --card-border-subtle: #192644;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  --topbar-bg: #0d1527;
  --topbar-border: #1e2b46;
  --search-bg: #0f182c;
  --search-border: #22304d;
  --hover-row: #182542;
  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-card-hover: 0 10px 28px -4px rgba(0, 0, 0, 0.75), 0 0 14px -2px rgba(59, 130, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--dash-bg);
  color: var(--text-main);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Custom Clean Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
}
body.theme-dark ::-webkit-scrollbar-thumb {
  background: #243456;
}

/* Main Layout Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   SIDEBAR COMPONENT (MATCHING UNIFIED TYPOGRAPHY & COMPACT CADENCE)
   ========================================================================== */
.app-sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-family);
  overflow: hidden;
}

.sidebar-brand-header {
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
  height: 56px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-logo-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #3b50e2 0%, #2563eb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 80, 226, 0.45);
  flex-shrink: 0;
}

.logo-co-mark {
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  color: #ffffff;
  user-select: none;
}

.brand-title-area {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-family);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: #3b82f6;
  white-space: nowrap;
}

.co-underline {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: #3b82f6;
}

.brand-highlight {
  color: #3b82f6;
}

.brand-tag {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 4px;
  line-height: 1;
  display: block;
  white-space: nowrap;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-surface);
  color: #ffffff;
}

.sidebar-scroll-area {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.55rem 0.55rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nav-category {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-category-title {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--sidebar-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0.6rem 0.2rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.6rem;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-item-left i,
.nav-item-left svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: var(--sidebar-surface);
  color: #ffffff;
}

.sidebar-nav-item.active {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

.nav-badge {
  display: none !important;
}

/* Sidebar Sustainability Footer Badge */
.sidebar-footer-card {
  flex-shrink: 0;
  margin: 0.4rem 0.55rem 0.55rem 0.55rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
}

.sidebar-scroll-area > .sidebar-footer-card {
  margin-top: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

.sidebar-footer-card:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.footer-card-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.leaf-icon-wrap,
.footer-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green, #10b981);
  flex-shrink: 0;
}

.leaf-icon-wrap i,
.leaf-icon-wrap svg,
.footer-card-icon i,
.footer-card-icon svg {
  width: 14px;
  height: 14px;
}

.footer-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.footer-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
}

.footer-card-sub {
  font-size: 0.62rem;
  color: var(--sidebar-text, #94a3b8);
  line-height: 1.2;
  white-space: nowrap;
}

/* Sidebar Collapsed State (Mini Rail) */
.app-sidebar.collapsed {
  width: 58px;
}

.app-sidebar.collapsed .sidebar-brand-header {
  height: 56px;
  min-height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.app-sidebar.collapsed .brand-wrapper {
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar.collapsed .brand-logo-box {
  margin: 0;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.app-sidebar.collapsed .brand-logo-box:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.6);
}

.app-sidebar.collapsed .sidebar-collapse-btn {
  display: none !important;
}

.app-sidebar.collapsed .brand-title-area,
.app-sidebar.collapsed .brand-subline,
.app-sidebar.collapsed .brand-tag,
.app-sidebar.collapsed .nav-category-title,
.app-sidebar.collapsed .sidebar-nav-item span,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .footer-card-copy {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-scroll-area {
  padding: 0.55rem 0.3rem;
  gap: 0.55rem;
}

.app-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.55rem 0;
  border-radius: 6px;
}

.app-sidebar.collapsed .nav-item-left {
  gap: 0;
  justify-content: center;
}

.app-sidebar.collapsed .sidebar-footer-card {
  justify-content: center;
  padding: 0.35rem;
  background: transparent;
  border: none;
}

/* ==========================================================================
   TOPBAR COMPONENT (COMPACT 50px EXECUTIVE COMMAND HEADER)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-topbar {
  height: 56px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-toggle-sidebar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-toggle-sidebar:hover {
  background: var(--search-bg);
  color: var(--text-main);
  border-color: var(--text-sub);
}

.topbar-toggle-sidebar i,
.topbar-toggle-sidebar svg {
  width: 15px;
  height: 15px;
}

/* Global Search with Hotkey */
.topbar-search-wrap {
  position: relative;
  width: 340px;
}

.topbar-search-wrap i,
.topbar-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-sub);
  pointer-events: none;
}

.topbar-search-input {
  width: 100%;
  height: 32px;
  background: var(--search-bg);
  border: 1px solid var(--search-border);
  border-radius: var(--radius-sm);
  padding: 0 2.2rem 0 2.2rem;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.topbar-search-input::placeholder {
  color: var(--text-sub);
  font-size: 0.78rem;
}

.topbar-search-input:focus {
  background: var(--card-bg);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}


/* Right Controls */
.topbar-right-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Live SLA Telemetry Indicator */
.topbar-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  display: inline-block;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Light / Dark Mode Toggle Pill */
.theme-selector-pill {
  background: var(--search-bg);
  padding: 2px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--card-border);
}

.theme-pill-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-pill-btn:hover {
  color: var(--text-main);
}

.theme-pill-btn[data-theme="light"].active {
  background: #ffffff;
  color: #f59e0b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.theme-pill-btn[data-theme="dark"].active {
  background: #1e293b;
  color: #818cf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.theme-pill-btn i,
.theme-pill-btn svg {
  width: 13px;
  height: 13px;
}

/* Notification Bell */
.topbar-icon-btn {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  background: var(--search-bg);
  color: var(--text-main);
}

.topbar-icon-btn i,
.topbar-icon-btn svg {
  width: 15px;
  height: 15px;
}

.notif-count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  background: var(--accent-red);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--topbar-bg);
}

/* Admin Profile Item */
.topbar-profile-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.topbar-profile-item:hover {
  background: var(--search-bg);
}

.profile-avatar-circle {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-circle::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border: 1.5px solid var(--topbar-bg);
  border-radius: 50%;
}

.profile-meta {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.profile-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.15;
}

/* ==========================================================================
   MAIN DASHBOARD CONTAINER (COMPACT EXECUTIVE DENSITY - FITS SCREEN)
   ========================================================================== */
.dashboard-content-area {
  max-width: 100%;
  margin: 0;
  width: 100%;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Dashboard Header Row */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-bottom: 0.25rem;
}

.dash-title-inline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dash-title-group h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.live-stream-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-title-group p {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.dash-header-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.date-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 34px;
  padding: 0 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.date-pill-badge span {
  white-space: nowrap;
  line-height: 1;
  display: inline-block;
}

.date-pill-badge i,
.date-pill-badge svg {
  width: 14px;
  height: 14px;
  color: var(--primary-blue);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.select-dropdown-pill {
  height: 34px;
  padding: 0 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.select-dropdown-pill:focus {
  border-color: var(--primary-blue);
}


/* ==========================================================================
   ROW 1: 4 KPI CARDS (COMPACT EXECUTIVE TILES - HEIGHT ~76px)
   ========================================================================== */
.kpi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  min-height: 82px;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--primary-blue);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-icon-box.icon-box-3d {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 44px;
  height: 44px;
}

.icon-3d {
  width: 42px;
  height: 42px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.kpi-card:hover .icon-3d {
  transform: translateY(-3px) scale(1.12);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.action-icon-badge.icon-box-3d {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.action-icon-badge svg.action-svg-3d,
.action-svg-3d {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  display: block !important;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.22));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.action-card-btn:hover .action-svg-3d {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}

.kpi-icon-box i,
.kpi-icon-box svg:not(.icon-3d) {
  width: 20px;
  height: 20px;
  stroke-width: 2.2px;
}

.kpi-icon-box.blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.kpi-icon-box.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}
.kpi-icon-box.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--accent-purple);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
}
.kpi-icon-box.orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-amber);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.kpi-number {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}

.kpi-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-green);
  white-space: nowrap;
}

.kpi-trend-pill i,
.kpi-trend-pill svg {
  width: 12px;
  height: 12px;
}

.kpi-meta-sub {
  font-size: 0.65rem;
  color: var(--text-sub);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   PANEL CARDS (STANDARD CONTAINER - COMPACT EXECUTIVE HEIGHT)
   ========================================================================== */
.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.panel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--primary-blue);
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.view-all-link {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ROW 2: ANALYTICS ROW GRID (COMPACT VIEWPORT HEIGHT ~220px)
   ========================================================================== */
.analytics-row-grid {
  display: grid;
  grid-template-columns: 2fr 1.35fr 1.25fr;
  gap: 0.75rem;
}

/* Bookings Trend Chart */
.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.bar-chart-container {
  flex: 1;
  min-height: 150px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.5rem 0 0 1.8rem;
  margin-top: 0.15rem;
}

.bar-chart-y-axis {
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--text-sub);
  font-weight: 600;
  line-height: 1;
  z-index: 2;
  font-feature-settings: 'tnum';
}

.bar-chart-gridlines {
  position: absolute;
  left: 1.6rem;
  right: 0;
  top: 0.5rem;
  bottom: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
}

.bar-chart-gridlines .grid-line {
  width: 100%;
  border-bottom: 1px dashed rgba(226, 232, 240, 0.7);
}

body.theme-dark .bar-chart-gridlines .grid-line {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}

.chart-bars-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.25rem;
  position: relative;
  z-index: 3;
}

.bar-col-group {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.bars-pair {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: calc(100% - 20px);
  width: 100%;
  justify-content: center;
}

.chart-bar {
  width: 6.5px;
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease, opacity 0.15s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.8;
  filter: brightness(1.2);
}

.chart-bar.completed {
  background: var(--primary-blue);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.35);
}

.chart-bar.pending {
  background: #93c5fd;
}

body.theme-dark .chart-bar.pending {
  background: rgba(147, 197, 253, 0.35);
}

.bar-x-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 0.35rem;
  height: 14px;
  line-height: 14px;
  white-space: nowrap;
}

/* ==========================================================================
   SERVICE DISTRIBUTION 2D DONUT CHART (COMPACT 125px)
   ========================================================================== */
.donut-chart-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex: 1;
  margin: auto 0;
  width: 100%;
}

.donut-svg-wrapper {
  position: relative;
  width: 125px;
  height: 125px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#donutSvg {
  width: 100%;
  height: 100%;
}

.donut-slice {
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.donut-slice:hover,
.donut-slice.active-hover {
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.4));
}

.donut-center-info {
  pointer-events: none;
}

.donut-center-num {
  font-family: var(--font-family);
  font-size: 1.15rem;
  font-weight: 800;
  fill: var(--text-main);
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}

.donut-center-lbl {
  font-family: var(--font-family);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  fill: var(--text-sub);
  text-transform: uppercase;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
  cursor: pointer;
}

.donut-legend-item:hover,
.donut-legend-item.active-hover {
  background: var(--search-bg);
}

.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-pct-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  font-feature-settings: 'tnum';
  margin-left: 0.35rem;
}

/* ==========================================================================
   UPCOMING JOBS LIST (STRUCTURED & HIGH-LEGIBILITY SCHEDULE)
   ========================================================================== */
.upcoming-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  justify-content: space-between;
}

.upcoming-job-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.42rem 0.5rem;
  border-radius: 7px;
  border: 1px solid var(--card-border-subtle);
  background: var(--card-bg);
  transition: all 0.15s ease;
}

.upcoming-job-card:hover {
  background: var(--search-bg);
  border-color: var(--card-border);
  transform: translateX(2px);
}

.job-date-badge {
  width: 36px;
  height: 40px;
  background: var(--search-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.job-date-month {
  width: 100%;
  background: var(--primary-blue);
  color: #ffffff;
  font-size: 0.52rem;
  font-weight: 800;
  text-align: center;
  padding: 1.5px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.job-date-num {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  font-feature-settings: 'tnum';
}

.job-main-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.job-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.job-client-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.job-service-tag {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 3px;
  flex-wrap: nowrap;
  width: 100%;
}

.job-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  font-size: 0.63rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.job-meta-chip i,
.job-meta-chip svg {
  width: 10.5px;
  height: 10.5px;
  stroke-width: 2.2px;
  flex-shrink: 0;
}

.job-meta-chip.time-chip {
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #2563eb;
}

body.theme-dark .job-meta-chip.time-chip {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.job-meta-chip.loc-chip {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #059669;
}

.job-meta-chip.loc-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

body.theme-dark .job-meta-chip.loc-chip {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Modern Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 0.14rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill.progress {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #2563eb;
}

.status-pill.progress .pill-dot {
  background: #2563eb;
  box-shadow: 0 0 5px rgba(37, 99, 235, 0.8);
  animation: pulse-ring 1.8s infinite ease-out;
}

.status-pill.scheduled {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0ea5e9;
}

.status-pill.scheduled .pill-dot {
  background: #0ea5e9;
}

.status-pill.completed {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.status-pill.completed .pill-dot {
  background: #10b981;
}

.status-pill.cancelled {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.status-pill.cancelled .pill-dot {
  background: #ef4444;
}

/* ==========================================================================
   ROW 3: RECENT BOOKINGS, STAFF ON DUTY, QUICK ACTIONS
   ========================================================================== */
.operations-row-grid {
  display: grid;
  grid-template-columns: 2fr 1.35fr 1.25fr;
  gap: 0.75rem;
}

/* Professional Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-data-table th {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--card-border);
}

.admin-data-table td {
  padding: 0.42rem 0.55rem;
  font-size: 0.76rem;
  border-bottom: 1px solid var(--card-border-subtle);
  vertical-align: middle;
}

.admin-data-table tbody tr:hover {
  background: var(--hover-row);
}

.admin-data-table tbody tr:last-child td {
  border-bottom: none;
}

.booking-ref-id {
  font-weight: 700;
  color: var(--primary-blue);
  font-size: 0.76rem;
  font-feature-settings: 'tnum';
}

.booking-client-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.78rem;
}

.booking-amount-val {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.78rem;
  font-feature-settings: 'tnum';
}

/* Staff On Duty Widget */
.staff-duty-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  height: 100%;
  gap: 0.25rem;
}

.staff-duty-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.52rem 0.5rem;
  border-bottom: 1px solid var(--card-border-subtle);
  flex: 1;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.staff-duty-card:hover {
  background: var(--hover-row);
}

.staff-duty-card:last-child {
  border-bottom: none;
}

.staff-avatar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.staff-initials-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--search-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.staff-name-role {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.staff-full-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.staff-role-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.staff-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.staff-duty-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.staff-duty-pill.on-duty {
  color: var(--accent-green);
}

.staff-duty-pill.off-duty {
  color: var(--text-sub);
}

.staff-duty-pill.on-leave {
  color: var(--accent-red);
}

.staff-loc-sub {
  font-size: 0.66rem;
  color: var(--text-sub);
}

/* ==========================================================================
   QUICK ACTIONS LIST (OPTIMIZED SPACE UTILIZATION & FULL-HEIGHT FILL)
   ========================================================================== */
.quick-actions-card-wrap {
  display: flex;
  flex-direction: column;
}

.panel-badge-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-sub);
  background: var(--search-bg);
  border: 1px solid var(--card-border);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  justify-content: space-between;
}

.action-card-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.52rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  flex: 1;
  min-height: 52px;
}

.action-card-btn:hover {
  background: var(--search-bg);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.action-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.action-card-btn:hover .action-icon-badge {
  transform: scale(1.08);
}

.action-icon-badge i,
.action-icon-badge svg:not(.action-svg-3d) {
  width: 17px;
  height: 17px;
  stroke-width: 2.2px;
}

.action-icon-badge.blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--primary-blue);
}

.action-icon-badge.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
}

.action-icon-badge.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-amber);
}

.action-icon-badge.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--accent-purple);
}

.action-text-cluster {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 1.5px;
}

.action-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.action-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-sub);
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.action-card-btn:hover .action-arrow {
  color: var(--primary-blue);
  transform: translate(2px, -2px);
}

/* ==========================================================================
   ROW 4: REVENUE OVERVIEW & RECENT ACTIVITIES
   ========================================================================== */
.bottom-feed-grid {
  display: grid;
  grid-template-columns: 3fr 1.6fr;
  gap: 0.75rem;
}

.revenue-chart-wrapper {
  position: relative;
  width: 100%;
  height: 115px;
}

.revenue-chart-wrapper svg {
  width: 100%;
  height: 100%;
}

.chart-tooltip-pin {
  position: absolute;
  top: 15%;
  left: 58%;
  background: #0d1527;
  color: #ffffff;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translateX(-50%);
  border: 1px solid var(--primary-blue);
}

.chart-tooltip-pin::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 7px;
  height: 7px;
  background: #0d1527;
}

/* Recent Activities Timeline Feed */
.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline-feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.timeline-left {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.timeline-dot-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-dot-circle.blue { background: var(--primary-blue); box-shadow: 0 0 6px var(--primary-blue); }
.timeline-dot-circle.green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.timeline-dot-circle.purple { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple); }
.timeline-dot-circle.grey { background: #64748b; }

.timeline-copy {
  display: flex;
  flex-direction: column;
}

.timeline-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.timeline-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.timeline-time {
  font-size: 0.65rem;
  color: var(--text-sub);
  white-space: nowrap;
}

/* ==========================================================================
   MODAL COMPONENT (CLEAN MODERN DIALOG)
   ========================================================================== */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.admin-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.admin-modal-backdrop.active .admin-modal-box {
  transform: translateY(0);
}

.admin-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.admin-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-group-admin {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group-admin label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-input-admin {
  padding: 0.55rem 0.75rem;
  background: var(--search-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input-admin:focus {
  border-color: var(--primary-blue);
  background: var(--card-bg);
}

.admin-modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn-secondary-admin {
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-admin:hover {
  background: var(--search-bg);
  color: var(--text-main);
}

.btn-primary-admin {
  padding: 0.45rem 1.15rem;
  background: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  transition: background 0.15s ease;
}

.btn-primary-admin:hover {
  background: var(--primary-hover);
}

/* Toast Notifications */
.admin-toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 2000;
}

.admin-toast {
  background: #0d1527;
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-left: 3px solid var(--primary-blue);
  animation: slideInRight 0.25s ease;
}

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

/* ==========================================================================
   RESPONSIVE LAYOUT MEDIA QUERIES (FIT LAPTOPS, TABLETS & MOBILES)
   ========================================================================== */
@media (max-width: 1400px) {
  .analytics-row-grid,
  .operations-row-grid {
    grid-template-columns: 1.7fr 1.3fr;
  }
  .upcoming-jobs-card-wrap,
  .quick-actions-card-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 1100px) {
  .kpi-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-row-grid,
  .operations-row-grid,
  .bottom-feed-grid {
    grid-template-columns: 1fr;
  }
  .upcoming-jobs-card-wrap,
  .quick-actions-card-wrap {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -250px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  }
  .app-sidebar.open {
    left: 0;
  }
  .dashboard-topbar {
    padding: 0 0.85rem;
  }
  .topbar-search-wrap,
  .topbar-telemetry-badge {
    display: none;
  }
  .kpi-metrics-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-content-area {
    padding: 0.75rem;
    gap: 0.75rem;
  }
}
