/* 
 * SkyISP Manager - Global Design System
 * Cleaned, Consolidated, and Modernized
 * Release: v54 (20261114_v54)
 */

:root {
  /* Release v98 12-Token Holistic Theme Engine Defaults (Cobalt Enterprise) */
  --color-brand: #2563eb;
  --color-brand-hover: #1d4ed8;
  --color-brand-active: #1e40af;
  --color-brand-hover-light: #60a5fa;
  --color-brand-rgb: 37, 99, 235;
  --color-brand-soft: rgba(37, 99, 235, 0.12);
  --color-brand-border: rgba(37, 99, 235, 0.28);

  --color-sidebar-bg-start: #0b132b;
  --color-sidebar-bg-end: #111d3d;
  --color-sidebar-bg: linear-gradient(180deg, var(--color-sidebar-bg-start) 0%, var(--color-sidebar-bg-end) 100%);
  --color-sidebar-text: #cbd5e1;
  --color-sidebar-accent: var(--color-brand);
  --color-sidebar-hover: rgba(255, 255, 255, 0.05);
  --color-sidebar-border: #334155;
  --color-sidebar-active-bg: rgba(37, 99, 235, 0.16);
  --color-sidebar-active-glow: rgba(37, 99, 235, 0.35);

  --bg-app-light-tint: #f4f7fb;
  --bg-app-dark-tint: #0b1120;
  --bg-card-dark-tint: #111827;

  /* Legacy aliases dynamically mapped to theme tokens */
  --brand-primary: var(--color-brand);
  --color-primary: var(--color-brand);
  --color-primary-dark: var(--color-brand-hover);
  --color-primary-soft: var(--color-brand-soft);
  --accent-color: var(--color-brand);

  /* V76 Typography Contract - global font tokens */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --title-tracking: -0.015em;
  --label-tracking: 0.04em;

  /* Semantic status colors (PRESERVED - Never overridden by theme) */
  --color-success: #16a34a;
  --color-success-soft: rgba(22, 163, 74, 0.1);
  --color-warning: #d97706;
  --color-warning-soft: rgba(217, 119, 6, 0.1);
  --color-danger: #dc2626;
  --color-danger-soft: rgba(220, 38, 38, 0.1);

  --color-background: var(--bg-app-light-tint, #f4f7fb);
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;

  /* Bottom Bar Branding (defaults for login page and dashboard footer) */
  --color-bottom-bar-bg: #ffffff;
  --color-bottom-bar-text: #475569;

  /* Shared layout tokens - Default: Medium Desktop (1441px - 1600px) */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 56px;
  --page-padding: 18px;
  --page-padding-top: 16px;
  --page-header-margin: 16px;
  --card-padding: 14px 16px;
  --card-gap: 14px;
  --content-max-width: 100%;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
:root[data-theme="dark"],
[data-theme="dark"],
body.dark-mode {
  --color-background: var(--dark-bg-canvas, #0b1120);
  --color-bg: var(--dark-bg-canvas, #0b1120);
  --color-surface: var(--dark-bg-surface, #111827);
  --bg-card: var(--dark-bg-surface, #111827);
  --color-surface-subtle: var(--dark-bg-subtle, #161f33);
  --color-surface-elevated: var(--dark-bg-elevated, #1e293b);
  --color-border: var(--dark-border, rgba(148, 163, 184, 0.14));
  --color-border-strong: var(--dark-border-strong, rgba(148, 163, 184, 0.25));

  --color-text: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;

  --color-primary-soft: var(--color-brand-soft, rgba(var(--color-brand-rgb, 37, 99, 235), 0.2));
  --color-success-soft: rgba(22, 163, 74, 0.2);
  --color-warning-soft: rgba(217, 119, 6, 0.2);
  --color-danger-soft: rgba(220, 38, 38, 0.2);

  --color-bottom-bar-bg: var(--dark-footer-bg, #0b1120);
  --color-bottom-bar-text: #94a3b8;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
}

/* System Dark Preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-background: var(--dark-bg-canvas, #0b1120);
    --color-bg: var(--dark-bg-canvas, #0b1120);
    --color-surface: var(--dark-bg-surface, #111827);
    --bg-card: var(--dark-bg-surface, #111827);
    --color-surface-subtle: var(--dark-bg-subtle, #161f33);
    --color-surface-elevated: var(--dark-bg-elevated, #1e293b);
    --color-border: var(--dark-border, rgba(148, 163, 184, 0.14));
    --color-border-strong: var(--dark-border-strong, rgba(148, 163, 184, 0.25));

    --color-text: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #64748b;

    --color-primary-soft: rgba(37, 99, 235, 0.2);
    --color-success-soft: rgba(22, 163, 74, 0.2);
    --color-warning-soft: rgba(217, 119, 6, 0.2);
    --color-danger-soft: rgba(220, 38, 38, 0.2);
  }
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

input[type="checkbox"], input[type="radio"], input[type="range"] {
  accent-color: var(--color-brand, #2563eb);
}
/* --- V76 Typography Contract: shared type utilities --- */
/* Page titles & headings: Inter heading stack, tightened -0.015em tracking */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: var(--title-tracking);
}

/* Mono utility for technical identifiers (MACs, IPs, PPPoE creds, refs) */
.font-mono {
  font-family: var(--font-mono);
}

/* Money / speed / count values: tabular figures + Inter character variants */
.v76-num,
.stat-value,
.metric-card-value,
.speed-badge,
.topbar-clock,
.router-latency-value,
.traffic-graph-value,
.tooltip-time,
.throughput-pill,
.act-session-metric .act-mono,
.supt-gps-coord,
.supt-kpi-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Micro uppercase labels that do not set their own tracking: 0.04em */
.data-table th,
.packages-table td[data-label]::before,
#pkgHistoryTable td[data-label]::before,
.b6-balance-header,
.b6-period-title,
.b6-notes-title,
.gw-field-lbl,
.mbl-detail-k {
  letter-spacing: var(--label-tracking);
}


a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* --- App Shell Layout (REAL DOM STRUCTURE) --- */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  background-color: var(--color-background, #f1f5f9) !important;
}

/* Sidebar - fixed positioning */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh !important;
  max-height: 100vh !important;
  background: var(--color-sidebar-bg, linear-gradient(180deg, #0b132b 0%, #111d3d 100%)) !important;
  color: var(--color-sidebar-text, #e2e8f0) !important;
  border-right: 1px solid var(--color-sidebar-border, rgba(15, 23, 42, 0.15)) !important;
  border-bottom: none;
  border-bottom-right-radius: 0;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform var(--transition), width var(--transition);
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="dark"] .sidebar,
body.dark-mode .sidebar {
  background: var(--color-sidebar-bg, linear-gradient(180deg, #0b132b 0%, #111d3d 100%)) !important;
  border-right: 1px solid var(--color-sidebar-border, rgba(15, 23, 42, 0.15)) !important;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06) !important;
}

/* Main content area - positioned after sidebar */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background, #f1f5f9) !important;
  transition: margin-left var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Content inside main - ensures proper flex growth */
.content,
#mainContent {
  flex: 1;
  min-width: 0;
  /* Remove width: 100% to prevent horizontal overflow when padding is applied */
  /* Pages should use padding on their inner containers instead */
}

/* Topbar spans full width of main area */
.topbar {
  height: var(--topbar-height, 56px);
  min-height: var(--topbar-height, 56px);
  max-height: var(--topbar-height, 56px);
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
  width: 100%;
  flex-shrink: 0;
}

[data-theme="dark"] .topbar,
body.dark-mode .topbar {
  background: color-mix(in srgb, var(--dark-bg-surface) 90%, transparent) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

/* Footer */
.shell-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-badge,
.footer-powered {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.brand-badge .badge-dot,
.footer-powered .badge-dot,
.shell-footer .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}

.brand-badge-text {
  font-family: var(--font-mono);
}

.shell-footer .powered-by {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1;
}

/* Sidebar Backdrop for mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Sidebar Components --- */
.sidebar-brand {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 11px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: var(--color-sidebar-bg-start, #0b132b) !important;
  background-color: var(--color-sidebar-bg-start, #0b132b) !important;
  flex: 0 0 56px !important;
  flex-shrink: 0 !important;
}

[data-theme="dark"] .sidebar-brand,
body.dark-mode .sidebar-brand {
  background: var(--color-sidebar-bg-start, #0b132b) !important;
  background-color: var(--color-sidebar-bg-start, #0b132b) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

.sidebar-brand .brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-brand, #2563eb) 0%, var(--color-brand-hover, #1d4ed8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px rgba(var(--color-brand-rgb, 37, 99, 235), 0.25);
}

.brand-mark-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.brand-mark-logo:hover {
  transform: scale(1.05);
}

.brand-mark-text.fallback {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-brand, #2563eb) 0%, var(--color-brand-hover, #1d4ed8) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-brand .brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

[data-theme="dark"] .sidebar-brand .brand-name,
body.dark-mode .sidebar-brand .brand-name {
  color: #f8fafc !important;
}

.sidebar-brand .brand-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #64748b;
  white-space: nowrap;
}

[data-theme="dark"] .sidebar-brand .brand-sub,
body.dark-mode .sidebar-brand .brand-sub {
  color: #94a3b8 !important;
}

.sidebar-brand .brand-sub .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-brand .brand-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-action-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.sidebar-action-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="dark"] .sidebar-action-btn,
body.dark-mode .sidebar-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--dark-border);
  color: #94a3b8;
}

[data-theme="dark"] .sidebar-action-btn:hover,
body.dark-mode .sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.sidebar-mobile-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 8px 10px 6px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: auto !important;
  -ms-overflow-style: none !important;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: none !important;
  border-right: none !important;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
  display: none !important;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  padding: 14px 12px 4px;
  user-select: none;
  pointer-events: none;
}

.nav-section-label.nav-section-label--first,
.nav-section-label:first-child {
  padding-top: 6px !important;
}

[data-theme="dark"] .nav-section-label,
body.dark-mode .nav-section-label {
  color: #94a3b8;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  text-decoration: none;
  border-radius: 8px;
  gap: 10px;
  color: #334155 !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em;
  transition: all var(--transition, 150ms ease);
  min-height: 36px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}

.sidebar .nav-item > .nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
  transition: color 150ms ease;
}

.sidebar .nav-item > .nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar .nav-item .nav-chevron {
  margin-left: auto;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, color 150ms ease;
}

.sidebar .nav-item:hover {
  background: rgba(226, 232, 240, 0.65) !important;
  color: #0f172a !important;
}

.sidebar .nav-item:hover > .nav-icon {
  color: var(--color-brand, #2563eb) !important;
}

.sidebar .nav-item:hover .nav-chevron {
  color: var(--color-brand, #2563eb) !important;
}

/* Active Standalone Item */
.sidebar .nav-item.active:not(.has-submenu) {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 0px solid transparent !important;
  box-shadow: 0 4px 14px rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important;
}

.sidebar .nav-item.active:not(.has-submenu) > .nav-icon {
  color: #ffffff !important;
}

/* Active Parent Group */
.sidebar .nav-item.active-parent {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 0px solid transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-item.active-parent > .nav-icon,
.sidebar .nav-item.active-parent .nav-chevron {
  color: var(--color-brand-hover-light, #60a5fa) !important;
}

/* Dark mode menu items */
[data-theme="dark"] .sidebar .nav-item,
body.dark-mode .sidebar .nav-item {
  color: #cbd5e1 !important;
  border: 0px solid transparent !important;
}

[data-theme="dark"] .sidebar .nav-item > .nav-icon,
body.dark-mode .sidebar .nav-item > .nav-icon {
  color: #94a3b8;
}

[data-theme="dark"] .sidebar .nav-item:hover,
body.dark-mode .sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border: 0px solid transparent !important;
}

[data-theme="dark"] .sidebar .nav-item:hover > .nav-icon,
body.dark-mode .sidebar .nav-item:hover > .nav-icon {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .sidebar .nav-item.active:not(.has-submenu),
body.dark-mode .sidebar .nav-item.active:not(.has-submenu) {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  border: 0px solid transparent !important;
  box-shadow: 0 4px 14px rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important;
}

[data-theme="dark"] .sidebar .nav-item.active:not(.has-submenu) > .nav-icon,
body.dark-mode .sidebar .nav-item.active:not(.has-submenu) > .nav-icon {
  color: #ffffff !important;
}

[data-theme="dark"] .sidebar .nav-item.active-parent,
body.dark-mode .sidebar .nav-item.active-parent {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  border: 0px solid transparent !important;
}

[data-theme="dark"] .sidebar .nav-item.active-parent > .nav-icon,
body.dark-mode .sidebar .nav-item.active-parent > .nav-icon,
[data-theme="dark"] .sidebar .nav-item.active-parent .nav-chevron,
body.dark-mode .sidebar .nav-item.active-parent .nav-chevron {
  color: var(--color-brand-hover-light, #60a5fa) !important;
}

.sidebar .nav-item.nav-item--disabled,
.sidebar .nav-item.is-disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar .nav-item.nav-item--disabled > .nav-label,
.sidebar .nav-item.nav-item--disabled > .nav-icon,
.sidebar .nav-item.is-disabled > .nav-label,
.sidebar .nav-item.is-disabled > .nav-icon {
  opacity: 0.55;
}

.sidebar .nav-item.nav-item--disabled:hover,
.sidebar .nav-item.is-disabled:hover {
  background: transparent;
  color: #94a3b8;
}

.nav-badge-soon {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.22);
  letter-spacing: 0.25px;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.parent-soon {
  margin-left: auto;
  margin-right: 6px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  letter-spacing: 0.02em;
}

/* Submenu container and child items */
.sidebar:not(.collapsed) .nav-submenu {
  position: relative;
  margin: 2px 0 6px 20px !important;
  padding: 2px 0 2px 12px !important;
  border-left: 1.5px solid #cbd5e1 !important;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.sidebar:not(.collapsed) .nav-submenu.open {
  display: flex !important;
  animation: skySidebarSubmenuIn 160ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sidebar .nav-submenu .nav-item {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  min-height: 32px !important;
  padding: 5px 10px !important;
  border-radius: 7px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 140ms ease;
}

.sidebar .nav-submenu .nav-item:hover {
  background: rgba(226, 232, 240, 0.6) !important;
  color: #0f172a !important;
}

.sidebar .nav-submenu .nav-item.active {
  position: relative;
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important;
}

.sidebar .nav-submenu .nav-item.active::before {
  content: '';
  position: absolute;
  left: -13.5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-brand, #2563eb);
  box-shadow: 0 0 8px rgba(var(--color-brand-rgb, 37, 99, 235), 0.6);
}

[data-theme="dark"] .sidebar:not(.collapsed) .nav-submenu,
body.dark-mode .sidebar:not(.collapsed) .nav-submenu {
  border-left: 1.5px solid #475569 !important;
}

[data-theme="dark"] .sidebar .nav-submenu .nav-item,
body.dark-mode .sidebar .nav-submenu .nav-item {
  color: #94a3b8 !important;
}

[data-theme="dark"] .sidebar .nav-submenu .nav-item:hover,
body.dark-mode .sidebar .nav-submenu .nav-item:hover {
  background: rgba(51, 65, 85, 0.6) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .sidebar .nav-submenu .nav-item.active,
body.dark-mode .sidebar .nav-submenu .nav-item.active {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important;
}

/* Executive Sidebar Footer */
.sidebar-footer {
  flex: 0 0 48px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: #172033 !important;
  background-color: #172033 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .sidebar-footer,
body.dark-mode .sidebar-footer {
  background: #172033 !important;
  background-color: #172033 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
}

#logoutLink.sidebar-logout-btn,
.sidebar-footer #logoutLink {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  border: 0px solid transparent !important;
  color: #94a3b8 !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  gap: 10px !important;
  cursor: pointer !important;
  transition: all 120ms ease !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

#logoutLink.sidebar-logout-btn .nav-icon,
.sidebar-footer #logoutLink .nav-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#logoutLink:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 0px solid transparent !important;
  color: #f87171 !important;
}

#logoutLink:hover .nav-icon {
  color: #f87171 !important;
}

[data-theme="dark"] #logoutLink.sidebar-logout-btn,
[data-theme="dark"] .sidebar-footer #logoutLink,
body.dark-mode #logoutLink.sidebar-logout-btn,
body.dark-mode .sidebar-footer #logoutLink {
  background: transparent !important;
  border: 0px solid transparent !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] #logoutLink:hover,
body.dark-mode #logoutLink:hover {
  background: rgba(220, 38, 38, 0.2) !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] #logoutLink:hover .logout-left .nav-icon,
body.dark-mode #logoutLink:hover .logout-left .nav-icon {
  color: #fca5a5 !important;
}

[data-theme="dark"] #logoutLink:hover .logout-hint,
body.dark-mode #logoutLink:hover .logout-hint {
  color: #f87171 !important;
}

/* --- Sidebar Collapsed State --- */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width, 68px) !important;
}

.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .nav-submenu.open,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .brand-actions,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-badge-soon,
.sidebar.collapsed .parent-soon,
.sidebar.collapsed .operator-info,
.sidebar.collapsed .sidebar-footer-actions,
.sidebar.collapsed .logout-hint {
  display: none !important;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center !important;
  padding: 0 !important;
}

.sidebar.collapsed .brand-left {
  justify-content: center !important;
  flex: none !important;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 0 !important;
  align-items: center !important;
  gap: 2px !important;
}

.sidebar.collapsed .nav-group {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .nav-item {
  width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 2px auto !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.sidebar.collapsed .nav-item > .nav-icon {
  margin: 0 !important;
  width: 18px !important;
  height: 18px !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 10px 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.sidebar.collapsed #logoutLink.sidebar-logout-btn,
.sidebar.collapsed .sidebar-footer #logoutLink {
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 10px !important;
}

.sidebar.collapsed #logoutLink .logout-left {
  justify-content: center !important;
}

.sidebar.collapsed #logoutLink .nav-icon {
  margin: 0 !important;
}

.sidebar.collapsed+.sidebar-backdrop+.main,
.sidebar.collapsed~.main {
  margin-left: var(--sidebar-collapsed-width, 68px) !important;
}

/* --- Mobile Sidebar (Drawer) --- */
@media (max-width: 992px) {
  .sidebar {
    width: min(84vw, 296px) !important;
    height: 100vh !important;
    border-bottom-right-radius: 0;
    border-bottom: none;
    z-index: 1000;
  }

  .sidebar:not(.open) {
    box-shadow: none !important;
    visibility: hidden !important;
    transform: translateX(calc(-100% - 16px)) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.22s !important;
  }

  .sidebar.open {
    visibility: visible !important;
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition, 200ms ease), visibility var(--transition, 200ms ease);
  }

  .sidebar-backdrop.visible {
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(11, 17, 32, 0.68) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }

  .sidebar .nav-item {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 13.5px !important;
  }

  .sidebar .nav-submenu .nav-item {
    min-height: 38px !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
  }

  .main {
    margin-left: 0 !important;
  }

  .sidebar.collapsed+.sidebar-backdrop+.main,
  .sidebar.collapsed~.main {
    margin-left: 0 !important;
  }
}

/* --- Topbar Components --- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-shrink: 1;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.crumb {
  color: var(--color-text-muted);
  transition: color var(--transition);
}

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

.crumb-current {
  color: var(--color-text);
  font-weight: 500;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

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

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-background);
}

.connection-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.connection-pill.connected .pill-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.connection-pill.connecting .pill-dot {
  background: var(--color-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-pill.disconnected .pill-dot {
  background: var(--color-danger);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
  min-width: 70px;
  text-align: center;
}



.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0 10px 0 4px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-chip:hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.admin-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 1000;
}

.admin-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

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

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

.dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.dashboard-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.dashboard-subtitle {
  color: var(--color-text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-brand, var(--color-primary, #2563eb)) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--color-brand-hover, var(--color-primary-dark, #1d4ed8)) !important;
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-brand-active, var(--color-brand-hover, #1e40af)) !important;
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.btn-secondary:hover {
  background: var(--color-background);
  border-color: var(--color-border-strong);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.card-body {
  padding: 20px;
}

/* --- Stat Cards --- */
.stat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: all var(--transition);
  padding: 16px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.stat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.stat-card:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--color-primary);
  transform: translateY(-2px);
}

/* --- Dashboard Metric Cards --- */
/* Top metrics row — equal height cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metrics-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1100px) {
  .metrics-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .metrics-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .metrics-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Base metric card — used by dashboard and customers */
.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.metric-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.metric-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.metric-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.metric-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.metric-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .metrics-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .metrics-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Base metric card — used by dashboard and customers */
.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.metric-card:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--color-primary);
  transform: translateY(-2px);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-card-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.metric-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.metric-card-icon.ok {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.metric-card-icon.warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.metric-card-icon.bad {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.metric-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 8px;
  word-break: break-word;
}

.metric-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.metric-card-meta .meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.metric-card-meta.ok .meta-dot {
  background: var(--color-success);
}

.metric-card-meta.warning .meta-dot {
  background: var(--color-warning);
}

.metric-card-meta.bad .meta-dot {
  background: var(--color-danger);
}

/* Stat card variant — used in dashboard */
.card.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card.stat-card:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--color-primary);
  transform: translateY(-2px);
}

.card.stat-card .card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100px;
}

.card.stat-card .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.card.stat-card .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.card.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}

.card.stat-card .stat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.card.stat-card .stat-meta .meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.card.stat-card .stat-meta.ok .meta-dot {
  background: var(--color-success);
}

.card.stat-card .stat-meta.warning .meta-dot {
  background: var(--color-warning);
}

.card.stat-card .stat-meta.bad .meta-dot {
  background: var(--color-danger);
}

/* --- Summary Cards Grids (PPPoE & Customers) --- */
.pppoe-summary-grid,
.customers-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.customers-summary-grid .category-tile,
.groups-summary-grid .category-tile,
.areas-summary-grid .category-tile,
.customer-diagnostic-card {
  border-radius: 12px !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.customers-summary-grid .category-tile:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
  transform: translateY(-2px) !important;
}

.customers-summary-grid .category-tile.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
}

@media (max-width: 1024px) {

  .pppoe-summary-grid,
  .customers-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {

  .pppoe-summary-grid,
  .customers-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Icons --- */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* --- Detail Grids & Items --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.detail-value.muted {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* --- Connection Health Panel --- */
.health-list {
  display: flex;
  flex-direction: column;
}

.health-list .detail-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

.health-list .detail-item:last-child {
  border-bottom: none;
}

.health-list .detail-label {
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.health-list .detail-value {
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  margin-right: 6px;
}

.status-dot.ok {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.text-success {
  color: var(--color-success);
}

.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

/* --- Traffic Graph --- */
.traffic-header {
  display: flex;
  gap: 32px;
  margin-bottom: 20px;
}

.traffic-stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.traffic-stat-value {
  font-size: 20px;
  font-weight: 700;
}

.traffic-stat-value.rx {
  color: var(--color-primary);
}

.traffic-stat-value.tx {
  color: var(--color-success);
}

.graph-rx-fill {
  fill: var(--color-primary);
  fill-opacity: 0.1;
  pointer-events: none;
}

.graph-tx-fill {
  fill: var(--color-warning);
  fill-opacity: 0.1;
  pointer-events: none;
}

.graph-rx {
  stroke: var(--color-primary);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
}

.graph-tx {
  stroke: var(--color-warning);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.2));
}

.graph-grid {
  stroke: var(--color-border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.5;
}

.graph-axis {
  font-family: var(--font-sans);
  font-weight: 500;
}

/* --- Tables --- */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: var(--color-background);
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.data-table tr:hover {
  background-color: var(--color-background);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.badge-info {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge-primary {
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.12));
  color: var(--color-primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Forms & Search --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text);
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* --- PPPoE Page Specific --- */
.pppoe-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}



.pppoe-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  max-width: 400px;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.pppoe-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pppoe-stat-info {
  display: flex;
  flex-direction: column;
}

.pppoe-stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.pppoe-stat-value {
  font-size: 20px;
  font-weight: 700;
}

/* Empty state styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

td.empty-state-cell {
  display: table-cell;
  text-align: center;
  padding: 0;
}

td.empty-state-cell .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
  width: 100%;
  color: var(--color-text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--color-background);
  color: var(--color-text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-background) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

/* --- Charts & Progress --- */
.ring-bg {
  stroke: var(--color-border);
  fill: none;
}

.ring-fg {
  fill: none;
  transition: stroke-dashoffset 0.5s ease-out;
}

.ring-fg.ok {
  stroke: var(--color-success);
}

.ring-fg.warning {
  stroke: var(--color-warning);
}

.ring-fg.bad {
  stroke: var(--color-danger);
}

.donut-segment {
  fill: none;
  stroke-width: 4;
  transition: stroke-dashoffset 0.5s ease-out;
}

.donut-ring {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 4;
}

.donut-segment.active {
  stroke: var(--color-primary);
}

.donut-text {
  fill: var(--color-text);
  font-family: inherit;
}

.donut-label {
  fill: var(--color-text-muted);
  font-size: 10px;
  font-weight: 500;
}

.traffic-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.rx {
  background: var(--color-primary);
}

.legend-dot.tx {
  background: var(--color-success);
}

/* ==========================================================================
   LOGIN PAGE — Classic Centered Glassmorphism Theme (Release v57)
   Proportional Viewport Scaling (Laptop 1366x768 vs Desktop 1920x1080+)
   Full-Bleed 100vw x 100vh Edge-to-Edge Dark Network Mesh Canvas
   ========================================================================== */

:root {
  /* Login-specific dark theme tokens (v108 Theme-Adaptive) */
  --login-bg-deep: var(--dark-bg-canvas, var(--color-sidebar-bg-end, #0b1120));
  --login-bg-card: var(--dark-bg-surface, #111827);
  --login-border: color-mix(in srgb, var(--color-brand, #2563eb) 22%, rgba(255, 255, 255, 0.08));
  --login-border-hover: color-mix(in srgb, var(--color-brand, #2563eb) 38%, rgba(255, 255, 255, 0.15));
  --login-text: #f8fafc;
  --login-text-muted: #94a3b8;
  --login-input-bg: var(--dark-bg-subtle, #161f33);
  --login-input-border: var(--dark-border, rgba(148, 163, 184, 0.22));
  --login-input-focus: var(--color-brand-soft, rgba(var(--color-brand-rgb, 37, 99, 235), 0.35));
  --login-success: #16a34a;
  --login-success-glow: rgba(22, 163, 74, 0.35);
  --login-primary: var(--color-brand, #2563eb);
  --login-primary-glow: var(--color-sidebar-active-glow, rgba(var(--color-brand-rgb, 37, 99, 235), 0.4));
  --login-glass: var(--dark-bg-surface, #111827);
  --login-glass-border: color-mix(in srgb, var(--color-brand, #2563eb) 22%, rgba(255, 255, 255, 0.08));
}

.login-page {
  position: relative !important;
  min-height: 100vh !important;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, var(--color-sidebar-bg-start, #0f172a) 0%, var(--color-sidebar-bg-end, #0b1120) 100%) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Background Layers (Full bleed 100vw x 100vh) */
.login-bg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  z-index: 0 !important;
  background: linear-gradient(180deg, var(--color-sidebar-bg-start, #0f172a) 0%, var(--color-sidebar-bg-end, #0b1120) 100%) !important;
}

.login-grid {
  position: absolute !important;
  inset: 0 !important;
  background-image:
    linear-gradient(rgba(var(--color-brand-rgb, 37, 99, 235), 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-brand-rgb, 37, 99, 235), 0.04) 1px, transparent 1px) !important;
  background-size: 60px 60px !important;
  opacity: 0.65 !important;
}

.login-nodes {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
}

.login-nodes-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.login-node-line {
  stroke: rgba(var(--color-brand-rgb, 37, 99, 235), 0.18) !important;
  stroke-width: 0.75 !important;
  opacity: 0.65 !important;
  transition: stroke 0.3s ease !important;
}

.login-node-group {
  transform-origin: center !important;
}

.login-node-halo {
  fill: var(--color-brand, #2563eb) !important;
  opacity: 0.28 !important;
  filter: blur(3px) !important;
  transition: fill 0.3s ease !important;
}

.login-node {
  fill: var(--color-brand-hover-light, var(--color-brand, #60a5fa)) !important;
  opacity: 0.55 !important;
  transition: fill 0.3s ease, opacity 0.3s ease !important;
}

.login-node-glow {
  opacity: 0.95 !important;
  fill: var(--color-brand-hover-light, #fb7185) !important;
  animation: nodePulse 4s ease-in-out infinite !important;
}

@keyframes nodePulse {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.95;
  }
}

.login-glow {
  position: absolute !important;
  border-radius: 50% !important;
  filter: blur(120px) !important;
  opacity: 0.18 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.login-glow-1 {
  width: 550px !important;
  height: 550px !important;
  background: radial-gradient(circle at center, var(--color-brand-hover-light, #60a5fa) 0%, var(--color-brand, #2563eb) 45%, transparent 70%) !important;
  top: -150px !important;
  right: -100px !important;
  animation: glowDrift 20s ease-in-out infinite alternate !important;
}

.login-glow-2 {
  width: 450px !important;
  height: 450px !important;
  background: radial-gradient(circle at center, var(--color-brand, #2563eb) 0%, rgba(var(--color-brand-rgb, 37, 99, 235), 0.4) 45%, transparent 70%) !important;
  bottom: -100px !important;
  left: -100px !important;
  animation: glowDrift 25s ease-in-out infinite alternate-reverse !important;
}

.login-glow-3 {
  width: 360px !important;
  height: 360px !important;
  background: radial-gradient(circle at center, rgba(var(--color-brand-rgb, 37, 99, 235), 0.8) 0%, var(--color-sidebar-bg-end, #0b1120) 55%, transparent 70%) !important;
  top: 30% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  animation: glowDrift 18s ease-in-out infinite alternate !important;
}

@keyframes glowDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, -20px) scale(1.05);
  }
}

.login-vignette {
  position: absolute !important;
  inset: 0 !important;
  background: radial-gradient(ellipse at center, transparent 40%, var(--color-sidebar-bg-end, #0b1120) 100%) !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

/* Centered Authentication Wrapper */
.login-content {
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

/* Glassmorphism Centered Card (Proportional Scaling for Laptop 1366x768 & Desktop 1920x1080) */
.login-card {
  width: 380px !important;
  max-width: 92vw !important;
  background: var(--dark-bg-surface, #111827) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid color-mix(in srgb, var(--color-brand, #2563eb) 22%, rgba(255, 255, 255, 0.08)) !important;
  border-top: 2px solid var(--color-brand, #2563eb) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 24px -6px var(--color-brand-soft, rgba(37, 99, 235, 0.25)) !important;
  padding: 26px 28px 22px !important;
  position: relative !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin: 0 auto !important;
}

.login-header {
  text-align: center !important;
  margin-bottom: 0 !important;
}

.login-logo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 12px !important;
  filter: drop-shadow(0 4px 16px var(--color-brand-soft, rgba(37, 99, 235, 0.4))) !important;
}

.login-brand-logo-img {
  width: 42px !important;
  height: 42px !important;
  display: block !important;
  border-radius: 12px !important;
}

.login-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.25 !important;
  letter-spacing: var(--title-tracking, normal) !important;
}

.login-subtitle {
  color: #94a3b8 !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  margin: 0 0 18px 0 !important;
  line-height: 1.35 !important;
}

.login-page .form-group {
  margin-bottom: 13px !important;
}

.login-page .form-label {
  display: block !important;
  margin-bottom: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  color: #cbd5e1 !important;
  text-transform: uppercase !important;
}

.login-input-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.login-input-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
}

.form-control.login-input {
  width: 100% !important;
  height: 40px !important;
  padding: 0 16px 0 42px !important;
  background: var(--dark-bg-subtle, #161f33) !important;
  border: 1px solid var(--dark-border, rgba(148, 163, 184, 0.22)) !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  color: #f8fafc !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.form-control.login-input::placeholder {
  color: #64748b !important;
  opacity: 0.8 !important;
}

.form-control.login-input:hover {
  border-color: var(--dark-border-strong, rgba(148, 163, 184, 0.35)) !important;
  background: var(--dark-bg-hover, #1e293b) !important;
}

.form-control.login-input:focus {
  border-color: var(--color-brand, #2563eb) !important;
  box-shadow: 0 0 0 3px var(--color-brand-soft, rgba(37, 99, 235, 0.25)) !important;
  background: var(--dark-bg-subtle, #161f33) !important;
}

.password-wrapper .form-control.login-input {
  padding-right: 44px !important;
}

.password-wrapper .password-toggle {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
  border-radius: 6px !important;
  transition: color 0.15s ease !important;
}

.password-wrapper .password-toggle:hover {
  color: #f8fafc !important;
}

.form-error {
  display: block !important;
  margin-top: 3px !important;
  font-size: 11px !important;
  color: #f87171 !important;
  min-height: 14px !important;
  line-height: 1.2 !important;
}

.login-submit {
  width: 100% !important;
  height: 40px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin-top: 6px !important;
  border-radius: 10px !important;
  background: var(--color-sidebar-active-gradient, #2563eb) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 16px var(--color-sidebar-active-glow, rgba(37, 99, 235, 0.4)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

.login-submit:hover:not(:disabled) {
  background: var(--color-sidebar-active-gradient, #1d4ed8) !important;
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px var(--color-sidebar-active-glow, rgba(37, 99, 235, 0.5)) !important;
}

.login-submit:active:not(:disabled) {
  background: var(--color-sidebar-active-gradient, #1e40af) !important;
  filter: brightness(0.95) !important;
  transform: translateY(0) !important;
}

.login-submit:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

.login-btn-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

.btn-spinner {
  width: 18px !important;
  height: 18px !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  border-top-color: #fff !important;
  border-radius: 50% !important;
  animation: spin 0.8s linear infinite !important;
}

.login-card-footer {
  margin-top: 16px !important;
  text-align: center !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.firefly-text {
  color: #fff !important;
  font-weight: 600 !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4) !important;
  animation: fireflyGlow 4s ease-in-out infinite !important;
}

@keyframes fireflyGlow {
  0%, 100% {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 12px rgba(var(--color-brand-rgb, 37, 99, 235), 0.2);
    opacity: 0.8;
  }
  50% {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7), 0 0 20px rgba(var(--color-brand-rgb, 37, 99, 235), 0.5);
    opacity: 1;
  }
}

/* Large Desktop Monitors (1600px+ width & 860px+ height) */
@media (min-width: 1600px) and (min-height: 860px) {
  .login-card {
    width: 420px !important;
    padding: 36px 36px 28px !important;
    border-radius: 18px !important;
  }
  .login-brand-logo-img {
    width: 48px !important;
    height: 48px !important;
  }
  .login-logo {
    margin-bottom: 14px !important;
  }
  .login-title {
    font-size: 22px !important;
    margin-bottom: 6px !important;
  }
  .login-subtitle {
    font-size: 13.5px !important;
    margin-bottom: 22px !important;
  }
  .login-page .form-group {
    margin-bottom: 16px !important;
  }
  .login-page .form-label {
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }
  .form-control.login-input {
    height: 44px !important;
    font-size: 14px !important;
  }
  .login-submit {
    height: 44px !important;
    font-size: 15px !important;
    margin-top: 8px !important;
  }
  .login-card-footer {
    margin-top: 20px !important;
    font-size: 11px !important;
  }
}

/* Mobile Viewports (max-width: 480px) */
@media (max-width: 480px) {
  .login-card {
    width: calc(100vw - 32px) !important;
    padding: 24px 20px 20px !important;
  }
  .login-title {
    font-size: 19px !important;
  }
}

/* --- Metric Card Icon Fix --- */
.metric-card-icon {
  flex-shrink: 0;
}

.metric-card-label {
  flex: 1;
  min-width: 0;
}

/* --- Connection Health Muted Fallback --- */
.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

/* --- Health Row Styles --- */
.health-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.health-row-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
  flex: 1;
  min-width: 120px;
}

.health-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  flex: 1;
}

.health-row-value.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

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

.health-dot.dot-ok {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.health-dot.dot-bad {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger-soft);
}

.text-ok {
  color: var(--color-success);
}

.text-bad {
  color: var(--color-danger);
}

.connection-health {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.connection-health.healthy {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.connection-health.unhealthy {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.connection-health .health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* --- Page Layout --- */
.page-header,
.billing-page-header,
.dashboard-header,
.router-header,
.custprofile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 0;
  margin-bottom: var(--page-header-margin, 16px);
  padding: 0;
  min-height: 42px;
}

.page-header-main,
.billing-header-main,
.dashboard-header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-title,
.billing-page-title,
.dashboard-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: var(--title-tracking);
  margin: 0;
  line-height: 1.25;
}

.page-subtitle,
.billing-page-subtitle {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin: 3px 0 0;
  line-height: 1.4;
}

.page-header-actions,
.customers-header-actions,
.packages-header-actions,
.billing-header-actions,
.page-actions,
.dashboard-header-actions,
.custprofile-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-header-actions .btn,
.customers-header-actions .btn,
.packages-header-actions .btn,
.billing-header-actions .btn,
.page-actions .btn,
.dashboard-header-actions .btn,
.custprofile-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  box-sizing: border-box;
}

.page-header-actions .btn svg,
.customers-header-actions .btn svg,
.packages-header-actions .btn svg,
.billing-header-actions .btn svg,
.page-actions .btn svg,
.dashboard-header-actions .btn svg,
.custprofile-actions .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.page-header-actions .btn-secondary,
.customers-header-actions .btn-secondary,
.packages-header-actions .btn-secondary,
.billing-header-actions .btn-secondary,
.page-actions .btn-secondary,
.dashboard-header-actions .btn-secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.page-header-actions .btn-secondary:hover,
.customers-header-actions .btn-secondary:hover,
.packages-header-actions .btn-secondary:hover,
.billing-header-actions .btn-secondary:hover,
.page-actions .btn-secondary:hover,
.dashboard-header-actions .btn-secondary:hover {
  background: var(--color-background);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

/* Authoritative Global Page Container System */
[class$="-page"],
.page-container,
.main-container {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  padding: var(--page-padding-top, 20px) var(--page-padding, 24px) var(--page-padding, 24px);
}

/* Neutralize duplicate side padding on headers inside page containers */
[class$="-page"] .page-header,
[class$="-page"] .billing-page-header,
[class$="-page"] .dashboard-header,
[class$="-page"] .router-header,
[class$="-page"] .pkgnew-header {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: var(--page-header-margin, 16px);
}

/* Fallback: ensure any direct content in #mainContent gets horizontal padding & container constraints */
#mainContent > :not([class$="-page"]):not(style):not(script) {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  padding-left: var(--page-padding, 24px);
  padding-right: var(--page-padding, 24px);
  padding-top: var(--page-padding-top, 20px);
  padding-bottom: var(--page-padding, 24px);
}

/* Page header within mainContent */
.router-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  margin-bottom: 28px;
  padding: 0 24px;
  min-height: 48px;
}

@media (max-width: 768px) {
  .router-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 20px;
    padding: 0 16px;
  }
}

/* Connection badge in router page header */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-background);
}

.connection-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: all var(--transition);
}

.connection-badge.connected .badge-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.connection-badge.connecting .badge-dot {
  background: var(--color-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-badge.disconnected .badge-dot {
  background: var(--color-danger);
}

.connection-badge.not-configured .badge-dot {
  background: var(--color-text-muted);
}

/* Ensure mainContent page-header has no extra margin */
#mainContent>.page-header {
  margin-left: 0;
  margin-right: 0;
}

/* Router header specifically needs horizontal padding to align with cards */
#mainContent>.router-header {
  padding-left: 24px;
  padding-right: 24px;
}

/* --- Dashboard Sections --- */
.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.dashboard-section-header span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

/* Dashboard section card wrapper - provides background, border, padding */
.dashboard-section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.system-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.monitor-panel {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.monitor-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.monitor-widget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.monitor-widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.monitor-widget-pct {
  font-size: 14px;
  font-weight: 700;
}

.monitor-widget-pct.success {
  color: var(--color-success);
}

.monitor-widget-pct.warning {
  color: var(--color-warning);
}

.monitor-widget-pct.danger {
  color: var(--color-danger);
}

.monitor-widget-pct.neutral {
  color: var(--color-text-muted);
}

.monitor-widget-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.monitor-widget-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease;
}

.monitor-widget-fill.success {
  background: var(--color-success);
}

.monitor-widget-fill.warning {
  background: var(--color-warning);
}

.monitor-widget-fill.danger {
  background: var(--color-danger);
}

.monitor-widget-fill.neutral {
  background: var(--color-text-muted);
}

.monitor-widget-bottom {
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.health-row-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
  flex: 1;
  min-width: 120px;
}

.health-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  flex: 1;
}

.health-row-value.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

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

.health-dot.dot-ok {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.health-dot.dot-bad {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger-soft);
}

.text-ok {
  color: var(--color-success);
}

.text-bad {
  color: var(--color-danger);
}

.connection-health {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.connection-health.healthy {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.connection-health.unhealthy {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.connection-health .health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* --- Overflow Prevention --- */
/* Prevent horizontal overflow on body/html */
html,


/* Ensure main content doesn't cause horizontal scroll */
.main {
  overflow-x: hidden;
}

/* Content area should NOT scroll - let .main or body handle scrolling to avoid nested scrollbars */
.content,
#mainContent {
  overflow: visible;
}

/* Main content area handles vertical scrolling - defined in main layout section above */

/* ==========================================================================
   FORM LAYOUT UTILITIES — Used by modals and forms
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row>* {
  flex: 1;
  min-width: 200px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Password wrapper with toggle visibility */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--color-text);
}

/* Checkbox group */
.checkbox-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Button group for modal footers, toolbar actions */
.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex-shrink: 0;
}

/* ==========================================================================
   GRID UTILITIES — Reusable grid systems
   ========================================================================== */

.grid {
  display: grid;
  gap: 20px;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
  .grid-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-cols-5,
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MODAL BASE STYLES — Shared modal system
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 16px;
  }
}

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

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  transform: translateY(8px);
  transition: transform 0.15s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.modal-header .customer-modal-header,
.modal-header .employee-modal-header,
.modal-header .pppoe-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.modal-header .customer-modal-header-icon,
.modal-header .employee-modal-header-icon,
.modal-header .pppoe-modal-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.modal-header .customer-modal-header-text,
.modal-header .employee-modal-header-text,
.modal-header .pppoe-modal-header-text {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}

.modal-close:hover {
  background: var(--color-background);
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

.modal-body-scroll {
  max-height: calc(88vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  border-radius: 0 0 var(--radius-lg, 16px) var(--radius-lg, 16px);
  flex-wrap: wrap;
  flex-shrink: 0;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.modal-footer .btn-group {
  margin-left: auto;
}

/* ==========================================================================
   CUSTOMER PAGE SPECIFIC STYLES
   ========================================================================== */

.customers-page {
  width: 100%;
  /* v105: flex column so the directory card can expand to fill remaining
     viewport height instead of stopping short and leaving a dead band. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.customers-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Filter toolbar card */
.customers-filter-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.customers-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
}

.customers-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  transition: all var(--transition);
  height: 36px;
  box-sizing: border-box;
}

.customers-search-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.customers-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  height: 100%;
  color: var(--color-text-muted);
  pointer-events: none;
  border-right: 1px solid var(--color-border);
}

.customers-search-input {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--color-text);
  height: 100%;
}

.customers-search-wrap .customers-search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.customers-search-input:focus {
  outline: none;
  box-shadow: none;
}

.customers-filter-select,
.pppoe-filter-select {
  flex: 0 1 auto;
  min-width: 140px;
  max-width: 180px;
}

.customers-filter-select select,
.customers-filter-select .form-control {
  height: 36px;
  font-size: 13px;
  border-radius: var(--radius-sm, 6px);
  padding: 0 10px;
  box-sizing: border-box;
}

.customers-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.customers-filter-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
}

.customers-filter-hint,
.pppoe-filter-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.015);
  line-height: 1.4;
}

.customers-hint-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.customers-hint-text {
  flex: 1;
  min-width: 0;
}

.customers-table-card,
.groups-table-card,
.areas-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.customers-table-wrap {
  overflow-x: hidden;
}

.customers-table,
table.customers-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

.customers-table th,
.customers-table td {
  padding: 8px 4px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  vertical-align: middle;
  box-sizing: border-box;
}

.customers-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-background);
  white-space: nowrap;
  font-size: 10.5px;
  letter-spacing: 0;
}

.customers-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.015);
}

.customers-table .actions-col,
.customers-table .col-actions {
  width: 7.5% !important;
  min-width: 74px !important;
  white-space: nowrap;
  text-align: right !important;
  padding-right: 16px !important;
  overflow: visible !important;
}

.customer-cell,
.customer-name-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.customer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.1));
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.customer-cell-main,
.customer-identity-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  gap: 2px;
}

.customer-name-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.customer-name-link,
.customer-name-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  transition: color var(--transition);
  line-height: 1.3;
  display: inline-block;
  max-width: 100%;
}

.customer-name-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.customer-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  line-height: 1.3;
}

.customer-group-indicator {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2.5px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  padding: 1px 3.5px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  cursor: default !important;
  letter-spacing: 0.02em !important;
  max-width: 38px !important;
  box-sizing: border-box !important;
}

.customer-group-indicator .group-dot {
  width: 3.5px !important;
  height: 3.5px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.customer-group-indicator .group-abbr {
  display: inline-block !important;
  line-height: 1 !important;
  font-size: 9px !important;
}

.customer-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  line-height: 1.2;
  min-width: 0;
}

.customer-phone-slot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  font-variant-numeric: tabular-nums;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
}

.customer-area-row {
  display: flex;
  align-items: center;
  line-height: 1.2;
  min-width: 0;
}

.customer-meta-sub {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 2px;
  line-height: 1.2;
  min-width: 0;
}

.customer-phone-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-text-muted, #64748b);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.customer-badge-slot {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 20px;
}

.customer-group-slot {
  width: auto;
  min-width: 0;
}

.customer-area-slot {
  width: auto;
  min-width: 0;
}

.customer-group-badge,
.customers-table .customer-group-badge {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 1px 5px !important;
  border-radius: 999px !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.customer-group-badge .group-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

.customer-area-sub,
.customers-table .customer-area-sub {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #166534 !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  padding: 1px 5px !important;
  border-radius: 999px !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

[data-theme="dark"] .customer-area-sub,
body.dark-mode .customer-area-sub,
[data-theme="dark"] .customers-table .customer-area-sub,
body.dark-mode .customers-table .customer-area-sub {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
}

.customer-area-sub .area-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

[data-theme="dark"] .customer-area-sub .area-dot,
body.dark-mode .customer-area-sub .area-dot {
  background: #10b981 !important;
}

.customer-badge-empty {
  color: var(--color-text-muted, #94a3b8);
  font-size: 12px;
  padding-left: 2px;
  line-height: 1;
}

.customer-sub-sep {
  color: var(--color-text-muted);
  font-size: 10px;
}

.customer-cid-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.08));
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  white-space: nowrap;
  max-width: none !important;
  flex-shrink: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  vertical-align: middle;
}

.customer-pppoe-user {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text);
  font-weight: 500;
}

.customer-empty-val,
.customers-table .customer-empty-val {
  color: var(--color-text-muted, #94a3b8);
  font-family: inherit;
  font-size: 12px;
  display: inline-block;
  vertical-align: middle;
}

.speed-badge,
.customers-table .speed-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #0f766e;
  background: #f0fdfa;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ccfbf1;
  line-height: 1.2;
  vertical-align: middle;
}

[data-theme="dark"] .speed-badge,
body.dark-mode .speed-badge,
[data-theme="dark"] .customers-table .speed-badge,
body.dark-mode .customers-table .speed-badge {
  background: rgba(20, 184, 166, 0.14) !important;
  color: #5eead4 !important;
  border: 1px solid rgba(20, 184, 166, 0.28) !important;
}

.customer-ip-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.customer-uptime-text,
.customer-due-date {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.customers-actions,
.table-actions.customers-actions {
  display: inline-flex !important;
  gap: 3px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.customers-actions .btn-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 26px;
  padding: 0 7px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  box-sizing: border-box;
}

.customers-actions .customer-action-view {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.08));
}

.customers-actions .customer-action-view:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.customers-actions .customer-action-edit {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.customers-actions .customer-action-edit:hover {
  background: var(--color-background);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.customer-pppoe-user {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-background);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

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

.account-badge.suspended {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.account-badge.expired {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.account-badge.due {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.account-badge.inactive {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.25);
}

.status-badge.status-unavailable {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

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

.customers-table .status-badge {
  padding: 2px 5px;
  font-size: 10px;
  gap: 3px;
  white-space: nowrap;
}

.customers-table .account-badge {
  padding: 2px 5px;
  font-size: 10px;
  gap: 2px;
  white-space: nowrap;
}

.customers-table .account-badge svg {
  width: 10px;
  height: 10px;
}

.table-pkg-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-background);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .customers-table-card,
  .customers-table-card .customers-table-wrap,
  .customers-table-card .table-wrap,
  .customers-table-wrap {
    overflow-x: visible !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .customers-table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .customers-table thead {
    display: none !important;
  }

  .customers-table,
  .customers-table tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .customers-table tr {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden !important;
  }

  .customers-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 7px 0 !important;
    border: none !important;
    font-size: 13px !important;
    text-align: right !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .customers-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 8px;
    flex-shrink: 0;
    font-size: 12px;
  }

  .customers-table td[data-label="Customer ID"] {
    padding-bottom: 4px !important;
  }

  .customers-table td[data-label="Customer Name"],
  .customers-table td[data-label="Customer"] {
    padding-bottom: 10px !important;
    margin-bottom: 6px !important;
    border-bottom: 1px solid var(--color-border) !important;
  }

  .customers-table .customer-cell,
  .customers-table .customer-name-cell {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    text-align: right !important;
    max-width: 65% !important;
    min-width: 0 !important;
    gap: 4px 6px !important;
  }

  .customers-table .customer-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    order: 1 !important;
  }

  .customers-table .customer-cell-main,
  .customers-table .customer-identity-stack {
    min-width: 0 !important;
    max-width: calc(100% - 40px) !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    order: 2 !important;
  }

  .customers-table .customer-name-line {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 5px !important;
    max-width: 100% !important;
  }

  .customers-table .customer-name-link,
  .customers-table .customer-name-text {
    font-size: 14px !important;
    font-weight: 600 !important;
    word-break: break-word !important;
    text-align: right !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  .customers-table .customer-phone-sub,
  .customers-table .customer-phone-slot {
    font-size: 12px !important;
    color: var(--color-text-muted) !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .customers-table .customer-group-slot,
  .customers-table .customer-area-slot {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    order: 3 !important;
  }

  .customers-table .customer-group-badge,
  .customers-table .customer-area-sub {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    max-width: 100% !important;
  }

  .customers-table .customer-badge-empty {
    display: none !important;
  }

  .customers-table .customer-meta-row,
  .customers-table .customer-meta-sub {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 4px 6px !important;
    max-width: 100% !important;
    margin-top: 3px !important;
    line-height: 1.2 !important;
  }

  .customers-table .customer-area-row {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 2px !important;
  }

  .customers-table .customer-sub-sep {
    display: none !important;
  }

  .customers-table .customer-cid-code {
    font-family: var(--font-mono) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
  }

  .customers-table .actions-col,
  .customers-table td[data-label="Actions"] {
    width: 100% !important;
    display: block !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid var(--color-border) !important;
    white-space: normal !important;
  }

  .customers-table .actions-col::before,
  .customers-table td[data-label="Actions"]::before {
    display: none !important;
  }

  .customers-actions {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .customers-actions .btn-table-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   Billing Module — uses existing design-system classes
   (.card, .page-header, .stat-card, .data-table, .badge, .btn)
   with scoped overrides. No global changes.
   ============================================================ */

.billing-page { color: var(--color-text); }

.billing-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 4px 0;
}

.billing-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-header-breadcrumb {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.billing-breadcrumb-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.billing-breadcrumb-link:hover {
  color: var(--color-primary);
}

.billing-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.billing-page-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 2px 0 0;
}

.billing-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.billing-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}

.billing-refresh-btn:hover {
  background: var(--color-background);
  border-color: var(--color-border-strong);
  color: var(--color-primary);
}

/* Billing Tabs */
.billing-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.billing-tabs::-webkit-scrollbar {
  display: none;
}

.billing-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  border-radius: var(--radius-sm, 6px) var(--radius-sm, 6px) 0 0;
}

.billing-tab:hover {
  color: var(--color-text);
  background: var(--color-background);
}

.billing-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Metric sections and grouping */
.billing-metrics-section {
  margin-bottom: 24px;
}

.billing-metrics-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Financial summary cards */
.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

.billing-summary-grid--5 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.billing-summary-grid--sc {
  grid-template-columns: repeat(4, 1fr);
}

.billing-stat-card,
.billing-summary-grid .stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-sm);
  min-height: 84px;
  transition: all var(--transition);
}

.billing-stat-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.billing-stat-card--link:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.billing-summary-grid .stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon--primary { background: var(--color-primary-soft); color: var(--color-primary); }
.stat-card-icon--success { background: var(--color-success-soft); color: var(--color-success); }
.stat-card-icon--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.stat-card-icon--danger { background: var(--color-danger-soft); color: var(--color-danger); }
.stat-card-icon--info { background: var(--color-info-soft, rgba(59, 130, 246, 0.12)); color: var(--color-info, #2563eb); }

.billing-summary-grid .stat-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.billing-summary-grid .stat-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  order: 1;
}

.billing-summary-grid .stat-card-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  order: 2;
  margin-top: 2px;
}

.stat-card-value--danger { color: var(--color-danger); }
.stat-card-value--warning { color: var(--color-warning); }
.stat-card-value--success { color: var(--color-success); }
.stat-card-value--info { color: var(--color-info, #2563eb); }

/* Service Control Strip on Billing Overview */
.billing-sc-strip,
.sc-strip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.sc-strip-header {
  margin-bottom: 12px;
}

.sc-strip-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.sc-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sc-strip-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  min-width: 0;
  gap: 12px;
}

.sc-strip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.sc-strip-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Date filter inputs */
.billing-date-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.billing-date-input {
  width: auto;
  font-size: 13px;
  padding: 6px 10px;
}

.billing-date-sep {
  font-size: 12px;
  color: var(--color-text-muted);
}

.billing-limit-select {
  width: auto;
  min-width: 100px;
}

@media (max-width: 1024px) {
  .billing-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sc-strip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .billing-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .billing-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }
  .sc-strip-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   BILLING COMMAND CENTER REDESIGN (Executive Financial Suite)
   ============================================================ */

/* Row 1: Hero KPI Grid */
.billing-cmd-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.billing-cmd-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-sm);
  min-height: 112px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.billing-cmd-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.billing-cmd-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.billing-cmd-kpi-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.billing-cmd-kpi-subline {
  margin-top: 5px;
  font-size: 12px;
}

.billing-cmd-subhead {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.billing-cmd-progress-wrap {
  margin-top: 8px;
}

.billing-cmd-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.billing-cmd-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-background);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.billing-cmd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.billing-cmd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.billing-cmd-badge.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.billing-cmd-badge.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.billing-cmd-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.billing-cmd-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.billing-cmd-pill.is-link:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.billing-cmd-pill.is-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

.billing-cmd-pill.is-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.billing-cmd-action-link {
  margin-top: 7px;
}

/* Row 2: Charts & Breakdowns Grid */
.billing-cmd-charts-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.billing-cmd-card {
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.billing-cmd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-cmd-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px 0;
}

.billing-cmd-card-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

.billing-cmd-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.billing-cmd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.billing-cmd-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.billing-cmd-efficiency-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-radius: 6px;
}

.billing-cmd-chart-body {
  width: 100%;
  overflow-x: auto;
}

.billing-cmd-svg-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 190px;
}

/* Right Breakdown Card */
.billing-cmd-breakdown-card {
  justify-content: space-between;
  gap: 16px;
}

.billing-cmd-subcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.billing-cmd-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.billing-cmd-channels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.billing-cmd-channel-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.billing-cmd-channel-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.billing-cmd-channel-name {
  font-weight: 600;
  color: var(--color-text);
}

.billing-cmd-channel-amt {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.billing-cmd-channel-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--color-background);
  border-radius: 999px;
  overflow: hidden;
}

.billing-cmd-channel-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.billing-cmd-divider {
  height: 1px;
  background: var(--color-border);
  width: 100%;
}

.billing-cmd-health-bar {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-background);
  border: 1px solid var(--color-border);
}

.billing-cmd-health-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.billing-cmd-health-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-cmd-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.billing-cmd-health-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Row 3: Action Tables Grid */
.billing-cmd-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.billing-cmd-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.billing-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-background);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Responsive adjustments for Command Center */
@media (max-width: 1100px) {
  .billing-cmd-hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .billing-cmd-charts-grid {
    grid-template-columns: 1fr;
  }
  .billing-cmd-tables-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .billing-cmd-hero-grid {
    grid-template-columns: 1fr;
  }
  .billing-cmd-kpi-value {
    font-size: 22px;
  }
  .billing-cmd-card {
    padding: 14px;
  }
  .billing-cmd-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Toolbar / search & filter */
.billing-toolbar-card { margin-bottom: 20px; }

.billing-toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.billing-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all var(--transition);
}

.billing-search-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.billing-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  align-self: stretch;
  color: var(--color-text-muted);
  pointer-events: none;
  border-right: 1px solid var(--color-border);
}

.billing-search-input {
  flex: 1;
  min-width: 0;
  padding-left: 12px;
  width: 100%;
  border: none;
  background: transparent;
}

.billing-search-wrap .billing-search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.billing-search-input:focus {
  outline: none;
  box-shadow: none;
}

.billing-toolbar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-filter-select { min-width: 160px; }

/* Table card */
.billing-table-card { overflow: hidden; }

.billing-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.billing-table-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.billing-table-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

.billing-table .billing-amount { font-weight: 600; white-space: nowrap; }
.billing-amount-col { text-align: right; }
.billing-table .billing-amount-col { text-align: right; }
.billing-table td.billing-amount { text-align: right; }

/* Row action buttons */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--color-background);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.icon-btn--danger:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.billing-table tbody .empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
}

.billing-table tbody .btn-spinner {
  margin-right: 8px;
}


/* Customer / invoice display cells */
.billing-customer { min-width: 0; }
.billing-customer-name { font-weight: 500; color: var(--color-text); }
.billing-customer-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* Detail grid (used in modals) */
.billing-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  margin: 16px 0 24px;
  font-size: 13px;
  color: var(--color-text);
}
.billing-detail-grid strong { font-weight: 600; color: var(--color-text); }

/* Section titles (used in invoice detail modal) */
.billing-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin: 20px 0 10px;
}
.billing-section-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 12px 0;
}

/* Invoice detail modal */
.billing-invoice-modal { max-width: 720px; }
.billing-invoice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.billing-invoice-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}
.billing-invoice-summary {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  font-size: 13px;
}

/* Form modals */
.billing-form-modal { max-width: 640px; }
.billing-form { display: flex; flex-direction: column; gap: 14px; }
.billing-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.billing-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.billing-form .required { color: var(--color-danger); }
.billing-form .form-error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.billing-form .form-hint { color: var(--color-text-muted); font-size: 12px; }
.billing-allocation-preview {
  display: flex;
  gap: 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  flex-wrap: wrap;
}
.billing-allocation-preview div { display: flex; gap: 6px; align-items: baseline; }
.billing-allocation-preview span { color: var(--color-text-secondary); }
.billing-allocation-preview strong { color: var(--color-text); font-variant-numeric: tabular-nums; }
.billing-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Customer autocomplete suggestions */
.billing-suggestions {
  position: absolute;
  z-index: 10;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  width: 100%;
  min-width: 240px;
}
.billing-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
}
.billing-suggestion:last-child { border-bottom: none; }
.billing-suggestion:hover { background: var(--color-background); }
.billing-suggestion-name { font-size: 13px; font-weight: 500; color: var(--color-text); }
.billing-suggestion-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

.customer-search-wrap {
  position: relative;
  width: 100%;
}

.customer-search-input-box {
  position: relative;
  width: 100%;
}

.customer-search-input {
  width: 100%;
  height: 38px;
  font-size: 13.5px;
  padding: 8px 34px 8px 12px;
  border-radius: 6px;
  box-sizing: border-box;
}

.customer-search-spinner {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  pointer-events: none;
}

.customer-search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  box-sizing: border-box;
}

.customer-search-list {
  display: flex;
  flex-direction: column;
}

.customer-search-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.12s ease;
}

.customer-search-item:last-child {
  border-bottom: none;
}

.customer-search-item:hover,
.customer-search-item.is-focused {
  background: var(--color-background);
}

.customer-search-item-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-search-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-search-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.customer-search-item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.customer-search-status {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.customer-search-status--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.customer-search-status--error {
  color: var(--color-danger);
}

.customer-search-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-sizing: border-box;
  min-height: 48px;
}

.customer-search-selected-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-soft, #e0e7ff);
  color: var(--color-primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.customer-search-selected-main {
  flex: 1;
  min-width: 0;
}

.customer-search-selected-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-search-selected-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.customer-search-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.customer-search-meta-item strong {
  color: var(--color-text);
}

.customer-search-clear-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}

.customer-search-clear-btn:hover {
  background: var(--color-danger-soft, #fee2e2);
  color: var(--color-danger, #ef4444);
  border-color: var(--color-danger, #ef4444);
}

.meta-dot {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* =========================================================================
   B13.11 Standardized Billing Search & Filter Toolbar System
   ========================================================================= */
.billing-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--color-surface, #ffffff);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  box-sizing: border-box;
  flex-wrap: wrap;
}

.billing-filter-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 200px;
  height: 36px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 6px;
  transition: border-color var(--transition, 0.15s ease), box-shadow var(--transition, 0.15s ease);
  box-sizing: border-box;
}

.billing-filter-search:focus-within {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(37, 99, 235, 0.15));
}

.billing-filter-search .billing-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 100%;
  flex-shrink: 0;
  color: var(--color-text-muted, #64748b);
  pointer-events: none;
}

.billing-filter-search .billing-filter-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 13px;
  color: var(--color-text, #1e293b);
  box-sizing: border-box;
}

.billing-filter-select-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.billing-filter-select {
  height: 36px;
  font-size: 13px;
  line-height: normal;
  padding: 0 30px 0 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #cbd5e1);
  background-color: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  transition: border-color var(--transition, 0.15s ease), box-shadow var(--transition, 0.15s ease);
}

.billing-filter-select:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(37, 99, 235, 0.15));
}

.billing-filter-select--status {
  width: 150px;
  min-width: 145px;
  flex: 0 0 150px;
}

.billing-filter-select--type {
  width: 165px;
  min-width: 160px;
  flex: 0 0 165px;
}

.billing-filter-select--tx-type {
  width: 235px;
  min-width: 220px;
  flex: 0 0 235px;
}

.billing-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.billing-filter-actions--end {
  margin-left: auto;
}

.billing-filter-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
}

.billing-filter-btn svg {
  flex-shrink: 0;
}

/* Backward compatibility aliases */
.billing-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-filter-control {
  box-sizing: border-box;
}

.billing-filter-control:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(37, 99, 235, 0.15));
}

.billing-filter-control--search {
  flex: 1 1 240px;
  min-width: 200px;
}

.billing-filter-control--status {
  width: 150px;
  min-width: 145px;
}

.billing-filter-control--type {
  width: 165px;
  min-width: 160px;
}

.billing-filter-control--tx-type {
  width: 235px;
  min-width: 220px;
}

.billing-filter-control--customer {
  min-width: 180px;
  width: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .billing-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .billing-search-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
  }

  .billing-search-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 100%;
  }

  .billing-search-input {
    height: 100%;
    font-size: 13.5px;
    padding: 0 12px;
  }

  .billing-toolbar-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .billing-filter-select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 13px;
    padding: 8px 10px;
    box-sizing: border-box;
  }

  .billing-filter-toolbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .billing-filter-search {
    flex: 1 1 200px;
    min-width: 170px;
  }

  .billing-filter-select--status {
    width: 145px;
    min-width: 135px;
  }

  .billing-filter-select--type {
    width: 155px;
    min-width: 145px;
  }

  .billing-filter-select--tx-type {
    width: 230px;
    min-width: 215px;
  }

  .customer-search-dropdown {
    max-height: 200px;
  }

  .customer-search-selected {
    padding: 8px 10px;
  }

  .billing-date-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .billing-date-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 12.5px;
    padding: 6px 8px;
    box-sizing: border-box;
  }

  .billing-date-sep {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
  }

  .billing-limit-select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 13px;
    padding: 8px 10px;
    box-sizing: border-box;
  }

  /* Billing Table Mobile Cards (Payment History, Subscriptions, Due Payments) */
  .billing-table-wrap {
    overflow-x: visible;
    width: 100%;
  }

  .billing-table thead {
    display: none;
  }

  .billing-table,
  .billing-table tbody,
  .billing-table tr,
  .billing-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .billing-table tr {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
  }

  .billing-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 13px;
    text-align: right;
    min-width: 0;
  }

  .billing-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 12px;
  }

  .billing-table td[data-label="Payment #"],
  .billing-table td[data-label="Invoice #"] {
    font-weight: 600;
    padding-bottom: 4px;
  }

  .billing-table td[data-label="Customer"] {
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
  }

  .billing-table .billing-customer {
    text-align: right;
  }

  .billing-table .billing-customer-name {
    font-weight: 600;
    word-break: break-word;
  }

  .billing-table td.billing-amount-col {
    text-align: right;
  }

  .billing-table td.billing-amount-col strong {
    font-size: 14px;
  }

  .billing-table .actions-col {
    display: flex !important;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    width: 100% !important;
  }

  .billing-table .actions-col::before {
    display: none;
  }

  .billing-table .actions-col .btn {
    width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    box-sizing: border-box;
    text-align: center;
  }

  .billing-table .actions-col .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .billing-table .actions-col .row-actions .icon-btn {
    width: 100%;
    min-height: 40px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .billing-table .actions-col .row-actions .icon-btn::after {
    content: " View Details";
    font-size: 13px;
    font-weight: 500;
  }
}

/* B13.11 Billing Filter Toolbar - Mobile Stacking */
@media (max-width: 640px) {
  .billing-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .billing-filter-search {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    height: 38px;
  }

  .billing-filter-search .billing-search-icon {
    width: 36px;
  }

  .billing-filter-search .billing-filter-input {
    height: 38px;
    font-size: 13.5px;
  }

  .billing-filter-select-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .billing-filter-select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    height: 38px;
    font-size: 13.5px;
    padding: 0 30px 0 12px;
  }

  .billing-filter-select--status,
  .billing-filter-select--type,
  .billing-filter-select--tx-type,
  .billing-filter-control--status,
  .billing-filter-control--type,
  .billing-filter-control--tx-type {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .billing-filter-actions {
    display: flex;
    width: 100% !important;
    gap: 8px;
    margin-left: 0 !important;
  }

  .billing-filter-actions .billing-filter-btn {
    flex: 1;
    height: 38px;
    font-size: 13.5px;
    justify-content: center;
  }

  .billing-filter-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .billing-filter-control {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px;
    font-size: 13px;
  }

  .billing-filter-control--search {
    width: 100% !important;
  }
}

.customers-pagination-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.customers-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-info {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 6px;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--color-background);
  border-color: var(--color-border-hover);
}

.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.customers-loading,
.customers-error,
.customers-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.customers-loading .btn-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.customers-empty-state .empty-icon {
  color: var(--color-text-muted);
}

.customers-empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.customers-empty-state p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.customers-empty-state .btn {
  margin-top: 8px;
}

/* Non-destructive error banner for customers list refresh failures */
.customers-error-banner {
  background: var(--color-warning-bg, #fff8e1);
  border: 1px solid var(--color-warning-border, #ffecb3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.error-banner-content svg {
  color: var(--color-warning, #f59e0b);
  flex-shrink: 0;
}

.error-banner-content span {
  font-size: 13px;
  color: var(--color-text);
  flex: 1;
  min-width: 200px;
}

.error-banner-content .btn {
  flex-shrink: 0;
}

/* Dark mode support for error banner */
@media (prefers-color-scheme: dark) {
  .customers-error-banner {
    background: var(--color-warning-bg-dark, #3d2b00);
    border-color: var(--color-warning-border-dark, #6b4c00);
  }
  
  .error-banner-content svg {
    color: var(--color-warning-dark, #fbbf24);
  }
}

/* ============================================================
   Customer Profile - Real-time Traffic Graph
   ============================================================ */
.customer-profile-traffic-graph {
  margin-top: 20px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.traffic-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.traffic-graph-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic-graph-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.traffic-graph-icon {
  color: var(--color-primary);
}

.traffic-graph-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.traffic-graph-live-badge .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: trafficLivePulse 1.5s ease-in-out infinite;
}

@keyframes trafficLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.traffic-graph-live-badge:not(.live) {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

.traffic-graph-live-badge:not(.live) .live-dot {
  animation: none;
  opacity: 0.5;
}

.traffic-graph-current {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.traffic-graph-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.traffic-graph-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.traffic-graph-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  font-family: var(--font-mono);
}

.traffic-graph-metric.traffic-graph-download .traffic-graph-value {
  color: var(--color-primary);
}

.traffic-graph-metric.traffic-graph-upload .traffic-graph-value {
  color: var(--color-warning);
}

.traffic-graph-canvas-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  margin-bottom: 8px;
}

#trafficGraphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
}

.traffic-graph-tooltip {
  position: absolute;
  top: 8px;
  left: 0;
  pointer-events: none;
  z-index: 10;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  min-width: 160px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tooltip-time {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.tooltip-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.traffic-graph-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 8px;
}

.traffic-graph-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.traffic-graph-legend-color {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.traffic-graph-legend-download .traffic-graph-legend-color {
  background: var(--color-primary);
}

.traffic-graph-legend-upload .traffic-graph-legend-color {
  background: var(--color-warning);
}

/* Responsive */
@media (max-width: 640px) {
  .traffic-graph-current {
    flex-direction: column;
    gap: 12px;
  }
  
  .traffic-graph-legend {
    gap: 16px;
  }
}
/* Customer form field in modals */
.customer-section {
  margin-bottom: 20px;
}

.customer-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.customer-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.customer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-field.full {
  grid-column: 1 / -1;
}

.customer-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.customer-field-label .required {
  color: var(--color-danger);
}

.customer-field-help {
  font-size: 11px;
  color: var(--color-text-muted);
}

.customer-field-error {
  font-size: 11px;
  color: var(--color-danger);
  min-height: 14px;
}

.customer-field .form-control.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px var(--color-danger-soft);
}

/* Customer info grid for view modal */
.customer-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-background);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.customer-overview-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}

.customer-overview-info {
  flex: 1;
  min-width: 0;
}

.customer-overview-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.customer-overview-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.customer-overview-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-section .customer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.customer-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-info-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.customer-info-value {
  font-size: 13px;
  color: var(--color-text);
  word-break: break-word;
}

.customer-info-value.muted {
  color: var(--color-text-muted);
}

.customer-connection {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--color-background);
  border-radius: var(--radius-md);
}

.customer-connection-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.customer-connection-text {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.customer-connection-text strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 4px;
}

.customer-connection-stale {
  font-size: 12px;
}

/* ==========================================================================
   PPPoE PAGE SPECIFIC STYLES
   ========================================================================== */

.pppoe-page {
  width: 100%;
}

.pppoe-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pppoe-filter-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.pppoe-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.pppoe-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

.pppoe-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 1;
}

.pppoe-search-input {
  padding-left: 40px;
  width: 100%;
}

.pppoe-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pppoe-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pppoe-table-wrap {
  overflow-x: auto;
}

.pppoe-table {
  width: 100%;
  border-collapse: collapse;
}

.pppoe-table th,
.pppoe-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.pppoe-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-background);
  white-space: nowrap;
}

.pppoe-table tbody tr:hover {
  background: var(--color-background);
}

.pppoe-table .actions-col {
  width: 220px;
  white-space: nowrap;
}

.pppoe-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pppoe-actions .btn-table-action {
  padding: 6px 10px;
  font-size: 12px;
}

.pppoe-pagination-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.pppoe-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.pppoe-loading,
.pppoe-error,
.pppoe-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.pppoe-loading .btn-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.pppoe-empty-state .empty-icon {
  color: var(--color-text-muted);
}

.pppoe-empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.pppoe-empty-state p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.pppoe-empty-state .btn {
  margin-top: 8px;
}

/* PPPoE Overview section */
.pppoe-overview {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.pppoe-donut-wrap {
  flex-shrink: 0;
}

.pppoe-stats-flex {
  display: flex;
  flex: 1;
  gap: 16px;
  flex-wrap: wrap;
}

.pppoe-stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pppoe-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.pppoe-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   ROUTER PAGE SPECIFIC STYLES
   ========================================================================== */

.router-page {
  width: 100%;
}

.router-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.router-connection-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.router-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.router-form-section {
  margin-bottom: 24px;
}

.router-form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.router-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.router-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.router-status-item {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.router-status-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.router-status-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

/* Router settings modal */
.router-settings-modal {
  max-width: 720px;
}

.router-settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
}

.router-settings-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.router-settings-tab:hover {
  color: var(--color-text);
}

.router-settings-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.router-settings-panel {
  display: none;
}

.router-settings-panel.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Color hex inputs for sidebar */
.color-hex-input {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  padding-left: 32px;
}

/* Icon for color input wrapper */
.color-picker-wrapper {
  position: relative;
}

.color-picker-wrapper .color-hex-input {
  padding-left: 8px;
}

/* Form Help and Error */
.form-help {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.form-error {
  display: block;
  font-size: 11px;
  color: var(--color-danger);
  margin-top: 6px;
  min-height: 14px;
}

/* Button Spinner */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Employee Modal */
.employee-modal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.employee-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.employee-modal-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.employee-modal-header-text {
  flex: 1;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

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

.modal-body {
  padding: 20px;
}

.modal-body-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.modal-footer .btn-group {
  display: flex;
  gap: 8px;
}

/* Permission List */
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row>* {
  flex: 1;
}

/* Password Wrapper */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.password-toggle:hover {
  background: var(--color-background);
  color: var(--color-text);
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

/* Button Group */
.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
}

/* Grid Utilities */
.grid {
  display: grid;
  gap: 16px;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
  .grid-cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5 {
    grid-template-columns: 1fr;
  }
}

/* Employee Modal Remove Buttons */
#removeLogoBtn,
#removeFaviconBtn {
  margin-left: auto;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

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

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition), opacity var(--transition);
  opacity: 0;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Employee Modal Specific */
.employee-modal {
  max-width: 640px;
}

.employee-modal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.employee-modal .modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Employee Modal Button */
#saveEmployeeBtn {
  min-width: 140px;
}

/* Employees Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-table-action {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-table-action:hover {
  transform: translateY(-1px);
}

.btn-table-action .btn-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

/* ==========================================================================
   EMPLOYEE TABLE COMPONENTS
   ========================================================================== */
.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.employee-name {
  font-weight: 500;
  color: var(--color-text);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-table-action {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   BRANDING FORM (LEGACY - kept for backward compatibility)
   ========================================================================== */
.color-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-preset {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-preset:hover {
  transform: scale(1.15);
}

.color-preset.active {
  border-color: var(--color-text);
  transform: scale(1.15);
}

.logo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
}

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow: hidden;
}

/* ==========================================================================
   TABLE WRAPPER — Shared table styles
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.data-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-background);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

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

.data-table td[data-label]::before {
  display: none;
  /* Hidden by default, shown on mobile via media query */
  content: attr(data-label) ": ";
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 8px;
}

@media (max-width: 768px) {
  .data-table thead {
    display: none;
  }

  .data-table {
    min-width: 0 !important;
  }

  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .data-table tr {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 13px;
    text-align: right;
  }

  .data-table td[data-label]::before {
    display: inline;
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
  }

  .data-table .actions-col {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    width: 100%;
  }

  .data-table .actions-col::before {
    display: none;
  }
}

/* Table actions */
.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-table-action:hover {
  background: var(--color-background);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.btn-table-action .btn-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ==========================================================================
   EMPTY STATE — Shared empty state
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-neutral-soft);
  color: var(--color-text-muted);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.empty-state p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 320px;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ==========================================================================
   BADGE / STATUS — Shared badge styles
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.badge-neutral {
  background: var(--color-neutral-soft);
  color: var(--color-text-muted);
}

.badge-primary {
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.12));
  color: var(--color-primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1;
}

.status-badge.connected {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-badge.disconnected {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-badge.connecting {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.status-badge.neutral {
  background: var(--color-neutral-soft);
  color: var(--color-text-muted);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.connected .status-dot {
  background: var(--color-success);
}

.status-badge.disconnected .status-dot {
  background: var(--color-danger);
}

.status-badge.connecting .status-dot {
  background: var(--color-warning);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.status-dot.ok {
  background: var(--color-success);
}

.status-dot.bad {
  background: var(--color-danger);
}

/* ==========================================================================
   LOADING / SKELETON — Shared loading states
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-background) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   TOAST CONTAINER
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast.success .toast-icon {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.toast.error .toast-icon {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.toast.warning .toast-icon {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.toast.info .toast-icon {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.toast-close:hover {
  background: var(--color-background);
  color: var(--color-text);
}

/* ==========================================================================
   ADMIN DROPDOWN
   ========================================================================== */

.admin-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
  z-index: 100;
}

.admin-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

/* ==========================================================================
   CONNECTION PILL
   ========================================================================== */

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.connection-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.connection-pill.connected {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.connection-pill.connected .pill-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.connection-pill.connecting {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.connection-pill.connecting .pill-dot {
  background: var(--color-warning);
  animation: pulse 1.5s infinite;
}

.connection-pill.disconnected {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.connection-pill.disconnected .pill-dot {
  background: var(--color-danger);
}

/* ==========================================================================
   THEME TOGGLE
   ========================================================================== */




/* ==========================================================================
   ADMIN CHIP
   ========================================================================== */

.admin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-chip:hover {
  background: var(--color-border);
}

.admin-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.admin-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.breadcrumb .crumb {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb .crumb:hover {
  color: var(--color-primary);
}

.crumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE UTILITIES — Breakpoint helpers
   ========================================================================== */

@media (max-width: 1200px) {
  .page-header {
    margin-bottom: var(--page-header-margin, 16px);
  }
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }

  .page-header,
  .billing-page-header,
  .dashboard-header,
  .router-header,
  .custprofile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-header-actions,
  .customers-header-actions,
  .packages-header-actions,
  .billing-header-actions,
  .page-actions,
  .dashboard-header-actions,
  .custprofile-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .page-title {
    font-size: 20px;
  }

  .modal {
    max-height: 95vh;
    margin: 12px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 12px 20px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .router-form-grid,
  .customer-form-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row>* {
    min-width: 0;
  }

  .btn-group {
    width: 100%;
  }

  .btn-group .btn {
    flex: 1;
  }

  .customers-filter-row,
  .pppoe-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .customers-search-wrap,
  .pppoe-search-wrap {
    flex: 0 0 42px !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
  }

  .customers-search-icon,
  .pppoe-search-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 100%;
  }

  .customers-search-input,
  .pppoe-search-input {
    height: 100%;
    font-size: 13.5px;
    padding-left: 10px;
  }

  .customers-filter-select,
  .pppoe-filter-select {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 40px;
  }

  .customers-filter-select select,
  .customers-filter-select .form-control,
  .pppoe-filter-select select,
  .pppoe-filter-select .form-control {
    width: 100%;
    height: 42px;
    min-height: 42px;
    font-size: 13px;
    box-sizing: border-box;
  }

  .customers-filter-row .btn,
  .pppoe-filter-row .btn {
    width: 100%;
    min-height: 42px;
    height: 42px;
    justify-content: center;
  }

  .customers-filter-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .customers-filter-actions .btn {
    flex: 1;
    width: 100%;
    min-height: 42px;
    height: 42px;
    justify-content: center;
  }

  .customers-header-actions,
  .pppoe-header-actions,
  .router-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .modal {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }

  .modal-header .customer-modal-header,
  .modal-header .employee-modal-header,
  .modal-header .pppoe-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Dashboard responsive */
@media (max-width: 1024px) {

  .dashboard-content>div[style*="grid-template-columns: 2fr 1fr"],
  .dashboard-content>div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .traffic-rx-tx {
    flex-direction: column;
    gap: 16px;
  }

  .traffic-side {
    min-width: 100%;
  }

  .pppoe-overview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .pppoe-stats-flex {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .metrics-grid-5 {
    grid-template-columns: 1fr;
  }

  .dashboard-section-card {
    padding: 16px;
  }

  .dashboard-section-header {
    padding: 12px 16px;
  }

  .dashboard-section-body {
    padding: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .pppoe-stats-flex {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   DASHBOARD SPECIFIC — Ensure cards align properly
   ========================================================================== */

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.dashboard-right-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.resource-usage-widgets {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.connection-health-body {
  padding: 0 !important;
}

.connection-health-summary {
  padding: 16px 20px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1024px) {

  .dashboard-main-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dashboard-header-left {
  flex: 1;
  min-width: 0;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.last-updated {
  font-size: 13px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard section cards — use .card for consistency */
.dashboard-section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.dashboard-section-header .section-icon,
.dashboard-section-header .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.dashboard-section-header span:last-child {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-section-body {
  padding: 20px;
}

/* System overview / monitor grid */
.system-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.monitor-panel {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* Health panel */
.health-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.health-row-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
  flex: 1;
  min-width: 120px;
}

.health-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  flex: 1;
}

.health-row-value.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

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

.health-dot.dot-ok {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success-soft);
}

.health-dot.dot-bad {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger-soft);
}

.text-ok {
  color: var(--color-success);
}

.text-bad {
  color: var(--color-danger);
}

.connection-health {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.connection-health.healthy {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.connection-health.unhealthy {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.connection-health .health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Traffic graph */
.traffic-graph-container {
  margin-top: 16px;
}

/* Dashboard LIVE badge (small variant) */
.traffic-graph-live-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success);
}
.traffic-graph-live-badge-small .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: trafficLivePulse 1.5s ease-in-out infinite;
}
.traffic-graph-live-badge-small:not(.live) {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}
.traffic-graph-live-badge-small:not(.live) .live-dot {
  animation: none;
  opacity: 0.5;
}


.traffic-graph-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.traffic-graph-head .section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.traffic-legend {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

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

.legend-dot.rx-dot {
  background: var(--color-primary);
}

.legend-dot.tx-dot {
  background: var(--color-warning);
}

/* Interfaces panel */
.interfaces-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.interfaces-panel.collapsed .interfaces-body {
  display: none;
}

.interfaces-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: var(--color-background);
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.interfaces-toggle:hover {
  background: var(--color-border);
}

.interfaces-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.interfaces-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 2px 8px;
  border-radius: 999px;
}

.interface-table {
  width: 100%;
  border-collapse: collapse;
}

.interface-table th,
.interface-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.interface-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-background);
}

.interface-name-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-right: 8px;
}

/* Info grid for router info */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-grid>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-grid label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.info-grid span:last-child {
  font-size: 13px;
  color: var(--color-text);
  word-break: break-word;
}

/* PPPoE overview in dashboard */
.pppoe-overview {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.pppoe-donut-wrap {
  flex-shrink: 0;
}

.pppoe-stats-flex {
  display: flex;
  flex: 1;
  gap: 16px;
  flex-wrap: wrap;
}

.pppoe-stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pppoe-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.pppoe-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.detail-value {
  font-size: 13px;
  color: var(--color-text);
  word-break: break-word;
}

.detail-value.muted {
  color: var(--color-text-muted);
}

.detail-value.muted-unavailable {
  color: var(--color-text-muted) !important;
  font-style: italic;
  font-weight: 400;
}

/* Traffic overview */
.traffic-overview {
  margin-bottom: 20px;
}

.traffic-rx-tx {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.traffic-side {
  flex: 1;
  min-width: 140px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.traffic-side-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.traffic-side-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.traffic-side.tx .traffic-side-icon {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.traffic-side-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.traffic-side-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

.traffic-totals {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.traffic-total-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.traffic-total-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.traffic-total-dot.rx-dot {
  background: var(--color-primary);
}

.traffic-total-dot.tx-dot {
  background: var(--color-warning);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

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

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

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

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

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

.mt-4 {
  margin-top: 16px;
}

.mt-8 {
  margin-top: 32px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-8 {
  margin-bottom: 32px;
}

.p-4 {
  padding: 16px;
}

.p-8 {
  padding: 32px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.w-full {
  width: 100%;
}

.min-w-0 {
  min-width: 0;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* ============================================================
   Customer Full Pages — Add Customer (/customers/new) + Profile
   (/customers/:id). SCOPED under .custnew-* / .custprofile-*.
   Uses ONLY existing theme variables; no global rules changed.
   ============================================================ */

/* ---------- Shared ---------- */
.custnew-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  transition: color var(--transition);
}
.custnew-back-link:hover {
  color: var(--color-primary);
}

/* ---------- Add Customer page ---------- */
.custnew-page {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.custnew-section {
  padding: 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}
.custnew-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.custnew-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}
.custnew-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}
.custnew-section-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.custnew-subblock {
  margin-top: 14px;
}
.custnew-subblock.hidden,
.hidden {
  display: none !important;
}

/* PPPoE mode radio cards */
.custnew-radio-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.custnew-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.custnew-radio:hover {
  border-color: var(--color-border-strong);
}
.custnew-radio.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.custnew-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.custnew-radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-border-strong);
  flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.custnew-radio.selected .custnew-radio-dot {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 3px var(--color-surface);
  background: var(--color-primary);
}
.custnew-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
}
.custnew-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.custnew-note.warn {
  color: var(--color-warning);
  background: var(--color-warning-soft);
  border-color: transparent;
}

/* Package summary */
.custnew-package-summary {
  margin-top: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--color-background);
}
.custnew-package-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.custnew-package-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.custnew-package-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
  color: var(--color-text);
  font-weight: 500;
}
.custnew-pkg-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Next due preview */
.custnext-due-preview {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-text);
}

/* ==========================================================================
   4-Step Quick Setup Wizard Component Styles
   ========================================================================== */
.wizard-header {
  margin-bottom: 24px;
}
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 20px 0 24px;
  padding: 0 10px;
}
.wizard-stepper::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: var(--color-border);
  z-index: 1;
}
.wizard-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.wizard-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.wizard-step-item.active .wizard-step-circle {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}
.wizard-step-item.completed .wizard-step-circle {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}
.wizard-step-title {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.wizard-step-item.active .wizard-step-title {
  color: var(--color-primary);
  font-weight: 700;
}
.wizard-step-item.completed .wizard-step-title {
  color: var(--color-text);
}

.wizard-step-card {
  display: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.wizard-step-card.active {
  display: block;
  animation: fadeInStep 0.2s ease-in-out;
}
@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.wizard-step-head-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Radio pills (Gender, Document Type, ONU Ownership) */
.pill-radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill-radio-label {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pill-radio-label input[type="radio"] {
  display: none;
}
.pill-radio-label:hover {
  border-color: var(--color-border-strong);
}
.pill-radio-label.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

/* Fiber Core Color Selector */
.fiber-color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.fiber-color-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fiber-color-pill:hover {
  border-color: var(--color-border-strong);
}
.fiber-color-pill.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 600;
}
.fiber-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* Optical Power Quality Badges */
.optical-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.optical-health-badge.optimal {
  background: var(--color-success-soft);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}
.optical-health-badge.marginal {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}
.optical-health-badge.danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

/* Financial Receipt Preview Box */
.receipt-preview-card {
  background: var(--color-background-subtle, #f8f9fa);
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}
:root[data-theme="dark"] .receipt-preview-card {
  background: #1a1e24;
}
.receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}
.receipt-line.total-line {
  border-bottom: none;
  border-top: 2px solid var(--color-border-strong);
  margin-top: 10px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
}

.wizard-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
}

/* Actions */
.custnew-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}
/* ---------- Customer Profile page (SP-P16 Redesign) ---------- */
.custprofile-top-bar {
  display: flex;
  align-items: center;
  margin-top: 0;
  margin-bottom: 12px;
}
.custprofile-hero-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}
.custprofile-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.custprofile-avatar-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: 8px;
}
.custprofile-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  border: 3px solid #ffffff;
  box-sizing: border-box;
}
.custprofile-avatar-status {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.custprofile-hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid transparent;
  line-height: 1.2;
}
.custprofile-hero-status-pill.status-active {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.custprofile-hero-status-pill.status-suspended {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.custprofile-hero-status-pill.status-expired {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.custprofile-hero-status-pill.status-inactive {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}
.custprofile-hero-status-pill.status-pending {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

.custprofile-hero-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
}
.custprofile-hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}
.custprofile-hero-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.custprofile-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.custprofile-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.custprofile-id-pill:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.custprofile-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.custprofile-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}
.custprofile-hero-actions .btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.custprofile-hero-actions .btn-hero-edit {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.custprofile-hero-actions .btn-hero-edit:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
.custprofile-hero-actions .btn-hero-suspend {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.custprofile-hero-actions .btn-hero-suspend:hover {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}
.custprofile-hero-actions .btn-hero-deactivate {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.custprofile-hero-actions .btn-hero-deactivate:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}
.custprofile-hero-actions .btn-hero-adjust {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}
.custprofile-hero-actions .btn-hero-adjust:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
}
.custprofile-hero-actions .btn-hero-reactivate {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}
.custprofile-hero-actions .btn-hero-reactivate:hover {
  background: #dcfce7 !important;
  border-color: #86efac !important;
}

.custprofile-hero-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* SP-P18: Highlighted PPPoE Password Chip in Hero Header */
.custprofile-chip--password {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}
.custprofile-chip--password strong,
.custprofile-chip--password .custprofile-pass-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #065f46;
  letter-spacing: 0.3px;
}
.custprofile-chip--password svg {
  color: #059669 !important;
}
.custprofile-chip--password .chip-copy-icon {
  color: #10b981;
  opacity: 0.85;
}
.custprofile-chip--password.custprofile-chip-copy:hover {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
  color: #064e3b !important;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.16);
}
.custprofile-chip--password.custprofile-chip-copy:hover strong,
.custprofile-chip--password.custprofile-chip-copy:hover .custprofile-pass-val {
  color: #064e3b;
}
.custprofile-chip--password.custprofile-chip-copy:hover svg {
  color: #047857 !important;
}
.custprofile-chip--password.custprofile-chip-copy:hover .chip-copy-icon {
  color: #059669;
  opacity: 1;
}
.custprofile-chip--password-empty {
  opacity: 0.85;
  background: #f8fafc !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
}
.custprofile-chip--password-empty svg {
  color: #94a3b8 !important;
}
.custprofile-chip--password-empty strong {
  font-style: italic;
  font-weight: 500;
  color: #64748b;
}
.custprofile-chip--package {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.22) !important;
  font-weight: 500 !important;
}
.custprofile-chip--package strong {
  font-weight: 600;
  color: #1e40af;
}
.custprofile-chip--package svg {
  color: #2563eb !important;
}
.custprofile-chip--expiry {
  background: #fffbeb !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
  font-weight: 500 !important;
}
.custprofile-chip--expiry strong {
  font-weight: 600;
}
.custprofile-chip--expiry svg {
  color: #d97706 !important;
}
.custprofile-chip--expiry-danger {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
  font-weight: 500 !important;
}
.custprofile-chip--expiry-danger strong {
  font-weight: 600;
}
.custprofile-chip--expiry-danger svg {
  color: #ef4444 !important;
}
.custprofile-chip-copy {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.custprofile-chip-copy:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #1e293b;
}

/* Dark Mode Adaptations for Hero Header */
:root[data-theme="dark"] .custprofile-id-pill {
  background: var(--dark-bg-elevated);
  color: #cbd5e1;
  border-color: #475569;
}
:root[data-theme="dark"] .custprofile-id-pill:hover {
  background: #475569;
  color: #f8fafc;
}
:root[data-theme="dark"] .custprofile-hero-avatar {
  border-color: var(--color-surface, var(--dark-border));
}
:root[data-theme="dark"] .custprofile-hero-status-pill.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}
:root[data-theme="dark"] .custprofile-hero-status-pill.status-suspended {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
:root[data-theme="dark"] .custprofile-hero-status-pill.status-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
:root[data-theme="dark"] .custprofile-hero-status-pill.status-inactive {
  background: var(--dark-bg-elevated);
  color: #cbd5e1;
  border-color: #475569;
}
:root[data-theme="dark"] .custprofile-hero-status-pill.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-edit {
  background: var(--dark-bg-elevated) !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-edit:hover {
  background: var(--dark-bg-hover) !important;
  color: #ffffff !important;
  border-color: #64748b !important;
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-suspend {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-suspend:hover {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fef3c7 !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-deactivate {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-deactivate:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fee2e2 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-adjust {
  background: var(--color-primary, #2563eb) !important;
  color: #ffffff !important;
  border-color: var(--color-primary, #2563eb) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-adjust:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-reactivate {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}
:root[data-theme="dark"] .custprofile-hero-actions .btn-hero-reactivate:hover {
  background: rgba(34, 197, 94, 0.25) !important;
  color: #bbf7d0 !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
}
/* SP-P18: Highlighted PPPoE Password Chip Dark Mode */
:root[data-theme="dark"] .custprofile-chip--password {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #6ee7b7 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .custprofile-chip--password strong,
:root[data-theme="dark"] .custprofile-chip--password .custprofile-pass-val {
  font-family: var(--font-mono);
  color: #a7f3d0;
  font-weight: 600;
}
:root[data-theme="dark"] .custprofile-chip--password svg {
  color: #34d399 !important;
}
:root[data-theme="dark"] .custprofile-chip--password .chip-copy-icon {
  color: #6ee7b7;
  opacity: 0.9;
}
:root[data-theme="dark"] .custprofile-chip--password.custprofile-chip-copy:hover {
  background: rgba(16, 185, 129, 0.24) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: #ecfdf5 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}
:root[data-theme="dark"] .custprofile-chip--password.custprofile-chip-copy:hover strong,
:root[data-theme="dark"] .custprofile-chip--password.custprofile-chip-copy:hover .custprofile-pass-val {
  color: #ffffff;
}
:root[data-theme="dark"] .custprofile-chip--password.custprofile-chip-copy:hover svg {
  color: #a7f3d0 !important;
}
:root[data-theme="dark"] .custprofile-chip--password.custprofile-chip-copy:hover .chip-copy-icon {
  color: #a7f3d0;
  opacity: 1;
}
:root[data-theme="dark"] .custprofile-chip--password-empty {
  background: rgba(148, 163, 184, 0.1) !important;
  color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
:root[data-theme="dark"] .custprofile-chip--password-empty svg {
  color: #64748b !important;
}
:root[data-theme="dark"] .custprofile-chip--password-empty strong {
  color: #94a3b8;
}
:root[data-theme="dark"] .custprofile-chip--package {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
:root[data-theme="dark"] .custprofile-chip--package strong {
  color: #bfdbfe;
}
:root[data-theme="dark"] .custprofile-chip--package svg {
  color: #60a5fa !important;
}
:root[data-theme="dark"] .custprofile-chip--expiry {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
:root[data-theme="dark"] .custprofile-chip--expiry svg {
  color: #f59e0b !important;
}
:root[data-theme="dark"] .custprofile-chip--expiry-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
:root[data-theme="dark"] .custprofile-chip--expiry-danger svg {
  color: #ef4444 !important;
}
:root[data-theme="dark"] .custprofile-chip-copy:hover {
  border-color: #64748b;
  background: var(--dark-bg-hover);
  color: #f8fafc;
}
:root[data-theme="dark"] .custprofile-area-chip {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}
:root[data-theme="dark"] .custprofile-area-chip svg {
  color: #94a3b8 !important;
}
.chip-copy-icon {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  margin-left: 3px;
}
.chip-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Overview Two-Column Sub-Cards (SP-P16) */
.custoverview-main-card {
  padding: 20px 24px;
}
.custoverview-two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.custoverview-subcard {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.custoverview-subcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: #f8fafc;
}
.custoverview-subcard-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  margin: 0;
  letter-spacing: -0.01em;
}
.custoverview-subcard-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  color: var(--color-text-secondary, #64748b);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.custoverview-subcard-edit-btn:hover {
  background: #f1f5f9;
  color: var(--color-text, #0f172a);
  border-color: #94a3b8;
}
.custoverview-subcard-edit-btn svg {
  width: 14px;
  height: 14px;
}
.custoverview-subcard-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.custoverview-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
}
.custoverview-row:first-child {
  padding-top: 0;
}
.custoverview-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.custoverview-split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.custoverview-full-row,
.custoverview-single-field-row {
  display: block;
}
.custoverview-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.custoverview-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
}
.custoverview-field-val {
  font-size: 13.5px;
  color: var(--color-text, #0f172a);
  word-break: break-word;
}
.custoverview-field-val.font-bold {
  font-weight: 600;
}
.custoverview-field-val.font-dark {
  color: var(--color-text, #0f172a);
  font-size: 14px;
}
.custoverview-field-val-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.custoverview-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #f1f5f9;
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.custoverview-copy-btn:hover {
  background: #e2e8f0;
  color: var(--color-text, #0f172a);
  border-color: #cbd5e1;
}
.custoverview-copy-btn.is-copied {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border-color: #bbf7d0 !important;
}

/* Dark Mode Overrides for Customer Profile Sub-Cards */
:root[data-theme="dark"] .custoverview-subcard,
[data-theme="dark"] .custoverview-subcard {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}
:root[data-theme="dark"] .custoverview-subcard-header,
[data-theme="dark"] .custoverview-subcard-header {
  background: var(--dark-bg-surface);
  border-bottom-color: var(--dark-border);
}
:root[data-theme="dark"] .custoverview-subcard-title,
[data-theme="dark"] .custoverview-subcard-title {
  color: var(--color-text, #f8fafc);
}
:root[data-theme="dark"] .custoverview-subcard-edit-btn,
[data-theme="dark"] .custoverview-subcard-edit-btn {
  background: var(--dark-bg-elevated);
  border-color: #475569;
  color: #cbd5e1;
}
:root[data-theme="dark"] .custoverview-subcard-edit-btn:hover,
[data-theme="dark"] .custoverview-subcard-edit-btn:hover {
  background: #475569;
  color: #f8fafc;
  border-color: #64748b;
}
:root[data-theme="dark"] .custoverview-row,
[data-theme="dark"] .custoverview-row {
  border-bottom-color: var(--dark-border);
}
:root[data-theme="dark"] .custoverview-field-val,
:root[data-theme="dark"] .custoverview-field-val.font-dark,
[data-theme="dark"] .custoverview-field-val,
[data-theme="dark"] .custoverview-field-val.font-dark {
  color: var(--color-text, #f8fafc);
}
:root[data-theme="dark"] .custoverview-copy-btn,
[data-theme="dark"] .custoverview-copy-btn {
  background: var(--dark-bg-elevated);
  border-color: #475569;
  color: #cbd5e1;
}
:root[data-theme="dark"] .custoverview-copy-btn:hover,
[data-theme="dark"] .custoverview-copy-btn:hover {
  background: #475569;
  color: #ffffff;
  border-color: #64748b;
}
:root[data-theme="dark"] .custoverview-copy-btn.is-copied,
[data-theme="dark"] .custoverview-copy-btn.is-copied {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
}
.custoverview-not-provided {
  font-size: 13px;
  font-style: italic;
  color: #94a3b8;
}
.custoverview-date-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.custoverview-cal-icon {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
}
.custoverview-group-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.custoverview-policy-text {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.custprofile-chip-copy.is-copied {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border-color: #bbf7d0 !important;
}
:root[data-theme="dark"] .custprofile-chip-copy.is-copied {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
}
.icon-copied {
  color: #16a34a !important;
}

.custprofile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.custprofile-header-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
  flex: 1 1 auto;
}
.custprofile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.custprofile-avatar {
  width: 52px;
  height: 52px;
  font-size: 22px;
}
.custprofile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.custprofile-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.custprofile-card {
  padding: 18px;
  border-radius: var(--radius-md);
}
.custprofile-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.custprofile-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}
.custprofile-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
}
.custprofile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 18px;
}
.custprofile-item-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.custprofile-item-value {
  font-size: 13.5px;
  color: var(--color-text);
  word-break: break-word;
}
.custprofile-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.status-dot.on,
.status-dot.off {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
}
.status-dot.off {
  opacity: 0.55;
}
.custprofile-muted {
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.custprofile-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 0;
  color: var(--color-text-secondary);
  font-size: 13.5px;
}
.custprofile-empty svg {
  color: var(--color-text-muted);
}
.custprofile-card-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-disconnect-session {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-danger, #ef4444);
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-danger, #ef4444);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  white-space: nowrap;
}
.btn-disconnect-session:hover:not(:disabled) {
  background: var(--color-danger, #ef4444);
  color: #ffffff;
}
.btn-disconnect-session:active:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.btn-disconnect-session:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: var(--color-border, #4b5563);
  color: var(--color-text-muted, #9ca3af);
  background: transparent;
}
.btn-disconnect-session .icon {
  font-size: 13px;
  line-height: 1;
}
.btn-refresh-conn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}
.btn-refresh-conn:hover {
  background: var(--color-background, #f1f5f9);
  color: var(--color-text, #0f172a);
  border-color: var(--color-border-strong, #94a3b8);
}
:root[data-theme="dark"] .btn-refresh-conn,
[data-theme="dark"] .btn-refresh-conn {
  background: var(--dark-bg-elevated);
  border-color: #475569;
  color: #cbd5e1;
}
:root[data-theme="dark"] .btn-refresh-conn:hover,
[data-theme="dark"] .btn-refresh-conn:hover {
  background: #475569;
  color: #f8fafc;
  border-color: #64748b;
}
@media (max-width: 540px) {
  .btn-disconnect-session .label {
    display: none;
  }
  .btn-disconnect-session {
    padding: 4px 8px;
  }
}
.custprofile-traffic {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.custprofile-traffic-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
  color: var(--color-text);
}
.custprofile-package {
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--color-background);
}
.custprofile-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.custprofile-notes p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}

/* ---------- Customer Profile v2 – scoped additions (customer workspace) ---------- */
.custprofile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.custprofile-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.custprofile-chip svg {
  color: var(--color-text-muted);
}

.custprofile-group-chip,
.custprofile-area-chip,
.group-badge-pill,
.area-badge-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Live metric tiles */
.custprofile-live {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.custprofile-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.custprofile-tile-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.custprofile-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}
.custprofile-tile-icon.down {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.custprofile-tile-icon.up {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}
.custprofile-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted);
}
.custprofile-tile-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
}
.custprofile-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.custprofile-dot.on {
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-soft);
}
.custprofile-dot.off {
  background: var(--color-text-muted);
  opacity: 0.6;
}

/* Main workspace layout */
.custprofile-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.custprofile-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.custprofile-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Billing balance block (Phase 3) */
.custprofile-billbal {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.custprofile-billbal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.custprofile-billbal-total { border-top: 1px dashed var(--color-border); padding-top: 6px; font-weight: 600; }
.custprofile-billbal-label { color: var(--color-text-secondary); }
.custprofile-billbal-value { font-variant-numeric: tabular-nums; color: var(--color-text); }
.custprofile-billbal-value.is-owed { color: var(--color-danger); }
.custprofile-billbal-value.is-credit { color: var(--color-success); }
.custprofile-billbal-value.is-clear { color: var(--color-text-muted); }
.custprofile-billbal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.adjust-credit-type-toggle {
  display: flex;
  gap: 8px;
  width: 100%;
}
.adjust-credit-type-toggle .btn {
  flex: 1;
  min-height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}
.adjust-credit-type-toggle .btn.active[data-type="credit"] {
  background-color: var(--color-primary, #3b82f6);
  border-color: var(--color-primary, #3b82f6);
  color: #fff;
}
.adjust-credit-type-toggle .btn.active[data-type="debit"] {
  background-color: var(--color-danger, #ef4444);
  border-color: var(--color-danger, #ef4444);
  color: #fff;
}

/* Billing status chip */
.custprofile-billing-status {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.custprofile-paychip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.custprofile-paychip .status-dot {
  margin-right: 0;
}
.custprofile-paychip.ok {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.custprofile-paychip.overdue {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.custprofile-paychip.overdue .status-dot {
  background: var(--color-danger);
}

/* Stale snapshot banner */
.custprofile-stale {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--color-warning-soft);
  color: var(--color-warning);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .custprofile-layout {
    grid-template-columns: 1fr;
  }
  .custprofile-live {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .custprofile-live {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .custprofile-grid.two {
    grid-template-columns: 1fr;
  }
  .custprofile-actions {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .custprofile-cards {
    grid-template-columns: 1fr;
  }
  .custnew-actions {
    flex-direction: column-reverse;
  }
  .custnew-actions .btn {
    width: 100%;
  }
}

/* ============================================================
   CUSTOMER 3.1 — Tabbed Workspace Layout & Dedicated Edit Page
   ============================================================ */

.custedit-page {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.custnew-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}

.custnew-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  align-self: flex-start;
  height: max-content;
}

.custnew-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-secondary, #475569);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.custnew-tab:hover {
  color: var(--color-text, #0f172a);
  background: #f1f5f9;
}

.custnew-tab.active {
  color: #ffffff !important;
  background: var(--color-primary, #2563eb) !important;
  font-weight: 600;
  border-color: var(--color-primary, #2563eb) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.custnew-tab.active svg {
  color: #ffffff !important;
}

.custnew-tab svg {
  flex-shrink: 0;
  color: var(--color-text-muted, #64748b);
  transition: color 0.15s ease;
}

:root[data-theme="dark"] .custnew-tab {
  color: var(--color-text-secondary, #cbd5e1);
}

:root[data-theme="dark"] .custnew-tab:hover {
  color: #ffffff;
  background: var(--dark-bg-hover);
}

:root[data-theme="dark"] .custnew-tab.active {
  color: #ffffff !important;
  background: var(--color-primary, #2563eb) !important;
  border-color: var(--color-primary, #2563eb) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

:root[data-theme="dark"] .custnew-tab.active svg {
  color: #ffffff !important;
}

.custnew-content {
  min-width: 0;
}

/* Tab Switching: Hide inactive sections, show active section */
.custnew-layout .custnew-section {
  display: none !important;
}

.custnew-layout .custnew-section.active {
  display: block !important;
  animation: fadeIn 0.15s ease;
}

/* Customer View: reset inner card container wrapper */
.custprofile-page .custnew-layout .custnew-section {
  padding: 0;
  margin-bottom: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

/* Customer Edit Page Form Sections */
#editCustomerForm .custnew-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.custnew-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.custnew-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.custnew-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.15s ease;
}

.custnew-back:hover {
  background: var(--color-background);
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}

.custnew-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}

.custnew-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 3px 0 0 0;
}

.custnew-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.custnew-grid .full-width {
  grid-column: 1 / -1;
}

.custnew-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

.custnew-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
}

@media (max-width: 992px) {
  .custprofile-hero-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .custprofile-hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .custoverview-two-col-grid {
    grid-template-columns: 1fr;
  }
  .custnew-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .custnew-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
    white-space: nowrap;
    border-radius: var(--radius);
  }
  .custnew-tab {
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .custprofile-hero-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .custprofile-hero-card {
    padding: 16px;
  }
  .custprofile-hero-actions {
    gap: 6px;
  }
  .custprofile-hero-actions .btn {
    flex: 1 1 auto;
    font-size: 12px;
    padding: 0 10px;
    height: 32px;
  }
  .custoverview-split-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .custnew-grid {
    grid-template-columns: 1fr;
  }
  .custnew-footer {
    flex-direction: column-reverse;
  }
  .custnew-footer .btn {
    width: 100%;
  }
}

/* ============================================================
   PACKAGES — Scoped UI (Phase 2.6)
   ============================================================ */

/* Page shells — restore the shared app-shell content padding so Packages
   pages align with the sidebar/topbar boundary like every other page */
.packages-page,
.pkgnew-page {
  padding: 16px 24px 24px;
}
/* The page wrapper already provides side padding; neutralize the shared
   .page-header side padding inside package pages only */
.packages-page .page-header,
.pkgnew-page .page-header {
  padding: 0;
}

/* Page header */
.pkgnew-header .page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}
.pkgnew-header .page-subtitle {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Back link (reuses .custnew-back-link from existing CSS) */
.custnew-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 12px;
  transition: color var(--transition);
}
.custnew-back-link:hover {
  color: var(--color-primary);
}

/* Summary grid */
.packages-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  .packages-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .packages-summary-grid {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition), border-color var(--transition);
  height: 100%;
}
.summary-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.summary-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.summary-card.total .summary-icon { background: var(--color-primary-soft); color: var(--color-primary); }
.summary-card.active .summary-icon { background: var(--color-success-soft); color: var(--color-success); }
.summary-card.inactive .summary-icon { background: var(--color-warning-soft); color: var(--color-warning); }
.summary-card.customers .summary-icon { background: var(--color-primary-soft); color: var(--color-primary); }

.summary-content { min-width: 0; }
.summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.summary-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.summary-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.summary-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

/* Compact horizontal summary tiles (Packages page only) */
.packages-summary-grid .summary-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.packages-summary-grid .summary-icon { width: 42px; height: 42px; }
.packages-summary-grid .summary-content { display: flex; flex-direction: column; gap: 2px; }
.packages-summary-grid .summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: 0;
}
.packages-summary-grid .summary-value {
  font-size: 1.45rem;
  line-height: 1.1;
}
.packages-summary-grid .summary-meta { margin-top: 0; }
.summary-sub-wrap { margin-top: 4px; }
.summary-sub-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.3;
}
:root[data-theme="dark"] .summary-sub-pill {
  background: var(--dark-bg-elevated);
  border-color: #475569;
  color: #cbd5e1;
}

/* Row 2: Bandwidth Tier & Revenue Share Studio Card */
.package-studio-card {
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.studio-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.studio-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.studio-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.studio-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
}
.studio-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
}
.studio-body {
  padding: 16px 20px;
}
.studio-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.studio-tier-card {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  transition: all var(--transition);
}
.studio-tier-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}
.studio-tier-card.tier-inactive {
  opacity: 0.65;
}
.studio-tier-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.studio-tier-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.studio-tier-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}
.studio-speed-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.studio-tier-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.studio-price-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}
.studio-period {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--color-text-muted);
}
.studio-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
}
.studio-progress-wrap {
  margin: 10px 0 8px 0;
}
.studio-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
}
.studio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 9999px;
  transition: width 0.3s ease;
}
.studio-tier-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}
.studio-subs-badge {
  font-weight: 600;
  color: var(--color-text-secondary);
}
.studio-revenue-badge {
  font-weight: 600;
  color: var(--color-text);
}

/* Filter toolbar */
.packages-filter-card,
.package-toolbar { margin-bottom: 20px; padding: 12px 16px; }
.package-actions { white-space: nowrap; text-align: right; }
.packages-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.packages-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.packages-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  color: var(--color-text-muted);
}
.packages-search-input {
  width: 100%;
  padding: 10px 12px 10px 45px !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.packages-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.packages-filter-select { min-width: 160px; }
.packages-filter-select .form-control { width: 100%; }

/* Row 3: Modernized Package Catalog Table & Direct Inline Actions */
.packages-table-card {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.packages-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.packages-table {
  width: 100%;
  border-collapse: collapse;
}
.packages-table th,
.packages-table td {
  padding: 8px 6px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.packages-table th {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--color-border) !important;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: normal !important;
  line-height: 1.25;
}
:root[data-theme="dark"] .packages-table th {
  background: var(--dark-bg-elevated) !important;
  color: #f1f5f9 !important;
  border-bottom: 2px solid var(--dark-border) !important;
}
.packages-table th:last-child,
.packages-table td.package-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.packages-table tbody tr:hover td {
  background: var(--color-primary-soft);
}
.packages-table td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.packages-table td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.package-name-cell { display: flex; flex-direction: column; gap: 2px; }
.package-name { font-weight: 600; color: var(--color-text); font-size: 0.86rem; }
.package-desc { font-size: 0.72rem; color: var(--color-text-muted); }

.bandwidth-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.speed-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 9999px;
  font-size: 0.70rem;
  font-weight: 600;
  white-space: nowrap;
}
.speed-dl {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}
:root[data-theme="dark"] .speed-dl {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.speed-ul {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.2);
}
:root[data-theme="dark"] .speed-ul {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.pkg-price {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text);
}
.cycle-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 9999px;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border);
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}
.profile-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text);
  width: fit-content;
}
.radius-group-sub {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}
.subs-mrr-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subs-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 0.70rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  width: fit-content;
}
.mrr-text {
  font-size: 0.70rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Direct Inline Action Buttons (100% Zero-Clipping) */
.inline-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  white-space: nowrap;
}
.pkg-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  transition: all var(--transition);
}
.pkg-btn-protected {
  opacity: 0.55;
  cursor: not-allowed !important;
}
.btn-outline-primary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline-primary:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.btn-outline-warning {
  background: transparent;
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}
.btn-outline-warning:hover {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}
.btn-outline-success {
  background: transparent;
  color: var(--color-success);
  border: 1px solid var(--color-success);
}
.btn-outline-success:hover {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.btn-outline-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}
.btn-outline-danger:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.btn-outline-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-outline-secondary:hover {
  background: var(--color-surface-subtle, #f1f5f9);
}

@media (max-width: 768px) {
  .packages-table,
  #pkgHistoryTable {
    min-width: 0 !important;
  }
  .packages-table thead,
  #pkgHistoryTable thead {
    display: none;
  }
  .packages-table tbody,
  .packages-table tr,
  .packages-table td,
  #pkgHistoryTable tbody,
  #pkgHistoryTable tr,
  #pkgHistoryTable td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .packages-table tr,
  #pkgHistoryTable tr {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }
  .packages-table td,
  #pkgHistoryTable td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
    border-bottom: 1px dashed var(--color-border);
    font-size: 13px;
    text-align: right;
    white-space: normal;
  }
  .packages-table td:last-child,
  #pkgHistoryTable td:last-child {
    border-bottom: none;
  }
  .packages-table td[data-label]::before,
  #pkgHistoryTable td[data-label]::before {
    display: inline-block;
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
  }
  .packages-table td[data-label="Actions"],
  #pkgHistoryTable td[data-label="Actions"] {
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--color-border);
    border-bottom: none;
  }
  .packages-table td[data-label="Actions"]::before,
  #pkgHistoryTable td[data-label="Actions"]::before {
    display: none;
  }
  .packages-table .inline-action-group {
    justify-content: flex-end;
    width: 100%;
  }
}

/* Empty state */
.packages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-secondary);
}
.packages-empty h3 { margin: 16px 0 8px; color: var(--color-text); }
.packages-empty p { margin: 0 0 16px; }

/* Loading */
.packages-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--color-text-secondary);
  gap: 12px;
}

/* Package New — layout (form + sticky preview)
   Cap max-width at 1280px so the form doesn't stretch excessively on 1080p+ */
.pkgnew-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: start;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
@media (max-width: 1100px) {
  .pkgnew-layout { grid-template-columns: 1fr; }
  .pkgnew-aside { align-self: auto; }
  .pkg-preview { position: static; }
}
.pkgnew-form { display: flex; flex-direction: column; gap: 12px; }
.pkgnew-aside { display: flex; flex-direction: column; align-self: start; }
.pkgnew-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
}

/* Section cards */
.pkg-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.pkg-section-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text);
}
.pkg-section-icon { flex-shrink: 0; }
.pkg-section-titles { display: flex; flex-direction: column; gap: 2px; }
.pkg-section-title { font-size: 0.95rem; }
.pkg-section-subtitle { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 400; }
.pkg-section-fields { padding: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.pkg-section-fields .form-field.full-width { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .pkg-section-fields { grid-template-columns: 1fr; }
}

/* Preview card */
.pkg-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  height: fit-content;
  position: sticky;
  top: 24px;
}
.pkg-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
}
.pkg-preview-body { padding: 16px; }
.pkg-preview-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 16px;
}
.pkg-preview-speeds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.pkg-preview-speed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
}
.pkg-preview-speed-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.pkg-preview-speed-value { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.pkg-preview-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.pkg-preview-per { font-size: 0.85rem; font-weight: 400; color: var(--color-text-muted); }
.pkg-preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}
.pkg-preview-status { display: flex; align-items: center; }

/* Pagination (reuses existing .pagination/.page-btn) */
.packages-pagination-wrap { margin-top: 16px; }

/* Form field helpers (consistency with existing .form-field) */
.form-field { margin-bottom: 0; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--color-text); margin-bottom: 6px; display: block; }
.form-label .required { color: var(--color-danger); }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-control.is-invalid { border-color: var(--color-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--color-danger-soft); }
.form-help { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--color-text-muted); }
.form-error { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--color-danger); }
.form-field textarea.form-control { min-height: 80px; resize: vertical; }

/* Form grid (reused from existing) */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Modal overlay (reuses existing .modal-overlay/.modal) */
.package-modal .modal-body { max-height: 70vh; overflow-y: auto; }

/* ============================================================
   Package New Page - Modern Form UI
   ============================================================ */

/* Modern form controls for package creation page */
.pkgnew-form .form-control {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pkgnew-form .form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.pkgnew-form .form-control.is-invalid {
  border-color: var(--color-danger);
}
.pkgnew-form .form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--color-danger-soft);
}
.pkgnew-form textarea.form-control {
  min-height: 80px;
  resize: vertical;
}
/* Sections already pad their own .pkg-section-fields; avoid double
   padding/spacing (section padding + margin are handled by the grid) */
.pkgnew-form .pkg-section {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  padding: 0;
  margin-bottom: 0;
}
.pkgnew-form .pkg-section-legend {
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}
/* Inline error slots collapse when empty to avoid dead vertical space */
.pkgnew-form .form-error:empty { display: none; }
.pkgnew-form .pkg-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}
.pkgnew-form .pkg-section-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Package preview sidebar - modern styling */
.pkg-preview {
  position: sticky;
  top: 100px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
}
.pkg-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.pkg-preview-body {
  padding: 16px;
}
.pkg-preview-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}
.pkg-preview-speeds {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.pkg-preview-speed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pkg-preview-speed-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pkg-preview-speed-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}
.pkg-preview-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}
.pkg-preview-per {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.pkg-preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}
.pkg-preview-status {
  display: flex;
  align-items: center;
}

/* Status badge modernization */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-badge.connected {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.status-badge.connected .status-dot {
  background: var(--color-success);
}
.status-badge.disconnected {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.status-badge.disconnected .status-dot {
  background: var(--color-danger);
}
.status-badge.connecting {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}
.status-badge.connecting .status-dot {
  background: var(--color-warning);
}

/* ============================================================
   End Packages Scoped UI
   ============================================================ */

/* ============================================================
   Router Scoped UI
   ============================================================ */

.router-quick-actions-card {
  border: 1px solid var(--color-border);
}

.router-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.router-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.router-quick-btn:hover:not(:disabled) {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.router-quick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--color-background);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.router-quick-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.router-quick-btn .card-icon,
.router-quick-btn .router-quick-btn-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.router-quick-title {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
}

.router-quick-desc {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.router-quick-btn:hover:not(:disabled) .router-quick-desc {
  color: var(--color-primary);
}

/* Connection Status Card */
.router-connection-status-card {
  border: 1px solid var(--color-border);
}

.router-connection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.router-connection-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.router-connection-indicator {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.router-connection-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}

.router-connection-indicator.connected .router-connection-pulse {
  background: var(--color-success);
  animation: router-pulse 2s ease-out infinite;
  opacity: 0.4;
}

.router-connection-indicator.connecting .router-connection-pulse {
  background: var(--color-warning);
  animation: router-pulse 1.5s ease-out infinite;
  opacity: 0.5;
}

@keyframes router-pulse {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.router-connection-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-text-muted);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-border);
  transition: all var(--transition);
}

.router-connection-indicator.connected .router-connection-dot {
  background: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 12px var(--color-success-soft);
}

.router-connection-indicator.connecting .router-connection-dot {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 12px var(--color-warning-soft);
}

.router-connection-indicator.disconnected .router-connection-dot {
  background: var(--color-danger);
}

.router-connection-indicator.not-configured .router-connection-dot {
  background: var(--color-text-muted);
}

.router-connection-text {
  flex: 1;
  min-width: 0;
}

.router-connection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

.router-connection-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.router-connection-latency {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 16px;
  background: var(--color-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  min-width: 80px;
}

.router-latency-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

.router-latency-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.router-connection-details {
  padding-top: 8px;
}

.router-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.router-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.router-detail-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.router-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.router-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

.router-detail-value.unavailable {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .router-quick-grid {
    grid-template-columns: 1fr;
  }
  
  .router-connection-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .router-connection-latency {
    align-items: flex-start;
    width: 100%;
  }
  
  .router-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .router-quick-btn {
    padding: 12px;
  }
  
  .router-connection-main {
    gap: 12px;
  }
  
  .router-connection-indicator {
    width: 40px;
    height: 40px;
  }
}

/* ============================================================
   End Router Scoped UI
   ============================================================ */

/* --- UI Fix Overrides --- */
.packages-search-icon {
  left: 12px !important;
  display: flex !important;
  align-items: center !important;
}
.packages-search-input {
  padding-left: 36px !important;
}
.pkgnew-form .form-control {
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.pkg-preview {
  box-shadow: var(--shadow-md) !important;
}



/* ============================================================
   Router Page — Network & Authentication (Phase 7 Foundation)
   Scoped under .router-network-section to avoid global regressions.
   ============================================================ */

.router-network-section .router-network-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.router-network-section .router-network-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}
.router-network-section .router-network-row:first-child {
  border-top: none;
  padding-top: 0;
}

.router-network-section .router-network-label {
  flex: 1 1 auto;
  min-width: 0;
}
.router-network-section .router-network-label-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.router-network-section .router-network-label-sub {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.router-network-section .router-network-control {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 180px;
}
.router-network-section .router-network-control .form-control {
  min-width: 180px;
  max-width: 240px;
  text-align: right;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}


.router-network-section .router-network-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.router-network-section .router-network-meta {
  font-size: 11.5px;
  color: var(--color-text-muted);
  text-align: right;
  max-width: 240px;
  line-height: 1.35;
}

.router-network-section .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
  transition: background var(--transition);
}
.router-network-section .status-dot.ok { background: var(--color-success); }
.router-network-section .status-dot.warn { background: var(--color-warning); }
.router-network-section .status-dot.err { background: var(--color-danger); }
.router-network-section .status-dot.idle { background: var(--color-text-muted); }

.router-network-section .router-advanced {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.router-network-section .router-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.router-network-section .router-advanced-toggle:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.router-network-section .router-advanced-content {
  margin-top: 10px;
  padding: 4px 0 0;
  border-top: 1px dashed var(--color-border);
}
.router-network-section .router-advanced-content .router-network-row {
  padding: 8px 0;
}


.router-network-section .router-diagnostics {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.router-network-section .router-diagnostics-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.router-network-section .router-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.router-network-section .router-diagnostics-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.router-network-section .router-diagnostics-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.router-network-section .router-diagnostics-value {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}


.router-network-section .router-network-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.router-network-section .router-network-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 7px 12px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 110px;
}
.router-network-section .router-network-actions .btn span {
  white-space: nowrap;
}

.router-network-section .router-network-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
}
.router-network-section .router-network-footnote .status-dot {
  width: 6px;
  height: 6px;
  background: var(--color-text-muted);
  opacity: 0.6;
}

@media (max-width: 640px) {
  .router-network-section .router-network-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .router-network-section .router-network-control {
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }
  .router-network-section .router-network-control .form-control {
    max-width: 100%;
    width: 100%;
    text-align: left;
  }
  .router-network-section .router-network-meta {
    text-align: left;
    max-width: 100%;
  }
  .router-network-section .router-diagnostics-grid {
    grid-template-columns: 1fr;
  }
  .router-network-section .router-network-actions .btn {
    min-width: 0;
  }
}
\n\n/* Added Submenu styles */\n/* Submenus */
.nav-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}
button.nav-item.has-submenu {
  background: transparent;
  width: 100%;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: inherit;
  justify-content: flex-start;
  cursor: pointer;
  padding: 6px 10px;
}
.sidebar.collapsed button.nav-item.has-submenu {
  justify-content: center;
}
.nav-item .nav-chevron {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
  margin-left: auto;
}
.sidebar.collapsed .nav-item .nav-chevron {
  display: none !important;
}
button.nav-item.has-submenu[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}
.sidebar:not(.collapsed) .nav-submenu {
  position: relative;
  margin: 2px 0 6px 20px !important;
  padding: 2px 0 2px 12px !important;
  border-left: 1.5px solid #cbd5e1 !important;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .nav-submenu.open {
  display: none !important;
}
.sidebar:not(.collapsed) .nav-submenu.open {
  display: flex !important;
  animation: skySidebarSubmenuIn 160ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes skySidebarSubmenuIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sidebar .nav-submenu .nav-item {
  color: #475569 !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: transparent !important;
  border-radius: 7px !important;
  margin-bottom: 2px;
  min-height: 32px !important;
  transition: all 140ms ease;
  border: 1px solid transparent !important;
}
.sidebar .nav-submenu .nav-item:hover {
  background: rgba(226, 232, 240, 0.6) !important;
  color: #0f172a !important;
}
.sidebar .nav-submenu .nav-item.active {
  position: relative;
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 7px !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28) !important;
}
.sidebar .nav-submenu .nav-item.active::before {
  content: '';
  position: absolute;
  left: -13.5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}


/* --- FINAL VISUAL POLISH OVERRIDES (PLUSWAB) --- */
.nav-item {
    display: flex;
    align-items: center;
    min-width: 0;
}

.nav-label {
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Dashboard & Global Mobile Fixes */
.traffic-graph,
.pppoe-donut,
.ring-progress,
.traffic-graph-container svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.traffic-graph-container {
    width: 100%;
    min-width: 0;
}

.dashboard-main-grid,
.dashboard-bottom-grid {
    min-width: 0;
    width: 100%;
}

.table-wrap,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Flex items should be able to shrink below their content size to avoid pushing containers wide */
.dashboard-section-card,
.dashboard-metric-card,
.monitor-widget,
.customer-profile-card,
.billing-widget {
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
}

/* Ensure no negative margins accidentally create scroll */


.app-shell {
    max-width: 100vw;
}


/* =========================================================================
   MOBILE-FIRST RESPONSIVE ARCHITECTURE
   ========================================================================= */

/* 1. Global Container Fixes */
html, body {
    max-width: 100vw;
}
.app-shell, .main, .content {
    min-width: 0 !important;
    max-width: 100%;
}

.main, .content, #mainContent {
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 768px) {
    .content, #mainContent {
        padding-inline: 16px;
        padding-top: 16px;
    }
    [class$="-page"],
    .page-container,
    .main-container {
        padding-top: 0;
        padding-inline: 0;
    }
}

/* 2. Topbar Recalibration */
.topbar {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .topbar {
        height: auto !important;
        min-height: var(--topbar-height);
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .topbar-left {
        flex: 1 1 100%;
        min-width: 0;
        justify-content: flex-start;
    }
    
    .topbar-right {
        flex: 1 1 100%;
        justify-content: space-between;
        min-width: 0;
    }
    
    .admin-chip {
        max-width: 150px;
    }
    
    .admin-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 3. Page Header Fixes */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-header h1 {
        font-size: 20px;
        line-height: 1.2;
    }
    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* 4. Dashboard Section Headers & Legend */
.dashboard-section-header {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

@media (max-width: 768px) {
    .dashboard-section-header > span:nth-child(2) {
        flex: 1 1 auto;
        white-space: normal;
    }
    .traffic-legend {
        width: 100%;
        margin-left: 0 !important;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 12px;
    }
    .traffic-legend .legend-item {
        white-space: nowrap;
    }
}

/* 5. Dashboard Network Traffic Layout */
.traffic-rx-tx {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    min-width: 0;
}

.traffic-side {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
}

@media (max-width: 480px) {
    .traffic-side {
        flex: 1 1 100%;
    }
}

/* 6. Dashboard Component Overflows (Tables, Charts) */
.table-wrap, .data-table-wrap, .dashboard-section-body, .dashboard-content, .dashboard-card, .dashboard-section-card {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.data-table {
    min-width: 0;
    width: 100%;
}
@media (max-width: 768px) {
    .data-table {
        min-width: 0;
        width: 100%;
    }
    .customers-table-card,
    .customers-table-card .customers-table-wrap,
    .customers-table-card .table-wrap,
    .customers-table-wrap {
        overflow-x: visible !important;
        overflow: visible !important;
    }
}

.traffic-graph-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden; 
}

/* 7. Billing Page Tabs & Modals */
@media (max-width: 768px) {
    .billing-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    .billing-tabs .tab,
    .billing-tabs .billing-tab {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        text-align: center;
        padding: 8px 12px;
        min-height: 40px;
    }
    .billing-cards {
        flex-direction: column;
    }
    .billing-card {
        width: 100% !important;
        max-width: none !important;
    }
}

/* 8. Breadcrumbs */
/*
   The topbar renders exactly ONE title node (renderTopbar in
   components/app-shell.js): an icon slot plus the current page title.
   There is no <ol>/<li> markup any more, so the browser can never inject
   ordered-list numbering ("1."). The list resets below are defensive only
   and keep any legacy breadcrumb list markup free of markers.
*/
.breadcrumb {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.breadcrumb .breadcrumb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.breadcrumb .breadcrumb-icon svg {
    display: block;
}

.breadcrumb .crumb-current {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb ol,
.breadcrumb ul,
.breadcrumb li,
.breadcrumb .breadcrumb-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb li::marker,
.breadcrumb .breadcrumb-item::marker {
    content: none;
}

@media (max-width: 480px) {
    .breadcrumb-item:not(:last-child) {
        display: none; 
    }
    .breadcrumb-item:last-child::before {
        content: "\2190  "; 
        text-decoration: none;
    }
}

/* 9. Grid Resets */
.metrics-grid-5, .grid-cols-5, .form-grid, .detail-grid, .monitor-grid, .dashboard-main-grid {
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 430px) {
    .metrics-grid-5, .grid-cols-5, .form-grid, .detail-grid, .monitor-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-main-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }
}


/* =========================================================================
   GLOBAL CUSTOMER SEARCH & MOBILE FIXES
   ========================================================================= */

.global-search-container {
    position: relative;
    display: inline-block;
}

.global-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.global-search-dropdown.hidden {
    display: none;
}

.global-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    gap: 8px;
}

.global-search-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    outline: none;
    font-size: 14px;
}

.global-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.global-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
}

.global-search-item:last-child {
    border-bottom: none;
}

.global-search-item:hover {
    background: var(--color-background);
}

.global-search-item-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.global-search-msg {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .global-search-dropdown {
        position: fixed;
        top: var(--topbar-height);
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
    
    .connection-pill .pill-text {
        display: none;
    }
    
    .admin-chip {
        background: transparent !important;
        border: none !important;
        padding: 4px !important;
    }
    
    .admin-name {
        display: none;
    }
    
    .admin-chip svg {
        display: none;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .dashboard-header-actions {
        width: 100%;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .last-updated {
        font-size: 12px;
        order: 2;
    }
}

/* ==============================================
   MOBILE & DESKTOP RESPONSIVE LAYOUT FIXES
   ============================================== */
/* .desktop-only / .mobile-only are GLOBAL on purpose: they were previously
   trapped inside the mobile media query, which is why the desktop topbar
   showed a duplicated page title and an unstyled search field. */

.desktop-only {
  display: flex !important;
}

.mobile-only {
  display: none !important;
}

/* Tablet topbar (768-992): the sidebar is ALREADY a drawer in this range
   (its breakpoint is 992px), so the topbar uses the same compact variant as
   mobile - page title + search button - instead of a clipped search field. */
@media (min-width: 768px) and (max-width: 992px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  .breadcrumb .crumb-current {
    font-size: 16px;
    font-weight: 600;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  
  .topbar {
    height: var(--topbar-height) !important;
    padding: 0 12px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  .topbar-left {
    flex: 1 1 auto !important;
    gap: 8px !important;
    min-width: 0 !important;
  }
  .topbar-right {
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
  }
  /* The topbar has exactly ONE title node (see renderTopbar). On small
     screens it becomes the page title next to the menu button. */
  .breadcrumb .crumb-current {
    font-size: 16px;
    font-weight: 600;
  }
  
  /* Make dashboard section header wrap intelligently on mobile stack */
  .page-header {
      flex-direction: column !important;
      align-items: flex-start !important;
      gap: 12px !important;
  }
  
  .admin-chip {
      padding: 0 !important;
      background: transparent !important;
      border: none !important;
  }
}

/* --- Theme Control Button UI Refinements --- */



/* --- Global Customer Search (desktop field) -------------------------------
   ONE container, one non-wrapping flex row, everything vertically centred:
     .quick-search-box
       +-- .search-icon-slot   (fixed 16px slot - the icon can never become
       |                        a sibling element below the field)
       +-- .search-placeholder (flexible, centred by align-items)
       +-- .search-hint        (Ctrl + K, pinned right)
   The explicit 36px height matches .icon-button and .theme-toggle so the
   field keeps a constant height at 1280/1366/1440/1600/1920.
   ------------------------------------------------------------------------- */
.quick-search-box {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0 8px 0 12px;
  line-height: 1;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  flex: 0 1 300px;
  width: 300px;
  min-width: 180px;
  max-width: 340px;
}
.quick-search-box:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.search-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}
.search-icon-slot svg,
.quick-search-box > svg.icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}
.search-placeholder {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  line-height: 34px;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-muted);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  user-select: none;
}
.global-search-container {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}
.global-search-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  flex-direction: column;
}
.global-search-panel.hidden {
  display: none !important;
}

/* Mobile search panel overrides */
@media (max-width: 768px) {
  .global-search-panel {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    border-radius: var(--radius-md);
  }
}



/* Packages & Services must stay on ONE line on desktop:
   no ellipsis, no clipping, no forced wrap. */
.nav-label { white-space: nowrap; }


/* --- Modern Desktop Theme Toggle Override --- */
@media (min-width: 993px) {
}
/* --- Polished Search Results UI --- */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover,
.search-result-item:focus {
  background: var(--color-background);
  outline: none;
}
.sr-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.sr-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}
.sr-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-id {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.global-search-msg {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   THEME TOGGLE & TOPBAR CONTROLS (AUTHORITATIVE PREMIUM POLISH)
   ========================================================================== */
.theme-toggle,
#themeToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  flex: 0 0 36px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.15s ease;
}

.theme-toggle:hover,
#themeToggle:hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.theme-toggle:active,
#themeToggle:active {
  transform: scale(0.96);
}

.theme-toggle:focus-visible,
#themeToggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle.active,
#themeToggle.active {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-warning, #f59e0b);
}

.theme-toggle.active:hover,
#themeToggle.active:hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-warning, #f59e0b);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-toggle svg,
#themeToggle svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  stroke-width: 1.85;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover svg,
#themeToggle:hover svg {
  transform: rotate(15deg);
}

.theme-toggle.active:hover svg,
#themeToggle.active:hover svg {
  transform: rotate(45deg);
}

/* Ensure Search Dropdown Stays Within Viewport Boundaries & Handles Long Names */
.global-search-panel {
  max-width: calc(100vw - 24px);
}

/* ==========================================================================
   Customer Activity / Session History & Assigned ONU (Feature 1 & 2)
   ========================================================================== */

.custprofile-onu-card .custprofile-item-value {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.custprofile-activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.custprofile-activity-table th {
  padding: 10px 12px;
  background: var(--color-surface-variant, rgba(255,255,255,0.03));
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.custprofile-activity-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255,255,255,0.05));
  vertical-align: middle;
}

.custprofile-activity-table tbody tr:hover {
  background: var(--color-surface-hover, rgba(255,255,255,0.02));
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.session-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.session-badge.completed {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot-anim 2s infinite ease-in-out;
}

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

.custprofile-term-cause {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* =========================================================================
   AUTHORITATIVE GLOBAL RESPONSIVE SCALING & DENSITY ARCHITECTURE
   Strictly scoped to min-width: 993px to protect the frozen mobile drawer.
   ========================================================================= */

/* --- TIER 1: SMALL DESKTOP & LAPTOP (993px - 1440px) --- */
@media (min-width: 993px) and (max-width: 1440px) {
  :root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 68px;
    --topbar-height: 56px;
    --page-padding: 24px;
    --page-padding-top: 20px;
    --page-header-margin: 14px;
    --card-padding: 12px 14px;
    --card-gap: 12px;
    --content-max-width: 100%;
  }

  /* Sidebar Proportions - Enterprise v48 */
  .sidebar-brand {
    height: var(--topbar-height, 56px);
    min-height: var(--topbar-height, 56px);
    max-height: var(--topbar-height, 56px);
    padding: 0 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #28374d;
    background-color: #28374d;
  }

  .brand-mark,
  .brand-mark-logo,
  .brand-mark-text {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 7px;
    background: #2563eb;
    color: #ffffff;
  }

  .brand-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    text-transform: uppercase;
  }

  .sidebar-nav {
    padding: 8px 0 6px;
    gap: 2px;
    scrollbar-width: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .nav-section-label {
    height: 1px !important;
    min-height: 1px !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: 6px 14px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    font-size: 0 !important;
    color: transparent !important;
    overflow: hidden !important;
    border: none !important;
  }

  .nav-section-label.nav-section-label--first,
  .nav-section-label:first-child {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
  }

  .sidebar .nav-item {
    padding: 0 12px;
    margin: 1px 8px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    min-height: 36px;
    height: 36px;
    gap: 10px;
    border-radius: 7px;
    border: 0px solid transparent !important;
    color: #cbd5e1 !important;
  }

  .sidebar .nav-item > .nav-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #cbd5e1;
  }

  .sidebar .nav-item > .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-chevron svg {
    width: 14px;
    height: 14px;
  }

  .sidebar:not(.collapsed) .nav-submenu {
    margin: 2px 0 4px 25px !important;
    padding: 2px 0 2px 10px !important;
    border-left: 1px solid rgba(203, 213, 225, 0.25) !important;
    gap: 2px;
  }

  .sidebar .nav-submenu .nav-item {
    padding: 0 10px !important;
    margin: 1px 8px 1px 0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    min-height: 31px !important;
    height: 31px !important;
    border-radius: 6px !important;
    border: 0px solid transparent !important;
    color: #cbd5e1 !important;
  }

  .sidebar-footer {
    padding: 5px 8px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    height: 46px !important;
    background: #1f2c3f !important;
    background-color: #1f2c3f !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  /* Topbar Proportions */
  .topbar {
    height: var(--topbar-height, 56px);
    min-height: var(--topbar-height, 56px);
    max-height: var(--topbar-height, 56px);
    padding: 0 16px;
  }

  .topbar-left,
  .topbar-right {
    gap: 10px;
  }

  .breadcrumb {
    font-size: 12.5px;
    gap: 5px;
  }

  .quick-search-box {
    height: 32px;
    min-height: 32px;
    flex: 0 1 190px;
    width: 190px;
    min-width: 150px;
    font-size: 12px;
    padding: 0 8px;
    gap: 6px;
  }

  .connection-pill {
    padding: 3px 8px;
    font-size: 11px;
    gap: 5px;
  }

  .admin-chip {
    padding: 3px 8px;
    gap: 6px;
  }

  .admin-avatar {
    width: 24px;
    height: 24px;
    font-size: 10.5px;
  }

  .admin-name {
    font-size: 12.5px;
    max-width: 125px;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  /* Page Headers & Typography */
  .page-header,
  .billing-page-header,
  .dashboard-header,
  .router-header,
  .custprofile-header {
    min-height: 36px;
    margin-bottom: var(--page-header-margin, 14px);
    gap: 10px;
  }

  .page-header-actions .btn,
  .customers-header-actions .btn,
  .packages-header-actions .btn,
  .billing-header-actions .btn,
  .page-actions .btn,
  .dashboard-header-actions .btn,
  .custprofile-actions .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    gap: 5px;
  }

  .page-header-actions .btn svg,
  .customers-header-actions .btn svg,
  .packages-header-actions .btn svg,
  .billing-header-actions .btn svg,
  .page-actions .btn svg,
  .dashboard-header-actions .btn svg,
  .custprofile-actions .btn svg {
    width: 14px;
    height: 14px;
  }

  .page-title,
  .dashboard-title {
    font-size: 19px;
    line-height: 1.25;
  }

  .billing-page-title {
    font-size: 19px;
    line-height: 1.25;
  }

  .page-subtitle,
  .billing-page-subtitle {
    font-size: 12px;
    margin-top: 2px;
  }

  .billing-header-breadcrumb {
    font-size: 10.5px;
  }

  /* Card Density & Spacing */
  .metrics-grid,
  .billing-summary-grid {
    gap: var(--card-gap, 12px);
    margin-bottom: 12px;
  }

  .metric-card {
    padding: 10px 12px;
    min-height: 68px;
    border-radius: var(--radius-sm, 6px);
  }

  .metric-card-header {
    margin-bottom: 3px;
  }

  .metric-card-label {
    font-size: 10.5px;
    gap: 5px;
  }

  .metric-card-icon {
    width: 20px;
    height: 20px;
  }

  .metric-card-icon svg {
    width: 14px;
    height: 14px;
  }

  .metric-card-value {
    font-size: 18px;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  .metric-card-meta {
    font-size: 10.5px;
    gap: 4px;
  }

  .billing-stat-card,
  .billing-summary-grid .stat-card {
    padding: 9px 12px;
    min-height: 66px;
    gap: 10px;
    border-radius: var(--radius-sm, 6px);
  }

  .billing-summary-grid .stat-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
  }

  .billing-summary-grid .stat-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .billing-summary-grid .stat-card-label {
    font-size: 10.5px;
    white-space: nowrap;
  }

  .billing-summary-grid .stat-card-value {
    font-size: 17px;
    line-height: 1.2;
  }

  .card.stat-card,
  .stat-card {
    min-height: 68px;
    border-radius: var(--radius-sm, 6px);
  }

  .card.stat-card .card-body {
    padding: 10px 12px;
    min-height: 68px;
  }

  .card.stat-card .card-title {
    font-size: 11px;
    gap: 6px;
    margin-bottom: 4px;
  }

  .card.stat-card .card-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
  }

  .card.stat-card .card-icon svg {
    width: 14px;
    height: 14px;
  }

  .card.stat-card .stat-value,
  .stat-value {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .card.stat-card .stat-meta,
  .stat-meta {
    font-size: 10.5px;
    gap: 4px;
  }

  .metrics-grid-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .billing-summary-grid--5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  /* Customer Filter Toolbar */
  .customers-filter-card {
    margin-bottom: 12px;
    border-radius: var(--radius-sm, 6px);
  }

  .customers-filter-row {
    padding: 8px 12px;
    gap: 8px;
  }

  .customers-filter-select,
  .customers-filter-select select,
  .customers-filter-select .form-control,
  .customers-search-wrap input {
    height: 32px;
    font-size: 12px;
    padding: 0 8px;
  }

  .customers-search-wrap {
    height: 32px;
    min-width: 170px;
    max-width: 280px;
  }

  .customers-search-icon {
    flex: 0 0 30px;
  }

  .customers-filter-actions .btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    gap: 4px;
  }

  .customers-filter-hint {
    padding: 7px 12px 8px;
    font-size: 11px;
    gap: 6px;
  }

  /* B13.11 Billing Filter Toolbar - Laptop Compact Density */
  .billing-filter-toolbar {
    padding: 10px 14px;
    gap: 8px;
  }

  .billing-filter-search {
    height: 34px;
    min-width: 180px;
    flex-basis: 220px;
  }

  .billing-filter-search .billing-search-icon {
    width: 32px;
  }

  .billing-filter-search .billing-filter-input {
    font-size: 12.5px;
  }

  .billing-filter-select-group {
    gap: 8px;
  }

  .billing-filter-select {
    height: 34px;
    font-size: 12.5px;
    padding: 0 26px 0 10px;
  }

  .billing-filter-select--status {
    width: 145px;
    min-width: 140px;
    flex: 0 0 145px;
  }

  .billing-filter-select--type {
    width: 155px;
    min-width: 150px;
    flex: 0 0 155px;
  }

  .billing-filter-select--tx-type {
    width: 225px;
    min-width: 215px;
    flex: 0 0 225px;
  }

  .billing-filter-actions {
    gap: 6px;
  }

  .billing-filter-btn {
    height: 34px;
    font-size: 12.5px;
    padding: 0 12px;
    gap: 5px;
  }

  /* Data Tables */
  .data-table th {
    padding: 7px 8px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .data-table td {
    padding: 6px 8px;
    font-size: 12px;
  }

  .customers-table th {
    padding: 10px 3.5px;
    font-size: 10.5px;
    letter-spacing: 0;
    box-sizing: border-box;
  }

  .customers-table td {
    padding: 10px 3.5px;
    font-size: 12px;
    box-sizing: border-box;
    vertical-align: middle;
  }

  .customers-table th:first-child,
  .customers-table td:first-child,
  .groups-table th:first-child,
  .groups-table td:first-child,
  .areas-table th:first-child,
  .areas-table td:first-child,
  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 14px !important;
  }

  .customers-table th:last-child,
  .customers-table td:last-child,
  .groups-table th:last-child,
  .groups-table td:last-child,
  .areas-table th:last-child,
  .areas-table td:last-child,
  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 14px !important;
  }

  .customers-table th.th-customer-name {
    padding-left: 14px !important;
  }

  .customers-table th.th-customer-name:first-child {
    padding-left: 14px !important;
  }

  .customers-table th.actions-col,
  .customers-table td.actions-col,
  .customers-table th.col-actions,
  .customers-table td.col-actions {
    width: 7.5% !important;
    min-width: 74px !important;
    max-width: none !important;
    text-align: right !important;
    padding-right: 16px !important;
    overflow: visible !important;
  }

  .customers-table .customer-cell,
  .customers-table .customer-name-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .customers-table .customer-avatar {
    width: 30px;
    height: 30px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .customers-table .customer-cell-main,
  .customers-table .customer-identity-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    overflow: hidden;
    gap: 2px;
  }

  .customers-table .customer-name-line {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 5px;
  }

  .customers-table .customer-name-link,
  .customers-table .customer-name-text {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    display: inline-block;
    max-width: 100%;
  }

  .customers-table .customer-meta-row,
  .customers-table .customer-meta-sub {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 2px;
    line-height: 1.2;
    min-width: 0;
  }

  .customers-table .customer-phone-slot {
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .customers-table .customer-phone-sub {
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .customers-table .customer-area-row {
    display: flex;
    align-items: center;
    line-height: 1.2;
    min-width: 0;
  }

  .customers-table .customer-group-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap !important;
    line-height: 1.2;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 999px;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .customers-table .customer-area-sub {
    display: inline-flex;
    align-items: center;
    white-space: nowrap !important;
    line-height: 1.2;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1px 5px;
    border-radius: 999px;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .table-actions.customers-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }

  .customers-actions .btn-table-action {
    height: 25px;
    padding: 0 5px;
    font-size: 10.5px;
    gap: 2.5px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .customers-actions .btn-table-action svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
  }

  .customer-cid-code {
    font-size: 10.5px;
    padding: 2px 5px;
    max-width: none !important;
    flex-shrink: 0;
    overflow: visible !important;
    text-overflow: clip !important;
    vertical-align: middle;
  }

  .customer-name-link {
    font-size: 12px;
  }

  .customer-phone-sub {
    font-family: var(--font-mono);
    font-size: 10.5px;
  }

  .table-pkg-badge {
    font-size: 10.5px;
    padding: 2px 5px;
    white-space: nowrap;
  }

  /* Customer Profile */
  .custprofile-header {
    margin-bottom: 12px;
  }

  .custprofile-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .custprofile-actions .btn {
    padding: 4px 8px;
    font-size: 11.5px;
    height: 30px;
  }

  .custprofile-live {
    margin-top: 8px;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .custprofile-tile {
    padding: 6px 8px;
    gap: 3px;
    border-radius: var(--radius-sm, 6px);
  }

  .custprofile-tile-label {
    font-size: 9.5px;
  }

  .custprofile-tile-value {
    font-size: 14px;
    gap: 4px;
  }

  .custprofile-tile-icon {
    width: 18px;
    height: 18px;
  }

  .custprofile-tile-icon svg {
    width: 11px;
    height: 11px;
  }

  /* Service Control */
  .service-control-page .sc-status-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px;
    margin-bottom: 10px;
  }

  .service-control-page .sc-status-item {
    padding: 6px 10px;
    gap: 3px;
  }

  .service-control-page .sc-status-label {
    font-size: 10px;
  }

  .service-control-page .sc-status-value {
    font-size: 11.5px;
  }

  .service-control-page .sc-controls-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
    margin-bottom: 10px;
  }

  .service-control-page .sc-control-block {
    padding: 8px 10px;
  }

  .service-control-page .sc-control-label {
    font-size: 10.5px;
    margin-bottom: 4px;
  }

  .service-control-page .sc-control-hint {
    font-size: 10.5px;
    margin-top: 3px;
  }

  .service-control-page .sc-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
  }

  .service-control-page .sc-card {
    padding: 6px 8px;
  }

  .service-control-page .sc-card-label {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .service-control-page .sc-card-value {
    font-size: 16px;
  }

  .service-control-page .sc-card-value-sm {
    font-size: 11px;
  }

  .service-control-page .sc-table-card {
    margin-bottom: 10px;
  }

  /* Reports */
  .reports-filter-card {
    margin-bottom: 10px;
    padding: 8px 12px;
  }

  .report-stat-card {
    padding: 8px 10px;
    min-height: 58px;
  }

  .report-stat-card .stat-card-value {
    font-size: 16px;
  }

  .report-table-card {
    margin-bottom: 10px;
  }

  /* Billing Settings */
  .billing-settings-body {
    padding: 14px;
  }

  .policy-groups-grid {
    gap: 10px;
  }

  .policy-group-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .policy-input-wrap .form-control {
    height: 32px;
    font-size: 12.5px;
  }

  .billing-settings-card .settings-card-header {
    padding: 10px 16px;
  }

  /* Dashboard Grid */
  .dashboard-section-body {
    padding: 14px;
  }

  .dashboard-grid {
    gap: 12px;
  }
}

/* --- TIER 2: MEDIUM DESKTOP (1441px - 1600px) --- */
@media (min-width: 1441px) and (max-width: 1600px) {
  :root {
    --sidebar-width: 240px;
    --topbar-height: 50px;
    --page-padding: 24px;
    --page-padding-top: 20px;
    --page-header-margin: 16px;
    --card-padding: 14px 16px;
    --card-gap: 14px;
    --content-max-width: 100%;
  }

  /* Sidebar */
  .brand-name {
    font-size: 13.5px;
    letter-spacing: -0.01em;
  }

  .nav-item {
    padding: 7px 10px;
    font-size: 13px;
    min-height: 34px;
  }

  /* Topbar */
  .quick-search-box {
    height: 34px;
    min-height: 34px;
    flex: 0 1 220px;
    width: 220px;
    font-size: 12.5px;
  }

  .admin-name {
    max-width: 140px;
    font-size: 13px;
  }

  .page-title,
  .dashboard-title {
    font-size: 21px;
  }

  .billing-page-title {
    font-size: 20px;
  }

  .metric-card {
    padding: 12px 14px;
    min-height: 74px;
    border-radius: var(--radius-sm, 6px);
  }

  .metric-card-header {
    margin-bottom: 4px;
  }

  .metric-card-label {
    font-size: 11px;
    gap: 6px;
  }

  .metric-card-icon {
    width: 22px;
    height: 22px;
  }

  .metric-card-icon svg {
    width: 15px;
    height: 15px;
  }

  .metric-card-value {
    font-size: 20px;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  .metric-card-meta {
    font-size: 11px;
  }

  .card.stat-card,
  .stat-card {
    min-height: 74px;
    border-radius: var(--radius-sm, 6px);
  }

  .card.stat-card .card-body {
    padding: 12px 14px;
    min-height: 74px;
  }

  .card.stat-card .card-title {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .card.stat-card .card-icon {
    width: 26px;
    height: 26px;
  }

  .card.stat-card .card-icon svg {
    width: 16px;
    height: 16px;
  }

  .card.stat-card .stat-value,
  .stat-value {
    font-size: 20px;
  }

  .billing-stat-card,
  .billing-summary-grid .stat-card {
    padding: 11px 14px;
    min-height: 72px;
    border-radius: var(--radius-sm, 6px);
  }

  .billing-summary-grid .stat-card-value {
    font-size: 19px;
  }

  .metrics-grid-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .billing-summary-grid--5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .customers-filter-card {
    margin-bottom: 14px;
    border-radius: var(--radius-sm, 6px);
  }

  .customers-filter-row {
    padding: 10px 14px;
    gap: 10px;
  }

  .customers-filter-select,
  .customers-filter-select select,
  .customers-filter-select .form-control,
  .customers-search-wrap input {
    height: 34px;
    font-size: 12.5px;
  }

  .customers-search-wrap {
    height: 34px;
  }

  .customers-filter-actions .btn {
    height: 34px;
    font-size: 12.5px;
  }

  .customers-filter-hint {
    padding: 8px 14px 10px;
    font-size: 11.5px;
    gap: 7px;
  }

  .data-table th {
    padding: 8px 10px;
    font-size: 12px;
  }

  .data-table td {
    padding: 7px 10px;
    font-size: 12.5px;
  }

  .table-actions.customers-actions .btn-table-action {
    height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .custprofile-live {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .custprofile-tile {
    padding: 8px 10px;
  }

  .service-control-page .sc-status-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px;
    margin-bottom: 12px;
  }

  .service-control-page .sc-controls-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
    margin-bottom: 12px;
  }
}

/* --- TIER 3: LARGE DESKTOP (1601px+) --- */
@media (min-width: 1601px) {
  :root {
    --sidebar-width: 240px;
    --topbar-height: 54px;
    --page-padding: 24px;
    --page-padding-top: 20px;
    --page-header-margin: 20px;
    --card-padding: 16px 18px;
    --card-gap: 16px;
    --content-max-width: 100%;
  }

  .page-title,
  .dashboard-title {
    font-size: 23px;
  }

  .billing-page-title {
    font-size: 22px;
  }

  .metric-card-value {
    font-size: 24px;
  }
}

.b6-invoices-page,
.b6-detail-page {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.b6-breadcrumb {
  margin-bottom: 6px;
}

.b6-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-primary, #0284c7);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.b6-back-link:hover {
  text-decoration: underline;
}

.b6-header-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.b6-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.b6-invoice-link {
  color: var(--color-primary, #0284c7);
  text-decoration: none;
  font-weight: 600;
}

.b6-invoice-link:hover {
  text-decoration: underline;
}

.b6-customer-link,
.b6-customer-name-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.b6-customer-link:hover,
.b6-customer-name-link:hover {
  color: var(--color-primary, #0284c7);
  text-decoration: underline;
}

.b6-period-cell {
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--color-text-muted, #64748b);
}

.b6-filter-card {
  padding: 16px;
  margin-bottom: 16px;
}

.b6-toolbar-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.b6-toolbar-grid .billing-search-wrap {
  flex: 1 1 240px;
  min-width: 200px;
}

.b6-filter-item {
  flex: 0 0 auto;
}

.b6-date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.b6-inline-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
}

.b6-filter-actions {
  margin-left: auto;
}

.b6-table-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
}

.b6-detail-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}

.b6-section-card {
  padding: 20px;
  margin-bottom: 20px;
}

.b6-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.b6-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.b6-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
}

.b6-info-full {
  grid-column: 1 / -1;
}

.b6-info-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}

.b6-sub-info-item {
  background: var(--color-background-soft, #f8fafc);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e2e8f0);
}

.b6-summary-card {
  position: sticky;
  top: 80px;
}

.b6-summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.b6-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.b6-summary-divider {
  height: 1px;
  background: var(--color-border, #e2e8f0);
  margin: 4px 0;
}

.b6-summary-total {
  font-size: 16px;
  font-weight: 700;
}

.b6-summary-due {
  font-size: 16px;
  font-weight: 700;
  padding-top: 4px;
}

.b6-balance-box {
  margin-top: 18px;
  padding: 12px;
  background: var(--color-background-soft, #f8fafc);
  border-radius: 6px;
  border: 1px solid var(--color-border, #e2e8f0);
}

.b6-balance-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.b6-balance-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.b6-period-box,
.b6-notes-box {
  margin-top: 16px;
  font-size: 13px;
}

.b6-period-title,
.b6-notes-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 4px;
}

.b6-period-val,
.b6-notes-val {
  color: var(--color-text, #1e293b);
  line-height: 1.4;
}

@media (max-width: 992px) {
  .b6-detail-grid-layout {
    grid-template-columns: 1fr;
  }

  .b6-summary-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .b6-toolbar-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .b6-toolbar-grid .billing-search-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    border-radius: var(--radius-sm, 8px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    box-sizing: border-box;
    margin-left: 0;
    flex: 0 0 auto;
  }

  .b6-toolbar-grid .billing-search-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: none;
    color: var(--color-text-muted);
    pointer-events: none;
  }

  .b6-toolbar-grid .billing-search-wrap .billing-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    font-size: 13.5px;
    padding: 0 12px 0 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box;
  }

  .b6-filter-item,
  .b6-filter-actions {
    width: 100%;
    margin-left: 0;
    flex: 0 0 auto;
  }

  .b6-date-filter {
    display: grid;
    grid-template-columns: 45px 1fr;
  }

  .b6-info-grid {
    grid-template-columns: 1fr;
  }

  .b6-header-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .b6-header-actions {
    width: 100%;
    margin-top: 8px;
  }

  .b6-header-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }

  /* B6 Invoices Table Mobile Cards */
  .b6-table-card .data-table-wrap {
    overflow-x: visible;
    width: 100%;
  }

  .b6-table-card .data-table thead {
    display: none;
  }

  .b6-table-card .data-table,
  .b6-table-card .data-table tbody,
  .b6-table-card .data-table tr,
  .b6-table-card .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .b6-table-card .data-table tr {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
  }

  .b6-table-card .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 13px;
    text-align: right;
    min-width: 0;
  }

  .b6-table-card .data-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 12px;
  }

  .b6-table-card .data-table td[data-label="Invoice #"] {
    font-weight: 700;
    font-size: 14px;
    padding-bottom: 4px;
  }

  .b6-table-card .data-table td[data-label="Customer"] {
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
  }

  .b6-table-card .data-table .billing-customer {
    text-align: right;
  }

  .b6-table-card .data-table .billing-customer-name {
    font-weight: 600;
    word-break: break-word;
  }

  .b6-table-card .data-table td.billing-amount-col {
    text-align: right;
  }

  .b6-table-card .data-table td[data-label="Due"] strong {
    font-size: 14px;
  }

  .b6-table-card .data-table .actions-col {
    display: flex !important;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    width: 100% !important;
  }

  .b6-table-card .data-table .actions-col::before {
    display: none;
  }

  .b6-table-card .data-table .actions-col .row-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .b6-table-card .data-table .actions-col .icon-btn {
    width: 100%;
    min-height: 40px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
  }

  .b6-table-card .data-table .actions-col a.icon-btn::after {
    content: "View Details";
  }

  .b6-table-card .data-table .actions-col button.inv-apply-credit-btn::after {
    content: "Apply Credit";
  }
}

/* ==========================================================================
   B9.4 — INVOICE APPLY CREDIT UI
   ========================================================================== */
.apply-credit-modal {
  max-width: 520px;
  width: 95%;
  margin: 0 auto;
}

.apply-credit-modal .modal-header .modal-close,
.apply-credit-modal .modal-close {
  min-width: 40px !important;
  min-height: 40px !important;
  width: 40px !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.apply-credit-summary {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--color-background-subtle, #f8f9fa);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border);
}

.apply-credit-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13.5px;
  gap: 8px;
  word-break: break-word;
}

.apply-credit-summary-row:last-child {
  margin-bottom: 0;
}

.apply-credit-summary-row .summary-label {
  color: var(--color-text-secondary);
  font-size: 13px;
  flex-shrink: 0;
}

.apply-credit-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.apply-credit-input-wrap .form-control {
  flex: 1;
  min-height: 40px;
  box-sizing: border-box;
  font-size: 15px;
}

.apply-credit-input-wrap .btn {
  min-height: 40px;
  min-width: 60px;
  font-weight: 600;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  gap: 8px;
}

.preview-row:last-child {
  margin-bottom: 0;
}

.preview-row-total {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--color-border);
  font-size: 14px;
  font-weight: 600;
}

.apply-credit-btn {
  min-height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.15s ease;
}

@media (max-width: 768px) {
  .apply-credit-modal {
    width: calc(100% - 24px) !important;
    margin: 12px auto !important;
  }

  .apply-credit-modal .modal-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .apply-credit-modal .modal-footer .btn {
    width: 100%;
    min-height: 42px;
  }
}

.payment-detail-page {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  min-width: 0;
}

.payment-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payment-detail-title-wrap {
  min-width: 0;
  flex: 1 1 200px;
}

.payment-detail-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.payment-detail-badges {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.payment-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  white-space: nowrap;
}

.payment-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payment-detail-card {
  padding: 20px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

.payment-detail-card-title {
  font-size: 16px;
  margin: 0 0 16px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-detail-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.payment-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payment-detail-label {
  color: var(--color-text-muted);
  font-size: 13px;
  flex: 0 0 auto;
  max-width: 48%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.payment-detail-value {
  font-size: 13.5px;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-detail-value a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-detail-value code {
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.payment-detail-notes {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin-top: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payment-detail-notes-label {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.payment-detail-notes-content {
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.payment-credit-card {
  margin-top: 20px;
  padding: 20px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.payment-credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.payment-credit-item {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-audit-card {
  margin-top: 20px;
  padding: 20px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

@media (max-width: 768px) {
  .payment-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .payment-detail-card,
  .payment-credit-card,
  .payment-audit-card {
    padding: 16px;
  }

  .payment-detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .payment-detail-actions {
    width: 100%;
  }

  .payment-detail-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .payment-credit-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .payment-detail-title {
    font-size: 20px;
  }

  .payment-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .payment-detail-label {
    max-width: 100%;
    font-size: 12px;
  }

  .payment-detail-value {
    text-align: left;
    width: 100%;
    font-size: 13px;
  }

  .payment-detail-actions .btn {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* ===================================================================
   B10.1 Adjust Billing Hub (Customer Billing Management)
   =================================================================== */
.adjust-billing-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.adjust-billing-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adjust-billing-identity-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md, 8px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.adjust-billing-identity-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--color-border-subtle, #eee);
  padding-bottom: 14px;
}

.adjust-billing-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--color-text-secondary);
}

.adjust-billing-balance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.adjust-billing-metric-tile {
  background: var(--color-background-subtle, #f8f9fa);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adjust-billing-metric-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.adjust-billing-metric-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.adjust-billing-metric-value.is-owed {
  color: var(--color-danger);
}

.adjust-billing-metric-value.is-credit {
  color: var(--color-success);
}

.adjust-billing-metric-value.is-clear {
  color: var(--color-text-muted);
}

.adjust-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  box-sizing: border-box;
}

.adjust-billing-section-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md, 8px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.adjust-billing-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-subtle, #f0f0f0);
  padding-bottom: 8px;
  margin: 0;
}

.adjust-billing-action-card {
  background: var(--color-background-subtle, #fbfbfb);
  border: 1px solid var(--color-border-subtle, #eee);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.adjust-billing-action-card:hover {
  border-color: var(--color-border);
}

.adjust-billing-action-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.adjust-billing-op-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
}

.adjust-billing-op-row:not(:last-child) {
  border-bottom: 1px solid var(--color-border-subtle, #eee);
}

.adjust-billing-action-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin: 0;
}

.adjust-billing-action-note {
  font-size: 11.5px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.responsive-payment-table {
  width: 100%;
}

@media (max-width: 768px) {
  .adjust-billing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .adjust-billing-balance-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .adjust-billing-action-card .btn,
  .adjust-billing-op-row .btn {
    width: 100%;
    min-height: 40px;
  }
  .adjust-billing-op-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .responsive-payment-table thead {
    display: none;
  }
  .responsive-payment-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--color-surface, #fff);
  }
  .responsive-payment-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 !important;
    border: none !important;
    text-align: right;
  }
  .responsive-payment-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 12px;
    margin-right: 8px;
    text-align: left;
  }
  .responsive-payment-table td[data-label="Receipt / Actions"] {
    justify-content: flex-end;
    padding-top: 10px !important;
    margin-top: 6px;
    border-top: 1px dashed var(--color-border-subtle, #eee) !important;
  }
  .responsive-payment-table td[data-label="Receipt / Actions"]::before {
    display: none;
  }
}

/* ===================================================================
   B11 Reports UI/UX Refinements (Billing Income & Payments)
   =================================================================== */

/* --- Report Shared Cards & Surfaces --- */
.report-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  box-sizing: border-box;
  min-width: 0;
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.report-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.report-card-subtitle {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin: 3px 0 0;
  line-height: 1.3;
}

/* --- Report Toolbar Cards & Controls --- */
.report-toolbar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  min-width: 0;
}

.report-control {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 12px;
  font-size: 13.5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-background);
  color: var(--color-text);
  box-sizing: border-box;
  width: 100%;
  transition: all var(--transition);
  font-family: inherit;
}

.report-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  background: var(--color-surface);
}

.report-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: block;
}

.report-filter-label--hidden {
  visibility: hidden;
}

/* Payments Report Toolbar Grid */
.report-filters-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(130px, 1.2fr) minmax(130px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 14px;
  align-items: flex-end;
  box-sizing: border-box;
  width: 100%;
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.report-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.report-search-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  pointer-events: none;
  font-size: 14px;
}

.report-search-input {
  padding-left: 36px !important;
}

.report-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.report-reset-btn:hover {
  background: var(--color-background);
  border-color: var(--color-border-strong);
  color: var(--color-primary);
}

/* Billing Income Report Toolbar */
.report-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.report-presets-group {
  display: inline-flex;
  align-items: center;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  padding: 3px;
  gap: 2px;
  height: 40px;
  box-sizing: border-box;
  min-width: 0;
}

.report-presets-group .preset-btn {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.report-presets-group .preset-btn:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.report-presets-group .preset-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.report-custom-date-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.report-date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.report-date-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.report-date-input {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-background);
  color: var(--color-text);
  box-sizing: border-box;
  max-width: 155px;
  font-family: inherit;
  transition: all var(--transition);
}

.report-date-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  background: var(--color-surface);
}

.report-apply-btn {
  height: 40px;
  min-height: 40px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  border-radius: var(--radius-sm, 6px);
}

/* --- Executive KPI Grids --- */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-summary-grid--2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-stat-card {
  padding: 18px 20px;
  min-height: 88px;
}

.report-stat-card .stat-card-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

/* --- Report Breakdown Grid (Issue A1) --- */
.report-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.report-breakdown-card {
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
}

/* Revenue by Payment Method Card (Responsive List - No Horizontal Scroll) */
.report-methods-container {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.report-method-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.report-method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.report-method-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.report-method-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.report-method-count {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.report-method-amount-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  text-align: right;
  justify-content: flex-end;
}

.report-method-amount {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap;
}

.report-method-percent {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  min-width: 44px;
  text-align: right;
}

.report-method-progress-track {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 6px;
  background: var(--color-background-subtle, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
}

.report-method-progress-bar {
  height: 100%;
  background: var(--color-success, #16a34a);
  border-radius: 3px;
  transition: width 0.3s ease;
  min-width: 0;
}

/* --- Report Table System --- */
.report-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th {
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: var(--color-background-subtle, #f8fafc);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.report-table th.billing-amount-col,
.report-table td.billing-amount-col,
.report-table .billing-amount-col {
  text-align: right !important;
}

.report-table td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.report-table tbody tr:hover td {
  background: var(--color-background-hover, rgba(0, 0, 0, 0.02));
}

.report-cell-primary {
  font-weight: 600;
  color: var(--color-text);
}

.report-cell-num {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.report-cell-title {
  font-weight: 600;
  color: var(--color-text);
}

.report-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-table-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color var(--transition);
}

.report-table-link:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}

.report-table-date,
.report-table-ref {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Two-Line Customer Identity Hierarchy (Issue 2.C) */
.billing-customer-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.billing-customer-name-row .billing-customer-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
}

.billing-customer-name-row .billing-customer-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.billing-customer-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  line-height: 1.3;
  margin-top: 2px;
}

.billing-customer-id {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

.billing-customer-sep {
  color: var(--color-text-muted);
}

.billing-customer-sub {
  color: var(--color-text-muted);
  font-size: 11.5px;
}

/* Compact Badges */
.badge-xs {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.badge-sm {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* Allocation & Collector Cells */
.report-allocation-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.report-allocation-item {
  color: var(--color-text-secondary);
}

.report-collector-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

/* Pagination */
.report-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-sizing: border-box;
}

.report-pagination-info {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.report-pagination-info strong {
  color: var(--color-text);
  font-weight: 600;
}

.report-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-page-indicator {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  padding: 0 4px;
}

.report-page-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Empty State */
.report-empty-state {
  padding: 36px 16px;
  text-align: center;
}

.report-empty-icon {
  margin-bottom: 8px;
  color: var(--color-text-muted);
}

.report-empty-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  margin: 0 0 4px;
}

.report-empty-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Export Button */
.report-export-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

/* --- Responsive Media Queries for Reports --- */
@media (max-width: 1400px) {
  .report-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .report-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .report-breakdown-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .report-toolbar-card {
    padding: 14px 16px;
  }
  .report-card-head {
    padding: 14px 16px;
  }
  .report-methods-container {
    padding: 14px 16px;
  }
  .report-stat-card {
    padding: 14px 16px;
  }

  /* Toolbar Stack */
  .report-toolbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .report-presets-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    width: 100%;
    padding: 4px;
    gap: 4px;
  }
  .report-presets-group .preset-btn {
    height: 36px;
    width: 100%;
    text-align: center;
  }
  .report-custom-date-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .report-date-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .report-date-input {
    max-width: none;
    flex: 1;
  }
  .report-apply-btn {
    width: 100%;
  }

  /* Ensure report-table maintains table layout and scrolls inside report-table-wrap */
  .report-table-wrap {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .report-table {
    display: table !important;
    width: 100% !important;
    min-width: 860px !important;
  }
  .report-table thead {
    display: table-header-group !important;
  }
  .report-table tbody {
    display: table-row-group !important;
  }
  .report-table tr {
    display: table-row !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .report-table th {
    display: table-cell !important;
    white-space: nowrap !important;
  }
  .report-table td {
    display: table-cell !important;
    white-space: nowrap !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--color-border) !important;
    text-align: left !important;
  }
  .report-table td[data-label]::before {
    display: none !important;
  }
  .report-table td.billing-amount-col,
  .report-table th.billing-amount-col {
    text-align: right !important;
  }

  /* Exception: 3-column Monthly and Daily tables in Billing Income don't need min-width 860px */
  .report-breakdown-card .report-table,
  .report-card .report-table-wrap .report-table:not(.report-table--wide) {
    min-width: 100% !important;
  }
}

@media (max-width: 680px) {
  .report-filters-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .report-filter-group--search {
    grid-column: 1 / -1;
  }
  .report-filter-group--action {
    grid-column: 1 / -1;
  }
  .report-filter-label--hidden {
    display: none;
  }
  .report-reset-btn {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .report-summary-grid,
  .report-summary-grid--2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .report-filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .report-filter-group--search,
  .report-filter-group--action {
    grid-column: auto;
  }
  .report-pagination {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .report-pagination-actions {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================================
   B13.1 — BILLING SETTINGS & CROSS-SCREEN SCALE POLISH
   ========================================================================= */

/* Canonical Page Containers & Max-Width Constraints */
.billing-settings-page,
.settings-page {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* =========================================================================
   Release v114: Segmented Pill Tab Bar language for Billing Settings
   ========================================================================= */
.settings-tabs {
  display: inline-flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  margin-bottom: 18px !important;
  background: var(--color-surface-subtle, #f1f5f9) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  box-sizing: border-box !important;
}

.tab-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 36px !important;
  padding: 0 14px !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: transparent !important;
  color: var(--color-text-secondary, #64748b) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.tab-button:hover:not(.active) {
  color: var(--color-text, #0f172a) !important;
  background: rgba(148, 163, 184, 0.12) !important;
}

.tab-button.active {
  background: var(--color-surface, #ffffff) !important;
  color: var(--color-brand, #2563eb) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.tab-button .tab-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: inherit !important;
}

[data-theme="dark"] .settings-tabs,
body.dark-mode .settings-tabs {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] .tab-button,
body.dark-mode .tab-button {
  color: var(--dark-text-secondary, #94a3b8) !important;
}

[data-theme="dark"] .tab-button:hover:not(.active),
body.dark-mode .tab-button:hover:not(.active) {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .tab-button.active,
body.dark-mode .tab-button.active {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: var(--color-brand-hover-light, var(--color-brand, #60a5fa)) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Service Control & Billing Settings Sleek Toggle Switch */
.sc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  transition: all var(--transition);
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.sc-toggle:hover:not([disabled]) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sc-toggle[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.sc-toggle.is-on {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.sc-toggle.is-off {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.sc-toggle-knob {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.sc-toggle-text {
  font-weight: 700;
  font-size: 11px;
}

/* Billing Settings Cards & Structured Layout */
.billing-settings-card {
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.billing-settings-card .settings-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
}

.billing-settings-card .card-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.billing-settings-card .card-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  flex-shrink: 0;
}

.billing-settings-card .settings-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.billing-settings-card .settings-card-desc {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin: 2px 0 0;
}

.billing-settings-body {
  padding: 20px;
}

.policy-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.policy-group-card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition);
}

.policy-group-card:hover {
  border-color: var(--color-border-strong);
}

.policy-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.policy-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.policy-group-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.policy-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.policy-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.policy-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.policy-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-input-wrap .form-control {
  height: 36px;
  padding: 6px 10px;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
}

.policy-input-sm {
  max-width: 140px;
}

.policy-input-unit {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.policy-field-hint {
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.35;
}

/* Policy Info Details Panel */
.policy-info-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.policy-info-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.policy-info-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

.policy-info-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Informational Rule Cards for other Settings Tabs */
.settings-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-info-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-text);
}

.settings-info-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
}

.settings-rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  padding: 10px 14px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.settings-rule-badge {
  font-weight: 600;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* Laptop Density Recalibration (993px - 1440px) */
@media (min-width: 993px) and (max-width: 1440px) {
  .billing-settings-body {
    padding: 16px;
  }
  .policy-groups-grid {
    gap: 12px;
  }
  .policy-group-card {
    padding: 14px 16px;
    gap: 12px;
  }
  .policy-input-wrap .form-control {
    height: 34px;
    font-size: 13px;
  }
  .billing-settings-card .settings-card-header {
    padding: 12px 18px;
  }
}

/* Mobile & Tablet Responsiveness (< 992px) */
@media (max-width: 992px) {
  .policy-groups-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .billing-settings-page {
    padding: 0;
  }
  .billing-settings-card {
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
  }
  .billing-settings-body {
    padding: 14px;
  }
  .policy-field-row {
    flex-direction: row;
    align-items: center;
  }
  .policy-input-wrap {
    width: 100%;
  }
  .policy-input-sm {
    max-width: 100%;
    flex: 1;
  }
  .policy-info-panel {
    padding: 12px 14px;
  }
}

/* SP-P7-ACTIVITIES-UI-IMPL & POLISH */
.custprofile-subtabs {
  margin-top: 4px;
}
.custprofile-subtab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.custprofile-subtab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1 1 auto;
}
.custprofile-subtab-bar::-webkit-scrollbar {
  display: none;
}
.custprofile-subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #94a3b8);
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
  flex: 1 1 0;
  min-width: 140px;
}
.custprofile-subtab:hover {
  color: var(--color-text-primary, #f8fafc);
  background: var(--color-surface-hover, #334155);
}
.custprofile-subtab.active {
  color: var(--color-primary-text, #ffffff);
  background: var(--color-primary, #6366f1);
  border-color: var(--color-primary, #6366f1);
}
.custprofile-subtab-panel {
  min-height: 200px;
}
.custprofile-retention-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  background: var(--color-surface-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 6px);
  margin-bottom: 16px;
}
.retention-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.retention-permanent {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.retention-ephemeral {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.retention-network {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.retention-policy {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.custprofile-subtab .badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-bg-subtle, #e2e8f0);
  color: var(--color-text, #0f172a);
  border: 1px solid var(--color-border-subtle, #cbd5e1);
}
[data-theme="dark"] .custprofile-subtab .badge {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.custprofile-subtab.active .badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.custprofile-activity-table tbody tr:hover {
  background: var(--color-surface-hover, rgba(255, 255, 255, 0.04));
}
.activity-table-header {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.custprofile-subrow {
  font-size: 11.5px;
  color: var(--color-text-muted);
  padding: 2px 10px 6px;
  font-style: italic;
}
#btnActivityRefresh .btn-spinner {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

@media (max-width: 640px) {
  .custprofile-subtab-bar {
    width: 100%;
    padding-bottom: 4px;
  }
  .custprofile-subtab {
    flex: 0 0 auto;
    min-width: unset;
  }
  #btnActivityRefresh .btn-label {
    display: none;
  }
  #btnActivityRefresh {
    padding: 8px 10px;
    min-width: 36px;
    justify-content: center;
  }
  .custprofile-pagination-bar button,
  .table-pagination .pagination-controls button {
    min-width: 44px;
    min-height: 44px;
  }
  .hide-mobile {
    display: none !important;
  }
}

/* =====================================================
   SP-P7-ACTIVITIES-UI-CARDS-IMPL — Card List Layout
   ===================================================== */

.act-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;   /* was 10 */
}

.act-card {
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-md, 8px);
  padding: 8px 12px;   /* was 12px 14px */
  transition: background 0.15s ease, border-color 0.15s ease;
}

.act-card:hover {
  background: var(--color-surface-hover, rgba(255,255,255,0.04));
  border-color: var(--color-border-strong, rgba(255,255,255,0.12));
}

.act-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;   /* was 8 */
  flex-wrap: wrap;
}

.act-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.act-card-primary {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-card-aside {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.act-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
}

.act-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.act-meta-label {
  color: var(--color-text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.act-meta-value {
  color: var(--color-text-primary);
}

.act-card-subrow {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 11.5px;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Amount semantics */
.act-amount {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
}

.act-amount.positive { color: #10b981; }
.act-amount.negative { color: #ef4444; }
.act-amount.neutral  { color: var(--color-text-secondary); }
.act-amount.absent   { color: var(--color-text-muted); font-weight: 500; }

/* Active session pulse dot */
.act-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.7);
  animation: actPulse 2s infinite;
  margin-right: 4px;
}

@keyframes actPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Mobile */
@media (max-width: 640px) {
  .act-card {
    padding: 10px 12px;
  }
  .act-card-head {
    align-items: flex-start;
  }
  .act-card-primary {
    white-space: normal;
  }
  .act-card-meta {
    gap: 4px 10px;
  }
}

/* =====================================================
   SP-P7-ACTIVITIES-UI-CARDS-VIEWPORT-FIX - Panel Enclosure
   ===================================================== */
.act-panel-box {
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.act-panel-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #334155);
}

/* Nested cards inside panel box should not double their border/shadow */
.act-panel-box .act-card {
  background: var(--color-surface-subtle, rgba(255,255,255,0.02));
  border-color: var(--color-border-subtle, rgba(255,255,255,0.06));
}

.act-panel-box .act-card:hover {
  background: var(--color-surface-hover, rgba(255,255,255,0.05));
}

/* Pagination centered compact */
.act-panel-footer .table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .act-panel-box {
    padding: 10px 10px;
  }
  .act-panel-footer .table-pagination {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =====================================================
   SP-P7-SESSIONS-REDESIGN — Professional Network Operator Session Cards
   Information-rich, consistent vertical alignment, comfortable breathing room
   ===================================================== */

/* === Card list container spacing === */
.act-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === Base session card === */
.act-card.act-card--session {
  background: var(--color-surface-subtle, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.07));
  border-left: 3px solid transparent;
  border-radius: var(--radius-md, 6px);
  padding: 11px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.act-card.act-card--session:hover {
  background: var(--color-surface-hover, rgba(255, 255, 255, 0.04));
  border-color: var(--color-border-strong, rgba(255, 255, 255, 0.14));
}

/* === Active session accent === */
.act-card.act-card--session.is-active {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.035);
  border-color: rgba(16, 185, 129, 0.22);
}

.act-card.act-card--session.is-active:hover {
  background: rgba(16, 185, 129, 0.055);
  border-color: rgba(16, 185, 129, 0.35);
}

/* === Session Card Header === */
.act-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.act-session-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.act-session-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* Cause / Live tags */
.act-cause-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--color-surface-variant, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--color-text-secondary);
}

.act-cause-pill.is-live {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-weight: 600;
}

.act-cause-label {
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.act-session-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.act-session-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.act-duration-icon {
  font-size: 12px;
  opacity: 0.8;
}

.act-session-total {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--color-text-primary);
}

.act-total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* === Session Card Body: 3-Column Structured Grid === */
.act-session-body {
  display: grid;
  grid-template-columns: 2.1fr 1.6fr 1.5fr;
  gap: 16px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.06));
}

.act-session-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.act-block-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.act-session-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.45;
  min-width: 0;
}

.act-metric-label {
  min-width: 65px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.act-metric-val {
  font-size: 12.5px;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-session-metric .act-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.03);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Active session inline highlight */
.act-active-text {
  color: #10b981;
  font-weight: 600;
}

/* Directional Traffic arrows & highlights */
.act-traffic-dl {
  color: var(--color-text-primary);
  font-weight: 600;
}

.act-arrow-dl {
  color: #10b981;
  font-weight: 700;
  margin-right: 2px;
}

.act-traffic-ul {
  color: var(--color-text-primary);
  font-weight: 600;
}

.act-arrow-ul {
  color: #38bdf8;
  font-weight: 700;
  margin-right: 2px;
}

/* === Mobile Responsiveness === */
@media (max-width: 640px) {
  .act-card.act-card--session {
    padding: 10px 12px;
  }

  .act-session-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .act-session-header-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px dashed var(--color-border-subtle, rgba(255, 255, 255, 0.05));
  }

  .act-session-body {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 8px;
    margin-top: 6px;
  }

  .act-session-block + .act-session-block {
    padding-top: 6px;
    border-top: 1px dashed var(--color-border-subtle, rgba(255, 255, 255, 0.05));
  }

  .act-metric-label {
    min-width: 64px;
  }
}

/* Label grid for SC + Activity */
.act-card-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border-subtle, rgba(255,255,255,0.06));
}

.act-meta-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
}

.act-meta-row .act-meta-label {
  min-width: 78px;
  flex-shrink: 0;
}

.act-meta-row .act-meta-value {
  color: var(--color-text-primary);
  word-break: break-word;
}

/* Mobile */
@media (max-width: 640px) {
  .act-meta-row {
    flex-direction: column;
    gap: 2px;
  }
  .act-meta-row .act-meta-label {
    min-width: unset;
  }
}

/* =====================================================
   ENTERPRISE AUDIT STREAM BADGES & TIMELINE COMPONENTS
   ===================================================== */
.badge-act-payment {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
[data-theme="dark"] .badge-act-payment {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.38);
}

.badge-act-credit-app {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.28);
}
[data-theme="dark"] .badge-act-credit-app {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.38);
}

.badge-act-credit-earn {
  background: rgba(13, 148, 136, 0.14);
  color: #0d9488;
  border: 1px solid rgba(13, 148, 136, 0.28);
}
[data-theme="dark"] .badge-act-credit-earn {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
  border-color: rgba(20, 184, 166, 0.38);
}

.badge-act-grace {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
[data-theme="dark"] .badge-act-grace {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.38);
}

.badge-act-package {
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.28);
}
[data-theme="dark"] .badge-act-package {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.38);
}

.badge-act-billing-date {
  background: rgba(147, 51, 234, 0.14);
  color: #7e22ce;
  border: 1px solid rgba(147, 51, 234, 0.28);
}
[data-theme="dark"] .badge-act-billing-date {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.38);
}

.badge-act-service-on {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
[data-theme="dark"] .badge-act-service-on {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.38);
}

.badge-act-service-off {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.28);
}
[data-theme="dark"] .badge-act-service-off {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.38);
}

.badge-act-neutral {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.28);
}
[data-theme="dark"] .badge-act-neutral {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.28);
}

.act-op-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.act-ref-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-surface-subtle, rgba(255, 255, 255, 0.05));
  color: var(--color-text-secondary, #94a3b8);
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.1));
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.act-amount-pill {
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.act-amount-pill.is-positive {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
[data-theme="dark"] .act-amount-pill.is-positive {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}
.act-amount-pill.is-credit {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.28);
}
[data-theme="dark"] .act-amount-pill.is-credit {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.act-amount-pill.is-charge {
  background: rgba(100, 116, 139, 0.14);
  color: var(--color-text-primary, #f8fafc);
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.act-actor-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.act-actor-pill.is-admin {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.act-actor-pill.is-system {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.act-timestamp {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
}

.act-stream-card {
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.act-stream-card:hover {
  background: var(--color-surface-hover, rgba(255, 255, 255, 0.04));
  border-color: var(--color-border-strong, rgba(255, 255, 255, 0.12));
}

.act-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.act-stream-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.act-stream-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.act-stream-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary, #94a3b8);
  margin-top: 6px;
  word-break: break-word;
}

@media (max-width: 640px) {
  .act-stream-card {
    padding: 10px 10px;
  }
  .act-stream-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .act-stream-header-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

/* Cutoff format toggle */
.cutoff-format-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--color-surface-subtle, rgba(255,255,255,0.04));
  border: 1px solid var(--color-border, #334155);
  border-radius: 6px;
  margin-bottom: 6px;
}

.cutoff-format-btn {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cutoff-format-btn:hover { color: var(--color-text-primary); }

.cutoff-format-btn.active {
  background: var(--color-primary, #6366f1);
  color: #fff;
}

.cutoff-format-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 12h variant row (Release v114 Polish) */
.cutoff-input-12h {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.cutoff-input-12h input[type="number"],
.cutoff-input-12h #scCutoffHour12,
.cutoff-input-12h #scCutoffMin12 {
  width: 58px !important;
  max-width: 58px !important;
  height: 38px !important;
  padding: 0 8px !important;
  text-align: center !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  background: var(--color-surface, #ffffff) !important;
  color: var(--color-text, #0f172a) !important;
  outline: none !important;
}

.cutoff-input-12h select,
#scCutoffMeridiem {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  min-width: 78px !important;
  width: 78px !important;
  height: 38px !important;
  padding: 0 30px 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  background-color: var(--color-surface, #ffffff) !important;
  color: var(--color-text, #0f172a) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  line-height: normal !important;
  outline: none !important;
}

.cutoff-input-12h select::-ms-expand,
#scCutoffMeridiem::-ms-expand {
  display: none !important;
}

.cutoff-sep {
  color: var(--color-text-muted, #64748b) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 38px !important;
}

[data-theme="dark"] .cutoff-input-12h input[type="number"],
body.dark-mode .cutoff-input-12h input[type="number"],
[data-theme="dark"] #scCutoffHour12,
body.dark-mode #scCutoffHour12,
[data-theme="dark"] #scCutoffMin12,
body.dark-mode #scCutoffMin12 {
  background-color: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.2)) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .cutoff-input-12h select,
body.dark-mode .cutoff-input-12h select,
[data-theme="dark"] #scCutoffMeridiem,
body.dark-mode #scCutoffMeridiem {
  background-color: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.2)) !important;
  color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Seconds-warning */
.cutoff-seconds-warning {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: #f59e0b;
  font-style: italic;
}

/* ==========================================================================
   CUSTOMER MAP WORKSPACE (NOC & Field Operations Live Location System)
   ========================================================================== */
.customer-map-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.customer-map-page .page-header {
  margin-bottom: 4px;
}

.map-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 6px;
}

.map-summary-grid .customer-diagnostic-card,
.map-summary-grid .category-tile {
  cursor: default !important;
  user-select: none;
  position: relative;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.map-summary-grid .metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.map-summary-grid .metric-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
}

.map-summary-grid .metric-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 8px);
  flex-shrink: 0;
}

.map-summary-grid .metric-card-icon svg {
  width: 18px;
  height: 18px;
}

.map-summary-grid .metric-card-icon.ok {
  background: var(--color-success-soft, #dcfce7);
  color: var(--color-success, #16a34a);
}

.map-summary-grid .metric-card-icon.neutral {
  background: #f1f5f9;
  color: #64748b;
}

.map-summary-grid .metric-card-icon.warning,
.map-summary-grid .metric-card-icon.due {
  background: var(--color-warning-soft, #fef3c7);
  color: var(--color-warning, #d97706);
}

.map-summary-grid .metric-card-icon.bad {
  background: var(--color-danger-soft, #fee2e2);
  color: var(--color-danger, #ef4444);
}

.map-summary-grid .metric-card-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text, #0f172a);
  margin-bottom: 4px;
}

.map-summary-grid .metric-card-meta {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted, #94a3b8);
}

@media (max-width: 1024px) {
  .map-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .map-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Toolbar & Filter Bar */
.map-workspace-toolbar {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.map-toolbar-row-primary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.map-search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  background: var(--color-background, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  color: var(--color-text, #0f172a);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.map-search-input:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  background: var(--color-surface, #ffffff);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.map-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
}

.map-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  padding: 2px;
  display: none;
}

.map-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  display: none;
}

.map-search-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  transition: background 0.12s;
}

.map-search-item:last-child {
  border-bottom: none;
}

.map-search-item:hover,
.map-search-item.selected {
  background: var(--color-background, #f8fafc);
}

.map-search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-search-item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text, #0f172a);
}

.map-search-item-meta {
  font-size: 11.5px;
  color: var(--color-text-secondary, #64748b);
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.map-select {
  height: 38px;
  padding: 6px 12px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  color: var(--color-text, #0f172a);
  cursor: pointer;
}

.map-select option {
  background-color: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 6px 10px;
}

:root[data-theme="dark"] .map-select {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border-strong);
  color: var(--color-text, #f1f5f9);
}

:root[data-theme="dark"] .map-select option {
  background-color: var(--dark-bg-subtle);
  color: #f1f5f9;
}

.map-toolbar-row-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, #f1f5f9);
}

.map-status-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.map-status-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--color-background, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-status-pill:hover {
  background: #e2e8f0;
}

.map-status-pill.active {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
}

.map-status-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.map-status-pill .pill-dot.green { background: #10b981; }
.map-status-pill .pill-dot.red { background: #ef4444; }
.map-status-pill .pill-dot.amber { background: #f59e0b; }
.map-status-pill .pill-dot.blue { background: #3b82f6; }

.map-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Workspace Canvas Split Layout */
.map-workspace-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 290px);
  min-height: 580px;
}

@media (max-width: 992px) {
  .map-workspace-layout {
    flex-direction: column;
    height: auto;
  }
}

.map-canvas-container {
  flex: 1;
  position: relative;
  background: #e5e7eb;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 520px;
}

#customerMapCanvas {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Map Floating Overlays & Banner */
.map-click-pin-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.map-layer-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 999;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Side Directory & Quick-Pin Panel */
.map-directory-panel {
  width: 380px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 992px) {
  .map-directory-panel {
    width: 100%;
    max-height: 480px;
  }
}

.map-directory-panel.collapsed {
  display: none;
}

.map-directory-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
}

.map-directory-tabs {
  display: flex;
  background: var(--color-background, #f1f5f9);
  padding: 3px;
  border-radius: var(--radius-sm, 6px);
  gap: 3px;
}

.map-dir-tab {
  flex: 1;
  padding: 6px 12px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 4px;
  color: var(--color-text-secondary, #64748b);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.map-dir-tab.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.map-dir-tab-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #334155;
}

.map-dir-tab.active .map-dir-tab-badge {
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.1));
  color: var(--color-primary, #2563eb);
}

.map-directory-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-customer-card {
  padding: 12px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.map-customer-card:hover {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.map-customer-card.active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.03);
}

.map-cust-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.map-cust-card-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-text, #0f172a);
}

.map-cust-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-cust-card-meta {
  font-size: 12px;
  color: var(--color-text-secondary, #64748b);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-cust-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-cust-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, #f1f5f9);
}

/* SVG Custom Map Pin Markers */
.cust-pin-wrapper {
  position: relative;
  width: 32px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cust-pin-wrapper:hover {
  transform: scale(1.15) translateY(-4px);
  z-index: 1000 !important;
}

.cust-pin-pulse {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
}

.cust-pin-pulse.green {
  background: rgba(16, 185, 129, 0.5);
  animation: radar-beacon 2s infinite ease-out;
}

@keyframes radar-beacon {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

.cust-pin-svg {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

/* Custom Floating Pin Detail Card / Popup */
.cust-map-popup-content {
  min-width: 280px;
  max-width: 340px;
  font-family: inherit;
  color: var(--color-text, #0f172a);
}

.cust-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.cust-popup-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.cust-popup-id {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.cust-popup-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 12px;
}

.cust-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
}

.cust-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.btn-google-maps {
  background: #1a73e8 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
  transition: background 0.15s;
}

.btn-google-maps:hover {
  background: #1557b0 !important;
  color: #ffffff !important;
}

.cust-popup-sub-actions {
  display: flex;
  gap: 6px;
}

.cust-popup-sub-actions .btn {
  flex: 1;
  text-align: center;
  justify-content: center;
  font-size: 12px;
  padding: 5px 8px;
}

/* Modals */
.map-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
}

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

.map-modal-box {
  background: var(--color-surface, #ffffff);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--color-border, #e2e8f0);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.15s ease;
}

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

.map-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface, #ffffff);
}

.map-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.map-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

.map-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--color-background, #f8fafc);
}

.map-dispatch-preview {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #1e293b;
  max-height: 220px;
  overflow-y: auto;
}

/* ==============================================================================
   Interactive Mini-Map & GPS Pin Picker Styles
   ============================================================================== */
.mini-map-picker-wrapper {
  position: relative;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border, #cbd5e1);
  overflow: hidden;
  background: #f1f5f9;
  margin-top: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mini-map-canvas {
  height: 280px;
  width: 100%;
  cursor: crosshair;
  background: #e2e8f0;
}

.mini-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  font-size: 12px;
}

.mini-map-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #475569;
}

.mini-map-status-badge.has-pin {
  color: #15803d;
  font-weight: 600;
}

.mini-map-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chrome-flag-helper-card input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}







/* ==========================================================================
   ISOLATED MOBILE RESPONSIVENESS FIXES (@media max-width: 768px / 640px)
   STRICTLY ENCLOSED - ZERO LEAKAGE INTO DESKTOP VIEWPORTS (>= 769px)
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Customer Map Mobile Canvas Layout & Leaflet Container Height Fix */
  .map-workspace-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
  }

  .map-canvas-container {
    flex: none !important;
    width: 100% !important;
    height: 55vh !important;
    min-height: 400px !important;
    max-height: 650px !important;
    position: relative !important;
  }

  #customerMapCanvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
  }

  #customerMapCanvas .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
  }

  /* 2. Customer Table Mobile Card Name Layout */
  .customers-table td[data-label="Customer Name"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding-bottom: 12px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid var(--color-border) !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .customers-table td[data-label="Customer Name"]::before {
    display: block !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--color-text-secondary) !important;
    text-align: left !important;
    margin-bottom: 2px !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
  }

  .customers-table .customer-cell,
  .customers-table .customer-name-cell {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 12px !important;
  }

  .customers-table .customer-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    order: 0 !important;
  }

  .customers-table .customer-cell-main,
  .customers-table .customer-identity-stack {
    min-width: 0 !important;
    max-width: calc(100% - 48px) !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    order: 1 !important;
    gap: 3px !important;
    overflow: visible !important;
  }

  .customers-table .customer-name-line {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 6px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    line-height: 1.35 !important;
  }

  .customers-table .customer-name-link,
  .customers-table .customer-name-text {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    white-space: normal !important;
    max-width: 100% !important;
    display: inline !important;
    color: var(--color-text, #0f172a) !important;
    line-height: 1.35 !important;
  }

  .customers-table .customer-group-indicator,
  .customers-table .customer-group-badge {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 1px 7px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    vertical-align: middle !important;
  }

  .customers-table .customer-meta-row,
  .customers-table .customer-meta-sub {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 1px !important;
    min-width: 0 !important;
  }

  .customers-table .customer-phone-sub,
  .customers-table .customer-phone-text {
    font-size: 12px !important;
    color: var(--color-text-muted) !important;
    white-space: nowrap !important;
    text-align: left !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

@media (max-width: 640px) {
  /* 3. Wizard Stepper Mobile Responsiveness */
  .wizard-stepper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 4px 10px;
    gap: 14px;
    justify-content: flex-start;
  }
  .wizard-stepper::before {
    display: none;
  }
  .wizard-step-item {
    flex: 0 0 auto;
  }
  .wizard-step-circle {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .wizard-step-title {
    font-size: 11px;
    margin-top: 4px;
  }
  .wizard-step-card {
    padding: 16px 12px !important;
  }
  .wizard-step-card .customer-field {
    padding: 10px 8px !important;
  }
}

/* --- Multi-Month Recharge Duration Pills --- */
.recharge-duration-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.recharge-pill {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--color-text-secondary, #4b5563);
}

.recharge-pill:hover {
  background: var(--color-background-subtle, #f3f4f6);
  border-color: var(--color-primary, #2563eb);
}

.recharge-pill.active {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

/* ==========================================================================
   GLOBAL & COMPONENT MODAL ARCHITECTURE (4 ROUNDED CORNERS & TRUE VIEWPORT CENTERING)
   ========================================================================== */

/* Universal Modal Overlay Layout & True Viewport Symmetrical Centering */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2000 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 16px !important;
  }
}

/* 4 Smooth Rounded Corners & Anti-Bleed Overflow */
.modal {
  margin: auto !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 92vh !important;
  box-sizing: border-box !important;
}

.modal-header {
  flex-shrink: 0 !important;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
}

.modal-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #cbd5e1) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-border, #cbd5e1);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted, #94a3b8);
}

.modal-footer {
  flex-shrink: 0 !important;
  border-bottom-left-radius: 16px !important;
  border-bottom-right-radius: 16px !important;
}

/* Specific Customer & Deactivate Modal Hardening */
.deactivate-confirm-modal {
  overflow: hidden !important;
  border-radius: 16px !important;
}

.deactivate-confirm-modal .modal-header {
  border-top-left-radius: inherit !important;
  border-top-right-radius: inherit !important;
}

.deactivate-confirm-modal .modal-footer {
  border-bottom-left-radius: inherit !important;
  border-bottom-right-radius: inherit !important;
}

/* ==========================================================================
   Payment History Modal Refined Interior System
   ========================================================================== */
.customer-payment-history-modal,
.payhist-modal {
  max-width: 820px !important;
  width: 100% !important;
}

.payhist-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .payhist-summary-grid {
    grid-template-columns: 1fr;
  }
}

.payhist-summary-card {
  background: var(--color-bg-subtle, #f8fafc);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  box-sizing: border-box;
}

.payhist-summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 4px;
}

.payhist-summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  line-height: 1.2;
}

.payhist-summary-value.is-success {
  color: #15803d;
}

.payhist-summary-value.is-last-payment {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Unified Copyable Receipt Pill */
.payhist-receipt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--color-background-subtle, #f1f5f9);
  color: var(--color-text, #0f172a);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
}

.payhist-receipt-chip:hover {
  background: #e2e8f0;
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.payhist-receipt-chip .payhist-chip-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted, #64748b);
  transition: color 0.15s ease;
}

.payhist-receipt-chip:hover .payhist-chip-icon {
  color: var(--color-primary, #2563eb);
}

/* Actions Column & Buttons */
.payhist-actions-header,
.payhist-actions-cell {
  white-space: nowrap !important;
  text-align: right !important;
}

.payhist-actions-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.payhist-action-btn {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}

.payhist-action-btn-receipt {
  background: var(--color-primary, #2563eb) !important;
  color: #ffffff !important;
  border: 1px solid var(--color-primary, #2563eb) !important;
}

.payhist-action-btn-receipt:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

.payhist-action-btn-invoice {
  background: #ffffff !important;
  color: var(--color-text, #1e293b) !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
}

.payhist-action-btn-invoice:hover {
  background: var(--color-background-subtle, #f8fafc) !important;
  border-color: var(--color-primary, #2563eb) !important;
  color: var(--color-primary, #2563eb) !important;
}

/* ==========================================================================
   Executive History Modal Suite Widths & Responsive Tables
   ========================================================================== */
.cust-ledger-modal {
  max-width: 860px !important;
  width: 100% !important;
}

.cust-credit-modal {
  max-width: 820px !important;
  width: 100% !important;
}

.cust-grace-modal {
  max-width: 860px !important;
  width: 100% !important;
}

.cust-package-modal {
  max-width: 860px !important;
  width: 100% !important;
}

.cust-billingdate-modal {
  max-width: 840px !important;
  width: 100% !important;
}

.responsive-modal-table {
  width: 100%;
}

@media (max-width: 768px) {
  .responsive-modal-table thead {
    display: none;
  }
  .responsive-modal-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--color-surface, #fff);
  }
  .responsive-modal-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 !important;
    border: none !important;
    text-align: right;
  }
  .responsive-modal-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 12px;
    margin-right: 8px;
    text-align: left;
  }
  .responsive-modal-table td[data-label="Action"],
  .responsive-modal-table td[data-label="Receipt / Actions"] {
    justify-content: flex-end;
    padding-top: 10px !important;
    margin-top: 6px;
    border-top: 1px dashed var(--color-border-subtle, #eee) !important;
  }
  .responsive-modal-table td[data-label="Action"]::before,
  .responsive-modal-table td[data-label="Receipt / Actions"]::before {
    display: none;
  }
}



/* ==========================================================================
   REPORT MODULE EXECUTIVE REDESIGN (Billing Income & Payments)
   ========================================================================== */

/* Remove any stuck blue focus outline box on KPI cards */
.report-kpi-card,
.stat-card.report-stat-card {
  outline: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.report-kpi-card:focus,
.stat-card.report-stat-card:focus {
  outline: none !important;
}

/* Spacious 3x2 Executive KPI Grid for Billing Income (Fix D5) */
.report-kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* 4-Column KPI Grid for Payments */
.report-kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .report-kpi-grid-6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .report-kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .report-kpi-grid-6 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .report-kpi-grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Executive KPI Card Design */
.report-kpi-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.report-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--color-primary, #2563eb));
}

.report-kpi-card.accent-emerald::before { background: #10b981; }
.report-kpi-card.accent-blue::before { background: #2563eb; }
.report-kpi-card.accent-indigo::before { background: #6366f1; }
.report-kpi-card.accent-amber::before { background: #f59e0b; }
.report-kpi-card.accent-purple::before { background: #8b5cf6; }
.report-kpi-card.accent-teal::before { background: #0d9488; }
.report-kpi-card.accent-rose::before { background: #f43f5e; }

.report-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.report-kpi-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
}

.report-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-subtle, #f8fafc);
  color: var(--color-text-secondary, #475569);
}

[data-theme="dark"] .report-kpi-card {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}
[data-theme="dark"] .report-kpi-icon {
  background: rgba(255, 255, 255, 0.06);
}

.report-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.report-kpi-subpill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  background: var(--color-bg-subtle, #f1f5f9);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  width: fit-content;
}

[data-theme="dark"] .report-kpi-subpill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

/* 2-Column Analytics Grid (Fix D6 & D9: ~56% / ~44%) */
.report-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}
.report-analytics-grid > * {
  min-width: 0;
}

@media (max-width: 992px) {
  .report-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Fix D6: Generous internal padding on report cards and breakdown containers */
.report-card-body {
  padding: 18px 22px;
  box-sizing: border-box;
  min-width: 0;
}

.report-methods-container {
  box-sizing: border-box;
}

/* Balanced Left Chart Card with Summary Efficiency Strip (Fix D9) */
.report-chart-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 100%;
}

.report-chart-card .report-chart-container {
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-chart-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-bg-subtle, #f8fafc);
  border-top: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0 0 var(--radius-md, 10px) var(--radius-md, 10px);
  box-sizing: border-box;
}

[data-theme="dark"] .report-chart-summary-strip {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.report-strip-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.report-strip-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-strip-value {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.report-strip-sub {
  font-size: 10.5px;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fix D7 & D8: Full-Width Row 3 Monthly Table with Non-Wrapping Monetary Cells */
.report-card--full-width {
  width: 100%;
}

.report-table--monthly {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.report-table--monthly th,
.report-table--monthly td,
.report-monetary-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* SVG Bar Chart */
.report-chart-container {
  padding: 16px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 16px;
}
[data-theme="dark"] .report-chart-container {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

.report-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

.report-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend-dot--invoiced { background: #3b82f6; }
.legend-dot--collected { background: #10b981; }

.report-svg-chart {
  width: 100%;
  height: 220px;
  display: block;
}

/* Single-Line Monospace Chip for Payments and Invoices */
.report-mono-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-bg-subtle, #f1f5f9);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  color: var(--color-text-emphasis, #1e293b);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
  max-height: 26px;
  box-sizing: border-box;
}

.report-mono-chip:hover {
  background: var(--color-primary-light, #eff6ff);
  border-color: var(--color-primary, #3b82f6);
  color: var(--color-primary, #2563eb);
}

[data-theme="dark"] .report-mono-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
[data-theme="dark"] .report-mono-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Brand-Colored Payment Method Badges */
.badge-bkash {
  background: rgba(226, 19, 110, 0.12) !important;
  color: #e2136e !important;
  border: 1px solid rgba(226, 19, 110, 0.25) !important;
  font-weight: 600;
}
.badge-nagad {
  background: rgba(247, 148, 29, 0.12) !important;
  color: #ea580c !important;
  border: 1px solid rgba(247, 148, 29, 0.25) !important;
  font-weight: 600;
}
.badge-rocket {
  background: rgba(140, 52, 148, 0.12) !important;
  color: #8c3494 !important;
  border: 1px solid rgba(140, 52, 148, 0.25) !important;
  font-weight: 600;
}
.badge-bank {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  font-weight: 600;
}
.badge-cash {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  font-weight: 600;
}
.badge-card {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
  font-weight: 600;
}

[data-theme="dark"] .badge-bkash {
  background: rgba(226, 19, 110, 0.2) !important;
  color: #f472b6 !important;
}
[data-theme="dark"] .badge-nagad {
  background: rgba(247, 148, 29, 0.2) !important;
  color: #fb923c !important;
}
[data-theme="dark"] .badge-rocket {
  background: rgba(140, 52, 148, 0.2) !important;
  color: #c084fc !important;
}
[data-theme="dark"] .badge-bank {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}
[data-theme="dark"] .badge-cash {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

/* Method Breakdown Progress Track */
.report-method-item {
  margin-bottom: 14px;
}
.report-method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.report-method-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-method-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #1e293b);
}
.report-method-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-bg-subtle, #f1f5f9);
  color: var(--color-text-muted, #64748b);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
}
.report-method-amount-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.report-method-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}
.report-method-percent {
  font-size: 11.5px;
  color: var(--color-text-muted, #64748b);
  min-width: 36px;
  text-align: right;
}
.report-method-progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-bg-subtle, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
}
[data-theme="dark"] .report-method-progress-track {
  background: rgba(255, 255, 255, 0.08);
}
.report-method-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Customer Group Distribution Bar */
.report-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-bg-subtle, #f8fafc);
  margin-bottom: 8px;
  border: 1px solid var(--color-border-subtle, #e2e8f0);
}
[data-theme="dark"] .report-group-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* High-Density Responsive Ledger Table (Fix D10 & D11) */
.report-ledger-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}
.report-ledger-table th {
  background: var(--color-bg-subtle, #f8fafc);
  color: var(--color-text-muted, #64748b);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  white-space: nowrap;
}
[data-theme="dark"] .report-ledger-table th {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.report-ledger-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
  font-size: 12.5px;
  vertical-align: middle;
  box-sizing: border-box;
}
.report-ledger-table th:first-child,
.report-ledger-table td:first-child {
  padding-left: 14px;
}
.report-ledger-table th:last-child,
.report-ledger-table td:last-child {
  padding-right: 16px;
}
[data-theme="dark"] .report-ledger-table td {
  border-color: rgba(255, 255, 255, 0.05);
}

.report-channel-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.report-invoice-alloc-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.report-ledger-col-cust {
  min-width: 155px;
}

.report-cust-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.report-cust-name {
  font-weight: 600;
  color: var(--color-text, #0f172a);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
}
.report-cust-name:hover {
  color: var(--color-primary, #2563eb);
}
.report-cust-meta {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
}

.report-alloc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.report-alloc-pill--inv {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
.report-alloc-pill--credit {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}
[data-theme="dark"] .report-alloc-pill--inv {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
[data-theme="dark"] .report-alloc-pill--credit {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.report-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--color-text-secondary, #334155);
  background: var(--color-bg-subtle, #f1f5f9);
  border: 1px solid var(--color-border-subtle, #cbd5e1);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.report-receipt-btn:hover {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
}
[data-theme="dark"] .report-receipt-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}
[data-theme="dark"] .report-receipt-btn:hover {
  background: var(--color-primary, #3b82f6);
  color: #ffffff;
  border-color: var(--color-primary, #3b82f6);
}

/* Mobile Responsive Table Transformation */
@media (max-width: 768px) {
  .report-ledger-table thead {
    display: none;
  }
  .report-ledger-table tbody,
  .report-ledger-table tr,
  .report-ledger-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .report-ledger-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--color-surface, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  }
  [data-theme="dark"] .report-ledger-table tr {
    background: var(--color-surface, #1e293b);
    border-color: var(--color-border, #334155);
  }
  .report-ledger-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 !important;
    border-bottom: 1px dashed var(--color-border-subtle, #f1f5f9) !important;
    text-align: right;
  }
  [data-theme="dark"] .report-ledger-table td {
    border-color: rgba(255, 255, 255, 0.06) !important;
  }
  .report-ledger-table td:last-child {
    border-bottom: none !important;
  }
  .report-ledger-table td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    text-align: left;
    margin-right: 10px;
    flex-shrink: 0;
  }
  .report-ledger-table td[data-label="Customer"] {
    align-items: flex-start;
  }
  .report-ledger-table td[data-label="Actions"],
  .report-ledger-table td[data-label="Receipt"] {
    justify-content: flex-end;
    padding-top: 8px !important;
  }
  .report-ledger-table td[data-label="Actions"]::before,
  .report-ledger-table td[data-label="Receipt"]::before {
    display: none;
  }
}

/* ==========================================================================
   Package Changes Hub Executive Redesign (B14.2)
   ========================================================================== */

.pkg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .pkg-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pkg-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.pkg-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
  height: 100%;
  box-sizing: border-box;
}

.pkg-kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.pkg-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  min-height: 36px;
}

.pkg-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 18px;
  height: 18px;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.pkg-kpi-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pkg-kpi-icon.icon-blue {
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.12));
  color: var(--color-primary, #3b82f6);
}

.pkg-kpi-icon.icon-amber {
  background: var(--color-warning-soft, rgba(245, 158, 11, 0.12));
  color: var(--color-warning, #d97706);
}

.pkg-kpi-icon.icon-emerald {
  background: var(--color-success-soft, rgba(16, 185, 129, 0.12));
  color: var(--color-success, #10b981);
}

.pkg-kpi-icon.icon-purple {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
}

:root[data-theme="dark"] .pkg-kpi-icon.icon-purple {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.pkg-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.pkg-kpi-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: auto;
  min-height: 24px;
  overflow-x: auto;
}

.pkg-kpi-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  height: 22px;
  max-height: 24px;
  box-sizing: border-box;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.pkg-kpi-pill.pill-success {
  background: var(--color-success-soft, rgba(16, 185, 129, 0.12));
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--color-success, #10b981);
}

.pkg-kpi-pill.pill-amber {
  background: var(--color-warning-soft, rgba(245, 158, 11, 0.12));
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--color-warning, #d97706);
}

.pkg-kpi-pill.pill-info {
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.12));
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--color-primary, #3b82f6);
}

.pkg-kpi-pill.pill-danger {
  background: var(--color-danger-soft, rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--color-danger, #ef4444);
}

:root[data-theme="dark"] .pkg-kpi-pill {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
  color: #94a3b8;
}

:root[data-theme="dark"] .pkg-kpi-pill.pill-success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

:root[data-theme="dark"] .pkg-kpi-pill.pill-amber {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

:root[data-theme="dark"] .pkg-kpi-pill.pill-info {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* Symmetric Pending Next-Cycle Queue Card */
.pkg-pending-card {
  margin-bottom: 24px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pkg-pending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pkg-pending-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pkg-pending-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--color-warning-soft, rgba(245, 158, 11, 0.12));
  color: var(--color-warning, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pkg-pending-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.pkg-pending-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* Unified Filter Toolbar */
.pkg-toolbar-card {
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.pkg-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pkg-toolbar-search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.pkg-toolbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.pkg-toolbar-search-input {
  padding-left: 36px !important;
  height: 38px;
  border-radius: 8px;
}

.pkg-toolbar-select {
  width: auto;
  min-width: 150px;
  height: 38px;
  border-radius: 8px;
}

.pkg-toolbar-btn {
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  white-space: nowrap;
}

/* Table Card & History Table */
.pkg-table-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Modal Proration Breakdown */
.pkg-proration-preview-box {
  padding: 14px 16px;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-top: 14px;
}

:root[data-theme="dark"] .pkg-proration-preview-box {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

.pkg-breakdown-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 8px;
}

.pkg-breakdown-table tr td {
  padding: 5px 0;
}

.pkg-breakdown-table tr.pkg-breakdown-divider td {
  border-top: 1px dashed var(--color-border);
  padding-top: 6px;
}

.pkg-breakdown-table tr.pkg-breakdown-total td {
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
  font-weight: 700;
}

/* ==========================================================================
   CONSOLIDATED PAYMENTS MODULE STYLES (Phases 1 - 4)
   ========================================================================== */

/* Bangladesh MFS & Payment Method Badges */
.badge-mfs-bkash {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid rgba(190, 24, 93, 0.25);
  font-weight: 600;
}

.badge-mfs-nagad {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.25);
  font-weight: 600;
}

.badge-mfs-rocket {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid rgba(126, 34, 206, 0.25);
  font-weight: 600;
}

.badge-mfs-upay {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.25);
  font-weight: 600;
}

.badge-mfs-bank {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid rgba(55, 48, 163, 0.25);
  font-weight: 600;
}

.badge-mfs-card {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.25);
  font-weight: 600;
}

.badge-mfs-cash {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.25);
  font-weight: 600;
}

.badge-wallet-credit {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid rgba(109, 40, 217, 0.25);
  font-weight: 600;
}

:root[data-theme="dark"] .badge-mfs-bkash {
  background: rgba(226, 19, 110, 0.18);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.35);
}

:root[data-theme="dark"] .badge-mfs-nagad {
  background: rgba(234, 88, 12, 0.18);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
}

:root[data-theme="dark"] .badge-mfs-rocket {
  background: rgba(140, 52, 148, 0.18);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.35);
}

:root[data-theme="dark"] .badge-mfs-upay {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
}

:root[data-theme="dark"] .badge-mfs-bank {
  background: rgba(30, 64, 175, 0.18);
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.35);
}

:root[data-theme="dark"] .badge-mfs-card {
  background: rgba(5, 150, 105, 0.18);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

:root[data-theme="dark"] .badge-mfs-cash {
  background: rgba(21, 128, 61, 0.18);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}

:root[data-theme="dark"] .badge-wallet-credit {
  background: rgba(109, 40, 217, 0.18);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.35);
}

/* ==========================================================================
   POS PAYMENT COLLECTION TERMINAL — Corporate Enterprise Architecture (pos4)
   Clean corporate form & ledger matching /packages and /packages/changes.
   Zero emojis, zero capsule clutter, standard form labels & controls.
   ========================================================================== */
.pos-page-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Row 1: Executive KPI Grid (keeps clean styling matching /packages) */
.pos-page-container .pkg-kpi-grid {
  margin-bottom: 20px;
}

.pos-page-container .pkg-kpi-card {
  padding: 14px 18px;
  gap: 8px;
}

.pos-page-container .pkg-kpi-top {
  height: 32px;
  min-height: 32px;
}

.pos-page-container .pkg-kpi-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
}

.pos-page-container .pkg-kpi-value {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

/* Row 2: Clean Corporate Payment Collection Card */
.pos-corporate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.pos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pos-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pos-header-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.1));
  color: var(--color-primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.pos-card-subtitle {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 2px 0 0;
  line-height: 1.3;
}

.pos-header-right {
  display: flex;
  align-items: center;
}

/* Card Body: 2-Column Corporate Layout */
.pos-corporate-body {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 28px;
  padding: 20px 24px;
  align-items: stretch;
}

/* LEFT COLUMN: Structured Form */
.pos-form-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.pos-form-row {
  display: grid;
  gap: 18px;
}

.pos-form-row > * {
  min-width: 0;
}

.pos-row-sub-mode {
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.pos-row-inv-chan {
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.pos-row-ref-notes {
  grid-template-columns: 1.2fr 1fr;
}

.pos-row-2col {
  grid-template-columns: 1.25fr 1fr;
}

.pos-form-column .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pos-form-column .form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0;
  line-height: 1.2;
}

.pos-label-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pos-ref-indicator {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pos-ref-indicator.checking {
  color: var(--color-text-muted);
}

.pos-ref-detail {
  font-size: 11.5px;
  min-height: 16px;
  line-height: 1.35;
  margin-top: 3px;
}

.pos-corporate-card .form-control,
.pos-input-standard {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 13.5px;
  padding: 0 14px;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pos-corporate-card .form-control:focus,
.pos-input-standard:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* Corporate 2-tab Segmented Control / Transaction Mode Switch */
.pos-corporate-tabs,
.pos-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  height: 42px;
  box-sizing: border-box;
  width: 100%;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.pos-corp-tab,
.pos-mode-btn {
  height: 100%;
  min-width: 0;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.pos-corp-tab:hover:not(.active):not(:disabled),
.pos-mode-btn:hover:not(.active):not(:disabled) {
  color: var(--color-text);
}

.pos-corp-tab.active,
.pos-mode-btn.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.pos-corp-tab:disabled,
.pos-mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--color-danger, #ef4444);
  color: #ffffff;
}

/* Flat 4-Column Corporate Subscriber Account Strip (Full Card Width) */
.pos-account-strip {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
  border-radius: 10px;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: center;
  margin: 16px 20px 0 20px;
  box-sizing: border-box;
}

.pos-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pos-metric-cell:not(:last-child) {
  border-right: 1px solid #e2e8f0;
  padding-right: 16px;
}

.pos-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.pos-metric-val {
  font-size: 13.5px;
  color: var(--color-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.pos-metric-danger {
  color: var(--color-danger, #ef4444);
  font-weight: 700;
}

.pos-metric-success {
  color: var(--color-success, #10b981);
  font-weight: 600;
}

.pos-strip-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
}

/* Wallet Row */
.pos-wallet-row {
  margin-top: -4px;
}

.pos-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.pos-checkbox-label strong {
  color: var(--color-primary);
}

/* Live-Searchable Enterprise Combobox (Scales to 600-5000+ Subscribers) */
.pos-combobox-wrapper {
  position: relative;
  width: 100%;
}

.pos-combobox-control,
.pos-combobox-trigger {
  min-height: 44px;
  height: 44px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
  box-sizing: border-box;
}

.pos-combobox-control:hover,
.pos-combobox-trigger:hover {
  border-color: #94a3b8;
}

.pos-combobox-control:focus-within,
.pos-combobox-control.is-open,
.pos-combobox-trigger:focus-within,
.pos-combobox-trigger.is-open {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.pos-combobox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.pos-combobox-selected-view {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pos-combobox-selected-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.pos-combobox-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  flex-shrink: 0;
}

.pos-combobox-id,
.pos-combobox-code {
  font-size: 10.5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

.pos-combobox-user {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.pos-combobox-placeholder {
  font-size: 13px;
  color: #94a3b8;
}

.pos-combobox-selected-badge {
  flex-shrink: 0;
}

.pos-combobox-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--color-text, #0f172a);
  padding: 0;
  outline: none;
  width: 100%;
}

.pos-combobox-input::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

.pos-combobox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.pos-combobox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #64748b;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
}

.pos-combobox-btn:hover {
  color: #2563eb;
  background: #f1f5f9;
}

.pos-combobox-chevron {
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-combobox-control.is-open .pos-combobox-chevron,
.pos-combobox-trigger.is-open .pos-combobox-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.pos-combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  z-index: 1000;
  overflow: hidden;
  animation: posDropdownFade 0.15s ease-out;
}

@keyframes posDropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pos-combobox-results {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pos-combobox-item,
.pos-combobox-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pos-combobox-item:last-child,
.pos-combobox-option:last-child {
  border-bottom: none;
}

.pos-combobox-item:hover,
.pos-combobox-item.highlighted,
.pos-combobox-option:hover,
.pos-combobox-option.highlighted {
  background: #f8fafc;
}

.pos-combobox-item.selected,
.pos-combobox-option.selected {
  background: #eff6ff;
}

.pos-combobox-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pos-combobox-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-combobox-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

.pos-combobox-item-id {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.pos-combobox-item-subtext {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-combobox-item-right {
  flex-shrink: 0;
  margin-left: 12px;
}

.pos-pill-due {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pos-pill-paid {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pos-combobox-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

.pos-combobox-status {
  padding: 8px 14px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pos-combobox-footer {
  padding: 8px 14px;
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.pos-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 1px 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

/* RIGHT COLUMN: Corporate Settlement Summary Panel */
.pos-summary-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.pos-summary-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.pos-summary-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.pos-summary-header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pos-summary-ledger {
  display: flex;
  flex-direction: column;
}

.pos-ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f6;
}

.pos-ledger-key {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.pos-ledger-val {
  text-align: right;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-total-strip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}

.pos-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pos-total-label {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}

.pos-total-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.pos-submit-btn {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}

.pos-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Row 3: Corporate Ledger Table Card (.packages-table look & feel) */
.pos-table-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 4px;
}

.pos-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pos-table-header-left {
  display: flex;
  align-items: center;
}

.pos-table-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-subtle, #f1f5f9);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.pos-table-tab {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.pos-table-tab:hover:not(.active) {
  color: var(--color-text);
}

.pos-table-tab.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.pos-table-header-right {
  display: flex;
  align-items: center;
}

.pos-table-subtitle {
  font-size: 12.5px;
}

.pos-table-body {
  overflow-x: auto;
}

.pos-corporate-table th,
.pos-corporate-table td {
  padding: 10px 14px;
  font-size: 13px;
}

.pos-corporate-table th:last-child,
.pos-corporate-table td:last-child {
  width: 90px !important;
  min-width: 90px !important;
  text-align: right !important;
}

.pos-table-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-table-name {
  color: var(--color-text);
}

.pos-table-meta {
  font-size: 11.5px;
}

.pos-inv-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-danger-soft, rgba(239, 68, 68, 0.1));
  color: var(--color-danger, #ef4444);
}

.pos-select-btn,
.pos-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}

.pos-corporate-table tbody tr.pos-row-active td {
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.06));
}

.pos-table-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  padding: 28px 14px !important;
}

/* Printable Receipt Modal */
.pos-receipt-dialog {
  max-width: 500px;
  width: 100%;
}

.pos-receipt-success-icon {
  color: var(--color-success, #10b981);
  margin-right: 8px;
  display: flex;
  align-items: center;
}

.pos-receipt-amount-badge {
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.08));
  border: 1px solid var(--color-primary-soft, rgba(37, 99, 235, 0.2));
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.pos-receipt-amount-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.pos-receipt-amount-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.pos-receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  border-top: 1px dashed var(--color-border);
  padding-top: 14px;
}

.pos-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Dark Mode Overrides */
:root[data-theme="dark"] .pos-corporate-tabs,
:root[data-theme="dark"] .pos-mode-switch {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-corp-tab.active,
:root[data-theme="dark"] .pos-mode-btn.active {
  background: var(--dark-bg-elevated);
  color: #f1f5f9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .pos-corporate-card .form-control,
:root[data-theme="dark"] .pos-corporate-card .pos-input-standard {
  background-color: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f1f5f9;
}

:root[data-theme="dark"] .pos-corporate-card .form-control:focus,
:root[data-theme="dark"] .pos-corporate-card .pos-input-standard:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

:root[data-theme="dark"] .pos-account-strip {
  background: linear-gradient(180deg, var(--dark-bg-elevated) 0%, var(--dark-bg-elevated) 100%);
  border: 1px solid var(--dark-border);
  border-left: 3px solid #3b82f6;
}

:root[data-theme="dark"] .pos-metric-cell:not(:last-child) {
  border-right-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-form-column .form-label {
  color: #cbd5e1;
}

:root[data-theme="dark"] .pos-summary-column {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
  box-shadow: none;
}

:root[data-theme="dark"] .pos-ledger-row {
  border-bottom-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-total-strip {
  background: #1e3a5f;
  border: 1px solid #2563eb;
}

:root[data-theme="dark"] .pos-total-label {
  color: #93c5fd;
}

:root[data-theme="dark"] .pos-total-val {
  color: #ffffff;
}

/* Dark Mode Combobox */
:root[data-theme="dark"] .pos-combobox-control,
:root[data-theme="dark"] .pos-combobox-trigger {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

:root[data-theme="dark"] .pos-combobox-control:hover,
:root[data-theme="dark"] .pos-combobox-trigger:hover {
  border-color: #475569;
}

:root[data-theme="dark"] .pos-combobox-control:focus-within,
:root[data-theme="dark"] .pos-combobox-control.is-open,
:root[data-theme="dark"] .pos-combobox-trigger:focus-within,
:root[data-theme="dark"] .pos-combobox-trigger.is-open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

:root[data-theme="dark"] .pos-combobox-name {
  color: #f8fafc;
}

:root[data-theme="dark"] .pos-combobox-id,
:root[data-theme="dark"] .pos-combobox-code {
  background: var(--dark-bg-surface);
  color: #cbd5e1;
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-combobox-user {
  color: #94a3b8;
}

:root[data-theme="dark"] .pos-combobox-input {
  color: #f8fafc;
}

:root[data-theme="dark"] .pos-combobox-input::placeholder {
  color: #64748b;
}

:root[data-theme="dark"] .pos-combobox-btn {
  color: #94a3b8;
}

:root[data-theme="dark"] .pos-combobox-btn:hover {
  background: var(--dark-bg-hover);
  color: #60a5fa;
}

:root[data-theme="dark"] .pos-combobox-dropdown {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .pos-combobox-item {
  border-bottom-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-combobox-item:hover,
:root[data-theme="dark"] .pos-combobox-item.highlighted {
  background: var(--dark-bg-hover);
}

:root[data-theme="dark"] .pos-combobox-item.selected {
  background: #1e3a5f;
}

:root[data-theme="dark"] .pos-combobox-item-name {
  color: #f8fafc;
}

:root[data-theme="dark"] .pos-combobox-item-id {
  background: var(--dark-bg-surface);
  color: #94a3b8;
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .pos-combobox-item-subtext {
  color: #94a3b8;
}

:root[data-theme="dark"] .pos-pill-due {
  background: #450a0a;
  color: #f87171;
  border-color: #7f1d1d;
}

:root[data-theme="dark"] .pos-pill-paid {
  background: #022c22;
  color: #34d399;
  border-color: #064e3b;
}

:root[data-theme="dark"] .pos-combobox-status,
:root[data-theme="dark"] .pos-combobox-footer {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
  color: #94a3b8;
}

:root[data-theme="dark"] .pos-kbd {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #cbd5e1;
}

/* Row 3 Table Filter Box */
.pos-table-filter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-table-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.pos-table-search-icon {
  position: absolute;
  left: 9px;
  color: #64748b;
  pointer-events: none;
  display: inline-flex;
}

.pos-table-search-input {
  height: 32px;
  font-size: 12px;
  padding-left: 28px;
  padding-right: 26px;
  width: 220px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
}

.pos-table-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}

:root[data-theme="dark"] .pos-table-search-input {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

.pos-table-search-clear {
  position: absolute;
  right: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
}

.pos-table-search-clear:hover {
  color: #0f172a;
}

:root[data-theme="dark"] .pos-table-search-clear:hover {
  color: #f8fafc;
}

:root[data-theme="dark"] .pos-table-tabs {
  background: var(--dark-bg-elevated);
}

:root[data-theme="dark"] .pos-table-tab {
  color: #94a3b8;
}

:root[data-theme="dark"] .pos-table-tab.active {
  background: var(--dark-bg-elevated);
  color: #f1f5f9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
  .pos-corporate-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .pos-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pos-row-sub-mode,
  .pos-row-inv-chan,
  .pos-row-ref-notes,
  .pos-row-2col {
    grid-template-columns: 1fr;
  }

  .pos-account-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 12px 16px;
  }

  .pos-metric-cell:nth-child(2) {
    border-right: none;
    padding-right: 0;
  }

  .pos-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .pos-corporate-tabs,
  .pos-mode-switch {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    height: 42px;
  }

  .pos-combobox-user {
    display: none;
  }

  .pos-account-strip {
    grid-template-columns: 1fr;
  }

  .pos-metric-cell:not(:last-child) {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
  }

  :root[data-theme="dark"] .pos-metric-cell:not(:last-child) {
    border-bottom-color: #334155;
  }
}

/* ==========================================================================
   Step 3: Payment Reconciliation & Shift Audit Enterprise Workspace
   ========================================================================== */

.recon-page-container {
  padding-bottom: 40px;
}

/* Page Header & Global Period Switcher */
.recon-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recon-period-switcher {
  display: inline-flex;
  background: var(--color-background-subtle, #f1f5f9);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
}

:root[data-theme="dark"] .recon-period-switcher {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.recon-period-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
}

.recon-period-btn:hover {
  color: var(--color-text, #0f172a);
}

.recon-period-btn.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-primary, #2563eb);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .recon-period-btn.active {
  background: var(--dark-bg-elevated);
  color: #60a5fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.recon-custom-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 8px;
}

.recon-custom-picker input[type="date"] {
  height: 30px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--color-background-subtle);
  color: var(--color-text);
}

/* Row 1: 4 Financial KPI Cards */
.recon-kpi-grid {
  margin-bottom: 20px;
}

.recon-kpi-grid .pkg-kpi-card {
  padding: 14px 18px;
  gap: 8px;
}

.recon-kpi-grid .pkg-kpi-top {
  height: 32px;
  min-height: 32px;
}

.recon-kpi-grid .pkg-kpi-label {
  font-size: 0.7rem;
  line-height: 18px;
  height: 18px;
}

.recon-kpi-grid .pkg-kpi-value {
  font-size: 1.6rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.recon-kpi-grid .pkg-kpi-pills {
  min-height: 22px;
}

.recon-kpi-grid .pkg-kpi-pill {
  font-size: 11.5px;
  line-height: 18px;
  max-height: 22px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* Row 2: Instant MFS TrxID & Reference Verification Studio (Full-Width) */
.recon-studio-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.recon-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.recon-studio-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recon-panel-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recon-studio-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.recon-studio-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* Quick-Test Reference Chips */
.recon-quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recon-chips-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.recon-chip-btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-background-subtle);
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.recon-chip-btn:hover {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.recon-chip-btn.recon-chip-used:hover {
  border-color: #f87171;
  color: #dc2626;
  background: #fef2f2;
}

.recon-chip-btn.recon-chip-new:hover {
  border-color: #34d399;
  color: #059669;
  background: #ecfdf5;
}

:root[data-theme="dark"] .recon-chip-btn.recon-chip-used:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: #ef4444;
}

:root[data-theme="dark"] .recon-chip-btn.recon-chip-new:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: #10b981;
}

/* Verifier Search Bar Row */
.recon-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.recon-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.recon-input-icon {
  position: absolute;
  left: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.recon-verifier-input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  border-radius: 8px;
  font-size: 13.5px;
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.recon-verifier-input:focus {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

:root[data-theme="dark"] .recon-verifier-input {
  border-color: var(--dark-border-strong);
  background: var(--dark-bg-subtle);
  color: #f8fafc;
}

:root[data-theme="dark"] .recon-verifier-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.recon-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.recon-verify-btn {
  height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 8px;
}

.recon-reset-btn {
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
}

/* Verification Result Banners (Zero Emojis!) */
.recon-empty-verifier {
  padding: 18px 20px;
  border-radius: 8px;
  background: var(--color-background-subtle);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* State A: Available / Clean */
.recon-result-clean {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

:root[data-theme="dark"] .recon-result-clean {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}

.recon-result-clean-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recon-result-clean-left .recon-icon-wrap {
  color: #059669;
  display: flex;
  align-items: center;
}

:root[data-theme="dark"] .recon-result-clean-left .recon-icon-wrap {
  color: #34d399;
}

.recon-clean-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #065f46;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .recon-clean-title {
  color: #a7f3d0;
}

.recon-clean-desc {
  font-size: 12.5px;
  color: #047857;
  margin-top: 2px;
}

:root[data-theme="dark"] .recon-clean-desc {
  color: #6ee7b7;
}

/* State B: Duplicate Alert */
.recon-result-duplicate {
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 10px;
  padding: 16px 20px;
}

:root[data-theme="dark"] .recon-result-duplicate {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

.recon-dup-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.recon-dup-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recon-dup-top-left .recon-icon-wrap {
  color: #dc2626;
  display: flex;
  align-items: center;
}

:root[data-theme="dark"] .recon-dup-top-left .recon-icon-wrap {
  color: #f87171;
}

.recon-dup-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #991b1b;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .recon-dup-title {
  color: #fca5a5;
}

.recon-dup-desc {
  font-size: 12.5px;
  color: #b91c1c;
  margin-top: 2px;
}

:root[data-theme="dark"] .recon-dup-desc {
  color: #f87171;
}

/* 6-Column Metadata Strip */
.recon-dup-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background: #ffffff;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 14px;
}

:root[data-theme="dark"] .recon-dup-grid {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

@media (max-width: 1024px) {
  .recon-dup-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .recon-dup-grid {
    grid-template-columns: 1fr;
  }
}

.recon-dup-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
}

.recon-dup-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Row 3: Split Grid (Channel Studio + Collector Table) */
.recon-split-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

@media (max-width: 1080px) {
  .recon-split-grid {
    grid-template-columns: 1fr;
  }
}

.recon-split-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.recon-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.recon-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recon-card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--color-text);
}

.recon-card-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Channel Distribution Studio */
.recon-channel-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  justify-content: center;
}

.recon-channel-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recon-channel-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.recon-channel-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recon-channel-txns {
  font-size: 12px;
  color: var(--color-text-muted);
}

.recon-channel-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recon-channel-amt {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.recon-channel-pct {
  font-size: 12px;
  color: var(--color-text-muted);
}

.recon-channel-bar-bg {
  height: 8px;
  border-radius: 999px;
  background: var(--color-background-subtle, #f1f5f9);
  overflow: hidden;
}

:root[data-theme="dark"] .recon-channel-bar-bg {
  background: var(--dark-bg-elevated);
}

.recon-channel-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bar-cash { background: #10b981; }
.bar-bkash { background: #e2136e; }
.bar-nagad { background: #ea580c; }
.bar-rocket { background: #8b5cf6; }
.bar-upay { background: #0284c7; }
.bar-bank { background: #2563eb; }
.bar-card { background: #06b6d4; }
.bar-other { background: #64748b; }

/* Collector Handover Table & Audit Table */
.recon-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.recon-table {
  display: table !important;
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

.recon-table thead {
  display: table-header-group !important;
  width: 100% !important;
}

.recon-table thead tr {
  display: table-row !important;
}

.recon-table th {
  display: table-cell !important;
  position: static !important;
  width: auto !important;
  background: var(--color-background-subtle, #f8fafc) !important;
  color: var(--color-text-secondary, #64748b) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--color-border) !important;
  white-space: nowrap !important;
  text-align: left !important;
}

:root[data-theme="dark"] .recon-table th {
  background: var(--dark-bg-elevated) !important;
  color: #94a3b8 !important;
}

.recon-table td {
  display: table-cell !important;
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
  font-size: 12px !important;
}

.recon-table th.text-right,
.recon-table th[style*="text-align: right"],
.recon-table th[style*="text-align:right"],
.recon-table td.text-right,
.recon-table td[style*="text-align: right"],
.recon-table td[style*="text-align:right"] {
  text-align: right !important;
}

.recon-table th.text-center,
.recon-table th[style*="text-align: center"],
.recon-table th[style*="text-align:center"],
.recon-table td.text-center,
.recon-table td[style*="text-align: center"],
.recon-table td[style*="text-align:center"] {
  text-align: center !important;
}

td.table-empty-cell,
.table-empty-cell,
td.empty-state {
  display: table-cell !important;
  text-align: center !important;
  padding: 32px 16px !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

.recon-empty-table-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.recon-total-row td {
  background: var(--color-background-subtle, #f8fafc);
  border-top: 2px solid var(--color-border) !important;
  border-bottom: none !important;
  font-weight: 600;
  font-size: 13.5px;
}

:root[data-theme="dark"] .recon-total-row td {
  background: var(--dark-bg-elevated);
}

.recon-table-action-btn {
  padding: 3px 8px;
  font-size: 11.5px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Row 4: Digital Reference & MFS Audit Card */
.recon-audit-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.recon-audit-search-wrapper {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.recon-audit-search-input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 32px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--color-background-subtle);
  color: var(--color-text);
  box-sizing: border-box;
  outline: none;
}

.recon-audit-search-input:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.recon-audit-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Payment Gateways Studio Tabs */
.gw-tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  overflow-x: auto;
}

.gw-tab-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition);
}

.gw-tab-btn:hover {
  background: var(--color-background-subtle);
  color: var(--color-text);
}

.gw-tab-btn.active {
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.12));
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.gw-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.gw-tab-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.gw-tab-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.gw-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.gw-channel-card {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gw-channel-card.channel-inactive {
  opacity: 0.65;
}

.gw-channel-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.gw-channel-name {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.gw-channel-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.gw-field-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.gw-field-instructions {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.gw-channel-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
}

/* Gateway Cards */
.gw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .gw-grid {
    grid-template-columns: 1fr;
  }
}

.gw-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.gw-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gw-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gw-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.gw-card-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gw-card-desc {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0 0 14px 0;
  line-height: 1.4;
}

.gw-env-selector {
  display: flex;
  gap: 8px;
}

.gw-env-radio {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gw-env-radio.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.08));
  color: var(--color-primary);
}

.gw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gw-eye-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.gw-webhook-copy-row {
  display: flex;
  gap: 8px;
}

.gw-webhook-url-input {
  font-size: 11.5px;
  height: 36px;
  background: var(--color-surface-subtle, #f8fafc);
}

/* Switch Toggle Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 22px;
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.switch-toggle input:checked + .slider {
  background-color: var(--color-primary, #2563eb);
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(18px);
}

/* Sandbox Testing Layout */
.gw-sim-layout {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .gw-sim-layout {
    grid-template-columns: 1fr;
  }
}

.gw-sim-form-card,
.gw-sim-result-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.gw-sim-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.gw-safety-notice {
  background: var(--color-success-soft, rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 12px;
}

.gw-empty-sim {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.gw-empty-sim-icon {
  margin-bottom: 12px;
  color: var(--color-text-muted);
}

.sim-result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-success-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-success-soft, rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 14px;
  color: var(--color-success, #10b981);
}

.sim-meta-bar {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  padding: 8px 12px;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  flex-wrap: wrap;
}

.sim-section {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
}

.sim-section-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.sim-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  font-size: 13px;
}

.sim-kv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Step 2: Unified Transactions Ledger Enterprise Redesign (Step 2 of 4)
   ========================================================================== */

.tx-page-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tx-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tx-refresh-btn,
.tx-collect-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Row 1: KPI Grid Alignment */
.tx-kpi-grid {
  margin-bottom: 16px;
}

.tx-kpi-grid .pkg-kpi-card {
  padding: 14px 18px;
  gap: 8px;
}

.tx-kpi-grid .pkg-kpi-top {
  height: 32px;
  min-height: 32px;
}

.tx-kpi-grid .pkg-kpi-label {
  font-size: 0.7rem;
  line-height: 18px;
  height: 18px;
}

.tx-kpi-grid .pkg-kpi-value {
  font-size: 1.6rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.tx-kpi-grid .pkg-kpi-pills {
  min-height: 22px;
}

.tx-kpi-grid .pkg-kpi-pill {
  font-size: 11.5px;
  line-height: 18px;
  max-height: 22px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* Row 2: Single-Line Compact Corporate Filter Toolbar */
.tx-toolbar-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.04));
  box-sizing: border-box;
  max-height: 66px;
}

.tx-toolbar-row {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  box-sizing: border-box;
  height: 64px;
  max-height: 64px;
}

.tx-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1.6;
  min-width: 260px;
  height: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tx-search-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(59, 130, 246, 0.15));
}

.tx-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 100%;
  color: var(--color-text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

.tx-search-input {
  flex: 1;
  height: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 10px 0 0;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
  min-width: 220px;
  box-sizing: border-box;
}

.tx-search-input::placeholder {
  color: var(--color-text-muted);
  font-size: 12.5px;
}

.tx-method-select {
  width: 145px;
  min-width: 135px;
  height: 40px;
  font-size: 12.5px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
  padding: 0 8px;
}

.tx-status-select {
  width: 125px;
  min-width: 115px;
  height: 40px;
  font-size: 12.5px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
  padding: 0 8px;
}

.tx-date-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.tx-date-input {
  width: 132px;
  height: 40px;
  font-size: 12px;
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
}

.tx-date-sep {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  user-select: none;
}

.tx-limit-select {
  width: 95px;
  min-width: 85px;
  height: 40px;
  font-size: 12.5px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
  padding: 0 6px;
}

.tx-reset-btn {
  height: 40px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Row 3: Corporate Transactions Table */
.tx-table-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  box-sizing: border-box;
}

.tx-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.tx-table-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.tx-table-count {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--color-surface-subtle, #f1f5f9);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.tx-table-wrapper {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.tx-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  font-size: 12.5px;
}

.tx-table thead th,
.tx-table tbody td {
  box-sizing: border-box !important;
  overflow: hidden !important;
  vertical-align: middle !important;
  padding: 10px 10px !important;
}

.tx-table thead th {
  background: var(--color-surface-subtle, #f8fafc) !important;
  color: var(--color-text-secondary, #475569) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em !important;
  border-bottom: 1px solid var(--color-border) !important;
  text-align: left;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

:root[data-theme="dark"] .tx-table thead th {
  background: var(--dark-bg-elevated) !important;
  color: #94a3b8 !important;
  border-bottom-color: var(--dark-border) !important;
}

.tx-table tbody td {
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.tx-table tbody tr:hover td {
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.04));
}

/* Optimized 7-Column Proportions with Zero-Collision Action Column */
.tx-table th.tx-col-payment,
.tx-table td.tx-col-payment,
.tx-col-payment {
  min-width: 110px !important;
  width: auto !important;
}

.tx-table th.tx-col-subscriber,
.tx-table td.tx-col-subscriber,
.tx-col-subscriber {
  min-width: 125px !important;
  max-width: 180px !important;
  width: auto !important;
}

.tx-table th.tx-col-invoice,
.tx-table td.tx-col-invoice,
.tx-col-invoice {
  min-width: 100px !important;
  width: auto !important;
}

.tx-table th.tx-col-channel,
.tx-table td.tx-col-channel,
.tx-col-channel {
  min-width: 110px !important;
  width: auto !important;
}

.tx-table th.tx-col-amount,
.tx-table td.tx-col-amount,
.tx-col-amount,
.tx-amount-col {
  min-width: 85px !important;
  width: auto !important;
  text-align: right !important;
  padding-right: 12px !important;
}

.tx-table th.tx-col-status,
.tx-table td.tx-col-status,
.tx-col-status {
  min-width: 105px !important;
  width: 110px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.tx-table th.tx-col-actions,
.tx-table td.tx-col-actions,
.tx-table th.tx-col-actions:last-child,
.tx-table td.tx-col-actions:last-child,
.tx-col-actions {
  min-width: 250px !important;
  width: 26% !important;
  text-align: right !important;
  padding-right: 14px !important;
  white-space: nowrap !important;
}

.tx-pay-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-pay-num {
  font-weight: 700 !important;
  font-family: var(--font-mono) !important;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 12.5px !important;
  white-space: nowrap !important;
}

.tx-pay-num:hover {
  text-decoration: underline;
}

.tx-pay-date {
  font-size: 11.5px !important;
  color: #64748b !important;
  white-space: nowrap !important;
}

.tx-subscriber-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-width: 100%;
}

.tx-subscriber-name {
  font-weight: 600 !important;
  color: var(--color-text);
  text-decoration: none;
  display: block;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  font-size: 13px !important;
}

.tx-subscriber-name:hover {
  color: var(--color-primary);
}

.tx-subscriber-meta {
  font-size: 11.5px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

.tx-invoice-badge,
.tx-invoice-chip {
  display: inline-block !important;
  max-width: 100% !important;
  padding: 3px 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  font-family: var(--font-mono) !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  color: #334155 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all var(--transition);
}

.tx-invoice-badge:hover,
.tx-invoice-chip:hover {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

:root[data-theme="dark"] .tx-invoice-badge,
:root[data-theme="dark"] .tx-invoice-chip {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

.tx-channel-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-width: 100%;
}

.tx-channel-badge-wrap {
  margin-bottom: 1px;
  white-space: nowrap;
}

.tx-ref-wrap {
  font-size: 11.5px !important;
  color: #64748b !important;
  margin-top: 3px !important;
  font-family: var(--font-mono);
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
}

.tx-amount-val {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap !important;
  color: var(--color-text);
}

.tx-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  white-space: nowrap !important;
  max-width: none !important;
  text-overflow: clip !important;
  overflow: visible !important;
}

.status-dot-completed {
  color: #10b981;
  font-size: 9px;
  line-height: 1;
}

.status-dot-reversed {
  color: #ef4444;
  font-size: 9px;
  line-height: 1;
}

.tx-actions-wrap,
.tx-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.tx-action-btn {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  line-height: 1 !important;
  transition: all var(--transition);
}

.tx-action-btn svg {
  display: none !important;
}

.tx-action-btn.tx-receipt-btn {
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.tx-action-btn.tx-receipt-btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.tx-action-btn.tx-details-btn {
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.04);
}

.tx-action-btn.tx-details-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-primary-dark, #2563eb);
}

.tx-action-btn.tx-reverse-btn {
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}

.tx-action-btn.tx-reverse-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.tx-action-btn.tx-transfer-btn {
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.04);
}

.tx-action-btn.tx-transfer-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: #8b5cf6;
}

/* Reversal Confirmation Modal */
.tx-reversal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 20px;
  box-sizing: border-box;
}

.tx-reversal-dialog {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg, 0 10px 25px -5px rgba(0, 0, 0, 0.1));
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
  margin: auto;
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

.tx-reversal-header {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tx-reversal-warning-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-text);
}

.tx-reversal-warning-title {
  color: #ef4444;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tx-reversal-warning-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  font-size: 12px;
}

/* Responsive adjustments for mobile */
@media (max-width: 1023px) {
  .tx-toolbar-row {
    height: auto;
    max-height: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .tx-search-wrap {
    width: 100%;
    min-width: 100%;
  }
  .tx-method-select,
  .tx-status-select,
  .tx-limit-select {
    flex: 1;
    min-width: 120px;
  }
  .tx-date-group {
    width: 100%;
  }
  .tx-date-input {
    flex: 1;
    width: auto;
  }
}

/* =========================================================================
   PAYMENT GATEWAYS & CHANNELS STUDIO (.gw-)
   ========================================================================= */

#mainContent > .gw-page-container,
.gw-page-container,
.payments-gateways-page {
  padding: 16px 24px 40px;
  box-sizing: border-box;
}

/* Aligned Gateway KPI Grid */
.gw-kpi-grid .pkg-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gw-kpi-grid .pkg-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  min-height: 36px;
  margin-bottom: 8px;
}

.gw-kpi-grid .pkg-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 18px;
  height: 18px;
  margin: 0;
  flex: 1;
}

.gw-kpi-grid .pkg-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 32px;
  height: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 4px 0 8px 0;
}

.gw-kpi-grid .pkg-kpi-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-height: 24px;
  height: 24px;
  overflow: hidden;
  margin-top: auto;
}

.gw-kpi-grid .pkg-kpi-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  height: 22px;
  max-height: 24px;
  box-sizing: border-box;
}

/* Sleek Segmented Studio Tab Bar */
.gw-studio-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.gw-tab-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gw-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
  white-space: nowrap;
}

.gw-tab-btn:hover:not(.active) {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.gw-tab-btn.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-primary, #3b82f6);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .gw-tab-switcher {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .gw-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .gw-tab-btn.active {
  background: var(--dark-bg-elevated);
  color: #60a5fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.gw-tab-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================================================================
   TAB 1: ACCEPTED MFS & BANK ACCOUNTS (Enterprise Table Card + Summary Strip)
   ========================================================================= */

/* Visual Summary Strip */
.gw-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}

:root[data-theme="dark"] .gw-summary-strip {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.gw-summary-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.gw-summary-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gw-summary-dot.dot-emerald {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.gw-summary-dot.dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.gw-summary-dot.dot-purple {
  background: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2);
}

.gw-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.gw-summary-val {
  color: var(--color-text);
  font-weight: 600;
}

.gw-summary-strip-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
}

@media (max-width: 768px) {
  .gw-summary-strip-divider {
    display: none;
  }
}

/* Tab 1 Enterprise Table Card */
.gw-channels-table-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gw-channels-table {
  width: 100%;
  border-collapse: collapse;
}

.gw-channels-table th,
.gw-channels-table td {
  white-space: normal !important;
}

.gw-channels-table th {
  padding: 10px 14px;
}

.gw-channels-table td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
}

.gw-channels-table tbody tr:last-child td {
  border-bottom: none;
}

.gw-channels-table tbody tr:hover td {
  background: var(--color-primary-soft, rgba(59, 130, 246, 0.04));
}

.gw-channel-cell-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gw-channel-brand-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gw-channel-brand-icon.brand-cash {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.gw-channel-brand-icon.brand-bkash {
  background: rgba(209, 32, 83, 0.12);
  color: #d12053;
  border: 1px solid rgba(209, 32, 83, 0.25);
}

.gw-channel-brand-icon.brand-nagad {
  background: rgba(247, 148, 29, 0.12);
  color: #ea580c;
  border: 1px solid rgba(247, 148, 29, 0.25);
}

.gw-channel-brand-icon.brand-rocket {
  background: rgba(140, 52, 148, 0.12);
  color: #8c3494;
  border: 1px solid rgba(140, 52, 148, 0.25);
}

.gw-channel-brand-icon.brand-bank {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

:root[data-theme="dark"] .gw-channel-brand-icon.brand-cash {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

:root[data-theme="dark"] .gw-channel-brand-icon.brand-bkash {
  background: rgba(209, 32, 83, 0.2);
  color: #f472b6;
}

:root[data-theme="dark"] .gw-channel-brand-icon.brand-nagad {
  background: rgba(247, 148, 29, 0.2);
  color: #fb923c;
}

:root[data-theme="dark"] .gw-channel-brand-icon.brand-rocket {
  background: rgba(140, 52, 148, 0.2);
  color: #c084fc;
}

:root[data-theme="dark"] .gw-channel-brand-icon.brand-bank {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

.gw-channel-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gw-channel-name-txt {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.gw-channel-type-subtext {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.gw-account-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gw-account-chip {
  display: inline-block;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

:root[data-theme="dark"] .gw-account-chip {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.gw-bank-subtext {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.gw-channels-table th.gw-col-instructions,
.gw-channels-table td.gw-col-instructions {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  max-width: 260px !important;
  white-space: normal !important;
}

.gw-instructions-text {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.35 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 260px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.gw-channels-table th.gw-col-status,
.gw-channels-table td.gw-col-status {
  min-width: 105px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.gw-channels-table th.gw-col-actions,
.gw-channels-table td.gw-col-actions,
.gw-channels-table th:last-child,
.gw-channels-table td:last-child {
  min-width: 160px !important;
  width: 170px !important;
  text-align: right !important;
  padding-right: 16px !important;
  white-space: nowrap !important;
}

.gw-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  white-space: nowrap !important;
}

.gw-actions-cell .btn {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  gap: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

.gw-inline-copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-secondary);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gw-inline-copy-btn:hover {
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
}

/* =========================================================================
   MODAL OVERLAY & CENTERED DIALOG (#gwChannelModal & #gwConfigModal)
   ========================================================================= */
.gw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
  animation: modalEnter 0.2s ease-out;
}

.gw-modal-dialog {
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto;
  box-sizing: border-box;
}

.gw-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gw-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.gw-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}

.gw-modal-close-btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.gw-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.gw-modal-body .form-group {
  margin-bottom: 14px;
}

.gw-modal-body .form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.gw-modal-body .form-control {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 14px;
  box-sizing: border-box;
  font-size: 13.5px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition, 0.15s);
}

.gw-modal-body textarea.form-control {
  height: auto;
  min-height: 72px;
  padding: 10px 14px;
}

.gw-modal-body .form-control:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(59, 130, 246, 0.15));
}

:root[data-theme="dark"] .gw-modal-body .form-control {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

.gw-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--color-surface-subtle, #f8fafc);
}

:root[data-theme="dark"] .gw-modal-footer {
  background: var(--dark-bg-surface);
}

/* =========================================================================
   TAB 2: ONLINE PAYMENT GATEWAYS (2x2 Graphical Provider Integration Cards)
   ========================================================================= */
.gw-gateways-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

@media (max-width: 1023px) {
  .gw-gateways-grid {
    grid-template-columns: 1fr;
  }
}

.gw-provider-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 195px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color var(--transition, 0.15s ease), box-shadow var(--transition, 0.15s ease);
}

.gw-provider-card:hover {
  border-color: var(--color-primary-soft, rgba(59, 130, 246, 0.4));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.gw-provider-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
}

.gw-provider-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.gw-provider-emblem {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.emblem-bkash {
  background: rgba(209, 32, 83, 0.12);
  color: #d12053;
  border: 1px solid rgba(209, 32, 83, 0.25);
}

.emblem-nagad {
  background: rgba(247, 148, 29, 0.12);
  color: #ea580c;
  border: 1px solid rgba(247, 148, 29, 0.25);
}

.emblem-sslcommerz {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.emblem-shurjopay {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.25);
}

:root[data-theme="dark"] .emblem-bkash {
  background: rgba(209, 32, 83, 0.2);
  color: #f472b6;
  border-color: rgba(209, 32, 83, 0.4);
}

:root[data-theme="dark"] .emblem-nagad {
  background: rgba(247, 148, 29, 0.2);
  color: #fb923c;
  border-color: rgba(247, 148, 29, 0.4);
}

:root[data-theme="dark"] .emblem-sslcommerz {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.4);
}

:root[data-theme="dark"] .emblem-shurjopay {
  background: rgba(147, 51, 234, 0.2);
  color: #c084fc;
  border-color: rgba(147, 51, 234, 0.4);
}

.gw-provider-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.gw-provider-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-provider-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 2px 0 0 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-provider-status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Middle Status & Metadata Strip (Simple, Clean 2-Item Status Strip) */
.gw-provider-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
  min-width: 0;
}

:root[data-theme="dark"] .gw-provider-strip {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.gw-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.gw-strip-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.gw-strip-meta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.gw-provider-strip .gw-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  height: 28px;
}

.gw-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.pill-sandbox {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.pill-defaults {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

:root[data-theme="dark"] .pill-live,
:root[data-theme="dark"] .pill-configured {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

:root[data-theme="dark"] .pill-sandbox {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.4);
}

:root[data-theme="dark"] .pill-defaults {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Provider Footer */
.gw-provider-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  min-width: 0;
  box-sizing: border-box;
}

.gw-footer-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gw-footer-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  height: 32px;
}

.gw-readiness-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-success, #10b981);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  #mainContent > .gw-page-container,
  .gw-page-container,
  .payments-gateways-page {
    padding: 12px 14px 30px;
  }

  .gw-provider-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .gw-provider-strip .gw-copy-btn {
    width: 100%;
    justify-content: center;
  }

  .gw-provider-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .gw-footer-buttons {
    width: 100%;
  }

  .gw-footer-buttons .btn {
    flex: 1;
    justify-content: center;
  }
}

/* Modal Form Controls for Gateway Configuration */
.gw-env-wrap {
  margin-bottom: 14px;
}

.gw-env-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.gw-env-switcher {
  display: inline-flex;
  width: 100%;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

:root[data-theme="dark"] .gw-env-switcher {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.gw-env-btn {
  flex: 1;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.gw-env-btn.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-primary, #3b82f6);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .gw-env-btn.active {
  background: var(--dark-bg-elevated);
  color: #60a5fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.gw-field-group {
  display: flex;
  flex-direction: column;
}

.gw-input-wrap {
  position: relative;
  width: 100%;
}

.gw-input-wrap .form-control {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 40px 0 14px;
  box-sizing: border-box;
  font-size: 13.5px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition, 0.15s);
}

.gw-input-wrap .form-control:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(59, 130, 246, 0.15));
}

:root[data-theme="dark"] .gw-input-wrap .form-control {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

.gw-eye-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s;
}

.gw-eye-toggle-btn:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .gw-eye-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gw-webhook-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gw-webhook-row .form-control {
  flex: 1;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  box-sizing: border-box;
  font-size: 12.5px;
  background: var(--color-surface-subtle, #f8fafc);
  color: var(--color-text);
}

:root[data-theme="dark"] .gw-webhook-row .form-control {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
}

/* Tab Sandbox Layout */
.gw-sim-layout {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1023px) {
  .gw-sim-layout {
    grid-template-columns: 1fr;
  }
}

.gw-sim-form-card,
.gw-sim-result-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.gw-sim-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.gw-sim-form-card .form-control {
  width: 100%;
  height: 42px;
  border: 1px solid rgb(203, 213, 225);
  border-radius: 8px;
  padding: 0 14px;
  box-sizing: border-box;
  font-size: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition, 0.15s);
}

.gw-sim-form-card .form-control:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(59, 130, 246, 0.15));
}

:root[data-theme="dark"] .gw-sim-form-card .form-control {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

.gw-safety-notice {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
}

.gw-empty-sim {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-secondary);
}

.gw-empty-sim-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: var(--color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.sim-result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-success-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--color-success, #10b981);
}

.sim-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--color-surface-subtle);
  border-radius: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.sim-section {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
}

.sim-section-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.sim-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sim-kv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

/* Gateway Studio Brand Badges */
.badge-mfs-bkash {
  background: rgba(209, 32, 83, 0.1);
  color: #d12053;
  border: 1px solid rgba(209, 32, 83, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-mfs-nagad {
  background: rgba(247, 148, 29, 0.1);
  color: #ea580c;
  border: 1px solid rgba(247, 148, 29, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-mfs-rocket {
  background: rgba(140, 52, 148, 0.1);
  color: #8c3494;
  border: 1px solid rgba(140, 52, 148, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-mfs-upay {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-mfs-cash {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-mfs-bank {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

:root[data-theme="dark"] .badge-mfs-bkash {
  background: rgba(209, 32, 83, 0.2);
  color: #f472b6;
  border-color: rgba(209, 32, 83, 0.4);
}

:root[data-theme="dark"] .badge-mfs-nagad {
  background: rgba(247, 148, 29, 0.2);
  color: #fb923c;
  border-color: rgba(247, 148, 29, 0.4);
}

:root[data-theme="dark"] .badge-mfs-rocket {
  background: rgba(140, 52, 148, 0.2);
  color: #c084fc;
  border-color: rgba(140, 52, 148, 0.4);
}

:root[data-theme="dark"] .badge-mfs-upay {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.4);
}

:root[data-theme="dark"] .badge-mfs-cash {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

:root[data-theme="dark"] .badge-mfs-bank {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.4);
}

/* KPI Purple Pill */
.pkg-kpi-pill.pill-purple {
  background: rgba(147, 51, 234, 0.12);
  border-color: rgba(147, 51, 234, 0.25);
  color: #9333ea;
}

:root[data-theme="dark"] .pkg-kpi-pill.pill-purple {
  background: rgba(147, 51, 234, 0.2);
  border-color: rgba(147, 51, 234, 0.35);
  color: #c084fc;
}

/* Tab 3 Duration Segmented Bar */
.gw-duration-pills {
  display: flex;
  gap: 8px;
  width: 100%;
}

.gw-duration-pill {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.gw-duration-pill:hover:not(.active) {
  border-color: var(--color-primary-soft);
  color: var(--color-text);
  background: var(--color-surface-subtle);
}

.gw-duration-pill.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

:root[data-theme="dark"] .gw-duration-pill {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
  color: #94a3b8;
}

:root[data-theme="dark"] .gw-duration-pill:hover:not(.active) {
  background: var(--dark-bg-hover);
  color: #f8fafc;
}

:root[data-theme="dark"] .gw-duration-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

/* =========================================================================
   ENTERPRISE MOBILE BANKING LOG & REASSIGNMENT STUDIO
   Corporate High-Contrast Design, Dual Modals, and Zero-Overflow Layout
   ========================================================================= */

.mbl-page-container {
  padding: 24px;
}

.mbl-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* --- Row 1: KPI Grid & Cards --- */
.mbl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.mbl-kpi-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mbl-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.mbl-kpi-icon-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.mbl-kpi-icon-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.mbl-kpi-icon-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.mbl-kpi-icon-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }

.mbl-kpi-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.mbl-kpi-badge.badge-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.mbl-kpi-badge.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.mbl-kpi-badge.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.mbl-kpi-badge.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }

/* --- Row 2: Status Tabs & Single-Row Filter Toolbar --- */
.mbl-toolbar-card {
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}

.mbl-status-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  overflow-x: auto;
}

.mbl-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #334155);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mbl-status-tab:hover {
  background: var(--color-surface-subtle, #f8fafc);
  border-color: var(--color-primary-soft, #93c5fd);
}

.mbl-status-tab.active {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
  font-weight: 600;
}

.mbl-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.mbl-status-tab.active .mbl-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.mbl-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
}

.mbl-search-wrap {
  position: relative;
  /* RELEASE v80: Proportional search box (flex 1.5, min-width 250px) */
  flex: 1.5;
  min-width: 250px;
  height: 100%;
}

.mbl-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.mbl-search-input {
  width: 100%;
  min-width: 245px;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mbl-search-input:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mbl-provider-select,
.mbl-limit-select,
.mbl-date-input {
  height: 100%;
  box-sizing: border-box;
  font-size: 13px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  padding: 0 10px;
}

.mbl-provider-select {
  min-width: 140px;
  outline: none !important;
  box-shadow: none !important;
}

.mbl-provider-select:not(:focus) {
  outline: none !important;
  box-shadow: none !important;
}

.mbl-provider-select:focus {
  outline: none !important;
  border-color: var(--color-primary, #2563eb) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.mbl-limit-select { min-width: 105px; }

.mbl-date-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.mbl-date-input {
  width: 130px;
  font-family: inherit;
}

.mbl-date-sep {
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
}

.mbl-reset-btn {
  height: 100%;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 500;
}

/* --- Row 3: High-Contrast MFS Log Table --- */
.mbl-table-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.mbl-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.mbl-table-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #1e293b);
}

.mbl-table-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface-subtle, #f1f5f9);
  color: var(--color-text-muted, #475569);
  border-radius: 9999px;
  padding: 2px 8px;
}

.mbl-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mbl-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

.mbl-table th {
  background: var(--color-surface-subtle, #f8fafc);
  color: var(--color-text-muted, #475569);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  white-space: nowrap !important;
  overflow: visible !important;
}

.mbl-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  vertical-align: middle;
  color: var(--color-text, #1e293b);
  white-space: nowrap !important;
  overflow: visible !important;
}

.mbl-table-row:hover td {
  background: var(--color-surface-subtle, #f8fafc);
}

.mbl-row-suspense td {
  background: rgba(245, 158, 11, 0.03);
}

/* RELEASE v80: Proportional 8-column grid budget totaling 100% (table-layout: fixed):
   1. # (4%)
   2. DATE & TIME (12%)
   3. SUBSCRIBER (16%)
   4. AMOUNT (12%)
   5. TRXID & REF (15%)
   6. GATEWAY & SENDER (15%)
   7. STATUS (13%)
   8. ACTIONS (13%) */
.mbl-col-num,
.mbl-table th.mbl-col-num,
.mbl-table td.mbl-col-num {
  width: 4% !important;
  min-width: 36px !important;
  text-align: center !important;
  padding: 11px 4px !important;
}

.mbl-col-date,
.mbl-table th.mbl-col-date,
.mbl-table td.mbl-col-date {
  width: 12% !important;
  min-width: 100px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-col-subscriber,
.mbl-table th.mbl-col-subscriber,
.mbl-table td.mbl-col-subscriber {
  width: 16% !important;
  min-width: 130px !important;
  text-align: left !important;
}

.mbl-col-amount,
.mbl-table th.mbl-col-amount,
.mbl-table td.mbl-col-amount {
  width: 12% !important;
  min-width: 95px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-col-trx-ref,
.mbl-table th.mbl-col-trx-ref,
.mbl-table td.mbl-col-trx-ref {
  width: 15% !important;
  min-width: 120px !important;
  text-align: left !important;
}

.mbl-col-gateway-sender,
.mbl-table th.mbl-col-gateway-sender,
.mbl-table td.mbl-col-gateway-sender {
  width: 15% !important;
  min-width: 120px !important;
  text-align: left !important;
}

.mbl-col-status,
.mbl-table th.mbl-col-status,
.mbl-table td.mbl-col-status {
  width: 13% !important;
  min-width: 110px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.mbl-col-actions,
.mbl-table th.mbl-col-actions,
.mbl-table td.mbl-col-actions,
.mbl-table th.mbl-col-actions:last-child,
.mbl-table td.mbl-col-actions:last-child {
  width: 13% !important;
  min-width: 115px !important;
  text-align: center !important;
  padding-right: 16px !important;
  white-space: nowrap !important;
}

.mbl-sub-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
}

.mbl-sub-stack .mbl-sub-name-bold {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text, #1e293b);
  white-space: nowrap;
}

:root[data-theme="dark"] .mbl-sub-stack .mbl-sub-name-bold {
  color: #f1f5f9;
}

.mbl-trx-ref-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
}

.mbl-trx-bold {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text, #1e293b);
  white-space: nowrap;
}

:root[data-theme="dark"] .mbl-trx-bold {
  color: #f1f5f9;
}

.mbl-ref-pill-clean {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  background: var(--color-surface-subtle, #f1f5f9);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border, #e2e8f0);
  display: inline-block;
  white-space: nowrap;
}

:root[data-theme="dark"] .mbl-ref-pill-clean {
  background: var(--dark-bg-elevated);
  color: #94a3b8;
  border-color: var(--dark-border);
}

.mbl-gw-sender-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
}

.mbl-date-wrap { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; line-height: 1.2; }
.mbl-date-day { font-size: 12px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.mbl-date-time {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
}
.mbl-sub-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mbl-sub-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mbl-sub-id-row .mbl-cust-badge { flex-shrink: 0; }
.mbl-sub-id-row .mbl-cust-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mbl-cust-badge {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  padding: 1px 6px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
  line-height: 1.4;
}
.mbl-cust-badge:hover {
  background: rgba(37, 99, 235, 0.16);
  text-decoration: none;
}
.mbl-cust-sub { font-size: 11px; color: var(--color-text-muted, #64748b); }

.mbl-amount-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.mbl-trx-action-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mbl-trx-val {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mbl-quick-action-slot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
}

.mbl-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 26px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  box-sizing: border-box;
}

.mbl-transfer-btn {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  justify-content: center !important;
}

.mbl-btn-transfer {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mbl-btn-transfer:hover {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.25);
}

.mbl-btn-assign {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.mbl-btn-assign:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.mbl-no-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--color-surface-subtle, #f1f5f9);
  color: var(--color-text-muted, #64748b);
  border: 1px solid var(--color-border, #e2e8f0);
  text-align: center;
  box-sizing: border-box;
  user-select: none;
}

:root[data-theme="dark"] .mbl-no-action-chip {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}

.mbl-action-settled {
  color: #059669;
  display: flex;
  align-items: center;
}

.mbl-status-ref-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mbl-ref-pill {
  font-size: 11px;
  color: var(--color-text-muted, #475569);
  background: var(--color-surface-subtle, #f1f5f9);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
  border: 1px solid var(--color-border, #e2e8f0);
}

.mbl-sub-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  display: block;
}

/* DEFECT B FIX: wallet pill now lives under the bold amount in the compact
   AMOUNT column (rendered only when a wallet balance is known). */
.mbl-amount-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.mbl-wallet-pill {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
  white-space: nowrap;
}

/* DEFECT B FIX: sender number is bold monospace; missing numbers render as
   muted "Counter / Manual" (manual/counter rows) or em dash. */
.mbl-sender-val {
  font-weight: 600;
}

/* Status Badges */
.badge-mbl-processed {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.badge-mbl-suspense {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.badge-mbl-suspense-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
}

.badge-mbl-transferred {
  background: rgba(147, 51, 234, 0.12);
  color: #6b21a8;
  border: 1px solid rgba(147, 51, 234, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.badge-mbl-reversed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.badge-mbl-failed {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

/* Gateway Brand Badges */
.badge-mfs-bkash { background: rgba(226, 19, 110, 0.1); color: #be185d; border: 1px solid rgba(226, 19, 110, 0.25); }
.badge-mfs-nagad { background: rgba(247, 148, 29, 0.12); color: #c2410c; border: 1px solid rgba(247, 148, 29, 0.3); }
.badge-mfs-rocket { background: rgba(140, 43, 137, 0.1); color: #86198f; border: 1px solid rgba(140, 43, 137, 0.25); }
.badge-mfs-upay { background: rgba(0, 168, 232, 0.1); color: #0369a1; border: 1px solid rgba(0, 168, 232, 0.25); }
.badge-mfs-sslcommerz { background: rgba(30, 58, 138, 0.1); color: #1e40af; border: 1px solid rgba(30, 58, 138, 0.25); }
.badge-mfs-shurjopay { background: rgba(13, 148, 136, 0.1); color: #0f766e; border: 1px solid rgba(13, 148, 136, 0.25); }

/* Pagination */
.mbl-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.mbl-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbl-page-cur {
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
  padding: 0 4px;
}

/* State cells */
.mbl-state-cell {
  text-align: center;
  padding: 40px 16px !important;
}

.mbl-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mbl-empty-title {
  margin: 6px 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #334155);
}

.mbl-empty-desc {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted, #64748b);
}

/* =========================================================================
   DUAL MODALS: TRANSFER STUDIO & ASSIGN MODAL
   ========================================================================= */

.mbl-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  box-sizing: border-box;
}

.mbl-dialog {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.mbl-studio-dialog { max-width: 820px; }
.mbl-assign-dialog { max-width: 680px; }

.mbl-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
}

.mbl-dialog-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mbl-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mbl-icon-transfer { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.mbl-icon-assign { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

.mbl-dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.mbl-dialog-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
}

.mbl-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted, #94a3b8);
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.mbl-close-btn:hover { color: var(--color-text, #0f172a); }

.mbl-dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.mbl-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface-subtle, #f8fafc);
}

/* Top Banner: Transaction Details Grid */
.mbl-tx-banner-card {
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.mbl-tx-banner-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 8px;
}

.mbl-tx-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 14px;
}

.mbl-detail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mbl-detail-k {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
}

.mbl-detail-v {
  font-size: 12.5px;
  color: var(--color-text, #0f172a);
}

/* Studio 2-Column Grid */
.mbl-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mbl-studio-card {
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.mbl-from-card {
  border-color: rgba(225, 29, 72, 0.25);
  background: rgba(255, 241, 242, 0.3);
}

.mbl-to-card {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(239, 246, 255, 0.3);
}

.mbl-studio-card-head {
  margin-bottom: 12px;
}

.mbl-studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
}

.mbl-badge-from { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.mbl-badge-to { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }

.mbl-subscriber-meta-box {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  padding: 12px;
}

.mbl-sub-main-info {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
}

.mbl-sub-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.mbl-cust-tag {
  background: var(--color-surface-subtle, #f1f5f9);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.mbl-sub-name-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}

.mbl-sub-pppoe {
  font-size: 11px;
}

.mbl-sub-details-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mbl-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.mbl-sub-row .mbl-label {
  color: var(--color-text-muted, #64748b);
}

.mbl-rollback-box {
  margin-top: 10px;
  padding: 10px;
  background: rgba(225, 29, 72, 0.05);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 6px;
}

.mbl-projected-box {
  margin-top: 10px;
  padding: 10px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
}

.mbl-box-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #be123c;
}

.mbl-projected-box .mbl-box-title {
  color: #047857;
}

.mbl-rollback-details,
.mbl-projected-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mbl-warning-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  color: #d97706;
}

/* Auto-suggest dropdown */
.mbl-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mbl-search-icon-inline {
  position: absolute;
  left: 10px;
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
}

.mbl-input-search {
  padding-left: 32px !important;
  font-size: 12.5px;
}

.mbl-autosuggest-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 2200;
}

.mbl-suggest-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  transition: background 0.1s ease;
}

.mbl-suggest-item:last-child { border-bottom: none; }
.mbl-suggest-item:hover { background: var(--color-surface-subtle, #f1f5f9); }

.mbl-suggest-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.mbl-suggest-sub {
  font-size: 11px;
  margin-top: 2px;
}

.mbl-suggest-none {
  cursor: default;
  color: var(--color-text-muted, #64748b);
  font-size: 12px;
}

.mbl-empty-target-box {
  padding: 24px 16px;
  text-align: center;
  border: 1px dashed var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text-muted, #64748b);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mbl-smart-suggest-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mbl-smart-suggest-chip:hover {
  background: rgba(59, 130, 246, 0.15);
}

.mbl-chip-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #1d4ed8;
}

.mbl-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text, #1e293b);
}

.mbl-error-banner {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  font-size: 12px;
}

/* =========================================================================
   DARK THEME OVERRIDES FOR MOBILE BANKING LOG
   ========================================================================= */
:root[data-theme="dark"] .mbl-kpi-card,
:root[data-theme="dark"] .mbl-toolbar-card,
:root[data-theme="dark"] .mbl-table-card {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-table th {
  background: var(--dark-bg-elevated);
  color: #94a3b8;
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-table td {
  border-color: var(--dark-border);
  color: #f1f5f9;
}

:root[data-theme="dark"] .mbl-table-row:hover td {
  background: var(--dark-bg-hover);
}

:root[data-theme="dark"] .mbl-cust-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

:root[data-theme="dark"] .mbl-ref-pill {
  background: var(--dark-bg-elevated);
  color: #94a3b8;
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-amount-val {
  color: #f8fafc;
}

:root[data-theme="dark"] .mbl-sub-name {
  color: #f1f5f9;
}

:root[data-theme="dark"] .mbl-search-input,
:root[data-theme="dark"] .mbl-provider-select,
:root[data-theme="dark"] .mbl-limit-select,
:root[data-theme="dark"] .mbl-date-input {
  background: var(--dark-bg-subtle);
  border-color: var(--dark-border-strong);
  color: #f8fafc;
}

:root[data-theme="dark"] .mbl-status-tab {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
  color: #94a3b8;
}

:root[data-theme="dark"] .mbl-status-tab:hover {
  background: var(--dark-bg-hover);
  color: #f8fafc;
}

:root[data-theme="dark"] .mbl-status-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

:root[data-theme="dark"] .mbl-dialog {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
  color: #f8fafc;
}

:root[data-theme="dark"] .mbl-dialog-header,
:root[data-theme="dark"] .mbl-dialog-footer {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-tx-banner-card {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-detail-v {
  color: #f8fafc;
}

:root[data-theme="dark"] .mbl-from-card {
  background: rgba(136, 19, 55, 0.2);
  border-color: rgba(225, 29, 72, 0.4);
}

:root[data-theme="dark"] .mbl-to-card {
  background: rgba(30, 58, 138, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

:root[data-theme="dark"] .mbl-subscriber-meta-box {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-autosuggest-dropdown {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .mbl-suggest-item:hover {
  background: var(--dark-bg-hover);
}

:root[data-theme="dark"] .mbl-empty-target-box {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

@media (max-width: 900px) {
  .mbl-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mbl-filter-row {
    flex-wrap: wrap;
    height: auto;
  }
  .mbl-studio-grid {
    grid-template-columns: 1fr;
  }
  .mbl-tx-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .mbl-kpi-grid {
    grid-template-columns: 1fr;
  }
  .mbl-tx-details-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MULTI-ROUTER & NAS STUDIO (STEP 1: /network/routers & /router)
   ========================================================================== */
.router-studio-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.router-fleet-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.router-fleet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-wrap: wrap;
}

.router-fleet-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.router-fleet-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.router-fleet-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.router-fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
  min-width: 780px;
}

.router-fleet-table th {
  padding: 12px 16px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.router-fleet-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.router-fleet-table tr:hover td {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.02));
}

.router-fleet-table tr.active-fleet-row td {
  background: rgba(37, 99, 235, 0.05);
}

.router-fleet-table tr.active-fleet-row td:first-child {
  border-left: 3px solid var(--color-primary, #2563eb);
}

.badge-isp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary, #2563eb);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-reseller {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-primary-star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
}

.workspace-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(99, 102, 241, 0.04));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
}

.workspace-active-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.uplink-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-family: var(--font-mono);
}

.fleet-action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.3;
  border-radius: var(--radius-sm, 4px);
}

/* 2x2 Active Router Workspace Studio Grid */
.router-studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .router-studio-grid {
    grid-template-columns: 1fr;
  }
}

.studio-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:root[data-theme="dark"] .studio-card {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.studio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  flex-wrap: wrap;
}

:root[data-theme="dark"] .studio-card-header {
  border-bottom-color: var(--dark-border);
}

.studio-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studio-icon-box {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.studio-icon-purple {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
}

.studio-icon-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.studio-icon-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.studio-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  margin: 0;
  line-height: 1.3;
}

:root[data-theme="dark"] .studio-card-title {
  color: #f8fafc;
}

.studio-card-subtitle {
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
  margin-top: 2px;
}

.studio-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill-connected {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

:root[data-theme="dark"] .status-pill-connected {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-pill-disconnected {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

:root[data-theme="dark"] .status-pill-disconnected {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}

.studio-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.studio-btn-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.studio-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.studio-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-progress-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary, #475569);
}

:root[data-theme="dark"] .studio-progress-label-wrap {
  color: #cbd5e1;
}

.studio-progress-track {
  width: 100%;
  height: 8px;
  background: var(--color-background, #f1f5f9);
  border-radius: 9999px;
  overflow: hidden;
}

:root[data-theme="dark"] .studio-progress-track {
  background: var(--dark-bg-elevated);
}

.studio-progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.3s ease;
}

.studio-progress-bar.emerald {
  background: linear-gradient(90deg, #10b981, #059669);
}

.studio-metadata-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.studio-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--color-background, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  box-sizing: border-box;
}

:root[data-theme="dark"] .studio-meta-item {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.studio-meta-label {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.studio-meta-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

:root[data-theme="dark"] .studio-meta-val {
  color: #f8fafc;
}

.studio-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.studio-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--color-background, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  box-sizing: border-box;
}

:root[data-theme="dark"] .studio-status-item {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

.studio-status-label {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.2;
}

.studio-status-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root[data-theme="dark"] .studio-status-value {
  color: #f8fafc;
}

/* Uplink Interfaces (Card 3) Interactive Grid/List */
.uplink-interfaces-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  max-height: 170px;
  overflow-y: auto;
  padding-right: 4px;
}

.uplink-interface-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--color-background, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.uplink-interface-row:hover {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.04);
}

.uplink-interface-row.selected {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
}

:root[data-theme="dark"] .uplink-interface-row {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .uplink-interface-row:hover {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
}

:root[data-theme="dark"] .uplink-interface-row.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.18);
}

.studio-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

:root[data-theme="dark"] .studio-card-footer {
  border-top-color: var(--dark-border);
}

.btn-outline-primary {
  background: transparent;
  color: var(--color-primary, #2563eb);
  border: 1px solid var(--color-primary, #2563eb);
}

.btn-outline-primary:hover {
  background: rgba(37, 99, 235, 0.08);
}

@media (max-width: 600px) {
  .studio-metadata-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .studio-meta-item {
    padding: 8px 10px;
  }
  .studio-status-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .studio-progress-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===========================================================================
   ITEM 5 — Router Studio compact KPI cards + 36px horizontal key-value pills.
   Scoped under .router-studio-container so POS / Recon / Transactions /
   Gateway pages sharing .pkg-kpi-card are untouched.
   =========================================================================== */
.router-studio-container .pkg-kpi-card {
  padding: 13px 16px;
  gap: 6px;
  min-height: 112px;
  height: 112px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.router-studio-container .pkg-kpi-top {
  height: 30px;
  min-height: 30px;
  gap: 8px;
}

.router-studio-container .pkg-kpi-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 7px;
}

.router-studio-container .pkg-kpi-label {
  font-size: 10.5px;
  line-height: 14px;
  height: auto;
}

.router-studio-container .pkg-kpi-value {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.router-studio-container .pkg-kpi-pills {
  min-height: 22px;
  overflow: hidden;
}

/* 36px single-line horizontal key-value pills (Card 1 + Card 2 telemetry) */
.router-studio-container .studio-meta-item,
.router-studio-container .studio-status-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  gap: 10px;
}

:root[data-theme="dark"] .router-studio-container .studio-meta-item,
:root[data-theme="dark"] .router-studio-container .studio-status-item {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

.router-studio-container .studio-meta-label,
.router-studio-container .studio-status-label {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1;
  flex-shrink: 0;
}

.router-studio-container .studio-meta-val,
.router-studio-container .studio-status-value {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: #334155;
  line-height: 1;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root[data-theme="dark"] .router-studio-container .studio-meta-val,
:root[data-theme="dark"] .router-studio-container .studio-status-value {
  color: #f8fafc;
}

@media (max-width: 600px) {
  .router-studio-container .studio-meta-item,
  .router-studio-container .studio-status-item {
    padding: 0 10px;
  }
}
/* ==========================================================================
   STEP 2 — Active PPPoE & BRAS Sessions Studio (/network/sessions)
   Scoped under .nses-page-container — every other studio page is untouched.
   Design language: /payments/mobile-banking-log + /network/routers
   (compact corporate KPI cards, segmented tabs, 40px filter bar, crisp
   10-column single-line table with 0px horizontal overflow @1366x768).
   ========================================================================== */

/* --- Scoped utility shims (used by this page only) --- */
.nses-page-container .font-mono,
.nses-page-container .nses-table .font-mono {
  font-family: var(--font-mono);
}

.nses-page-container .text-info { color: #2563eb; }
.nses-page-container .text-purple { color: #9333ea; }

:root[data-theme="dark"] .nses-page-container .text-info { color: #60a5fa; }
:root[data-theme="dark"] .nses-page-container .text-purple { color: #c084fc; }

/* --- Compact Executive KPI Cards (~112px, mirrors router-studio) --- */
.nses-page-container .nses-kpi-grid {
  margin-bottom: 20px;
}

.nses-page-container .pkg-kpi-card {
  padding: 13px 16px;
  gap: 6px;
  min-height: 112px;
  height: 112px;
}

.nses-page-container .pkg-kpi-top {
  height: 30px;
  min-height: 30px;
  gap: 8px;
}

.nses-page-container .pkg-kpi-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 7px;
}

.nses-page-container .pkg-kpi-label {
  font-size: 10.5px;
  line-height: 14px;
  height: auto;
}

.nses-page-container .nses-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 24px;
}

.nses-page-container .pkg-kpi-value {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.nses-page-container .pkg-kpi-pills {
  min-height: 22px;
  overflow: hidden;
}

.nses-page-container .pkg-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nses-page-container .pkg-kpi-pill.badge-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.nses-page-container .pkg-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nses-page-container .pkg-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }

/* --- Header: Auto-Refresh Toggle Pill --- */
.nses-autorefresh-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nses-autorefresh-pill:hover {
  background: rgba(16, 185, 129, 0.16);
}

.nses-autorefresh-pill.paused {
  border-color: var(--color-border, #e2e8f0);
  background: var(--color-surface-subtle, #f8fafc);
  color: var(--color-text-muted, #64748b);
}

.nses-refresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  animation: nsesPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.nses-refresh-dot.paused {
  background: #94a3b8;
  box-shadow: none;
  animation: none;
}

@keyframes nsesPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* --- Row 2: Status Tabs & Single-Row Filter Bar --- */
.nses-toolbar-card {
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}

.nses-status-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  overflow-x: auto;
}

.nses-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #334155);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nses-status-tab:hover {
  background: var(--color-surface-subtle, #f8fafc);
  border-color: var(--color-primary-soft, #93c5fd);
}

.nses-status-tab.active {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
  font-weight: 600;
}

.nses-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.nses-status-tab.active .nses-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nses-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
}

.nses-search-wrap {
  position: relative;
  flex: 1.8;
  min-width: 300px;
  height: 100%;
}

.nses-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.nses-search-input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nses-search-input:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nses-router-select {
  height: 100%;
  box-sizing: border-box;
  font-size: 13px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  padding: 0 10px;
  width: 230px;
  min-width: 175px;
  max-width: 230px;
  flex: 0 0 auto;
}

.nses-reset-btn {
  height: 100%;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 500;
}

/* --- Row 3: Crisp 10-Column Single-Line Sessions Table --- */
.nses-table-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.nses-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.nses-table-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #1e293b);
}

.nses-table-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface-subtle, #f1f5f9);
  color: var(--color-text-muted, #475569);
  border-radius: 9999px;
  padding: 2px 8px;
}

.nses-snapshot-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.nses-snapshot-hint.stale {
  color: var(--color-text-muted, #64748b);
  background: var(--color-surface-subtle, #f1f5f9);
  border-color: var(--color-border, #e2e8f0);
}

.nses-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nses-table {
  width: 100%;
  /* Fixed layout pins the 10 columns to their budgeted widths (sums to
     1066px of the 1092px container at 1366x768), mathematically guaranteeing
     0px horizontal overflow. */
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.nses-table th {
  background: var(--color-surface-subtle, #f8fafc);
  color: var(--color-text-muted, #475569);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nses-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  vertical-align: middle;
  color: var(--color-text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nses-table-row:hover td {
  background: var(--color-surface-subtle, #f8fafc);
}

.nses-row-drift td {
  background: rgba(244, 63, 94, 0.035);
}

.nses-row-pool td {
  background: rgba(245, 158, 11, 0.035);
}

.nses-table-row.nses-row-drift:hover td,
.nses-table-row.nses-row-pool:hover td {
  background: var(--color-surface-subtle, #f8fafc);
}

/* 10-column width budget for the 1092px container @1366x768:
   36 + 130 + 118 + 96 + 100 + 130 + 112 + 118 + 96 + 108 = 1044px (0px overflow) */
.nses-col-num { width: 3.5%; text-align: center; }
.nses-col-sub { width: 14.0%; }
.nses-col-user { width: 12.0%; }
.nses-col-pop { width: 9.5%; }
.nses-col-ip { width: 10.0%; }
.nses-col-mac { width: 12.5%; }
.nses-col-profile { width: 11.0%; }
.nses-col-data { width: 11.0%; }
.nses-col-uptime { width: 8.5%; }
.nses-col-action { width: 8.0%; text-align: center; }
/* The shared .packages-table th:last-child { width: 1% } rule would crush the
   final ACTION column (the sessions table carries both classes); re-pin the
   budgeted width with higher specificity so the column is never squeezed. */
.nses-table th.nses-col-action:last-child,
.nses-table td.nses-col-action:last-child {
  width: 8.0%;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.nses-table td.nses-col-mac {
  padding-left: 8px;
  padding-right: 8px;
}

/* --- Cell internals --- */
.nses-sub-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nses-cust-badge {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  padding: 1px 6px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
  line-height: 1.4;
  width: fit-content;
  max-width: 100%;
}

.nses-cust-badge:hover {
  background: rgba(37, 99, 235, 0.16);
  text-decoration: none;
}

.nses-sub-name {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nses-user-val,
.nses-ip-val,
.nses-mac-val {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nses-table td.nses-col-mac .nses-mac-val {
  font-size: 11px;
}

.nses-pop-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(100, 116, 139, 0.10);
  color: var(--color-text, #334155);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nses-profile-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nses-pool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nses-data-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nses-data-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nses-data-val.nses-data-ul {
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
}

.nses-livenas-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.10);
  color: #059669;
  white-space: nowrap;
}

.nses-uptime-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nses-uptime-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text, #1e293b);
}

.nses-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}

.nses-badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.nses-badge-aaa {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.nses-badge-drift {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
}

/* --- Action buttons --- */
.nses-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  background: transparent;
}

.nses-btn-disconnect {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.05);
}

.nses-btn-disconnect:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.55);
}

.nses-btn-ghost {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.05);
}

.nses-btn-ghost:hover {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.55);
}

.nses-btn-ghost-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #d97706;
  border: 1px solid #d97706;
  color: #ffffff;
}

.nses-btn-ghost-solid:hover {
  background: #b45309;
}

/* --- State cells --- */
.nses-state-cell {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--color-text-muted, #64748b);
}

.nses-loading-wrap,
.nses-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.nses-loading-wrap {
  flex-direction: row;
  justify-content: center;
  font-size: 13px;
}

.nses-empty-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #1e293b);
}

.nses-empty-desc {
  font-size: 12.5px;
  margin: 0;
  color: var(--color-text-muted, #64748b);
}

.nses-error-cell {
  color: #dc2626;
}

/* --- Confirm Dialog --- */
.nses-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.nses-dialog-overlay.active {
  display: flex;
}

.nses-dialog {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.nses-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
}

.nses-dialog-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.nses-header-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nses-icon-disconnect {
  background: rgba(220, 38, 38, 0.10);
  color: #dc2626;
}

.nses-icon-ghost {
  background: rgba(217, 119, 6, 0.10);
  color: #d97706;
}

.nses-dialog-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--color-text, #1e293b);
}

.nses-dialog-subtitle {
  font-size: 12px;
  margin: 0;
  color: var(--color-text-muted, #64748b);
  line-height: 1.45;
}

.nses-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.nses-close-btn:hover {
  background: var(--color-surface-subtle, #f1f5f9);
  color: var(--color-text, #334155);
}

.nses-dialog-body {
  padding: 16px 20px;
}

.nses-confirm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  margin-bottom: 12px;
}

.nses-banner-coa {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.nses-banner-ghost {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.nses-confirm-username {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}

.nses-confirm-mode {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #dc2626;
  white-space: nowrap;
}

.nses-banner-ghost .nses-confirm-mode {
  color: #d97706;
}

.nses-confirm-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--color-text-muted, #475569);
  margin-bottom: 14px;
}

.nses-confirm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text, #334155);
  cursor: pointer;
}

.nses-confirm-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary, #2563eb);
  cursor: pointer;
}

.nses-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--color-border, #f1f5f9);
}

/* --- Dark theme overrides --- */
:root[data-theme="dark"] .nses-toolbar-card,
:root[data-theme="dark"] .nses-table-card {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .nses-search-input,
:root[data-theme="dark"] .nses-router-select {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border-strong);
  color: var(--color-text, #e2e8f0);
}

:root[data-theme="dark"] .nses-status-tab {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
  color: var(--color-text, #e2e8f0);
}

:root[data-theme="dark"] .nses-status-tab.active {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #ffffff;
}

:root[data-theme="dark"] .nses-table th {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--dark-border);
}

:root[data-theme="dark"] .nses-table td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .nses-table-row:hover td {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .nses-pop-badge {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

:root[data-theme="dark"] .nses-profile-pill {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

:root[data-theme="dark"] .nses-pool-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

:root[data-theme="dark"] .nses-data-val {
  color: #e2e8f0;
}

:root[data-theme="dark"] .nses-cust-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

:root[data-theme="dark"] .nses-dialog {
  background: var(--dark-bg-surface);
  border-color: var(--dark-border);
}

:root[data-theme="dark"] .nses-confirm-username {
  color: #e2e8f0;
}

:root[data-theme="dark"] .nses-close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* --- Responsive (compact workspaces) --- */
@media (max-width: 1024px) {
  .nses-page-container .pkg-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nses-filter-row {
    height: auto;
    flex-wrap: wrap;
  }

  .nses-search-wrap {
    min-width: 100%;
    height: 40px;
  }

  .nses-router-select,
  .nses-reset-btn {
    height: 40px;
  }

  .nses-page-container .pkg-kpi-grid {
    grid-template-columns: 1fr;
  }

  .nses-page-container .pkg-kpi-card {
    height: auto;
    min-height: 100px;
  }
}

/* ==========================================================================
   NETWORK MODULE: STEP 3 OF 5 — IP POOLS & SUBNETS STUDIO (.nip-*)
   Scoped under .nip-page-container — keeps all other studio pages untouched.
   ========================================================================== */

.nip-page-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nip-page-container .font-mono:not(.pkg-kpi-value):not(.nip-kpi-value),
.nip-page-container .nip-table .font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.nip-page-container .pkg-kpi-value,
.nip-kpi-value {
  font-family: inherit !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin: 0;
}

.nip-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.nip-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 18px 16px 18px !important;
  min-height: 112px !important;
  height: auto !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: visible !important;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nip-kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.nip-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0px !important;
}

.nip-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nip-kpi-icon.icon-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nip-kpi-icon.icon-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nip-kpi-icon.icon-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.nip-kpi-icon.icon-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.nip-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.nip-kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.nip-kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.1;
}

.nip-kpi-pills {
  margin-top: 2px !important;
  margin-bottom: 0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2 !important;
}

.nip-kpi-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2 !important;
}

.nip-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nip-kpi-pill.badge-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.nip-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nip-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }

/* Toolbar & Filter Row */
.nip-toolbar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nip-status-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  overflow-x: auto;
}

.nip-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.nip-status-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-hover);
}

.nip-status-tab.active {
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  font-weight: 600;
}

.nip-tab-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
}

.nip-status-tab.active .nip-tab-count {
  background: #2563eb;
  color: #ffffff;
}

.nip-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.nip-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 260px;
  height: 40px;
}

.nip-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.nip-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.nip-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.nip-router-select,
select.nip-router-select,
.nip-filter-row .nip-router-select {
  width: 220px !important;
  flex: 0 0 220px !important;
  max-width: 220px !important;
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-sizing: border-box;
}

.nip-reset-btn {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* Table Card & Structure */
.nip-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.nip-table-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.nip-table-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary);
}

.nip-table-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
}

.nip-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.nip-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  margin: 0;
}

.nip-table th {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: var(--color-surface-hover);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
  box-sizing: border-box;
}

.nip-table td {
  padding: 8px 8px;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.nip-table-row:hover td {
  background: var(--color-surface-hover);
}

/* Exact 9 Columns sizing */
.nip-col-num { width: 3.5%; text-align: center; }
.nip-col-name { width: 16.0%; }
.nip-col-pop { width: 10.0%; }
.nip-col-family { width: 7.5%; }
.nip-col-range { width: 17.5%; font-size: 11.5px; }
.nip-col-util { width: 12.5%; }
.nip-col-purpose { width: 10.0%; }
.nip-col-sync { width: 9.0%; }
.nip-col-actions { width: 14.0%; text-align: right; }
.nip-table th.nip-col-actions { text-align: right !important; }

.nip-pool-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nip-pool-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 12.5px;
  white-space: nowrap;
}

.nip-next-tag {
  font-size: 10px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}

.nip-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nip-badge-pop {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  font-weight: 500;
}

.nip-badge-v4 {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-weight: 600;
}

.nip-badge-v6-56 {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  font-weight: 600;
}

.nip-badge-v6-64 {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  font-weight: 600;
}

.nip-badge-purpose-normal {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.nip-badge-purpose-expired {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  font-weight: 600;
}

.nip-badge-purpose-slow {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.nip-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.nip-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(100, 116, 139, 0.18);
  border-radius: 3px;
  overflow: hidden;
}

.nip-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.nip-progress-bar.bar-emerald { background: #10b981; }
.nip-progress-bar.bar-amber { background: #f59e0b; }
.nip-progress-bar.bar-red { background: #ef4444; }

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

.nip-action-btn-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  vertical-align: middle;
}

.nip-btn-quick-expired {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 5px;
  height: 26px;
  line-height: 20px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: all var(--transition);
}

.nip-btn-quick-expired:hover {
  background: #f59e0b;
  color: #ffffff;
}

.nip-icon-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  box-sizing: border-box;
  transition: all var(--transition);
}

.nip-icon-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-hover);
  border-color: var(--color-text-muted);
}

.nip-icon-btn.btn-delete:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Modal form controls */
.nip-family-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  margin-bottom: 14px;
}

.nip-family-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.nip-family-toggle-btn.active {
  background: var(--color-primary);
  color: #ffffff;
}

.nip-capacity-preview {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dark Theme Overrides */
:root[data-theme="dark"] .nip-badge-pop {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

:root[data-theme="dark"] .nip-kpi-icon.icon-blue { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nip-kpi-icon.icon-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nip-kpi-icon.icon-purple { background: rgba(147, 51, 234, 0.18); color: #c084fc; }
:root[data-theme="dark"] .nip-kpi-icon.icon-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

:root[data-theme="dark"] .nip-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nip-kpi-pill.badge-blue { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nip-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
:root[data-theme="dark"] .nip-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.18); color: #c084fc; }

:root[data-theme="dark"] .nip-status-tab.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

:root[data-theme="dark"] .nip-badge-v4 { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nip-badge-v6-56 { background: rgba(168, 85, 247, 0.18); color: #c084fc; }
:root[data-theme="dark"] .nip-badge-v6-64 { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
:root[data-theme="dark"] .nip-badge-purpose-normal { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nip-badge-purpose-expired { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
:root[data-theme="dark"] .nip-capacity-preview {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .nip-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nip-kpi-grid {
    grid-template-columns: 1fr;
  }
  .nip-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .nip-search-wrap,
  .nip-router-select,
  .nip-reset-btn {
    width: 100%;
    min-width: 100%;
  }
}


/* ==========================================================================
   NETWORK MODULE: STEP 4 OF 5 — RADIUS & AAA STUDIO (.nrad-*)
   Scoped under .nrad-page-container — keeps all other studio pages untouched.
   ========================================================================== */

.nrad-page-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nrad-page-container .font-mono:not(.pkg-kpi-value):not(.nrad-kpi-value),
.nrad-page-container .nrad-table .font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.nrad-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: nowrap !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin-bottom: 20px;
}

.nrad-header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nrad-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
}

.nrad-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 4px 0 0 0;
}

.nrad-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

.nrad-header-actions .btn {
  height: 36px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Executive KPI Grid matching /network/routers and /network/ip-pools */
.nrad-page-container .pkg-kpi-grid,
.nrad-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.nrad-page-container .pkg-kpi-card,
.nrad-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: 13px 16px;
  min-height: 112px;
  height: 112px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nrad-page-container .pkg-kpi-card:hover,
.nrad-kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.nrad-page-container .pkg-kpi-top,
.nrad-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  min-height: 30px;
  gap: 8px;
  margin-bottom: 0;
}

.nrad-page-container .pkg-kpi-icon,
.nrad-kpi-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nrad-kpi-icon.icon-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nrad-kpi-icon.icon-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nrad-kpi-icon.icon-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.nrad-kpi-icon.icon-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.nrad-kpi-icon.icon-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.nrad-page-container .pkg-kpi-label,
.nrad-kpi-label {
  font-size: 10.5px;
  line-height: 14px;
  height: auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.nrad-kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.nrad-page-container .pkg-kpi-value,
.nrad-kpi-value {
  font-family: inherit !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin: 0;
}

.nrad-page-container .pkg-kpi-pills,
.nrad-kpi-pills {
  min-height: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  flex-wrap: nowrap;
}

.nrad-page-container .pkg-kpi-pill,
.nrad-kpi-pill {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  height: 22px;
  max-height: 24px;
  box-sizing: border-box;
}

.nrad-kpi-pill.pill-success,
.pkg-kpi-pill.pill-success { background: rgba(16, 185, 129, 0.12); color: #059669; }

.nrad-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nrad-kpi-pill.badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nrad-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nrad-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.nrad-kpi-pill.badge-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.nrad-kpi-pill.badge-rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }

/* Studio Tabs Bar */
.nrad-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  margin-bottom: 8px;
}

.nrad-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.nrad-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition);
}

.nrad-tab-btn:hover {
  color: var(--color-text-primary);
}

.nrad-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.nrad-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05));
  color: var(--color-text-secondary);
}

.nrad-tab-btn.active .nrad-tab-count {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
}

/* Single-Row Filter Bar */
.nrad-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 14px;
}

.nrad-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  height: 40px;
}

.nrad-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
}

.nrad-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--transition);
}

.nrad-search-input:focus {
  border-color: var(--color-primary);
}

.nrad-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  min-width: 160px;
}

.nrad-reset-btn {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all var(--transition);
}

.nrad-reset-btn:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.03));
  color: var(--color-text-primary);
}

/* Tables */
.nrad-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow-x: auto;
  width: 100% !important;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}

.nrad-table {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  text-align: left;
}

.nrad-table th {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.nrad-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  color: var(--color-text-primary);
  box-sizing: border-box;
}

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

/* Subscriber cells may carry long unbroken identifiers (e.g. sanitized
   XSS-probe customer names) - wrap within the fixed column instead of
   clipping, so scrollWidth never exceeds clientWidth. */
.nrad-table td.nrad-wrap-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.nrad-table td.nrad-wrap-cell a {
  overflow-wrap: anywhere;
}

.nrad-table tbody tr:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.02));
}

/* Badges */
.nrad-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.nrad-badge.badge-accept { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nrad-badge.badge-reject { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.nrad-badge.badge-warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nrad-badge.badge-neutral { background: rgba(148, 163, 184, 0.12); color: #64748b; }
.nrad-badge.badge-info { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nrad-badge.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }

/* Bridge Top Strip Cards — Enterprise Architecture */
.nrad-bridge-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.nrad-bridge-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.nrad-bridge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nrad-bridge-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nrad-card-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nrad-card-icon-wrap.icon-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.nrad-card-icon-wrap.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.nrad-bridge-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.25;
}

.nrad-bridge-card-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.nrad-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  flex-shrink: 0;
  white-space: nowrap;
}

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

.nrad-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.nrad-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nrad-tile {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.nrad-tile-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}

.nrad-tile-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nrad-tile-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nrad-bridge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* Modals */
.nrad-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  padding: 16px;
  box-sizing: border-box;
}

.nrad-modal-dialog {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.2));
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.nrad-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.nrad-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.nrad-modal-close-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-hover, rgba(0,0,0,0.05));
}

.nrad-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nrad-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.nrad-form-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.nrad-form-input:focus {
  border-color: var(--color-primary);
}

.nrad-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Dark Theme Overrides */
:root[data-theme="dark"] .nrad-kpi-icon.icon-blue { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nrad-kpi-icon.icon-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nrad-kpi-icon.icon-purple { background: rgba(147, 51, 234, 0.18); color: #c084fc; }
:root[data-theme="dark"] .nrad-kpi-icon.icon-indigo { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
:root[data-theme="dark"] .nrad-kpi-icon.icon-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

:root[data-theme="dark"] .nrad-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nrad-kpi-pill.badge-blue { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nrad-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
:root[data-theme="dark"] .nrad-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.18); color: #c084fc; }
:root[data-theme="dark"] .nrad-kpi-pill.badge-indigo { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
:root[data-theme="dark"] .nrad-kpi-pill.badge-rose { background: rgba(244, 63, 94, 0.18); color: #fb7185; }

:root[data-theme="dark"] .nrad-tab-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-bottom-color: #60a5fa;
  color: #60a5fa;
}

:root[data-theme="dark"] .nrad-tab-btn.active .nrad-tab-count {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

:root[data-theme="dark"] .nrad-badge.badge-accept { background: rgba(16, 185, 129, 0.18); color: #34d399; }
:root[data-theme="dark"] .nrad-badge.badge-reject { background: rgba(244, 63, 94, 0.18); color: #fb7185; }
:root[data-theme="dark"] .nrad-badge.badge-warning { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
:root[data-theme="dark"] .nrad-badge.badge-neutral { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
:root[data-theme="dark"] .nrad-badge.badge-info { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
:root[data-theme="dark"] .nrad-badge.badge-purple { background: rgba(147, 51, 234, 0.18); color: #c084fc; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .nrad-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nrad-bridge-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nrad-kpi-grid {
    grid-template-columns: 1fr;
  }
  .nrad-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .nrad-search-wrap,
  .nrad-select,
  .nrad-reset-btn {
    width: 100%;
    min-width: 100%;
  }
}

/* ========================================================================
   NETWORK MODULE — STEP 5: FTTH & OLT PON OPTICAL STUDIO (scoped .nolt-*)
   ======================================================================== */

.nolt-page-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Row 1 — 4 Compact Executive KPI Cards (112px, standard pkg sans-serif) */
.nolt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.nolt-kpi-card {
  height: 112px;
  padding: 13px 16px;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

/* Compact the shared pkg-kpi-* primitives to fit the 112px executive card */
.nolt-kpi-card .pkg-kpi-top.nolt-kpi-top {
  height: 26px;
  min-height: 26px;
  gap: 8px;
}

.nolt-kpi-card .pkg-kpi-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
}

.nolt-kpi-card .pkg-kpi-icon svg {
  width: 15px;
  height: 15px;
}

.nolt-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-kpi-value {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-kpi-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.nolt-kpi-pill {
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nolt-kpi-pill.badge-rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.nolt-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nolt-kpi-pill.badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nolt-kpi-pill.badge-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.nolt-kpi-pill.badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.nolt-kpi-pill.badge-neutral { background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05)); color: var(--color-text-secondary); }

.icon-rose { color: #e11d48; }

/* Studio Tabs Bar */
.nolt-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  margin-bottom: 8px;
}

.nolt-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.nolt-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}

.nolt-tab-btn:hover { color: var(--color-text-primary); }

.nolt-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.nolt-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05));
  color: var(--color-text-secondary);
}

.nolt-tab-btn.active .nolt-tab-count {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
}

/* Single-Row Filter Bar (40px) */
.nolt-filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  margin-bottom: 14px !important;
  padding: 12px 16px !important;
  background: var(--color-surface, #ffffff) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

#noltOnusFilterBtn,
#noltOnusResetBtn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.nolt-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  height: 40px;
}

.nolt-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
}

.nolt-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--transition);
}

.nolt-search-input:focus { border-color: var(--color-primary); }

.nolt-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  min-width: 160px;
}

.nolt-select:focus { border-color: var(--color-primary); }

.nolt-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}

.nolt-reset-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Tables — fixed layout, zero horizontal overflow */
.nolt-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}

.nolt-table {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}

.nolt-table th {
  text-align: left;
  padding: 10px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-table tbody tr:last-child td { border-bottom: none; }
.nolt-table tbody tr:hover { background: rgba(37, 99, 235, 0.03); }

/* Badges */
.nolt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  height: 20px;
  box-sizing: border-box;
}

.nolt-badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nolt-badge-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.nolt-badge-rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.nolt-badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nolt-badge-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.nolt-badge-neutral { background: var(--color-surface-subtle, rgba(0, 0, 0, 0.06)); color: var(--color-text-secondary); }

/* PON utilization bar */
.nolt-util-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.nolt-util-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.06));
  overflow: hidden;
}

.nolt-util-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
}

.nolt-util-label {
  font-size: 10.5px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Optical RX/TX cell — 3-segment visual meter + badge */
.nolt-optical-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nolt-meter {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 132px;
  height: 6px;
  border-radius: 4px;
  overflow: visible;
}

.nolt-meter-seg {
  height: 100%;
  opacity: 0.85;
}

.nolt-seg-rose { width: 30.8%; background: #f43f5e; border-radius: 4px 0 0 4px; }
.nolt-seg-amber { width: 11.5%; background: #f59e0b; }
.nolt-seg-emerald { width: 57.7%; background: #10b981; border-radius: 0 4px 4px 0; }

.nolt-meter-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--color-text-primary);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Alert queue (Tab 3) */
.nolt-alert-section {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  margin-bottom: 14px;
  overflow: hidden;
}

.nolt-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
}

.nolt-alert-dying .nolt-alert-header { border-left: 3px solid #f59e0b; }
.nolt-alert-los .nolt-alert-header { border-left: 3px solid #f43f5e; }
.nolt-alert-weak .nolt-alert-header { border-left: 3px solid #f59e0b; }

.nolt-alert-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.nolt-alert-table-wrap { width: 100%; overflow-x: auto; }
.nolt-alert-table { table-layout: fixed; }

/* Modals */
.nolt-modal {
  width: 100%;
  max-width: 680px;
  margin: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.nolt-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}

.nolt-form-field { min-width: 0; }
.nolt-form-field.nolt-span-2 { grid-column: span 2; }

.nolt-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 5px;
}

.nolt-form-field input,
.nolt-form-field select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
}

.nolt-form-field input:focus,
.nolt-form-field select:focus { border-color: var(--color-primary); }

.nolt-form-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  line-height: 1.35;
}

.nolt-req { color: #e11d48; }

.nolt-radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
}

.nolt-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
}

/* History graph modal */
.nolt-modal.nolt-graph-modal,
.nolt-modal:has(.nolt-graph-wrap) {
  max-width: 940px;
}

.nolt-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.nolt-graph-onu-label {
  font-size: 14px;
  font-weight: 700;
}

.nolt-graph-range-btns {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.nolt-graph-range-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.nolt-graph-range-btn + .nolt-graph-range-btn { border-left: 1px solid var(--color-border); }

.nolt-graph-range-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.nolt-graph-wrap {
  position: relative;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}

.nolt-graph-wrap canvas { display: block; width: 100%; }

.nolt-graph-tooltip {
  position: absolute;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 5;
}

.nolt-graph-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nolt-graph-tooltip-time {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--color-text-tertiary);
  text-align: right;
}

.nolt-graph-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
}

.nolt-graph-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nolt-legend-dot {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.nolt-legend-band {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.nolt-band-emerald { background: rgba(16, 185, 129, 0.35); }
.nolt-band-amber { background: rgba(245, 158, 11, 0.35); }
.nolt-band-rose { background: rgba(244, 63, 94, 0.35); }

/* Customer Profile — FTTH Optical Studio Card (Step 5) */
.nolt-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.nolt-tile {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.015));
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nolt-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.nolt-tile-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nolt-tile-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nolt-tile-value {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 4px;
}

.nolt-tile-sub {
  font-size: 11.5px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Unified single-row chart toolbar */
.nolt-chart-unified-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.nolt-chart-unified-toolbar + .nolt-graph-wrap {
  border-radius: 0 0 10px 10px;
}

.nolt-chart-stats-unified {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  flex-wrap: wrap;
}

.nolt-chart-stats-unified .nolt-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nolt-chart-stats-unified .nolt-stat-label {
  color: var(--color-text-muted);
  font-size: 11px;
}

.nolt-chart-stats-unified .nolt-stat-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nolt-chart-stats-unified .nolt-stat-divider {
  color: var(--color-border);
}

.nolt-chart-stats-unified .nolt-stat-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.nolt-gauge {
  display: flex;
  width: 100%;
  max-width: 150px;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 7px;
  position: relative;
}

.nolt-gauge-seg { height: 100%; }

/* Hero optical pill (#heroOpticalChip) */
.custprofile-chip.nolt-hero-chip {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  border: 1px solid;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.4;
  transition: box-shadow 0.15s ease;
}

.custprofile-chip.nolt-hero-chip:hover {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.nolt-hero-chip.nolt-chip-optimal { background: rgba(16, 185, 129, 0.10); color: #059669; border-color: rgba(16, 185, 129, 0.35); }
.nolt-hero-chip.nolt-chip-weak { background: rgba(245, 158, 11, 0.12); color: #d97706; border-color: rgba(245, 158, 11, 0.40); }
.nolt-hero-chip.nolt-chip-critical { background: rgba(244, 63, 94, 0.10); color: #e11d48; border-color: rgba(244, 63, 94, 0.40); }
.nolt-hero-chip.nolt-chip-neutral { background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05)); color: var(--color-text-secondary); border-color: var(--color-border); }

@media (max-width: 1100px) {
  .nolt-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nolt-tiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nolt-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ========================================================================
   NETWORK MODULE — DEDICATED GRAPHICAL OLT SETUP & ONBOARDING STUDIO
   (/network/olts/new & /network/olts/:id/edit — scoped .noft-*)
   ======================================================================== */

.noft-page-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-bottom: 24px !important;
  box-sizing: border-box !important;
}

/* Header */
.noft-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: nowrap !important;
  margin-bottom: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.noft-header-left {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.noft-back-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-primary, #2563eb) !important;
  text-decoration: none !important;
  margin-bottom: 2px !important;
  padding: 0 !important;
  transition: color 0.15s ease !important;
}

.noft-back-link:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

.noft-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  letter-spacing: -0.2px !important;
}

.noft-subtitle {
  font-size: 13px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 0 !important;
  max-width: 100% !important;
}

.noft-header-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
  padding-top: 0 !important;
}

.noft-header-btn {
  height: 38px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Balanced multi-column executive studio layout */
.noft-studio-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.noft-studio-row1 {
  width: 100%;
}

.noft-step1-grid {
  display: grid;
  grid-template-columns: minmax(0, 71fr) minmax(290px, 29fr);
  gap: 20px;
  align-items: start;
}

.noft-step1-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.noft-step1-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Symmetrical 50%/50% equal-height cards */
.noft-studio-row2 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: stretch !important;
  width: 100% !important;
}

.noft-col-card {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.noft-col-card .noft-step-card,
#noftStep2,
#noftStep3 {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

/* Step cards */
.noft-step-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.noft-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.noft-step-no {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.noft-step-titles { min-width: 0; }

.noft-step-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.25;
}

.noft-step-hint {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

/* 11-Vendor selector grid: sleek single-line executive pills (6 columns on desktop, 44px height) */
.noft-vendor-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.noft-vendor-card {
  position: relative;
  height: 42px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  background: var(--color-surface-subtle, #f8fafc) !important;
  border: 1.5px solid var(--color-border, #cbd5e1) !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease !important;
  font-family: inherit !important;
  overflow: hidden !important;
}

.noft-vendor-card:hover {
  border-color: color-mix(in srgb, var(--accent, #2563eb) 55%, transparent) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06) !important;
}

.noft-vendor-card.active {
  border-color: var(--accent, #2563eb) !important;
  background: color-mix(in srgb, var(--accent, #2563eb) 6%, var(--color-surface, #fff)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #2563eb) 18%, transparent) !important;
}

.noft-vendor-badge {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--accent, #2563eb), color-mix(in srgb, var(--accent, #2563eb) 62%, #0f172a)) !important;
  flex-shrink: 0 !important;
}

.noft-vendor-name {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  letter-spacing: -0.3px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  flex: 1 !important;
}

.noft-vendor-check {
  display: none !important;
}

/* Preset chips */
.noft-preset-block { border-top: 1px dashed var(--color-border); padding-top: 13px; }

.noft-field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.noft-field-label-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--color-text-tertiary, #94a3b8); }

.noft-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.noft-preset-chip {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.noft-preset-chip:hover { border-color: var(--color-primary, #2563eb); color: var(--color-primary, #2563eb); }

.noft-preset-chip.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.noft-preset-row-strip {
  display: grid;
  grid-template-columns: 44fr 32fr 24fr;
  gap: 12px;
  align-items: flex-start;
}

.noft-preset-col-model,
.noft-preset-col-pon,
.noft-preset-col-ports {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Modern inputs & custom select styling with sleek vector SVG chevron */
.noft-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-text-primary, #0f172a);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.noft-input,
.noft-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 36px;
  height: 38px;
  cursor: pointer;
  background-color: var(--color-surface, #ffffff);
}

.noft-input:focus,
select.noft-input:focus,
.noft-select:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.noft-input.noft-invalid {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.noft-form-flex {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  flex: 1 !important;
  justify-content: space-between !important;
}

.noft-form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.noft-row-split-60-40 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.noft-row-split-55-45 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.noft-row-split-65-35 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.noft-row-split-50-50 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.noft-w60 { flex: 0 0 calc(60% - 6px); width: calc(60% - 6px); }
.noft-w40 { flex: 0 0 calc(40% - 6px); width: calc(40% - 6px); }
.noft-w55 { flex: 0 0 calc(55% - 6px); width: calc(55% - 6px); }
.noft-w45 { flex: 0 0 calc(45% - 6px); width: calc(45% - 6px); }
.noft-w65 { flex: 0 0 calc(65% - 6px); width: calc(65% - 6px); }
.noft-w35 { flex: 0 0 calc(35% - 6px); width: calc(35% - 6px); }
.noft-w50 { flex: 0 0 calc(50% - 6px); width: calc(50% - 6px); }
.noft-w-full { width: 100%; }

.noft-req { color: #e11d48; font-weight: 700; }

.noft-hint {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--color-text-tertiary, #94a3b8);
}

.noft-hint-secure { display: flex; align-items: center; gap: 4px; color: #059669; font-weight: 600; }

/* Segmented controls */
.noft-seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--color-surface-subtle, #f1f5f9);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.noft-seg-btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.noft-seg-btn:hover { color: var(--color-text-primary); }

.noft-seg-btn:disabled,
.noft-seg-btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.noft-seg-btn.active {
  background: var(--color-surface, #fff);
  color: var(--color-primary, #2563eb);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.noft-seg-h38 {
  height: 38px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  padding: 3px;
}

.noft-seg-h38 .noft-seg-btn {
  height: 30px;
  flex: 1;
  padding: 0 8px;
  font-size: 12px;
}

/* Community & password input with eye toggle */
.noft-community-wrap { position: relative; display: flex; align-items: center; width: 100%; }

.noft-community-wrap .noft-input { padding-right: 40px; }

.noft-eye-btn {
  position: absolute;
  right: 5px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-tertiary, #94a3b8);
  cursor: pointer;
}

.noft-eye-btn:hover { background: var(--color-surface-subtle, #f1f5f9); color: var(--color-text-primary); }

/* Telemetry mode cards (2-column: height 62px each) */
.noft-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.noft-mode-card {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px !important;
  height: 62px !important;
  box-sizing: border-box;
  text-align: left;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.noft-mode-card:hover { border-color: rgba(37, 99, 235, 0.45); transform: translateY(-1px); }

.noft-mode-card.active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.noft-mode-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.10);
  color: var(--color-primary, #2563eb);
  flex-shrink: 0;
}

.noft-mode-card.active .noft-mode-icon { background: var(--color-primary, #2563eb); color: #fff; }

.noft-mode-titles { min-width: 0; }

.noft-mode-titles b { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-primary); line-height: 1.25; }

.noft-mode-titles small { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.35; color: var(--color-text-secondary); }

/* Right column — chassis card */
.noft-chassis-card,
.noft-cli-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.noft-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.noft-card-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.noft-card-head-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 10px !important;
  border-radius: 9999px !important;
  background: rgba(16, 185, 129, 0.10) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.30) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}

/* The 1U rack chassis visualizer */
.noft-chassis {
  display: flex;
  align-items: stretch;
  gap: 0;
  filter: drop-shadow(0 10px 22px rgba(2, 6, 23, 0.28));
  min-height: 120px;
  box-sizing: border-box;
  border-radius: 6px;
  overflow: hidden;
}

.noft-rack-ear {
  width: 16px;
  background: linear-gradient(180deg, #334155, #1e293b);
  border-radius: 6px 0 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.noft-rack-ear.noft-ear-right { border-radius: 0 6px 6px 0; }

.noft-rack-ear i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.noft-faceplate {
  flex: 1;
  min-width: 0;
  background:
    linear-gradient(180deg, #3b4759 0%, #2a3444 8%, #232c3a 50%, #1c2430 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  border-bottom: 1px solid rgba(2, 6, 23, 0.8);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}

.noft-faceplate-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.noft-vendor-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #2563eb), color-mix(in srgb, var(--accent, #2563eb) 60%, #0f172a));
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.5);
}

.noft-faceplate-model {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noft-leds { margin-left: auto; display: inline-flex; gap: 8px; }

.noft-led {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.noft-led i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
}

.noft-led.on i {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.9);
}

.noft-faceplate-banks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.noft-bank {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  padding: 5px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.noft-bank::-webkit-scrollbar {
  display: none;
}

.noft-bank-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #64748b;
  writing-mode: initial;
  min-width: 62px;
}

.noft-uplink-ports, .noft-pon-ports {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.noft-uplink-port {
  width: 22px;
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  border: 1px solid rgba(148, 163, 184, 0.25);
  position: relative;
  flex-shrink: 0;
}

.noft-uplink-port i {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 3px;
  border-radius: 1px;
  background: rgba(148, 163, 184, 0.35);
}

.noft-pon-port {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.noft-pon-port i {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0b1220, #16202f);
  border: 1px solid rgba(148, 163, 184, 0.22);
  position: relative;
}

.noft-pon-port.on i {
  background: linear-gradient(180deg, #102a1e, #0d2418);
  border-color: rgba(52, 211, 153, 0.55);
}

.noft-pon-port.on i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 3px;
  border-radius: 1.5px;
  background: #34d399;
  box-shadow: 0 0 7px rgba(52, 211, 153, 0.95);
}

.noft-pon-port b {
  font-size: 7.5px;
  font-weight: 700;
  color: #7c8ba1;
  line-height: 1;
}

.noft-bank.dense .noft-pon-ports { gap: 3px; }
.noft-bank.dense .noft-pon-port i { width: 15px; height: 12px; }
.noft-bank.dense .noft-pon-port b { font-size: 6.5px; }

.noft-faceplate-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.noft-faceplate-meta {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noft-faceplate-sn { font-size: 8.5px; color: #94a3b8; white-space: nowrap; }

.noft-chassis-caption {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--color-text-tertiary, #94a3b8);
  text-align: center;
}

/* CLI cheat-sheet */
.noft-cli-pre {
  margin: 0;
  padding: 11px 13px;
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #a5f3fc;
  overflow-x: auto;
  white-space: pre;
}

.noft-cli-card .btn-sm { height: 28px; padding: 0 10px; font-size: 11px; }

.noft-cli-caption {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--color-text-tertiary, #94a3b8);
}

/* Probe result panel — ZERO empty ghost bar when hidden/empty */
.noft-probe-result {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.noft-probe-result[hidden],
.noft-probe-result:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

.noft-probe-result.ok { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.06); }
.noft-probe-result.bad { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.05); }
.noft-probe-result.neutral { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.05); }

.noft-probe-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.noft-probe-result.ok .noft-probe-head { color: #059669; }
.noft-probe-result.bad .noft-probe-head { color: #e11d48; }
.noft-probe-result.neutral .noft-probe-head { color: #d97706; }

.noft-probe-latency {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--color-primary, #2563eb);
}

.noft-probe-msg { margin: 0; font-size: 12px; line-height: 1.5; color: var(--color-text-secondary); }

.noft-probe-sysdesc {
  margin: 0;
  padding: 8px 10px;
  background: var(--color-surface-subtle, #f1f5f9);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 1100px) {
  .noft-step1-grid { grid-template-columns: 1fr; }
  .noft-studio-row2 { grid-template-columns: 1fr; }
  .noft-sticky { position: static; }
  .noft-vendor-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (max-width: 720px) {
  .noft-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .noft-header-left {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .noft-title {
    font-size: 18px !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }
  .noft-subtitle {
    white-space: normal !important;
    word-break: break-word !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .noft-header-actions {
    padding-top: 0 !important;
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  .noft-header-actions .noft-header-btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
  .noft-vendor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .noft-preset-row-strip { grid-template-columns: 1fr; }
  .noft-row-split-60-40,
  .noft-row-split-55-45,
  .noft-row-split-65-35,
  .noft-row-split-50-50 {
    flex-direction: column;
  }
  .noft-w60, .noft-w40, .noft-w55, .noft-w45, .noft-w65, .noft-w35, .noft-w50 {
    flex: 1 1 100%;
    width: 100%;
  }
  .noft-mode-grid { grid-template-columns: 1fr; }
  .noft-bank-label { min-width: 48px; font-size: 7.5px; }
  .noft-chassis { min-height: 124px; }
}

/* FTTH & OLT PON Studio — Action Buttons & Decluttered Styles */
.nolt-table th.nolt-actions-col,
.nolt-table td.nolt-actions-col,
.nolt-table th:last-child,
.nolt-table td:last-child {
  width: 142px !important;
  min-width: 142px !important;
  max-width: 142px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  padding: 6px 4px !important;
  text-align: right !important;
  box-sizing: border-box !important;
}

/* Empty State Centering */
.nolt-empty-td {
  white-space: normal !important;
  text-align: center !important;
  width: 100% !important;
  padding: 48px 24px !important;
  overflow: visible !important;
}

.nolt-empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  text-align: center !important;
  max-width: 540px;
}

.nolt-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  overflow: hidden !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
}

.nolt-btn-icon {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

.nolt-btn-icon svg {
  flex-shrink: 0;
}

/* Decluttered Optical Signal Cell */
.nolt-signal-cell {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.nolt-signal-rx {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid transparent;
}

.nolt-signal-rx.pill-optimal {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

.nolt-signal-rx.pill-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}

.nolt-signal-rx.pill-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #e11d48;
  border-color: rgba(239, 68, 68, 0.35);
}

.nolt-signal-rx.pill-unknown {
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05));
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.nolt-signal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.nolt-signal-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

.nolt-signal-tx {
  font-size: 11px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* Optical Chart Summary Stats Strip */
.nolt-chart-stats-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 11.5px;
}

.nolt-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nolt-stat-label {
  color: var(--color-text-secondary);
  font-size: 11px;
}

.nolt-stat-divider {
  color: var(--color-border);
}

.nolt-stat-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nolt-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--color-text-secondary);
}

.nolt-legend-pill i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

@media (max-width: 600px) {
  .nolt-chart-stats-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .nolt-stat-divider {
    display: none;
  }
  .nolt-stat-legend-group {
    margin-left: 0;
    flex-wrap: wrap;
  }
}


/* ==========================================================================
   CUSTOMER LIST CLEAN 2-LINE CELL REFINEMENT & POP BADGE REMOVAL
   ========================================================================== */
.cust-pop-badge,
.customer-pop-badge {
  display: none !important;
}

.customers-table .customer-name-line {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.customers-table .customer-name-link,
.customers-table .customer-name-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

.customers-table .customer-group-indicator,
.customers-table .customer-group-badge {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.customers-table .customer-meta-row,
.customers-table .customer-meta-sub {
  display: flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  margin-top: 2px !important;
  line-height: 1.2 !important;
  min-width: 0 !important;
}

.customers-table .customer-phone-slot,
.customers-table .customer-phone-sub {
  font-family: var(--font-mono) !important;
  font-size: 11.5px !important;
  color: var(--color-text-muted, #64748b) !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

/* ==========================================================================
   HOTFIX 2026-11-01 - Fleet context pills (dashboard), pulsing emerald/rose
   status dots (dashboard + FreeRADIUS AAA bridge), descender-safe tile values.
   ========================================================================== */

/* Pulsing status dots - emerald (online/active) and rose (offline) */
.pulse-dot-emerald,
.pulse-dot-rose {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}

.pulse-dot-emerald {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.pulse-dot-rose {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Router Status row text (Router & Resource Status card) */
.dash-status-connected {
  color: #059669;
  font-weight: 600;
}

.dash-status-offline {
  color: #e11d48;
  font-weight: 600;
}

/* Fleet identity pill (single-router mode) - dashboard card headers */
.dash-fleet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
  white-space: nowrap;
  line-height: 1.4;
}

.dash-fleet-pill .fleet-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.dash-fleet-pill.is-offline {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.dash-fleet-pill.is-offline .fleet-pill-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Fleet summary badge - dashboard card headers (1/1 POP Online / Fleet: X/Y) */
.dash-fleet-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
  line-height: 1.4;
}

:root[data-theme="dark"] .dash-fleet-badge,
[data-theme="dark"] .dash-fleet-badge,
body.dark-mode .dash-fleet-badge {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.dash-fleet-badge.is-degraded {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

:root[data-theme="dark"] .dash-fleet-badge.is-degraded,
[data-theme="dark"] .dash-fleet-badge.is-degraded,
body.dark-mode .dash-fleet-badge.is-degraded {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.dash-fleet-badge.is-offline {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

:root[data-theme="dark"] .dash-fleet-badge.is-offline,
[data-theme="dark"] .dash-fleet-badge.is-offline,
body.dark-mode .dash-fleet-badge.is-offline {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

/* HOTFIX 2026-11-01 - descender-safe key-value tiles on /network/routers
   (FreeRADIUS AAA Bridge + Hardware & RouterOS Telemetry cards). Tight
   line-height + overflow:hidden was slicing the g/y/p descenders. */
.nrtr-kv-item,
.nrtr-kv-val,
.nrtr-kv-label,
.nrtr-meta-box,
.nrtr-meta-box strong,
.nrtr-meta-box span {
  line-height: 1.45 !important;
  padding-top: 2px;
  padding-bottom: 3px;
  overflow: visible !important;
}

.nrtr-kv-item {
  min-height: 44px;
  align-items: center;
}

.nrtr-meta-box {
  overflow: visible !important;
}

/* HOTFIX 2026-11-01 (Defect B) - /network/routers FreeRADIUS AAA Bridge +
   Hardware & RouterOS Telemetry tiles: fixed 36px rows with line-height:1 and
   overflow:hidden sliced the g/y/p descenders ("Configured", "Synced",
   "ether1_UpLink"). Give the tiles breathing room and let glyphs render. */
.router-studio-container .studio-meta-item,
.router-studio-container .studio-status-item {
  height: auto;
  min-height: 44px;
  padding-top: 2px;
  padding-bottom: 3px;
  overflow: visible !important;
}

.router-studio-container .studio-meta-val,
.router-studio-container .studio-status-value {
  line-height: 1.45 !important;
  padding-top: 2px;
  padding-bottom: 3px;
  overflow: visible !important;
  white-space: nowrap;
}

.router-studio-container .studio-meta-label,
.router-studio-container .studio-status-label {
  line-height: 1.45 !important;
  padding-top: 2px;
  padding-bottom: 3px;
  overflow: visible !important;
}

/* HOTFIX 2026-11-01 - specificity fix: .status-dot.ok (var(--color-success) = #16a34a)
   out-specifies .pulse-dot-emerald; the AAA bridge dots must be exactly #10b981. */
.status-dot.pulse-dot-emerald {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

/* ===========================================================================
   SUPPORT NOC & GEO-DISPATCH STUDIO (Migration 057)
   Scoped under .supt-* so existing studios (OLT/router/billing) are untouched.
   =========================================================================== */

/* Page container — mirrors .nolt-page-container */
.supt-page-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Row 1 — 4 Compact Executive KPI Cards (112px, standard pkg sans-serif) */
.supt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.supt-kpi-card {
  height: 112px;
  padding: 13px 16px;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.supt-kpi-card .pkg-kpi-top.supt-kpi-top { height: 26px; min-height: 26px; gap: 8px; }
.supt-kpi-card .pkg-kpi-icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.supt-kpi-card .pkg-kpi-label.supt-kpi-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supt-kpi-card .pkg-kpi-value.supt-kpi-value { font-size: 19px; font-weight: 700; line-height: 1.1; }
.supt-kpi-card .pkg-kpi-pills.supt-kpi-pills { flex-wrap: nowrap; overflow: hidden; min-height: 22px; }

.supt-kpi-pill {
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supt-kpi-pill.badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.supt-kpi-pill.badge-rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.supt-kpi-pill.badge-amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.supt-kpi-pill.badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.supt-kpi-pill.badge-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.supt-kpi-pill.badge-purple { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.supt-kpi-pill.badge-neutral { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15)); color: var(--color-text-secondary); }

/* Standalone badges used across the studio */
.badge.supt-badge-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.badge.supt-badge-rose { background: rgba(244, 63, 94, 0.14); color: #e11d48; }
.badge.supt-badge-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.badge.supt-badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.badge.supt-badge-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.badge.supt-badge-purple { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.badge.supt-badge-neutral { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15)); color: var(--color-text-secondary); }

/* Tabs bar with right-side view switcher */
.supt-tabs-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.supt-tabs-list { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }

.supt-view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface);
  flex-shrink: 0;
}

.supt-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.supt-view-btn + .supt-view-btn { border-left: 1px solid var(--color-border); }
.supt-view-btn:hover { background: var(--color-surface-hover, rgba(0, 0, 0, 0.03)); }
.supt-view-btn.active { background: var(--color-primary); color: #ffffff; }

/* Filter bar + table tweaks (overflow-safe on mobile) */
.supt-filter-bar { margin-bottom: 14px; }
.supt-page-container .nolt-table-wrap { overflow-x: auto; }
.supt-actions-col { color: var(--color-text-secondary); }

/* Empty state helper */
.supt-empty-state { gap: 4px; }

/* Workspace */
.supt-workspace { min-width: 0; }

/* ---------------- Geo-Fault map view ---------------- */
.supt-map-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.supt-map-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.supt-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.supt-fault-map {
  height: 560px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 0;
}

/* Fault pins (Leaflet divIcon) */
.supt-fault-icon { background: transparent; border: none; }
.supt-pin-wrapper { position: relative; width: 30px; height: 40px; }
.supt-pin-svg { position: absolute; top: 0; left: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.supt-pin-pulse {
  position: absolute; top: 4px; left: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  pointer-events: none;
  animation: supt-radar 2s infinite ease-out;
}
@keyframes supt-radar {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

.supt-custom-leaflet-popup .leaflet-popup-content-wrapper { border-radius: 10px; }
.supt-fault-popup { min-width: 240px; max-width: 300px; }

/* ---------------- Verdict banner ---------------- */
.supt-verdict {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px;
  line-height: 1.45;
}

.supt-verdict-icon { display: inline-flex; flex-shrink: 0; margin-top: 1px; }
.supt-verdict-code { font-weight: 700; font-size: 11px; letter-spacing: 0.05em; margin-bottom: 2px; }
.supt-verdict-text { color: inherit; }

.supt-verdict-critical { background: rgba(244, 63, 94, 0.10); border-color: rgba(244, 63, 94, 0.35); color: #e11d48; }
.supt-verdict-high { background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.35); color: #d97706; }
.supt-verdict-info { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.35); color: #059669; }
.supt-verdict-neutral { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.12)); border-color: var(--color-border); color: var(--color-text-secondary); }

/* ---------------- Diagnostic card ---------------- */
.supt-diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.supt-diag-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--color-surface);
  min-width: 0;
}

.supt-diag-label { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--color-text-tertiary, var(--color-text-secondary)); margin-bottom: 5px; }
.supt-diag-value { font-size: 12.5px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.supt-diag-sub { font-size: 11px; color: var(--color-text-secondary); line-height: 1.5; overflow-wrap: anywhere; }

.supt-probe-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.supt-probe-empty {
  display: flex; align-items: center; gap: 8px;
  padding: 14px; border: 1px dashed var(--color-border); border-radius: 10px;
  color: var(--color-text-secondary); font-size: 12.5px; line-height: 1.5;
}

.supt-noc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); }

/* ---------------- Cards inside drawer right column ---------------- */
.supt-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.supt-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}

/* ---------------- Drawer (split view modal) ---------------- */
.supt-modal { max-width: 680px; width: calc(100vw - 32px); }
.supt-drawer-modal { max-width: 1150px; width: calc(100vw - 32px); }

.supt-drawer-grid {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: 16px;
  align-items: start;
}

.supt-drawer-left { min-width: 0; }
.supt-drawer-right { min-width: 0; }

.supt-ticket-head { margin-bottom: 12px; }
.supt-ticket-num { font-size: 15px; font-weight: 800; color: var(--color-primary); letter-spacing: 0.01em; }
.supt-ticket-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.supt-ticket-subject { font-size: 13.5px; font-weight: 700; color: var(--color-text-primary); line-height: 1.4; }
.supt-ticket-meta { font-size: 11.5px; color: var(--color-text-secondary); margin-top: 4px; line-height: 1.5; }
.supt-ticket-customer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.supt-cust-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--color-primary); font-weight: 600; font-size: 12.5px;
  text-decoration: none;
}
.supt-cust-link:hover { text-decoration: underline; }
.supt-pppoe-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 9999px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15));
  font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-secondary);
}

/* Timeline */
.supt-timeline {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 300px; overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 12px;
}

.supt-msg { border: 1px solid var(--color-border); border-radius: 10px; padding: 8px 10px; background: var(--color-surface); }
.supt-msg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.supt-msg-author { font-size: 11.5px; font-weight: 700; color: var(--color-text-primary); }
.supt-msg-time { font-size: 10.5px; color: var(--color-text-tertiary, var(--color-text-secondary)); white-space: nowrap; }
.supt-msg-body { font-size: 12.5px; line-height: 1.55; color: var(--color-text-primary); overflow-wrap: anywhere; white-space: pre-wrap; }

.supt-msg-system { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.08)); }
.supt-msg-system .supt-msg-author { color: var(--color-text-secondary); }
.supt-msg-system .supt-msg-body { color: var(--color-text-secondary); font-size: 12px; }
.supt-msg-internal { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); }

/* Composer */
.supt-composer { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.supt-composer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.supt-internal-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); white-space: nowrap; cursor: pointer; }
.supt-reply-text {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-surface);
  resize: vertical;
}
.supt-reply-text:focus { outline: none; border-color: var(--color-primary); }
.supt-composer-actions { display: flex; justify-content: flex-end; }
.supt-quick-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* GPS mini map & dispatch */
.supt-minimap-wrap { margin-bottom: 8px; }
.supt-minimap { height: 210px; border-radius: 10px; overflow: hidden; border: 1px solid var(--color-border); z-index: 0; }
.supt-minimap-empty { display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary); font-size: 12px; background: var(--color-surface-subtle, rgba(148, 163, 184, 0.08)); }
.supt-gps-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.supt-gps-coord { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--color-text-primary); }
.supt-gps-src { font-size: 11px; color: var(--color-text-secondary); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.supt-gps-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.supt-gps-editor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.supt-staff-current {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.06));
  margin-bottom: 10px; font-size: 12.5px;
}
.supt-staff-phone { display: inline-flex; align-items: center; gap: 4px; color: var(--color-primary); text-decoration: none; font-size: 12px; }

.supt-staff-recs { display: flex; flex-direction: column; gap: 8px; }
.supt-staff-rec {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--color-border); border-radius: 10px;
  padding: 8px 10px; background: var(--color-surface);
}
.supt-staff-rec-rank {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15)); color: var(--color-text-secondary);
}
.supt-staff-rec-rank.best { background: rgba(16, 185, 129, 0.14); color: #059669; }
.supt-staff-rec-main { flex: 1; min-width: 0; font-size: 12.5px; color: var(--color-text-primary); }

/* ---------------- Create modal ---------------- */
.supt-create-grid { display: flex; flex-direction: column; gap: 12px; }
.supt-create-modal { max-width: 760px; }

/* ---------------- Canned responses studio ---------------- */
.supt-canned-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.supt-canned-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supt-canned-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.supt-canned-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-primary); }
.supt-canned-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11.5px; flex-wrap: wrap; }
.supt-canned-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.supt-canned-body {
  font-size: 12px; line-height: 1.55; color: var(--color-text-secondary);
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.07));
  border-radius: 8px; padding: 9px 11px;
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 130px; overflow-y: auto;
}

.supt-shortcut {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 6px;
  background: rgba(37, 99, 235, 0.10); color: #2563eb;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.supt-canned-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
  border: 1px dashed var(--color-border); border-radius: 12px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .supt-drawer-grid { grid-template-columns: 1fr; }
  .supt-canned-grid { grid-template-columns: 1fr; }
  .supt-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .supt-kpi-grid { grid-template-columns: 1fr; }
  .supt-fault-map { height: 380px; }
  .supt-tabs-bar { flex-direction: column; align-items: stretch; }
  .supt-view-switcher { justify-content: stretch; }
  .supt-view-btn { flex: 1; justify-content: center; }
}

/* ===========================================================================
   SUPPORT STUDIO V2 (2026-11-01) — Zero-Clip ACTIONS + NOC Telemetry Queue
   Overrides the global 142px last-column clamp (line ~30677) which sliced the
   wide [Inspect / Dispatch] button. All rules scoped to .supt-page-container.
   =========================================================================== */

/* --- 1. Zero-clip tables: fixed layout, container-fit, wider ACTIONS --- */
.supt-page-container .nolt-table,
.supt-page-container table.sup-table,
.supt-page-container table.sup-staff-table,
.supt-page-container table.sup-canned-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed;
}

.supt-page-container .nolt-table th:last-child,
.supt-page-container .nolt-table td:last-child {
  width: 135px !important;
  min-width: 135px !important;
  max-width: 135px !important;
  padding: 6px 12px 6px 4px !important;
  text-align: right !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* --- 2. Compact 28px action controls (never wrap, never clip) --- */
.supt-actions-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  white-space: nowrap;
}

.supt-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.supt-act-btn:hover { background: rgba(37, 99, 235, 0.18); box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25); }
.supt-act-btn svg { flex-shrink: 0; }

.supt-act-btn.supt-act-neutral {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}
.supt-act-btn.supt-act-neutral:hover { color: var(--color-primary); border-color: var(--color-primary); }

.supt-act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: all 0.15s ease;
}
.supt-act-icon:hover { color: var(--color-primary); border-color: var(--color-primary); background: rgba(37, 99, 235, 0.08); }
.supt-act-icon.supt-act-danger:hover { color: #e11d48; border-color: rgba(244, 63, 94, 0.5); background: rgba(244, 63, 94, 0.08); }

/* --- 3. Initials avatars (subscriber + staff) --- */
.supt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.supt-avatar.supt-avatar-lg { width: 36px; height: 36px; font-size: 13px; }
.supt-avatar.supt-avatar-sm { width: 24px; height: 24px; font-size: 9.5px; }
.supt-avatar-c1 { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.supt-avatar-c2 { background: linear-gradient(135deg, #059669, #0d9488); }
.supt-avatar-c3 { background: linear-gradient(135deg, #d97706, #ea580c); }
.supt-avatar-c4 { background: linear-gradient(135deg, #db2777, #9333ea); }
.supt-avatar-c5 { background: linear-gradient(135deg, #0891b2, #2563eb); }
.supt-avatar-c6 { background: linear-gradient(135deg, #e11d48, #db2777); }

.supt-cell-flex { display: flex; align-items: center; gap: 9px; min-width: 0; }
.supt-cell-main { min-width: 0; }
.supt-cell-l1 {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supt-cell-l2 {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* --- 4. Ticket number + SLA row --- */
.supt-tkt-no { font-weight: 700; color: var(--color-primary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supt-tkt-sla { margin-top: 3px; display: flex; align-items: center; gap: 4px; }

@keyframes supt-sla-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(244, 63, 94, 0); }
}
.badge.supt-badge-rose.supt-pulse { animation: supt-sla-pulse 1.8s infinite; }

/* --- 5. Inline live NOC telemetry strip (the visual hero) --- */
.supt-tele {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.supt-tele-cat {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 6px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.14));
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supt-tele-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-shrink: 1;
  min-width: 0;
}
.supt-tele-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 5px currentColor;
}
.supt-tele-critical { background: rgba(244, 63, 94, 0.13); color: #e11d48; }
.supt-tele-warn { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.supt-tele-ok { background: rgba(16, 185, 129, 0.13); color: #059669; }
.supt-tele-info { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.supt-tele-billing { background: rgba(168, 85, 247, 0.14); color: #9333ea; }

/* --- 6. Priority dot badges --- */
.supt-pri {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.supt-pri::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.supt-pri-critical { background: rgba(244, 63, 94, 0.13); color: #e11d48; }
.supt-pri-high { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.supt-pri-medium { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.supt-pri-low { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15)); color: var(--color-text-secondary); }

/* --- 7. GPS pinned chip + POP tag --- */
.supt-gps-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #059669;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.supt-pop-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.10);
  color: #4f46e5;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --- 8. Unified single-row tabs + view switcher bar --- */
.supt-tabs-bar { flex-wrap: nowrap; min-width: 0; }
.supt-tabs-bar .supt-tabs-list { flex: 1 1 auto; min-width: 0; }
.supt-tabs-bar .supt-view-switcher { flex: 0 0 auto; }

.supt-filter-bar .nolt-search-wrap { flex: 1.6; min-width: 260px; }
.supt-filter-bar .nolt-select { min-width: 0; flex: 0 0 auto; padding: 0 26px 0 10px; font-size: 12.5px; }

/* --- 9. Availability pills with pulsing dot + workload meter (staff studio) --- */
.supt-avail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.supt-avail-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.supt-avail.available { background: rgba(16, 185, 129, 0.13); color: #059669; }
.supt-avail.on_field { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.supt-avail.busy { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.supt-avail.off_duty { background: var(--color-surface-subtle, rgba(148, 163, 184, 0.15)); color: var(--color-text-secondary); }
.supt-avail.available .supt-avail-dot { animation: supt-avail-pulse 1.6s infinite; }
.supt-avail.on_field .supt-avail-dot { animation: supt-avail-pulse 2.2s infinite; }

@keyframes supt-avail-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.supt-meter {
  width: 100%;
  max-width: 96px;
  height: 5px;
  border-radius: 9999px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.2));
  overflow: hidden;
  margin-top: 4px;
}
.supt-meter-fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #059669, #10b981); }
.supt-meter-fill.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.supt-meter-fill.full { background: linear-gradient(90deg, #e11d48, #f43f5e); }

/* --- 10. Canned template studio table --- */
.supt-page-container .sup-canned-table th:last-child,
.supt-page-container .sup-canned-table td:last-child { width: 135px !important; }

.supt-canned-preview {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  white-space: normal !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
}

.supt-var-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: #9333ea;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.supt-usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.14));
  color: var(--color-text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* --- 11. Ticket Command Drawer (executive command center) --- */
.supt-drawer-modal { max-width: 1040px; border-radius: 16px; overflow: hidden; }
.supt-drawer-modal .modal-header { border-radius: 16px 16px 0 0; }

.supt-cmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.10) 55%, rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.18);
  margin-bottom: 14px;
}

.supt-cmd-id {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.supt-cmd-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.supt-cmd-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.supt-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.supt-quick-pill:hover { color: var(--color-primary); border-color: var(--color-primary); }
.supt-quick-pill.supt-qp-go { border-color: rgba(79, 70, 229, 0.4); background: rgba(79, 70, 229, 0.10); color: #4f46e5; }
.supt-quick-pill.supt-qp-go:hover { background: rgba(79, 70, 229, 0.18); }
.supt-quick-pill.supt-qp-resolve { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.10); color: #059669; }
.supt-quick-pill.supt-qp-resolve:hover { background: rgba(16, 185, 129, 0.18); }
.supt-quick-pill:disabled { opacity: 0.5; cursor: not-allowed; }

/* 2x2 live telemetry grid */
.supt-tele-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.supt-tele-cell {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.05));
  min-width: 0;
}

.supt-noc-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* Geo-dispatch card B */
.supt-pop-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.supt-minimap { position: relative; height: 200px; }

.supt-tech-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--color-surface);
}
.supt-tech-avail { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }

/* Fault popup dots (replacing emoji) */
.supt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.supt-dot-ok { background: #10b981; }
.supt-dot-bad { background: #ef4444; }
.supt-dot-wait { background: #94a3b8; }

@media (max-width: 1024px) {
  .supt-tele-grid2 { grid-template-columns: 1fr; }
}

/* =============================================================================
   SUPPORT MODULE PRACTICAL WORKFLOW & DEDICATED PAGES (Sprint 2026-11)
   Clean 8-column table, inline workflow controls, 112px KPI cards,
   dedicated /support/tickets/new and /support/tickets/:id inspect studio.
   ============================================================================= */

.supt-kpi-grid-practical {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.supt-kpi-card-112 {
  min-height: 112px;
  max-height: 112px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.supt-kpi-card-112:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

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

.supt-kpi-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.supt-kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.supt-kpi-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.supt-kpi-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.supt-kpi-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabs */
.supt-tabs-practical {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
  margin-bottom: 16px;
  overflow-x: auto;
}

.supt-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.supt-tab-btn:hover {
  color: var(--color-text-primary);
}

.supt-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

.supt-tab-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-secondary);
}

.supt-tab-btn.active .supt-tab-badge {
  background: rgba(37, 99, 235, 0.14);
  color: var(--color-primary);
}

/* Table layout */
.supt-table-wrap-practical {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow-x: hidden !important;
  width: 100% !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.supt-table-practical {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse !important;
  font-size: 12px;
  table-layout: fixed !important;
}

.supt-table-practical thead th {
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.06));
  padding: 12px 10px !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  text-align: left !important;
  box-sizing: border-box !important;
}

.supt-table-practical thead th:last-child {
  text-align: right !important;
  padding: 12px 10px !important;
}

.supt-table-practical tbody td {
  padding: 12px 10px !important;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text-primary);
  text-align: left !important;
  box-sizing: border-box !important;
}

.supt-table-practical tbody td:last-child {
  text-align: right !important;
  padding: 12px 10px !important;
}

.supt-table-practical tbody tr:last-child td {
  border-bottom: none;
}

.supt-table-practical tbody tr:hover td {
  background: var(--color-surface-hover, rgba(148, 163, 184, 0.04));
}

/* Inline Staff Select */
.supt-inline-staff-select {
  width: 100% !important;
  max-width: 100% !important;
  height: 28px;
  padding: 0 16px 0 6px !important;
  font-size: 11px !important;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.supt-inline-staff-select:focus {
  border-color: var(--color-primary);
}

/* Inline Status Select (Pill Dropdown) */
.supt-inline-status-select {
  height: 28px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  border-width: 1px;
  border-style: solid;
  transition: all 0.15s ease;
}

.supt-status-sel-new {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.supt-status-sel-assigned {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
}
.supt-status-sel-solved {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #5eead4;
}
.supt-status-sel-completed {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}
.supt-status-sel-cancelled {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Dark mode pill selects */
[data-theme="dark"] .supt-status-sel-new {
  background: rgba(30, 58, 138, 0.35);
  color: #93c5fd;
  border-color: #1e40af;
}
[data-theme="dark"] .supt-status-sel-assigned {
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
  border-color: #92400e;
}
[data-theme="dark"] .supt-status-sel-solved {
  background: rgba(19, 78, 74, 0.35);
  color: #99f6e4;
  border-color: #115e59;
}
[data-theme="dark"] .supt-status-sel-completed {
  background: rgba(6, 78, 59, 0.35);
  color: #a7f3d0;
  border-color: #065f46;
}
[data-theme="dark"] .supt-status-sel-cancelled {
  background: rgba(51, 65, 85, 0.35);
  color: #cbd5e1;
  border-color: #475569;
}

/* Row fadeout animation */
.supt-row-fadeout {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Inspector and Create Form layouts */
.supt-layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.supt-card-clean {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 20px;
}

.supt-card-clean:last-child {
  margin-bottom: 0;
}

.supt-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.supt-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Diagnostics boxes */
.supt-diag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.supt-diag-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--color-surface-subtle, rgba(148, 163, 184, 0.04));
}

.supt-diag-item.highlight {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.25);
}

.supt-diag-item.warning {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.25);
}

.supt-diag-item.danger {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.25);
}

.supt-diag-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.supt-diag-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.supt-diag-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .supt-kpi-grid-practical { grid-template-columns: repeat(2, 1fr); }
  .supt-layout-2col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .supt-kpi-grid-practical { grid-template-columns: 1fr; }
  .supt-diag-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   Support Module Enterprise Form Controls & Layout (v3)
   ============================================================================= */
.supt-form-control,
.supt-form-select {
  width: 100% !important;
  height: 40px !important;
  padding: 0 34px 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-sizing: border-box !important;
  line-height: normal !important;
}

.supt-form-control {
  background-image: none !important;
  padding: 0 12px !important;
}

.supt-form-textarea {
  width: 100% !important;
  padding: 10px 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-sizing: border-box !important;
  resize: vertical !important;
  line-height: 1.5 !important;
}

.supt-form-control:focus,
.supt-form-select:focus,
.supt-form-textarea:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

/* Dedicated Inspect Top Command Bar */
.supt-inspect-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  padding: 18px 24px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  margin-bottom: 20px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.supt-inspect-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  flex-shrink: 0 !important;
}

.supt-inspect-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  margin-left: auto !important;
}

/* =============================================================================
   SUPPORT MODULE GRAPHICAL STUDIO ENHANCEMENTS (v4 Master Overhaul)
   ============================================================================= */

/* 1. /support/tickets/new Graphical Studio */
.supt-problem-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

.supt-problem-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  user-select: none !important;
  text-align: left !important;
}

.supt-problem-card:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  transform: translateY(-1px) !important;
}

.supt-problem-card.active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.supt-problem-icon-wrap {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.supt-problem-card-label {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.supt-problem-card-sub {
  font-size: 10.5px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 2px !important;
}

/* Priority Segmented Pill Selector */
.supt-priority-segmented {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 4px !important;
  height: 40px !important;
  box-sizing: border-box !important;
}

.supt-prio-seg-btn {
  flex: 1 !important;
  height: 30px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}

.supt-prio-seg-btn:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

.supt-prio-seg-btn.active[data-priority="normal"] {
  background: #ffffff !important;
  border-color: #93c5fd !important;
  color: #2563eb !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15) !important;
}

.supt-prio-seg-btn.active[data-priority="high"] {
  background: #ffffff !important;
  border-color: #fde68a !important;
  color: #d97706 !important;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.15) !important;
}

.supt-prio-seg-btn.active[data-priority="critical"] {
  background: #ffffff !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.15) !important;
}

/* 2-Column Form Row alignment */
.supt-form-row-2col {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 14px !important;
  align-items: end !important;
}

.supt-form-label {
  display: block !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #475569 !important;
  margin-bottom: 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Centered Empty State */
.supt-empty-state-centered {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 360px !important;
  padding: 32px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* 2. /support/tickets/:id Inspector Polish */
.supt-inspect-header .btn {
  white-space: nowrap !important;
  height: 36px !important;
  padding: 0 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}

/* Contact rows in Subscriber Info card */
.supt-contact-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  background: #f8fafc !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
  border: 1px solid #f1f5f9 !important;
}

.supt-contact-icon-box {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  flex-shrink: 0 !important;
}

.supt-contact-content {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 12px !important;
  color: #334155 !important;
  line-height: normal !important;
}

/* Connected Vertical Activity Timeline */
.supt-timeline-connected {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  padding: 4px 0 !important;
}

.supt-timeline-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  position: relative !important;
  padding-bottom: 14px !important;
}

.supt-timeline-item:last-child {
  padding-bottom: 0 !important;
}

.supt-timeline-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
  z-index: 2 !important;
}

.supt-timeline-line {
  position: absolute !important;
  left: 15px !important;
  top: 32px !important;
  bottom: 0 !important;
  width: 2px !important;
  background: #e2e8f0 !important;
  z-index: 1 !important;
}

.supt-timeline-item:last-child .supt-timeline-line {
  display: none !important;
}

.supt-timeline-bubble {
  flex: 1 !important;
  min-width: 0 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
}

.supt-timeline-bubble-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 4px !important;
  gap: 8px !important;
}

/* Composer box */
.supt-composer-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px !important;
  margin-top: 12px !important;
}

/* 3. /support/tickets Table Polish (v5 Spacious 6-Column Layout) */
.supt-table-practical thead th {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 11px 12px !important;
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  color: #475569 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

.supt-table-practical thead th:last-child {
  text-align: right !important;
  padding: 11px 18px !important;
}

.supt-table-practical tbody tr td {
  padding: 14px 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
}

.supt-table-practical tbody td:last-child {
  text-align: right !important;
  padding: 14px 18px 14px 12px !important;
}

.supt-table-practical tbody tr:hover td {
  background: #f8fafc !important;
}

.supt-inline-staff-select {
  width: 100% !important;
  max-width: 148px !important;
  height: 32px !important;
  padding: 0 24px 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

.supt-inline-status-select {
  width: 100% !important;
  max-width: 112px !important;
  height: 32px !important;
  font-weight: 700 !important;
  padding: 0 24px 0 10px !important;
  font-size: 11px !important;
  letter-spacing: 0.02em !important;
  text-align: left !important;
  border-radius: 999px !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

.supt-inspect-btn-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

.supt-inspect-btn-pill:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Employee Work Summary Banner on /support/tickets */
.supt-employee-summary-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.supt-emp-pill-btn {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.3;
}

.supt-emp-pill-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.supt-emp-metric-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  min-width: 90px;
  text-align: center;
}

/* 4. Customer Profile Tickets Tab */
.custprofile-kpi-grid3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 14px 16px !important;
  margin-bottom: 16px !important;
}

.custprofile-kpi-card {
  background: #ffffff !important;
  padding: 12px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.custprofile-kpi-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* Spacious Zero-Truncation Customer Profile Ticket Cards */
.cprof-ticket-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  overflow-x: auto;
}

.cprof-ticket-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 205px 168px !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 15px 18px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow: hidden !important;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.cprof-ticket-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

/* Zone 1 — Left Complaint Column */
.cprof-tkt-left,
.cprof-tkt-zone1 {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  padding-right: 18px !important;
  border-right: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

/* Row 1 — Meta Row */
.cprof-tkt-meta-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.cprof-ticket-id {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  letter-spacing: -0.2px !important;
}

.cprof-cat-badge {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.cprof-tkt-priority {
  font-size: 10.5px !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: 0 !important;
}

/* Row 2 — Subject / Complaint */
.cprof-tkt-subject,
.cprof-tkt-complaint {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}

/* Row 3 — Submeta / Date & Update */
.cprof-tkt-submeta,
.cprof-tkt-row3 {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}

.cprof-ticket-date {
  white-space: nowrap !important;
  font-size: 12px !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.cprof-tkt-update {
  font-size: 12px !important;
  color: #64748b !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Zone 2 — Center Engineer Column */
.cprof-engineer-block {
  width: 205px !important;
  min-width: 205px !important;
  max-width: 205px !important;
  padding: 4px 16px !important;
  border-right: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  align-self: center !important;
}

.cprof-engineer-name {
  white-space: nowrap !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cprof-engineer-role {
  white-space: nowrap !important;
  font-size: 11.5px !important;
  color: #64748b !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Zone 3 — Right Status & Action Column */
.cprof-tkt-right,
.cprof-tkt-zone3 {
  width: 168px !important;
  min-width: 168px !important;
  max-width: 168px !important;
  padding-left: 14px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.cprof-status-pill {
  white-space: nowrap !important;
}

/* ===========================================================================
   SUPPORT NOC & WORKSPACE v8: CARD STREAM & QUICK-PEEK DRAWER
   Scraps legacy table completely for spacious, modern horizontal ticket cards.
   =========================================================================== */

/* Top Executive Header Bar */
.supt-v8-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.supt-v8-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.supt-v8-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: suptPulse 1.8s infinite;
}

@keyframes suptPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.supt-btn-gradient-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28) !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.supt-btn-gradient-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px);
}

/* 4 Modern KPI Cards (repeat(4, 1fr), gap: 16px) */
.supt-v8-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.supt-v8-kpi-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.supt-v8-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.supt-v8-kpi-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.supt-v8-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.supt-v8-kpi-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.01em;
}

.supt-v8-kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.supt-v8-kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.supt-v8-kpi-sub {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Unified Command Toolbar */
.supt-command-toolbar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.supt-command-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 16px;
  flex-wrap: wrap;
}

.supt-segmented-tabs {
  background: #f1f5f9;
  padding: 3px 4px;
  border-radius: 10px;
  display: inline-flex;
  gap: 3px;
  flex-wrap: nowrap;
  align-items: center;
}

.supt-seg-tab-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

.supt-seg-tab-btn:hover {
  color: #0f172a;
}

.supt-seg-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.supt-seg-tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.supt-seg-tab-btn.active .supt-seg-tab-badge {
  background: #eff6ff;
  color: #2563eb;
}

.supt-pri-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.supt-pri-pill-btn {
  border: none;
  background: transparent;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.supt-pri-pill-btn:hover {
  color: #0f172a;
}

.supt-pri-pill-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.supt-command-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  flex-wrap: nowrap;
}

.supt-search-wrap {
  position: relative;
  flex: 1.8;
  min-width: 280px;
}

.supt-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

.supt-search-input {
  width: 100%;
  height: 38px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0 12px 0 36px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.supt-search-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.supt-filter-select {
  height: 38px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0 28px 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.supt-filter-select:focus {
  border-color: #2563eb;
}

.supt-reset-btn {
  height: 38px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.supt-reset-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* THE CORE BREAKTHROUGH: Modern Horizontal Ticket Cards */
.supt-stream-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.supt-stream-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563eb;
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 250px 1fr 330px;
  align-items: center;
  gap: 20px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  box-sizing: border-box;
  width: 100%;
}

.supt-stream-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

/* Zone 1: Subscriber & Ticket Identity */
.supt-card-zone1 {
  border-right: 1px solid #f1f5f9;
  padding-right: 16px;
  min-width: 0;
}

.supt-zone1-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.supt-ticket-code-pill {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  transition: all 0.12s ease;
}

.supt-ticket-code-pill:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.supt-pri-badge {
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.supt-pri-badge.critical { color: #dc2626; }
.supt-pri-badge.high { color: #d97706; }
.supt-pri-badge.normal { color: #2563eb; }
.supt-pri-badge.low { color: #64748b; }

.supt-rel-time {
  font-size: 11.5px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}

.supt-zone1-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.supt-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.supt-sub-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.supt-sub-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supt-cust-code-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.supt-sub-meta {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zone 2: Complaint Subject, Category & Latest Activity (Spacious 1fr) */
.supt-card-zone2 {
  min-width: 0;
}

.supt-zone2-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.supt-cat-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.supt-address-chip {
  font-size: 11.5px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supt-complaint-headline {
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
  cursor: pointer;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.supt-complaint-headline:hover {
  color: #2563eb;
}

.supt-zone2-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zone 3: Workflow Controls & Actions */
.supt-card-zone3 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.supt-card-staff-select {
  width: 142px !important;
  height: 34px !important;
  padding: 0 24px 0 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  cursor: pointer !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.supt-card-status-select {
  width: 112px !important;
  height: 34px !important;
  padding: 0 24px 0 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-align: left !important;
  border-radius: 999px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  cursor: pointer !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.supt-quick-peek-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.supt-quick-peek-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.supt-card-inspect-btn {
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.supt-card-inspect-btn:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Slide-Over Quick-Peek Drawer */
.supt-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.supt-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.supt-quick-drawer {
  position: fixed !important;
  top: 0 !important;
  left: auto !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 480px !important;
  max-width: 92vw !important;
  background: #ffffff !important;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.16) !important;
  z-index: 1050 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.supt-quick-drawer.open {
  transform: translateX(0) !important;
}

.supt-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.supt-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.supt-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.supt-diag-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.supt-diag-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.supt-diag-tile-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.supt-diag-tile-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

/* ===========================================================================
   Enterprise ISP Operational Ticket Grid (.supt-isp-grid-table) Architecture v10
   Strict Column Isolation & High-Density SaaS Styling (Zero Collision)
   =========================================================================== */

.supt-isp-grid-wrap {
  width: 100% !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 24px !important;
}

.supt-isp-grid-table {
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0 !important;
}

.supt-isp-grid-table thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 12px 10px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.supt-isp-grid-table tbody tr {
  transition: background-color 0.15s ease !important;
}

.supt-isp-grid-table tbody tr:hover {
  background-color: #f8fafc !important;
}

.supt-isp-grid-table tbody td {
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  vertical-align: top !important;
  padding: 12px 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 12.5px !important;
  color: #1e293b !important;
}

/* Col 1: TKT # & Age (9%) */
.supt-col-tkt {
  width: 9% !important;
}
.supt-grid-tkt-pill {
  display: inline-block;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.supt-grid-tkt-pill:hover {
  background: #2563eb;
  color: #ffffff;
}
.supt-grid-date {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
}
.supt-grid-age-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* Col 2: Subscriber Dossier (18%) */
.supt-col-subscriber {
  width: 18% !important;
}
.supt-grid-sub-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.supt-grid-sub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.supt-grid-cust-code {
  font-weight: 800;
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}
.supt-grid-cust-code:hover {
  text-decoration: underline;
}
.supt-grid-cust-id {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}
.supt-grid-cust-type-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
.supt-grid-sub-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
  line-height: 1.3;
  margin: 2px 0;
}
.supt-grid-fin-strip {
  font-size: 11.5px;
  margin: 2px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.supt-fin-bal {
  font-weight: 700;
}
.supt-fin-exp {
  font-weight: 600;
}
.supt-grid-cell-strip {
  font-size: 11.5px;
  color: #475569;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.supt-cell-copy-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #64748b;
  display: inline-flex;
  align-items: center;
}
.supt-cell-copy-btn:hover {
  color: #2563eb;
}
.supt-signal-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.supt-signal-online {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.supt-signal-los {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.supt-signal-weak {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Col 3: Type & Priority (11%) */
.supt-col-type {
  width: 11% !important;
}
.supt-grid-cat-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}
.supt-grid-pri-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.supt-grid-pri-bar.critical {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.supt-grid-pri-bar.high {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}
.supt-grid-pri-bar.normal {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.supt-grid-pri-bar.low {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Col 4: Assigned To (12%) */
.supt-col-assigned {
  width: 12% !important;
}
.supt-grid-staff-sel {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 2px 6px;
  color: #0f172a;
  cursor: pointer;
  box-sizing: border-box;
}
.supt-grid-staff-sel:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.supt-grid-staff-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Col 5: Details & Last Comment (21%) */
.supt-col-details {
  width: 21% !important;
}
.supt-grid-details-text {
  font-size: 12.5px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
}
.supt-grid-details-divider {
  border-top: 1px dashed #e2e8f0;
  margin: 6px 0 5px 0;
}
.supt-grid-last-preview {
  font-size: 11.5px;
  color: #64748b;
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}
.supt-grid-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.supt-grid-mini-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  transition: all 0.15s ease;
}
.supt-grid-mini-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Col 6: PON / POP & Address (13%) */
.supt-col-location {
  width: 13% !important;
}
.supt-grid-pop-pon {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.supt-grid-address {
  font-size: 11.5px;
  color: #64748b;
  word-break: break-word;
  line-height: 1.35;
  margin-top: 3px;
}

/* Col 7: Audit (Open / Close) (8%) */
.supt-col-audit {
  width: 8% !important;
}
.supt-grid-audit-line {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supt-grid-audit-line strong {
  color: #0f172a;
}
.supt-grid-audit-dt {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
}

/* Col 8: TKT Status & Action (8%, right-aligned) */
.supt-col-status {
  width: 8% !important;
  text-align: right !important;
}
.supt-grid-status-sel {
  width: 100%;
  height: 28px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  text-align-last: center;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0 4px;
  box-sizing: border-box;
  margin-bottom: 6px;
}
.supt-grid-status-sel:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.supt-grid-row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.supt-grid-row-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}
.supt-grid-row-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.supt-grid-row-btn-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}
.supt-grid-row-btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Status Colors for Select */
.supt-status-new, .supt-status-active { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #bfdbfe !important; }
.supt-status-assigned, .supt-status-pending { background: #fffbeb !important; color: #b45309 !important; border-color: #fde68a !important; }
.supt-status-solved { background: #f5f3ff !important; color: #6d28d9 !important; border-color: #ddd6fe !important; }
.supt-status-completed { background: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
.supt-status-cancelled { background: #f1f5f9 !important; color: #475569 !important; border-color: #cbd5e1 !important; }

/* Quick Comment Modal & SOP Modal */
.supt-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(2px) !important;
  z-index: 1050 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
}
.supt-modal-backdrop.open {
  display: flex !important;
}
.supt-modal-box {
  background: #ffffff !important;
  border-radius: 14px !important;
  width: 100% !important;
  max-width: 560px !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
}
.supt-modal-header {
  padding: 14px 18px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #f8fafc !important;
}
.supt-modal-body {
  padding: 18px !important;
  overflow-y: auto !important;
  flex: 1 !important;
}
.supt-modal-footer {
  padding: 12px 18px !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  background: #f8fafc !important;
}

/* =============================================================================
   SUPPORT TICKETS V11 MINIMAL & CLEAN UI REDESIGN (.supt-clean-table, unified toolbar)
   ============================================================================= */

.supt-unified-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.supt-unified-search-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.supt-unified-search-wrap .supt-search-icon {
  position: absolute !important;
  left: 11px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.supt-unified-search-input {
  width: 280px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0 12px 0 34px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.supt-unified-search-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12) !important;
}

.supt-unified-filter-btn {
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #334155 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.supt-unified-filter-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.supt-filter-count-badge {
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
}

.supt-filter-popover {
  width: 350px !important;
  padding: 14px 16px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
  position: absolute !important;
  right: 0 !important;
  top: 44px !important;
  z-index: 1050 !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.supt-filter-popover[style*="display: none"] {
  display: none !important;
}

.supt-popover-select {
  width: 100% !important;
  height: 30px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 12px !important;
  padding: 0 8px !important;
  color: #1e293b !important;
  background: #ffffff !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.supt-popover-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}

.supt-active-chips-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #f1f5f9;
  box-sizing: border-box;
}

.supt-active-chips-strip[style*="display: none"] {
  display: none !important;
}

.supt-filter-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  white-space: nowrap !important;
}

.supt-chip-remove-btn {
  border: none !important;
  background: transparent !important;
  color: #2563eb !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  padding: 0 2px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.supt-chip-remove-btn:hover {
  color: #1d4ed8 !important;
}

.supt-chip-clear-all-btn {
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
  padding: 0 4px !important;
}

.supt-chip-clear-all-btn:hover {
  color: #0f172a !important;
}

/* 6-Column Clean Table */
.supt-clean-table-wrap {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-sizing: border-box !important;
}

.supt-clean-table {
  width: 100% !important;
  min-width: 980px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
  margin: 0 !important;
}

.supt-clean-table thead th {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  color: #64748b !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

.supt-clean-table tbody tr {
  transition: background-color 0.15s ease !important;
}

.supt-clean-table tbody tr:hover td {
  background-color: #f8fafc !important;
}

.supt-clean-table tbody td {
  border-bottom: 1px solid #f1f5f9 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.supt-clean-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* Strict Alignment Rule for Columns 1 to 5 (Left-aligned, padding 14px 10px) */
.supt-clean-table thead th:nth-child(1),
.supt-clean-table thead th:nth-child(2),
.supt-clean-table thead th:nth-child(3),
.supt-clean-table thead th:nth-child(4),
.supt-clean-table thead th:nth-child(5),
.supt-clean-table tbody td:nth-child(1),
.supt-clean-table tbody td:nth-child(2),
.supt-clean-table tbody td:nth-child(3),
.supt-clean-table tbody td:nth-child(4),
.supt-clean-table tbody td:nth-child(5),
.supt-clean-table th.supt-c-tkt, .supt-clean-table td.supt-c-tkt,
.supt-clean-table th.supt-c-sub, .supt-clean-table td.supt-c-sub,
.supt-clean-table th.supt-c-prob, .supt-clean-table td.supt-c-prob,
.supt-clean-table th.supt-c-staff, .supt-clean-table td.supt-c-staff,
.supt-clean-table th.supt-c-stat, .supt-clean-table td.supt-c-stat {
  text-align: left !important;
  padding-left: 14px !important;
  padding-right: 10px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  vertical-align: middle !important;
}

/* Strict Alignment Rule for Column 6 (Right-aligned, padding 8px 16px) */
.supt-clean-table thead th:nth-child(6),
.supt-clean-table tbody td:nth-child(6),
.supt-clean-table th.supt-c-act,
.supt-clean-table td.supt-c-act {
  text-align: right !important;
  padding-left: 8px !important;
  padding-right: 16px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  vertical-align: middle !important;
}

/* Column Widths (16%, 21%, 28%, 15%, 11.5%, 8.5% = 100%) */
.supt-clean-table th.supt-c-tkt,
.supt-clean-table td.supt-c-tkt {
  width: 16% !important;
  min-width: 170px !important;
  padding-left: 10px !important;
  padding-right: 4px !important;
}

.supt-clean-table th.supt-c-sub,
.supt-clean-table td.supt-c-sub {
  width: 21% !important;
}

.supt-clean-table th.supt-c-prob,
.supt-clean-table td.supt-c-prob {
  width: 28% !important;
}

.supt-clean-table th.supt-c-staff,
.supt-clean-table td.supt-c-staff {
  width: 15% !important;
}

.supt-clean-table th.supt-c-stat,
.supt-clean-table td.supt-c-stat {
  width: 11.5% !important;
}

.supt-clean-table th.supt-c-act,
.supt-clean-table td.supt-c-act {
  width: 8.5% !important;
}

/* Typography & Inner elements */
.supt-clean-tkt-id {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  display: inline-block !important;
  text-decoration: none !important;
}

.supt-clean-tkt-id:hover {
  text-decoration: underline !important;
}

.supt-clean-date-age {
  font-size: 11px !important;
  color: #64748b !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
}

.supt-clean-sub-name {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.supt-clean-code-badge {
  font-size: 11px !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  margin-left: 6px !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.supt-clean-sub-meta {
  font-size: 12px !important;
  color: #64748b !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.supt-clean-cat-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

.supt-clean-subject {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  margin-top: 4px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
}

/* Staff and Status Selects & Inspect Button Geometry (32px Height, 8px Radius) */
.supt-clean-table .supt-inline-staff-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 12px 12px !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  width: 144px !important;
  height: 32px !important;
  padding: 0 28px 0 10px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  line-height: 30px !important;
  cursor: pointer !important;
  margin: 0 !important;
  display: block !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.supt-clean-table .supt-inline-staff-select:hover {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

.supt-clean-table .supt-inline-staff-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}

.supt-clean-table .supt-inline-status-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  background-size: 11px 11px !important;
  border-radius: 8px !important;
  width: 108px !important;
  height: 32px !important;
  padding: 0 24px 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-align: left !important;
  line-height: 30px !important;
  cursor: pointer !important;
  margin: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
  outline: none !important;
}

/* Status Specific Semantic Colors and Matching SVG Carets */
.supt-clean-table .supt-inline-status-select.supt-status-new,
.supt-clean-table .supt-inline-status-select.supt-status-active {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.supt-clean-table .supt-inline-status-select.supt-status-assigned,
.supt-clean-table .supt-inline-status-select.supt-status-pending {
  background-color: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.supt-clean-table .supt-inline-status-select.supt-status-solved {
  background-color: #f5f3ff !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236d28d9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.supt-clean-table .supt-inline-status-select.supt-status-completed {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.supt-clean-table .supt-inline-status-select.supt-status-cancelled {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.supt-clean-table .supt-inline-staff-select option,
.supt-clean-table .supt-inline-status-select option {
  background: #ffffff !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}

.supt-clean-table .supt-inspect-btn-pill,
.supt-clean-table .supt-clean-inspect-btn {
  height: 32px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #2563eb !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  line-height: 30px !important;
  float: right !important;
  width: 68px !important;
}

.supt-clean-table .supt-inspect-btn-pill:hover,
.supt-clean-table .supt-clean-inspect-btn:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}

/* =============================================================================
   UNIFIED FILTER BUTTON + POPOVER STUDIO ARCHITECTURE (V13)
   Applies across /customers, /billing, /billing/payments, /network/sessions, /network/olts
   ============================================================================= */

/* Customer Unified Toolbar */
.cust-unified-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.cust-segmented-tabs {
  display: none !important;
}

.cust-seg-tab-btn {
  display: none !important;
}

/* Proportional Left Search + Filter Cluster */
.cust-toolbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

.cust-search-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 380px !important;
  max-width: 400px !important;
  flex: 0 1 380px !important;
  min-width: 0 !important;
}

.cust-search-wrap .cust-search-icon {
  position: absolute !important;
  left: 12px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
}

.cust-search-input {
  width: 100% !important;
  height: 38px !important;
  border-radius: 9px !important;
  background-color: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0 34px 0 36px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.cust-search-input:focus {
  background-color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.cust-clear-search-btn {
  position: absolute !important;
  right: 10px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  padding: 2px 4px !important;
  line-height: 1 !important;
  z-index: 2 !important;
}

.cust-clear-search-btn:hover {
  color: #475569 !important;
}

.cust-filter-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.cust-unified-filter-btn {
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #1e293b !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.cust-unified-filter-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.cust-unified-filter-btn.has-active-filters {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.cust-filter-count-badge {
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
}

.cust-reset-btn {
  height: 38px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  box-sizing: border-box !important;
}

/* Right Side of .cust-unified-toolbar */
.cust-toolbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

.cust-count-pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.3 !important;
}

.cust-add-customer-btn {
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12) !important;
  transition: all 0.15s ease !important;
}

.cust-add-customer-btn:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
}

#invoicesFilterBtn,
#invoicesResetBtn,
#paymentsFilterBtn,
#filter-reset-btn,
#nsesFilterBtn,
#nses-filter-reset,
#noltOnusFilterBtn,
#noltOnusResetBtn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Proportional Search Standard (340px–400px) Across All Unified Toolbars */
.billing-search-wrap,
.tx-search-wrap,
.nses-search-wrap,
.nolt-search-wrap {
  flex: 0 1 380px !important;
  max-width: 400px !important;
  min-width: 240px !important;
}

/* 2-Column Advanced Filter Popover Card (Desktop: 520px) */
.cust-filter-popover {
  width: 520px !important;
  padding: 16px 18px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: calc(100% + 6px) !important;
  z-index: 1050 !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.cust-filter-popover[style*="display: none"] {
  display: none !important;
}

.cust-preset-pills-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.cust-preset-pill {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.cust-preset-pill:hover {
  border-color: #2563eb !important;
  color: #2563eb !important;
  background: #eff6ff !important;
}

.cust-popover-grid-2col {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
}

.cust-filter-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.cust-filter-label {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin-bottom: 2px !important;
  display: block !important;
}

/* Custom Styled Select with SVG Chevron and Zero Browser Carets */
.supt-form-select,
.cust-form-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 12px 12px !important;
  width: 100% !important;
  height: 34px !important;
  border-radius: 7px !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 12.5px !important;
  padding: 0 28px 0 10px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.supt-form-select:focus,
.cust-form-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12) !important;
}

/* Active Chips Strip */
.cust-active-chips-strip {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  padding: 8px 16px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-top: none !important;
  box-sizing: border-box !important;
}

.cust-active-chips-strip[style*="display: none"] {
  display: none !important;
}

.cust-filter-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  white-space: nowrap !important;
}

.cust-chip-remove-btn {
  border: none !important;
  background: transparent !important;
  color: #2563eb !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  padding: 0 2px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.cust-chip-remove-btn:hover {
  color: #1d4ed8 !important;
}

.cust-chip-clear-all-btn {
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
  padding: 0 4px !important;
}

.cust-chip-clear-all-btn:hover {
  color: #0f172a !important;
}

/* =============================================================================
   CUSTOMER UNIFIED TOOLBAR, CONTROLS, POPOVER & SCROLLBAR POLISH (v103)
   ============================================================================= */
[data-theme="dark"] .cust-unified-toolbar,
body.dark-mode .cust-unified-toolbar {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  border-bottom-color: var(--dark-border) !important;
}

[data-theme="dark"] .cust-search-input,
body.dark-mode .cust-search-input {
  background-color: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .cust-search-input:focus,
body.dark-mode .cust-search-input:focus {
  background-color: var(--dark-bg-elevated) !important;
  border-color: var(--color-brand, #2563eb) !important;
}

[data-theme="dark"] .cust-unified-filter-btn,
body.dark-mode .cust-unified-filter-btn,
[data-theme="dark"] #custUnifiedFilterBtn,
body.dark-mode #custUnifiedFilterBtn {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border-strong) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .cust-unified-filter-btn:hover,
body.dark-mode .cust-unified-filter-btn:hover,
[data-theme="dark"] #custUnifiedFilterBtn:hover,
body.dark-mode #custUnifiedFilterBtn:hover {
  background: var(--dark-bg-hover) !important;
  border-color: var(--dark-border-strong) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .cust-unified-filter-btn.has-active-filters,
body.dark-mode .cust-unified-filter-btn.has-active-filters {
  background: rgba(37, 99, 235, 0.2) !important;
  border-color: var(--color-brand, #3b82f6) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .cust-reset-btn,
body.dark-mode .cust-reset-btn,
[data-theme="dark"] #custResetFilterBtn,
body.dark-mode #custResetFilterBtn {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .cust-count-pill,
body.dark-mode .cust-count-pill {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .cust-filter-popover,
body.dark-mode .cust-filter-popover {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border-strong) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .cust-preset-pills-row,
body.dark-mode .cust-preset-pills-row {
  border-bottom-color: var(--dark-border) !important;
}

[data-theme="dark"] .cust-preset-pill,
body.dark-mode .cust-preset-pill {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .cust-preset-pill:hover,
body.dark-mode .cust-preset-pill:hover {
  background: var(--dark-bg-hover) !important;
  border-color: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .cust-filter-label,
body.dark-mode .cust-filter-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cust-form-select,
body.dark-mode .cust-form-select,
[data-theme="dark"] .supt-form-select,
body.dark-mode .supt-form-select {
  background-color: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

[data-theme="dark"] .cust-active-chips-strip,
body.dark-mode .cust-active-chips-strip {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .cust-filter-chip,
body.dark-mode .cust-filter-chip {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .cust-chip-clear-all-btn,
body.dark-mode .cust-chip-clear-all-btn {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cust-chip-clear-all-btn:hover,
body.dark-mode .cust-chip-clear-all-btn:hover {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .cust-filter-popover-header,
body.dark-mode .cust-filter-popover-header,
[data-theme="dark"] .cust-filter-popover-footer,
body.dark-mode .cust-filter-popover-footer {
  border-color: var(--dark-border) !important;
}

/* Day Badges in Customer Due and Expired Views */
.cust-days-left-badge {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

[data-theme="dark"] .cust-days-left-badge,
body.dark-mode .cust-days-left-badge {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.cust-days-overdue-badge {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

[data-theme="dark"] .cust-days-overdue-badge,
body.dark-mode .cust-days-overdue-badge {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

/* Dark Scrollbar Polish for Tables (Eliminate Native White Bottom Track) */
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .customers-table-wrap,
[data-theme="dark"] .billing-table-wrap,
[data-theme="dark"] .dash-table-wrap,
body.dark-mode .table-wrap,
body.dark-mode .customers-table-wrap,
body.dark-mode .billing-table-wrap,
body.dark-mode .dash-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--dark-border-strong) transparent;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar,
[data-theme="dark"] .customers-table-wrap::-webkit-scrollbar,
[data-theme="dark"] .billing-table-wrap::-webkit-scrollbar,
[data-theme="dark"] .dash-table-wrap::-webkit-scrollbar,
body.dark-mode .table-wrap::-webkit-scrollbar,
body.dark-mode .customers-table-wrap::-webkit-scrollbar,
body.dark-mode .billing-table-wrap::-webkit-scrollbar,
body.dark-mode .dash-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-track,
[data-theme="dark"] .customers-table-wrap::-webkit-scrollbar-track,
[data-theme="dark"] .billing-table-wrap::-webkit-scrollbar-track,
[data-theme="dark"] .dash-table-wrap::-webkit-scrollbar-track,
body.dark-mode .table-wrap::-webkit-scrollbar-track,
body.dark-mode .customers-table-wrap::-webkit-scrollbar-track,
body.dark-mode .billing-table-wrap::-webkit-scrollbar-track,
body.dark-mode .dash-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .customers-table-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .billing-table-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .dash-table-wrap::-webkit-scrollbar-thumb,
body.dark-mode .table-wrap::-webkit-scrollbar-thumb,
body.dark-mode .customers-table-wrap::-webkit-scrollbar-thumb,
body.dark-mode .billing-table-wrap::-webkit-scrollbar-thumb,
body.dark-mode .dash-table-wrap::-webkit-scrollbar-thumb {
  background: var(--dark-border-strong);
  border-radius: 4px;
}

/* Activity Hub Header & Panels */
.activity-hub-header {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
}

[data-theme="dark"] .activity-hub-header,
body.dark-mode .activity-hub-header {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .act-panel-box,
body.dark-mode .act-panel-box {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

/* Customer Profile Stale Banners */
.custprofile-stale-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .custprofile-stale-danger,
body.dark-mode .custprofile-stale-danger {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.custprofile-stale-warning {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .custprofile-stale-warning,
body.dark-mode .custprofile-stale-warning {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #fcd34d !important;
}

/* Customer Profile Segmented Controls */
[data-theme="dark"] .ip-mode-segmented-switcher,
body.dark-mode .ip-mode-segmented-switcher,
[data-theme="dark"] .mgmt-proto-toggle,
body.dark-mode .mgmt-proto-toggle {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .cprof-ticket-card,
body.dark-mode .cprof-ticket-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

/* Customer Groups Policy Radio Cards */
[data-theme="dark"] .policy-radio-card,
body.dark-mode .policy-radio-card {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .policy-radio-card div,
body.dark-mode .policy-radio-card div {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .policy-radio-card.active-std,
body.dark-mode .policy-radio-card.active-std {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: var(--color-brand, #2563eb) !important;
}

[data-theme="dark"] .policy-radio-card.active-vip,
body.dark-mode .policy-radio-card.active-vip {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: #d97706 !important;
}

[data-theme="dark"] .policy-radio-card.active-free,
body.dark-mode .policy-radio-card.active-free {
  background: rgba(148, 163, 184, 0.15) !important;
  border-color: #64748b !important;
}

/* Customer Areas, Groups, Import/Export, Map in Dark Mode */
[data-theme="dark"] .areas-table-card,
body.dark-mode .areas-table-card,
[data-theme="dark"] .groups-table-card,
body.dark-mode .groups-table-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .areas-table-card .card-header,
body.dark-mode .areas-table-card .card-header,
[data-theme="dark"] .groups-table-card .card-header,
body.dark-mode .groups-table-card .card-header {
  border-bottom-color: var(--dark-border) !important;
}

[data-theme="dark"] .areas-table-card .badge,
body.dark-mode .areas-table-card .badge,
[data-theme="dark"] .groups-table-card .badge,
body.dark-mode .groups-table-card .badge {
  background: var(--dark-bg-subtle) !important;
  color: #cbd5e1 !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .groups-table-card .badge[style*="#ecfdf5"],
body.dark-mode .groups-table-card .badge[style*="#ecfdf5"],
[data-theme="dark"] .areas-table-card .badge[style*="#ecfdf5"],
body.dark-mode .areas-table-card .badge[style*="#ecfdf5"] {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .groups-table-card .badge[style*="#fef2f2"],
body.dark-mode .groups-table-card .badge[style*="#fef2f2"],
[data-theme="dark"] .groups-table-card .badge[style*="#fee2e2"],
body.dark-mode .groups-table-card .badge[style*="#fee2e2"],
[data-theme="dark"] .areas-table-card .badge[style*="#fee2e2"],
body.dark-mode .areas-table-card .badge[style*="#fee2e2"] {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .groups-table-card .badge[style*="#fef3c7"],
body.dark-mode .groups-table-card .badge[style*="#fef3c7"] {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .groups-table-card .badge[style*="#e0f2fe"],
body.dark-mode .groups-table-card .badge[style*="#e0f2fe"] {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

[data-theme="dark"] .cust-popup-row,
body.dark-mode .cust-popup-row {
  background: var(--dark-bg-subtle) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .leaflet-popup-content-wrapper,
body.dark-mode .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip,
body.dark-mode .leaflet-popup-tip {
  background: var(--dark-bg-surface) !important;
  color: #e2e8f0 !important;
  border: 1px solid var(--dark-border) !important;
}

.cust-map-badge-online {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="dark"] .cust-map-badge-online,
body.dark-mode .cust-map-badge-online {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.cust-map-badge-warning {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
[data-theme="dark"] .cust-map-badge-warning,
body.dark-mode .cust-map-badge-warning {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fcd34d !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.cust-map-badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
[data-theme="dark"] .cust-map-badge-danger,
body.dark-mode .cust-map-badge-danger {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.cust-map-badge-tj {
  background: #f1f5f9;
  color: #334155;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
}
[data-theme="dark"] .cust-map-badge-tj,
body.dark-mode .cust-map-badge-tj {
  background: var(--dark-bg-subtle) !important;
  color: #cbd5e1 !important;
  border: 1px solid var(--dark-border) !important;
}

[data-theme="dark"] .cust-popup-fiber-meta,
body.dark-mode .cust-popup-fiber-meta {
  background: var(--dark-bg-subtle) !important;
  color: #e2e8f0 !important;
}

/* =============================================================================
   MOBILE-ONLY RESPONSIVENESS ENGINE (@media max-width: 768px)
   STRICTLY SCOPED: 100% ISOLATED WITH ZERO IMPACT AT 1366x768 DESKTOP!
   ============================================================================= */
@media (max-width: 768px) {
  /* Prevent horizontal page overflow across entire application */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .content, .main-content {
    padding: 12px !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* -------------------------------------------------------------------------
     1. SUPPORT TICKETS QUEUE (/support/tickets)
     ------------------------------------------------------------------------- */
  /* Header: Stack title and action buttons across 2 compact rows */
  .supt-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
  }

  .supt-header-actions {
    display: flex !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .supt-header-actions .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 6px !important;
    font-size: 11.5px !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 4 KPI Cards: Compact 2x2 Grid */
  .supt-v8-kpi-grid,
  .supt-v8-kpis-grid,
  #practicalKPIs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .supt-v8-kpi-card {
    padding: 12px 14px !important;
  }

  .supt-v8-kpi-val {
    font-size: 20px !important;
  }

  /* Toolbar: Status tabs scroll horizontally + Search & Filter row */
  .supt-unified-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }

  .supt-segmented-tabs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    max-width: 100% !important;
    display: flex !important;
    padding: 3px !important;
  }

  .supt-segmented-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .supt-seg-tab-btn {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    flex-shrink: 0 !important;
  }

  .supt-unified-toolbar > div:last-child {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .supt-unified-search-wrap {
    flex: 1 1 auto !important;
    width: auto !important;
  }

  .supt-unified-search-input {
    width: 100% !important;
    min-width: 0 !important;
  }

  .supt-unified-filter-btn {
    flex: 0 0 auto !important;
  }

  /* Centered / Bottom-Anchored Mobile Filter Sheet */
  .supt-filter-popover,
  #unifiedFilterPopover,
  #custUnifiedFilterPopover,
  .cust-filter-popover,
  #invoicesFilterPopover,
  #paymentsFilterPopover,
  #nsesFilterPopover,
  #noltOnusFilterPopover,
  #pkgUnifiedFilterPopover,
  #pkgChangesFilterPopover {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25) !important;
  }

  /* Mobile Ticket Card Transformation (.supt-clean-table <= 768px ONLY!) */
  .supt-clean-table-wrap {
    background: transparent !important;
    border: none !important;
  }

  .supt-clean-table thead {
    display: none !important;
  }

  .supt-clean-table,
  .supt-clean-table tbody {
    display: block !important;
    width: 100% !important;
  }

  .supt-clean-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr 110px auto !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    width: 100% !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  }

  .supt-clean-table td.supt-c-num {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 0 6px 0 !important;
    border: none !important;
    border-bottom: 1px dashed #f1f5f9 !important;
    width: 100% !important;
  }

  .supt-clean-table td.supt-c-sub {
    grid-column: 1 / -1 !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
  }

  .supt-clean-table td.supt-c-prob {
    grid-column: 1 / -1 !important;
    display: block !important;
    padding: 0 0 4px 0 !important;
    border: none !important;
    width: 100% !important;
  }

  .supt-clean-table td.supt-c-staff {
    grid-column: 1 !important;
    display: block !important;
    padding: 10px 0 0 0 !important;
    border: none !important;
    border-top: 1px solid #f1f5f9 !important;
    width: 100% !important;
  }

  .supt-clean-table td.supt-c-staff .supt-inline-staff-select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .supt-clean-table td.supt-c-stat {
    grid-column: 2 !important;
    display: block !important;
    padding: 10px 0 0 0 !important;
    border: none !important;
    border-top: 1px solid #f1f5f9 !important;
    width: 110px !important;
  }

  .supt-clean-table td.supt-c-stat .supt-inline-status-select {
    width: 110px !important;
  }

  .supt-clean-table td.supt-c-act {
    grid-column: 3 !important;
    display: block !important;
    padding: 10px 0 0 0 !important;
    border: none !important;
    border-top: 1px solid #f1f5f9 !important;
    text-align: right !important;
  }

  .supt-clean-table td.supt-c-act .supt-inspect-btn-pill,
  .supt-clean-table td.supt-c-act .supt-clean-inspect-btn {
    float: none !important;
    display: inline-flex !important;
  }

  /* -------------------------------------------------------------------------
     2. CREATE TICKET (/support/tickets/new) & INSPECT (/support/tickets/:id)
     ------------------------------------------------------------------------- */
  .supt-layout-2col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .supt-problem-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .supt-inspect-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  .supt-inspect-header-left {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .supt-inspect-header-right {
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .supt-inspect-header-right .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .supt-summary-grid-2x2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .supt-diag-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* -------------------------------------------------------------------------
     3. SUPPORT STAFF, CANNED RESPONSES & SETTINGS
     ------------------------------------------------------------------------- */
  .supt-kpi-grid,
  .pkg-kpi-grid,
  .staff-kpis-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  #settingsHeaderRow {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .supt-canned-categories {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  /* -------------------------------------------------------------------------
     4. CUSTOMERS PAGE (/customers)
     ------------------------------------------------------------------------- */
  .customers-page .customers-summary-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .cust-unified-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }

  .cust-toolbar-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .cust-search-wrap {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .cust-search-input {
    width: 100% !important;
    min-width: 0 !important;
  }

  .cust-toolbar-right {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-left: 0 !important;
  }

  .cust-count-pill {
    font-size: 11px !important;
    padding: 3px 8px !important;
  }

  .cust-add-customer-btn {
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  .cust-unified-filter-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  .cust-reset-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  .cust-popover-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* -------------------------------------------------------------------------
     5. OTHER LIST PAGES (BILLING, PAYMENTS, NETWORK SESSIONS, OLTs)
     ------------------------------------------------------------------------- */
  .billing-toolbar-row,
  .tx-toolbar-row,
  .nses-filter-row,
  .nolt-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .billing-search-wrap,
  .tx-search-wrap,
  .nses-search-wrap,
  .nolt-search-wrap {
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  .billing-toolbar-filters {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* Horizontal scrolling for all wide tables on mobile */
  .data-table-wrap,
  .billing-table-wrap,
  .tx-table-wrapper,
  .nses-table-wrapper,
  .nolt-table-wrap,
  .customers-page .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 640px) {
  .supt-form-row-2col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* =========================================================================
   MASTER UI/UX & FILTER POPOVER REMEDIATION DIRECTIVE (v16)
   ========================================================================= */

/* Rule A (Parent Card & Toolbar Overflow/Stacking):
   Every card or container wrapping a unified filter toolbar MUST have:
   overflow: visible !important; position: relative !important; z-index: 40 !important;
   The toolbar wrapper itself MUST have overflow: visible !important; position: relative !important; z-index: 50 !important;. */
.nses-toolbar-card,
.tx-toolbar-card,
.billing-toolbar-card,
.nolt-filter-bar,
.nolt-workspace-container,
.nolt-workspace-tab,
.supt-toolbar-card,
.cust-toolbar-card,
.pkg-toolbar-card,
.package-toolbar,
.packages-filter-card {
  overflow: visible !important;
  position: relative !important;
  z-index: 40 !important;
  max-height: none !important;
}

.nses-filter-row,
.tx-toolbar-row,
.billing-toolbar-row,
.billing-toolbar-filters,
.supt-unified-toolbar,
.cust-unified-toolbar,
.pkg-toolbar-row,
.pkg-unified-toolbar,
.packages-filter-row {
  overflow: visible !important;
  position: relative !important;
  z-index: 50 !important;
  max-height: none !important;
}

/* Ensure the button-popover relative container has higher z-index and overflow visible */
.tx-toolbar-row > div[style*="position:relative"],
.nses-filter-row > div[style*="position:relative"],
.nolt-filter-bar > div[style*="position:relative"],
.billing-toolbar-filters,
.filter-btn-popover-wrap,
.pkg-filter-wrap {
  position: relative !important;
  overflow: visible !important;
  z-index: 60 !important;
}

/* Rule B (Popover Floating Overlay Geometry on Desktop > 768px):
   Every unified filter popover on desktop (> 768px) MUST use:
   position: absolute !important; top: calc(100% + 8px) !important; left: 0 !important;
   z-index: 9999 !important; background: #ffffff !important; border: 1px solid #cbd5e1 !important;
   border-radius: 12px !important; padding: 18px !important;
   box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14) !important; */
@media (min-width: 769px) {
  .cust-filter-popover,
  .supt-filter-popover,
  #nsesFilterPopover,
  #paymentsFilterPopover,
  #invoicesFilterPopover,
  #noltOnusFilterPopover,
  #custUnifiedFilterPopover,
  #unifiedFilterPopover,
  #pkgUnifiedFilterPopover,
  #pkgChangesFilterPopover {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 18px !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14) !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  #nsesFilterPopover {
    width: 380px !important;
  }
}

:root[data-theme="dark"] .cust-filter-popover,
:root[data-theme="dark"] .supt-filter-popover,
:root[data-theme="dark"] #nsesFilterPopover,
:root[data-theme="dark"] #paymentsFilterPopover,
:root[data-theme="dark"] #invoicesFilterPopover,
:root[data-theme="dark"] #noltOnusFilterPopover,
:root[data-theme="dark"] #custUnifiedFilterPopover,
:root[data-theme="dark"] #unifiedFilterPopover,
:root[data-theme="dark"] #pkgUnifiedFilterPopover,
:root[data-theme="dark"] #pkgChangesFilterPopover {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
}

/* =========================================================================
   PART 2: SLEEK 4-CARD EXECUTIVE METRIC RIBBON (Payment Gateways & Subpages)
   ========================================================================= */
.gw-kpi-grid,
.recon-kpi-grid,
.tx-kpi-grid,
.pkg-changes-kpi-grid,
.pos-kpi-grid,
.pos-page-container .pkg-kpi-grid,
.mbl-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
}

@media (max-width: 1024px) {
  .gw-kpi-grid,
  .recon-kpi-grid,
  .tx-kpi-grid,
  .pkg-changes-kpi-grid,
  .pos-kpi-grid,
  .pos-page-container .pkg-kpi-grid,
  .mbl-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .gw-kpi-grid,
  .recon-kpi-grid,
  .tx-kpi-grid,
  .pkg-changes-kpi-grid,
  .pos-kpi-grid,
  .pos-page-container .pkg-kpi-grid,
  .mbl-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

.gw-kpi-grid .pkg-kpi-card,
.recon-kpi-grid .pkg-kpi-card,
.tx-kpi-grid .pkg-kpi-card,
.pkg-changes-kpi-grid .pkg-kpi-card,
.pos-kpi-grid .pkg-kpi-card,
.pos-page-container .pkg-kpi-card,
.pos-page-container .pkg-kpi-grid .pkg-kpi-card,
.payments-collect-page .pkg-kpi-grid .pkg-kpi-card,
.mbl-kpi-grid .pkg-kpi-card,
.mbl-kpi-card,
.packages-summary-grid .package-summary-card,
.packages-summary-grid .summary-card,
.nip-kpi-grid .pkg-kpi-card,
.nip-kpi-card,
.nolt-kpi-grid .pkg-kpi-card,
.nolt-kpi-card,
.nses-kpi-grid .pkg-kpi-card,
.nses-kpi-card,
.pkg-kpi-card {
  min-height: 112px !important;
  height: auto !important;
  max-height: none !important;
  padding: 16px 18px 16px 18px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: all 0.15s ease !important;
}

:root[data-theme="dark"] .gw-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .recon-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .tx-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .pkg-changes-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .pos-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .pos-page-container .pkg-kpi-card,
:root[data-theme="dark"] .pos-page-container .pkg-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .payments-collect-page .pkg-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .mbl-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .mbl-kpi-card,
:root[data-theme="dark"] .packages-summary-grid .package-summary-card,
:root[data-theme="dark"] .packages-summary-grid .summary-card,
:root[data-theme="dark"] .nip-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .nip-kpi-card,
:root[data-theme="dark"] .nolt-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .nolt-kpi-card,
:root[data-theme="dark"] .nses-kpi-grid .pkg-kpi-card,
:root[data-theme="dark"] .nses-kpi-card,
:root[data-theme="dark"] .pkg-kpi-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.gw-kpi-grid .pkg-kpi-card:hover,
.recon-kpi-grid .pkg-kpi-card:hover,
.tx-kpi-grid .pkg-kpi-card:hover,
.pkg-changes-kpi-grid .pkg-kpi-card:hover,
.pos-kpi-grid .pkg-kpi-card:hover,
.pos-page-container .pkg-kpi-card:hover,
.pos-page-container .pkg-kpi-grid .pkg-kpi-card:hover,
.payments-collect-page .pkg-kpi-grid .pkg-kpi-card:hover,
.mbl-kpi-grid .pkg-kpi-card:hover,
.mbl-kpi-card:hover,
.packages-summary-grid .package-summary-card:hover,
.packages-summary-grid .summary-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
  border-color: #cbd5e1 !important;
}

.gw-kpi-grid .pkg-kpi-top,
.recon-kpi-grid .pkg-kpi-top,
.tx-kpi-grid .pkg-kpi-top,
.pkg-changes-kpi-grid .pkg-kpi-top,
.pos-kpi-grid .pkg-kpi-top,
.pos-page-container .pkg-kpi-top,
.mbl-kpi-grid .pkg-kpi-top,
.pkg-kpi-ribbon-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
}

.gw-kpi-grid .pkg-kpi-label,
.recon-kpi-grid .pkg-kpi-label,
.tx-kpi-grid .pkg-kpi-label,
.pkg-changes-kpi-grid .pkg-kpi-label,
.pos-kpi-grid .pkg-kpi-label,
.pos-page-container .pkg-kpi-label,
.mbl-kpi-grid .pkg-kpi-label,
.pkg-kpi-ribbon-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}

:root[data-theme="dark"] .gw-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .recon-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .tx-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .pkg-changes-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .pos-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .pos-page-container .pkg-kpi-label,
:root[data-theme="dark"] .mbl-kpi-grid .pkg-kpi-label,
:root[data-theme="dark"] .pkg-kpi-ribbon-label {
  color: #94a3b8 !important;
}

.gw-kpi-grid .pkg-kpi-icon,
.recon-kpi-grid .pkg-kpi-icon,
.tx-kpi-grid .pkg-kpi-icon,
.pkg-changes-kpi-grid .pkg-kpi-icon,
.pos-kpi-grid .pkg-kpi-icon,
.pos-page-container .pkg-kpi-icon,
.mbl-kpi-grid .pkg-kpi-icon,
.pkg-kpi-ribbon-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.kpi-value,
.tx-kpi-value,
.pkg-kpi-value,
.pkg-kpi-ribbon-value,
.pos-kpi-value,
.gw-kpi-grid .pkg-kpi-value,
.recon-kpi-grid .pkg-kpi-value,
.tx-kpi-grid .pkg-kpi-value,
.pkg-changes-kpi-grid .pkg-kpi-value,
.pos-kpi-grid .pkg-kpi-value,
.pos-page-container .pkg-kpi-value,
.mbl-kpi-grid .pkg-kpi-value,
#stat-total-collected,
#stat-mfs-total,
#stat-cash-total,
#stat-reversed-total {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.25 !important;
  height: auto !important;
  min-height: 28px !important;
  overflow: visible !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

:root[data-theme="dark"] .kpi-value,
:root[data-theme="dark"] .tx-kpi-value,
:root[data-theme="dark"] .pkg-kpi-value,
:root[data-theme="dark"] .pkg-kpi-ribbon-value,
:root[data-theme="dark"] .pos-kpi-value,
:root[data-theme="dark"] .gw-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] .recon-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] .tx-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] .pkg-changes-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] .pos-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] .pos-page-container .pkg-kpi-value,
:root[data-theme="dark"] .mbl-kpi-grid .pkg-kpi-value,
:root[data-theme="dark"] #stat-total-collected,
:root[data-theme="dark"] #stat-mfs-total,
:root[data-theme="dark"] #stat-cash-total,
:root[data-theme="dark"] #stat-reversed-total {
  color: #f8fafc !important;
}

.gw-kpi-grid .pkg-kpi-pills,
.recon-kpi-grid .pkg-kpi-pills,
.tx-kpi-grid .pkg-kpi-pills,
.pkg-changes-kpi-grid .pkg-kpi-pills,
.pos-kpi-grid .pkg-kpi-pills,
.pos-page-container .pkg-kpi-pills,
.mbl-kpi-grid .pkg-kpi-pills,
.pkg-kpi-ribbon-pills,
.nip-kpi-pills,
.nolt-kpi-pills,
.nses-kpi-pills,
.nrad-kpi-pills,
.pkg-kpi-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 2px 0 0 0 !important;
  margin-top: 2px !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
  min-height: 20px !important;
  max-width: 100% !important;
}

.gw-kpi-grid .pkg-kpi-pill,
.recon-kpi-grid .pkg-kpi-pill,
.tx-kpi-grid .pkg-kpi-pill,
.pkg-changes-kpi-grid .pkg-kpi-pill,
.pos-kpi-grid .pkg-kpi-pill,
.pos-page-container .pkg-kpi-pill,
.mbl-kpi-grid .pkg-kpi-pill,
.pkg-kpi-ribbon-pill,
.nip-kpi-pill,
.nolt-kpi-pill,
.nses-kpi-pill,
.pkg-kpi-pill {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.2 !important;
  height: 20px !important;
}

/* =========================================================================
   PART 3: REDESIGNED /packages & /packages/changes STUDIO STANDARDS
   ========================================================================= */
.packages-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
}

@media (max-width: 1024px) {
  .packages-summary-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .packages-summary-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Plan Revenue & Subscriber Share Bar */
.pkg-share-strip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  margin-bottom: 16px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

:root[data-theme="dark"] .pkg-share-strip {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
}

/* Package Toolbar Proportions & Buttons */
.pkg-search-wrap {
  width: 380px !important;
  max-width: 400px !important;
  min-width: 300px !important;
}

@media (max-width: 768px) {
  .pkg-search-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.packages-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}

.packages-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.packages-table td.package-actions {
  overflow: visible !important;
}

.packages-table-wrapper {
  overflow-x: hidden !important;
}

@media (max-width: 1024px) {
  .packages-table-wrapper {
    overflow-x: auto !important;
  }
}

.pkg-btn-action {
  height: 28px !important;
  min-height: 28px !important;
  border-radius: 6px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}

.radius-users-table,
#nradSubsTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}

.radius-users-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radius-users-table td:last-child {
  overflow: visible !important;
}

#nradSubsTableWrapper {
  overflow-x: hidden !important;
}

@media (max-width: 1024px) {
  #nradSubsTableWrapper {
    overflow-x: auto !important;
  }
}

.router-fleet-table th,
.nses-table th {
  padding: 8px 10px !important;
  height: 36px !important;
  max-height: 38px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.billing-cmd-pill,
.billing-cmd-health-pill {
  white-space: nowrap !important;
  height: 26px !important;
  max-height: 28px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

td.package-actions {
  padding-right: 16px !important;
  text-align: right !important;
  white-space: nowrap !important;
}

/* Plan Cards Alternate Grid */
.pkg-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 16px !important;
  padding: 16px !important;
}

.pkg-plan-card {
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.15s ease !important;
}

:root[data-theme="dark"] .pkg-plan-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.pkg-plan-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}

/* Package Table Mini Progress Bar */
.pkg-mini-progress-bar {
  width: 100% !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  margin-top: 5px !important;
  overflow: hidden !important;
}

:root[data-theme="dark"] .pkg-mini-progress-bar {
  background: var(--dark-bg-subtle) !important;
}

.pkg-mini-progress-fill {
  height: 100% !important;
  background: #10b981 !important;
  border-radius: 999px !important;
  transition: width 0.3s ease !important;
}

/* ==========================================================================
   v21: Customer Remote Router Management & Dedicated Static IP Full-Width Studios
   ========================================================================== */
.network-studios-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  margin-top: 16px !important;
}

.static-ip-studio-card,
.remote-mgmt-studio-card {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  overflow: hidden !important;
  margin-top: 0 !important;
}

/* Activity Tab Category Pills & Modern Filter Controls */
.act-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  user-select: none;
}

.act-cat-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.act-cat-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.ip-mode-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none !important;
}

.ip-mode-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.ip-mode-segmented-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--color-bg-secondary, #f1f5f9);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  height: 38px;
  box-sizing: border-box;
  margin-bottom: 14px;
}

.ip-mode-seg-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
}

.ip-mode-seg-btn.active {
  background: var(--color-surface, #ffffff);
  color: #2563eb;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mgmt-proto-toggle {
  display: inline-flex;
  background: var(--color-bg-secondary, #f1f5f9);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e2e8f0);
  height: 36px;
  box-sizing: border-box;
  width: 100%;
}

.mgmt-proto-btn {
  flex: 1;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mgmt-proto-btn.active {
  background: var(--color-surface, #ffffff);
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mgmt-preset-chip {
  transition: all 0.15s ease !important;
  user-select: none !important;
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  cursor: pointer;
}

.mgmt-preset-chip:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #1e293b !important;
}

.hero-remote-btn {
  transition: background 0.15s ease !important;
}

.hero-remote-btn:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

.custprofile-chip--remote-launch:hover {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
}

.custprofile-chip--static-ip:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
}

/* Dark mode adjustments */
:root[data-theme="dark"] .ip-mode-segmented-switcher,
[data-theme="dark"] .ip-mode-segmented-switcher,
:root[data-theme="dark"] .mgmt-proto-toggle,
[data-theme="dark"] .mgmt-proto-toggle {
  background: var(--color-bg-secondary, var(--dark-bg-elevated)) !important;
  border-color: var(--dark-border) !important;
}

:root[data-theme="dark"] .ip-mode-seg-btn.active,
[data-theme="dark"] .ip-mode-seg-btn.active,
:root[data-theme="dark"] .mgmt-proto-btn.active,
[data-theme="dark"] .mgmt-proto-btn.active {
  background: var(--color-surface, var(--dark-bg-elevated)) !important;
  color: #60a5fa !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

:root[data-theme="dark"] .mgmt-preset-chip,
[data-theme="dark"] .mgmt-preset-chip {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--color-text, #f8fafc) !important;
}

:root[data-theme="dark"] .mgmt-preset-chip:hover,
[data-theme="dark"] .mgmt-preset-chip:hover {
  background: var(--dark-bg-hover) !important;
  color: #ffffff !important;
}

/* =========================================================================
   ISP INVENTORY MANAGEMENT MODULE (v23) — STRICT DESIGN STANDARDS
   Zero Duplicate Symbols, Executive 4-Card Ribbon, 380px Search, Fixed Tables
   ========================================================================= */

.inv-page-container {
  padding: 24px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.inv-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.inv-title-area h1 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-title-area p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* v42: platform-standard page-title typography. The communication studios
   render <h1 class="inv-page-title"> directly; without these rules an h1
   outside .inv-title-area falls back to the 32px browser default (the
   "giant heading" defect). These hard rules pin every page to the crisp
   Customers/Inventory scale: 20px title, 13px subtitle. */
.inv-page-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em !important;
  color: #0f172a !important;
  margin: 0 !important;
}

.inv-page-subtitle {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: #64748b !important;
  margin: 2px 0 0 0 !important;
}

.inv-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Executive 4-Card KPI Ribbon */
.inv-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
  width: 100% !important;
}

.inv-kpi-card {
  position: relative !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  min-height: 114px !important;
  height: auto !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  /* v28: flex gap guarantees label-to-value clearance even when a 2-line
     label (e.g. SCHEDULED WINDOWS) consumes all free space, so the metric
     value can never touch the label above it (>= 6px always). */
  gap: 6px !important;
  box-sizing: border-box !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.inv-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}

.inv-kpi-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  margin-bottom: 2px !important;
}

.inv-kpi-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  /* v28: predictable line height so wrapped 2-line labels keep clean geometry */
  line-height: 1.35 !important;
}

.inv-kpi-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.inv-kpi-icon.emerald { background: #ecfdf5 !important; color: #059669 !important; }
.inv-kpi-icon.blue    { background: #eff6ff !important; color: #2563eb !important; }
.inv-kpi-icon.indigo  { background: #eef2ff !important; color: #4f46e5 !important; }
.inv-kpi-icon.amber   { background: #fffbeb !important; color: #d97706 !important; }
.inv-kpi-icon.rose    { background: #fff1f2 !important; color: #e11d48 !important; }
.inv-kpi-icon.purple  { background: #faf5ff !important; color: #9333ea !important; }

.inv-kpi-val {
  font-size: 23px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  min-height: 28px !important;
  margin: 0 0 6px 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

.inv-kpi-pill {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  width: fit-content !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

/* Global Anti-Wrapping Single-Line Invariant for Badges & Pills */
.inv-badge,
.inv-status-pill,
.inv-health-pill,
.inv-type-pill,
.inv-po-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  width: fit-content !important;
  box-sizing: border-box !important;
}

.inv-health-pill {
  height: 22px !important;
  font-size: 11px !important;
  padding: 0 8px !important;
}

.inv-badge.emerald, .inv-status-pill.emerald, .inv-health-pill.emerald, .inv-type-pill.emerald, .inv-po-status-pill.emerald, .inv-kpi-pill.emerald { background: #d1fae5 !important; color: #047857 !important; border: 1px solid #a7f3d0 !important; }
.inv-badge.blue, .inv-status-pill.blue, .inv-health-pill.blue, .inv-type-pill.blue, .inv-po-status-pill.blue, .inv-kpi-pill.blue { background: #dbeafe !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe !important; }
.inv-badge.indigo, .inv-status-pill.indigo, .inv-health-pill.indigo, .inv-type-pill.indigo, .inv-po-status-pill.indigo, .inv-kpi-pill.indigo { background: #e0e7ff !important; color: #4338ca !important; border: 1px solid #c7d2fe !important; }
.inv-badge.amber, .inv-status-pill.amber, .inv-health-pill.amber, .inv-type-pill.amber, .inv-po-status-pill.amber, .inv-kpi-pill.amber { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.inv-badge.rose, .inv-status-pill.rose, .inv-health-pill.rose, .inv-type-pill.rose, .inv-po-status-pill.rose, .inv-kpi-pill.rose { background: #ffe4e6 !important; color: #be123c !important; border: 1px solid #fecdd3 !important; }
.inv-badge.purple, .inv-status-pill.purple, .inv-health-pill.purple, .inv-type-pill.purple, .inv-po-status-pill.purple, .inv-kpi-pill.purple { background: #faf5ff !important; color: #7c3aed !important; border: 1px solid #e9d5ff !important; }
.inv-badge.slate, .inv-status-pill.slate, .inv-health-pill.slate, .inv-type-pill.slate, .inv-po-status-pill.slate, .inv-kpi-pill.slate { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0 !important; }

/* Filter Bar & Card */
.inv-filter-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin-bottom: 16px !important;
  position: relative !important;
  z-index: 40 !important;
  overflow: visible !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

.inv-filter-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  position: relative !important;
  z-index: 50 !important;
  overflow: visible !important;
  flex-wrap: wrap !important;
}

.inv-toolbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
  min-width: 280px !important;
  position: relative !important;
  overflow: visible !important;
}

.inv-search-wrap {
  flex: 0 1 380px !important;
  width: 380px !important;
  max-width: 400px !important;
  min-width: 240px !important;
  height: 38px !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.inv-search-icon {
  position: absolute !important;
  left: 12px !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
}

.inv-search-input {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: transparent !important;
  padding: 0 12px 0 36px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.inv-search-input::placeholder {
  color: #94a3b8 !important;
}

.inv-filter-btn,
.cust-unified-filter-btn,
.supt-unified-filter-btn,
.inv-btn-compact.inv-filter-btn,
.inv-btn-compact.cust-unified-filter-btn,
.inv-btn-compact.supt-unified-filter-btn {
  height: 38px !important;
  border-radius: 9px !important;
  padding: 0 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.inv-filter-btn:hover,
.cust-unified-filter-btn:hover,
.supt-unified-filter-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.inv-filter-btn.active,
.inv-filter-btn.has-active-filters,
.cust-unified-filter-btn.active,
.cust-unified-filter-btn.has-active-filters,
.supt-unified-filter-btn.active,
.supt-unified-filter-btn.has-active-filters {
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}

.inv-reset-btn {
  height: 38px !important;
  border-radius: 9px !important;
  padding: 0 12px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  background: transparent !important;
  border: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.inv-reset-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.inv-count-badge {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  background: #f1f5f9 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}

/* Category Quick Filter Pills */
.inv-category-strip {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
}

.inv-cat-pill {
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.inv-cat-pill:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.inv-cat-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

/* Floating Filter Popover */
.inv-filter-popover {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  z-index: 9999 !important;
  width: 460px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14) !important;
  padding: 16px 18px !important;
  box-sizing: border-box !important;
}

.inv-filter-popover[style*="display: none"] {
  display: none !important;
}

.inv-popover-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}

.inv-popover-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.inv-popover-field label {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
}

.inv-select, select.inv-select {
  width: 100% !important;
  height: 36px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0 28px 0 10px !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.inv-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.inv-popover-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding-top: 10px !important;
  border-top: 1px solid #f1f5f9 !important;
}

/* Zero-Collision Fixed-Layout Tables */
.inv-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  box-sizing: border-box !important;
}

.inv-table {
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: collapse !important;
  box-sizing: border-box !important;
}

.inv-table thead th {
  height: 38px !important;
  max-height: 40px !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.inv-table tbody td {
  padding: 10px 12px !important;
  font-size: 12.5px !important;
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.inv-table tbody tr:hover {
  background: #f8fafc !important;
}

.inv-table thead th.text-right,
.inv-table tbody td.text-right {
  text-align: right !important;
}

.inv-table thead th.text-center,
.inv-table tbody td.text-center {
  text-align: center !important;
}

/* Compact Action Buttons with >= 14px Right-Edge Clearance */
.inv-action-btn-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  justify-content: flex-end !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
}

.inv-btn-compact {
  height: 30px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}

.inv-btn-compact:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.inv-btn-compact.primary {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}

.inv-btn-compact.primary:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
}

.inv-btn-compact.emerald {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

.inv-btn-compact.emerald:hover {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
  color: #065f46 !important;
}

.inv-btn-compact.amber {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

.inv-btn-compact.amber:hover {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}

/* Modals */
.inv-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

.inv-modal-card {
  background: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2) !important;
  width: 100% !important;
  max-width: 580px !important;
  /* v40 audit: hard platform cap at 88vh so NO modal ever exceeds the
     16px/752px safe bounds at 1366x768 or shows clipped footer buttons. */
  max-height: 88vh !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.inv-modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.inv-modal-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.inv-modal-close {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 4px !important;
  display: flex !important;
  align-items: center !important;
}

.inv-modal-close:hover {
  color: #0f172a !important;
}

.inv-modal-body {
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.inv-modal-footer {
  padding: 14px 20px !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  border-bottom-left-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .inv-page-container {
    padding: 12px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .inv-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .inv-search-wrap {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  .inv-filter-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .inv-toolbar-left {
    flex-wrap: wrap !important;
  }

  .inv-filter-popover {
    width: 100% !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2) !important;
  }

  .inv-popover-grid {
    grid-template-columns: 1fr !important;
  }
}








/* =============================================================================
   FIELD OPERATIONS (v26) — 4-Pillar /field/* Studios
   fld-badge = single-line 24px pill (anti-wrap invariant), workload strip,
   splitter port map grid, stage track, mono refs. Reuses inv-* system.
   ============================================================================= */
.fld-badge,
.fld-status-pill,
.fld-type-pill,
.fld-priority-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  width: fit-content !important;
  box-sizing: border-box !important;
}
.fld-badge.emerald { background: #d1fae5 !important; color: #047857 !important; border: 1px solid #a7f3d0 !important; }
.fld-badge.blue    { background: #dbeafe !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe !important; }
.fld-badge.indigo  { background: #e0e7ff !important; color: #4338ca !important; border: 1px solid #c7d2fe !important; }
.fld-badge.amber   { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.fld-badge.rose    { background: #ffe4e6 !important; color: #be123c !important; border: 1px solid #fecdd3 !important; }
.fld-badge.purple  { background: #faf5ff !important; color: #7c3aed !important; border: 1px solid #e9d5ff !important; }
.fld-badge.slate   { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0 !important; }

.fld-ref-mono {
  font-family: var(--font-mono);
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: 0.01em;
  white-space: nowrap !important;
}

/* Technician Live Workload Strip (Pillar 2) */
.fld-workload-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 4px !important;
}
.fld-workload-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  min-height: 56px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  white-space: nowrap !important;
}
.fld-workload-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  flex-shrink: 0 !important;
}
.fld-workload-name {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
.fld-workload-meta {
  font-size: 11px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  margin-top: 2px !important;
}
.fld-workload-dot { width: 8px !important; height: 8px !important; border-radius: 50% !important; display: inline-block !important; flex-shrink: 0 !important; }
.fld-workload-dot.on { background: #10b981 !important; }
.fld-workload-dot.off { background: #94a3b8 !important; }

/* Visual Splitter Port Map Grid (Pillar 3) */
.fld-portmap-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
@media (max-width: 640px) {
  .fld-portmap-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)) !important; }
}
.fld-port-cell {
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  background: #f8fafc !important;
  min-height: 74px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  box-sizing: border-box !important;
  position: relative !important;
}
.fld-port-cell.connected { background: #ecfdf5 !important; border-color: #a7f3d0 !important; }
.fld-port-cell.reserved  { background: #eff6ff !important; border-color: #bfdbfe !important; }
.fld-port-cell.faulty    { background: #fff1f2 !important; border-color: #fecdd3 !important; }
.fld-port-no {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  white-space: nowrap !important;
}
.fld-port-core {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #0f172a !important;
}
.fld-core-dot {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(15, 23, 42, 0.25) !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
.fld-port-sub {
  font-size: 11px !important;
  color: #475569 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-weight: 600 !important;
}
.fld-port-actions {
  display: flex !important;
  gap: 6px !important;
  margin-top: 2px !important;
}
.fld-port-btn {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  border-radius: 7px !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  cursor: pointer !important;
  color: #334155 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
.fld-port-btn:hover { background: #f1f5f9 !important; }
.fld-port-btn.primary { background: #2563eb !important; border-color: #2563eb !important; color: #ffffff !important; }
.fld-port-btn.primary:hover { background: #1d4ed8 !important; }
.fld-port-btn.rose { background: #ffffff !important; border-color: #fecdd3 !important; color: #be123c !important; }
.fld-port-btn.rose:hover { background: #fff1f2 !important; }

/* Port utilization mini bar (table cells) */
.fld-utilbar {
  height: 6px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  overflow: hidden !important;
  width: 100% !important;
  max-width: 130px !important;
}
.fld-utilbar > span {
  display: block !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #10b981, #34d399) !important;
}
.fld-utilbar > span.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24) !important; }
.fld-utilbar > span.full { background: linear-gradient(90deg, #e11d48, #f43f5e) !important; }

/* v26 Field tables: action groups may wrap instead of overflowing (anti-collision) */
#fldInstTable .inv-action-btn-group,
#fldWoTable .inv-action-btn-group,
#fldTjbTable .inv-action-btn-group {
  flex-wrap: wrap !important;
  row-gap: 4px !important;
  max-width: 100% !important;
}

/* v26: badges ellipsize within their container instead of painting into cell padding */
.fld-badge, .fld-status-pill, .fld-type-pill, .fld-priority-pill {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* v26 mobile: field tables keep a comfortable width and scroll inside their
   rounded wrap (page scrollWidth stays <= 375; zero text-on-text collision) */
@media (max-width: 768px) {
  #fldInstTable,
  #fldWoTable,
  #fldTjbTable {
    width: 980px !important;
    min-width: 980px !important;
  }
}

/* =============================================================================
   RELEASE v113: Executive Maintenance Card-Row List Redesign (/field/maintenance)
   Stripe / Linear 2-tier row cards with zero wrapping AM/PM & zero stacked buttons
   ============================================================================= */
.fld-mnt-container {
  width: 100% !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.fld-mnt-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-top: 16px;
}

.fld-mnt-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.fld-mnt-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-secondary, #64748b);
  box-sizing: border-box;
}

.fld-mnt-item {
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  transition: background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

.fld-mnt-item:last-child {
  border-bottom: none;
}

.fld-mnt-item:hover {
  background: var(--color-surface-subtle, #f8fafc);
}

/* Tier 1: Top Row */
.fld-mnt-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.fld-mnt-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.fld-mnt-identity-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fld-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-brand, #2563eb);
}

.fld-mnt-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  letter-spacing: -0.2px;
  line-height: 1.35;
  word-break: break-word;
}

/* Right Status & Single-Line Action Cluster */
.fld-mnt-controls {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.fld-mnt-controls .fld-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 106px !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.fld-mnt-action-btns {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.fld-mnt-action-btns .inv-btn-compact {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

/* Tier 2: Recessed Structured Info Strip */
.fld-mnt-recessed-strip {
  margin-top: 2px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.fld-mnt-strip-divider {
  width: 1px;
  height: 18px;
  background: var(--color-border, #cbd5e1);
  flex-shrink: 0;
}

.fld-mnt-zone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary, #475569);
  min-width: 0;
}

.fld-mnt-zone-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary, #64748b);
  flex-shrink: 0;
}

.fld-mnt-zone-schedule {
  flex-shrink: 0;
}

.fld-mnt-schedule-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap !important;
}

.fld-mnt-duration-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.fld-mnt-duration-badge.blue {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-brand, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.fld-mnt-duration-badge.rose {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

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

.fld-mnt-zone-scope {
  flex: 1 1 auto;
  overflow: hidden;
}

.fld-mnt-scope-path {
  font-weight: 600;
  color: var(--color-text, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fld-mnt-impact-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.fld-mnt-impact-badge.amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

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

.fld-mnt-zone-lead {
  flex-shrink: 0;
  margin-left: auto;
}

.fld-mnt-lead-name {
  color: var(--color-text-secondary, #475569);
  white-space: nowrap;
}

.fld-mnt-lead-name strong {
  color: var(--color-text, #0f172a);
}

.fld-mnt-role-badge {
  font-size: 11px;
  color: var(--color-text-secondary, #64748b);
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Dark Mode Harmonization */
[data-theme="dark"] .fld-mnt-card,
body.dark-mode .fld-mnt-card {
  background: var(--dark-bg-surface, #111827) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] .fld-mnt-item,
body.dark-mode .fld-mnt-item {
  border-bottom-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] .fld-mnt-item:hover,
body.dark-mode .fld-mnt-item:hover {
  background: var(--dark-bg-subtle, #161f33) !important;
}

[data-theme="dark"] .fld-mnt-title,
body.dark-mode .fld-mnt-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .fld-cat-pill,
body.dark-mode .fld-cat-pill {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

[data-theme="dark"] .fld-mnt-recessed-strip,
body.dark-mode .fld-mnt-recessed-strip {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] .fld-mnt-strip-divider,
body.dark-mode .fld-mnt-strip-divider {
  background: var(--dark-border, rgba(148, 163, 184, 0.2)) !important;
}

[data-theme="dark"] .fld-mnt-schedule-text,
body.dark-mode .fld-mnt-schedule-text {
  color: #f8fafc !important;
}

[data-theme="dark"] .fld-mnt-scope-path,
body.dark-mode .fld-mnt-scope-path {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .fld-mnt-lead-name strong,
body.dark-mode .fld-mnt-lead-name strong {
  color: #f8fafc !important;
}

[data-theme="dark"] .fld-mnt-lead-name,
body.dark-mode .fld-mnt-lead-name,
[data-theme="dark"] .fld-mnt-zone,
body.dark-mode .fld-mnt-zone {
  color: #94a3b8 !important;
}

[data-theme="dark"] .fld-mnt-role-badge,
body.dark-mode .fld-mnt-role-badge {
  background: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.2)) !important;
  color: #94a3b8 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fld-mnt-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .fld-mnt-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .fld-mnt-recessed-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }
  .fld-mnt-strip-divider {
    display: none;
  }
  .fld-mnt-zone {
    width: 100%;
    flex-wrap: wrap;
  }
  .fld-mnt-zone-lead {
    margin-left: 0;
  }
}

/* =============================================================================
   v28 REPORTS & ANALYTICS MODULE — Shared Additions
   1. Payments ledger column calibration (zero collision at 1366x768)
   2. Report page helpers (aging bars, source badges, operator avatars, JSON modal)
   3. Shared @media print stylesheet (hide chrome, expand report body)
   ============================================================================= */

/* --- 1. Payments ledger calibration: fixed layout + colgroup enforcement --- */
.report-ledger-table {
  table-layout: fixed;
  width: 100%;
}

.report-ledger-table th,
.report-ledger-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Stacked customer / invoice-allocation cells need vertical room (not single-line) */
.report-ledger-table td .report-cust-cell,
.report-ledger-table td .report-invoice-alloc-cell,
.report-ledger-table td .report-channel-cell {
  overflow: visible;
}

/* v28 compact analytics tables (collector settlement / cashbook):
   fixed layout + colgroup enforcement + single-line ellipsis cells.
   Headers wrap to 2 lines instead of clipping. */
.report-compact-table {
  table-layout: fixed;
  width: 100%;
}

.report-compact-table th {
  overflow: hidden;
  white-space: normal;
  word-break: keep-all;
  vertical-align: middle;
}

.report-compact-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* --- 2. v28 report page helpers --- */

/* Due-aging / utilization progress rows */
.report-aging-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
}

.report-aging-row + .report-aging-row {
  border-top: 1px dashed var(--color-border-subtle, #e2e8f0);
}

.report-aging-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  flex: 0 0 132px;
}

.report-aging-track {
  flex: 1 1 auto;
  height: 7px;
  border-radius: 999px;
  background: var(--color-bg-subtle, #f1f5f9);
  overflow: hidden;
  min-width: 60px;
}

.report-aging-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.report-aging-amount {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
  min-width: 92px;
}

/* Unified audit source badges (single line, <= 28px) */
.report-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.report-source-badge--activity { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.report-source-badge--billing  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.report-source-badge--service_control { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

/* Operator avatar initials circle (leaderboard) */
.report-op-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Live availability pill (technician leaderboard) */
.report-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.report-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bandwidth DL/UL pills */
.report-bw-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* Rank chip (top consumers) */
.report-rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--color-bg-subtle, #f1f5f9);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-secondary, #475569);
}

.report-rank-chip--top {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* Metadata inspection modal (Audit report) */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.report-modal-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  width: min(720px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
}

.report-modal-body {
  padding: 16px 18px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
}

.report-json-block {
  background: var(--color-bg-subtle, #f8fafc);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: 9px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text, #0f172a);
  margin: 0;
}

/* --- 3. Shared @media print stylesheet (v28) — clean report printing --- */
@media print {
  .sidebar,
  .app-sidebar,
  #sidebar,
  .topbar,
  .app-topbar,
  .unified-filter-toolbar,
  .cust-unified-toolbar,
  .report-toolbar-card,
  .billing-header-actions,
  .report-export-btn,
  .report-print-btn,
  .report-filter-wrap,
  .preset-btn,
  .report-custom-date-group,
  .report-filter-popover,
  .cust-filter-popover,
  .report-pagination,
  .paginationControls,
  .report-modal-overlay,
  .toast-container,
  .btn-spinner {
    display: none !important;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11px !important;
  }

  .content.main-content,
  #mainContent {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .billing-page {
    padding: 0 !important;
    margin: 0 !important;
  }

  .card,
  .report-card,
  .report-kpi-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
  }

  .report-kpi-grid-6,
  .report-kpi-grid-4 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  .report-analytics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .data-table-wrap,
  .report-table-wrap {
    overflow: visible !important;
  }

  .report-ledger-table,
  .data-table {
    font-size: 10px !important;
  }

  .report-card-title { font-size: 13px !important; }
  .report-card-subtitle { font-size: 10.5px !important; }
  .report-kpi-value { font-size: 18px !important; }

  a { text-decoration: none !important; color: inherit !important; }

  @page {
    size: A4 landscape;
    margin: 10mm;
  }
}

/* ============================================================================
   Report Studios v30 Executive System (Standard 4-Card KPI + 2-Col Flexbox Equal Height + Zero Scrollbars)
   ============================================================================ */

.report-visual-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 14px !important;
  margin-bottom: 14px !important;
  width: 100% !important;
}

.report-visual-card {
  flex: 1 1 0% !important;
  min-height: 260px !important;
  height: auto !important;
  overflow: hidden !important; /* NO SCROLLBARS EVER! */
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
}

/* Ensure any legacy/utility h-250 / h-230 classes do not force rigid height or cause scrollbars */
.report-visual-card.h-250,
.report-visual-card.h-230 {
  height: auto !important;
  max-height: none !important;
  min-height: 260px !important;
}

/* Make the SVG chart inside the left card dynamically fill the remaining height */
.report-visual-card .report-chart-wrap {
  flex-grow: 1 !important;
  width: 100% !important;
  min-height: 180px !important;
  display: flex !important;
  align-items: flex-end !important;
}

.report-visual-card-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
  height: 24px !important;
}

.report-visual-card-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.report-visual-card-sub {
  font-size: 11px !important;
  color: #64748b !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.report-visual-card-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important; /* NO SCROLLBARS EVER! */
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

/* Preset pills inside the unified filter toolbar */
.report-preset-pills {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: #f1f5f9 !important;
  padding: 3px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}

.report-preset-pills .preset-btn {
  border: none !important;
  background: transparent !important;
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.report-preset-pills .preset-btn:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.6) !important;
}

.report-preset-pills .preset-btn.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

/* Floating Filter Popover */
.report-filter-popover {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  z-index: 9999 !important;
  width: 380px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1) !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.report-filter-popover-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.report-filter-popover-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.report-popover-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

.report-popover-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.report-popover-field.full {
  grid-column: 1 / -1 !important;
}

.report-popover-field label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.report-popover-field input,
.report-popover-field select {
  height: 34px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.report-popover-field input:focus,
.report-popover-field select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.report-popover-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 14px !important;
  padding-top: 10px !important;
  border-top: 1px solid #f1f5f9 !important;
}

/* Invariants for tables */
.inv-table thead th {
  height: 38px !important;
  max-height: 40px !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.inv-table td.report-num,
.inv-table td.report-amount-cell {
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
}

/* Dark mode adjustments */
[data-theme="dark"] .report-visual-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}
[data-theme="dark"] .report-visual-card-title {
  color: #f8fafc !important;
}
[data-theme="dark"] .report-visual-card-sub {
  color: #94a3b8 !important;
}
[data-theme="dark"] .report-preset-pills {
  background: var(--dark-bg-elevated) !important;
}
[data-theme="dark"] .report-preset-pills .preset-btn {
  color: #94a3b8 !important;
}
[data-theme="dark"] .report-preset-pills .preset-btn.active {
  background: var(--dark-bg-elevated) !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .report-filter-popover {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
}
[data-theme="dark"] .report-filter-popover-title {
  color: #f8fafc !important;
}
[data-theme="dark"] .report-filter-popover-head,
[data-theme="dark"] .report-popover-actions {
  border-color: var(--dark-border) !important;
}
[data-theme="dark"] .report-popover-field label {
  color: #94a3b8 !important;
}
[data-theme="dark"] .report-popover-field input,
[data-theme="dark"] .report-popover-field select {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
}

@media (max-width: 900px) {
  .report-visual-row {
    flex-direction: column !important;
  }
}

/* =============================================================================
   v35 COMMUNICATION & AUTOMATED SMS ENGINE (/communication/*)
   Clean, uncluttered, progressive-disclosure studios with above-the-fold fit.
   Reuses .inv-* executive ribbon, toolbar, popover, modal, and .fld-badge pills.
   Zero internal scrollbars, 100.0% colgroup tables, mobile-safe at 375x812.
   ============================================================================= */

.comm-hidden {
  display: none !important;
}

.comm-studio-page {
  padding-top: 18px !important;
}

.comm-studio-page .inv-page-header {
  margin-bottom: 14px !important;
}

.comm-studio-page .inv-kpi-grid {
  margin-bottom: 14px !important;
}

/* Unified Quick Broadcast Composer Card (<= 310px height on desktop) */
.comm-composer-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  width: 100% !important;
}

.comm-composer-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding-bottom: 10px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  flex-wrap: wrap !important;
}

.comm-composer-meta {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.comm-composer-body {
  display: grid !important;
  grid-template-columns: 42% 1fr !important;
  gap: 20px !important;
  align-items: stretch !important;
}

@media (max-width: 960px) {
  .comm-composer-body {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

.comm-col-left,
.comm-col-right {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.comm-step-heading {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.comm-audience-fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.comm-audience-preview {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-height: 36px !important;
  font-size: 12px !important;
  color: #334155 !important;
}

.comm-audience-preview-text {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.comm-msg-topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.comm-tpl-inline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 !important;
  min-width: 200px !important;
}

.comm-tpl-inline label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
}

.comm-tpl-inline .inv-select {
  height: 32px !important;
  font-size: 12.5px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.comm-var-dropdown {
  position: relative !important;
  display: inline-block !important;
}

.comm-var-menu {
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 4px) !important;
  z-index: 50 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14) !important;
  padding: 6px !important;
  min-width: 196px !important;
  display: flex;
  flex-direction: column !important;
  gap: 2px !important;
}

.comm-var-menu-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 6px 10px !important;
  border: none !important;
  background: transparent !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  color: #0f172a !important;
  cursor: pointer !important;
  text-align: left !important;
  width: 100% !important;
}

.comm-var-menu-item:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.comm-var-menu-item code {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  color: #2563eb !important;
}

.comm-msg-textarea {
  width: 100% !important;
  height: 82px !important;
  min-height: 82px !important;
  max-height: 112px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 11px !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  outline: none !important;
  font-family: inherit !important;
  line-height: 1.45 !important;
  resize: vertical !important;
}

.comm-msg-textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.comm-composer-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.comm-meter-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 11.5px !important;
  color: #475569 !important;
  white-space: nowrap !important;
}

.comm-sub-autocomplete {
  position: relative !important;
}

.comm-sub-suggest {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 4px) !important;
  z-index: 45 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14) !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  padding: 4px !important;
}

.comm-sub-option {
  width: 100% !important;
  text-align: left !important;
  border: none !important;
  background: transparent !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  color: #0f172a !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.comm-sub-option:hover {
  background: #eff6ff !important;
}

.comm-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 18px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.comm-card-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.comm-card-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.comm-scenario-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.comm-pill-btn {
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.comm-pill-btn:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

.comm-pill-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

.comm-form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

@media (max-width: 640px) {
  .comm-form-grid {
    grid-template-columns: 1fr !important;
  }
}

.comm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comm-field.full {
  grid-column: 1 / -1 !important;
}

.comm-field label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.comm-input,
.comm-textarea {
  width: 100% !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  outline: none !important;
  font-family: inherit !important;
}

.comm-input {
  height: 36px !important;
  padding: 0 10px !important;
}

.comm-textarea {
  min-height: 116px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.comm-input:focus,
.comm-textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.comm-var-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
}

.comm-var-chip {
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  border: 1px solid #dbeafe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-family: var(--font-mono) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
}

.comm-var-chip:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
}

.comm-audience-box {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.comm-audience-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.comm-sub-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  white-space: nowrap !important;
}

.comm-meter-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  color: #475569 !important;
}

/* Segmented Studio Tabs */
.comm-tab-bar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 4px !important;
  flex-wrap: wrap !important;
}

.comm-tab-btn {
  height: 32px !important;
  padding: 0 14px !important;
  border: none !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}

.comm-tab-btn:hover {
  color: #0f172a !important;
}

.comm-tab-btn.active {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

/* Toggle Switch */
.comm-switch {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  width: 38px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}

.comm-switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
}

.comm-switch-track {
  width: 38px !important;
  height: 22px !important;
  background: #cbd5e1 !important;
  border-radius: 999px !important;
  transition: background 0.18s ease !important;
  position: relative !important;
}

.comm-switch-track::after {
  content: '' !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  transition: transform 0.18s ease !important;
}

.comm-switch input:checked + .comm-switch-track {
  background: #10b981 !important;
}

.comm-switch input:checked + .comm-switch-track::after {
  transform: translateX(16px) !important;
}

/* Horizontal Gateway Mode Studio Rows (v36 Premium Minimalist) */
.comm-gw-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}

.comm-gw-row {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 18px 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.comm-gw-row:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

.comm-gw-row.is-default {
  border: 1.5px solid #2563eb !important;
  background: linear-gradient(90deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08) !important;
}

.comm-gw-left {
  flex: 1 1 34% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.comm-gw-mid {
  flex: 1 1 32% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.comm-gw-right {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.comm-gw-meta-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  white-space: nowrap !important;
  max-width: 230px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.comm-gw-spec-label {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.comm-btn-set-active {
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: 7px !important;
  border: 1.5px solid #2563eb !important;
  background: #ffffff !important;
  color: #1d4ed8 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}

.comm-btn-set-active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

.comm-active-default-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 30px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #047857 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: default !important;
  user-select: none !important;
  pointer-events: none !important;
}

.comm-gw-action-btn {
  height: 32px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
  gap: 5px !important;
}

#commGwTable thead th {
  padding: 11px 10px !important;
  white-space: nowrap !important;
}

#commGwTable tbody td {
  padding: 12px 10px !important;
}

#commGwTable .comm-btn-set-active,
#commGwTable .comm-gw-action-btn {
  height: 30px !important;
  padding: 0 10px !important;
}

.comm-sender-chip {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  font-family: var(--font-mono) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Single Customer SMS Search & Elevated Selected Chip (v36) */
.comm-sub-search-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.comm-sub-search-icon {
  position: absolute !important;
  left: 11px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #64748b !important;
  pointer-events: none !important;
  display: inline-flex !important;
  align-items: center !important;
}

.comm-sub-search-input {
  height: 38px !important;
  padding: 0 12px 0 34px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

.comm-selected-chip {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-top: 6px !important;
  padding: 7px 11px !important;
  border-radius: 9px !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1e3a8a !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08) !important;
  font-size: 12.5px !important;
}

.comm-selected-chip-text {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.comm-selected-chip-clear {
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  border: none !important;
  background: rgba(37, 99, 235, 0.1) !important;
  color: #1d4ed8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: background 0.15s ease !important;
}

.comm-selected-chip-clear:hover {
  background: #dbeafe !important;
  color: #1e40af !important;
}

.comm-info-strip {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  margin-bottom: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  font-size: 12px !important;
  color: #334155 !important;
}

@media (max-width: 1040px) {
  .comm-gw-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 14px 16px !important;
  }
  .comm-gw-right {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

.comm-wa-btn {
  height: 30px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  border: 1px solid #bbf7d0 !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

.comm-wa-btn:hover {
  background: #dcfce7 !important;
  border-color: #86efac !important;
}

#commCampTable .inv-action-btn-group,
#commTriggerTable .inv-action-btn-group,
#commTplTable .inv-action-btn-group,
#commLogsTable .inv-action-btn-group,
#commGwTable .inv-action-btn-group {
  flex-wrap: nowrap !important;
  row-gap: 4px !important;
  max-width: 100% !important;
  justify-content: flex-end !important;
}

#commLogsTable td:last-child .inv-btn-compact,
#commLogsTable td:last-child .comm-wa-btn {
  padding: 0 7px !important;
  font-size: 11px !important;
  height: 27px !important;
  gap: 4px !important;
}

#commTriggerTable td:last-child .inv-btn-compact {
  padding: 0 8px !important;
  font-size: 11.5px !important;
  height: 27px !important;
  gap: 4px !important;
}

.comm-hidden,
.comm-var-menu.comm-hidden,
.comm-sub-suggest.comm-hidden,
.comm-field.comm-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  #commCampTable,
  #commTriggerTable,
  #commTplTable,
  #commLogsTable,
  #commGwTable {
    width: 980px !important;
    min-width: 980px !important;
  }
}

[data-theme="dark"] .comm-card,
[data-theme="dark"] .comm-composer-card,
[data-theme="dark"] .comm-gw-row {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}
[data-theme="dark"] .comm-card-title,
[data-theme="dark"] .comm-step-heading { color: #f8fafc !important; }
[data-theme="dark"] .comm-card-head,
[data-theme="dark"] .comm-composer-top { border-color: var(--dark-border) !important; }
[data-theme="dark"] .comm-input,
[data-theme="dark"] .comm-textarea,
[data-theme="dark"] .comm-msg-textarea {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .comm-audience-box,
[data-theme="dark"] .comm-audience-preview,
[data-theme="dark"] .comm-meter-pill,
[data-theme="dark"] .comm-gw-meta-pill,
[data-theme="dark"] .comm-info-strip,
[data-theme="dark"] .comm-meter-row {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}
[data-theme="dark"] .comm-var-menu,
[data-theme="dark"] .comm-sub-suggest {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
}
[data-theme="dark"] .comm-var-menu-item,
[data-theme="dark"] .comm-sub-option {
  color: #f1f5f9 !important;
}
[data-theme="dark"] .comm-tab-bar { background: var(--dark-bg-elevated) !important; border-color: var(--dark-border) !important; }
[data-theme="dark"] .comm-tab-btn.active { background: var(--dark-bg-elevated) !important; color: #f8fafc !important; }
[data-theme="dark"] .comm-sender-chip { background: var(--dark-bg-elevated) !important; border-color: var(--dark-border) !important; color: #e2e8f0 !important; }
[data-theme="dark"] .comm-selected-chip { background: rgba(37, 99, 235, 0.16) !important; border-color: rgba(59, 130, 246, 0.4) !important; color: #dbeafe !important; }
[data-theme="dark"] .comm-btn-set-active { background: transparent !important; border-color: #60a5fa !important; color: #93c5fd !important; }
[data-theme="dark"] .comm-btn-set-active:hover { background: #2563eb !important; border-color: #2563eb !important; color: #ffffff !important; }

.inv-kpi-icon.slate {
  background: #f1f5f9 !important;
  color: #475569 !important;
}
.inv-kpi-icon.rose {
  background: #fff1f2 !important;
  color: #e11d48 !important;
}

/* =============================================================================
   v37 — Communication Studio Clean Redesign (/communication/broadcast + gateways)
   Platform-standard: .inv-table-card wrapper, filter topbar with category strip,
   Executive Modal composer fields, 6-column gateway channel table.
   ============================================================================= */

/* Generic table card wrapper (card header + full-width table) */
.inv-table-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  width: 100% !important;
}

.inv-table-card .inv-table-wrap {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.inv-table-card-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  flex-wrap: wrap !important;
}

.inv-table-card-head h3 {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.inv-table-card-head p {
  font-size: 12px !important;
  color: #64748b !important;
  margin: 3px 0 0 0 !important;
}

/* Filter card top row: category pills + quick launch CTA */
.comm-filter-topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.comm-filter-topbar .inv-category-strip {
  margin-bottom: 0 !important;
}

.comm-quick-launch-btn {
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid #fcd34d !important;
  background: #fffbeb !important;
  color: #b45309 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.comm-quick-launch-btn:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

/* Broadcast & Outage Ledger refinements */
#commCampTable td {
  padding: 10px 12px !important;
  vertical-align: middle !important;
}

#commCampTable .comm-recipients-pill {
  font-size: 11px !important;
  height: 22px !important;
  padding: 0 8px !important;
}

#commCampTable td:last-child .inv-action-btn-group {
  flex-wrap: wrap !important;
  row-gap: 5px !important;
  margin-right: 0 !important;
}

#commCampTable td:last-child .inv-btn-compact {
  padding: 0 8px !important;
  font-size: 11px !important;
  height: 26px !important;
}

/* Executive Modal composer fields */
.comm-scenario-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.comm-scenario-btn {
  height: 32px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.comm-scenario-btn:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.comm-scenario-btn.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.comm-match-strip {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin: 4px 0 12px !important;
}

.comm-modal-textarea {
  width: 100% !important;
  min-height: 96px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  outline: none !important;
  font-family: inherit !important;
  line-height: 1.5 !important;
  resize: vertical !important;
}

.comm-modal-textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.comm-static-field {
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 12px !important;
  color: #334155 !important;
  box-sizing: border-box !important;
}

.comm-inspect-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px !important;
}

/* Production Gateway Channels table */
.comm-gw-channel-cell {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.comm-gw-icon-badge {
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.comm-gw-icon-badge.blue { background: #dbeafe !important; color: #1d4ed8 !important; }
.comm-gw-icon-badge.emerald { background: #d1fae5 !important; color: #047857 !important; }

.comm-gw-channel-text {
  min-width: 0 !important;
}

.comm-gw-channel-name {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.comm-gw-channel-sub {
  font-size: 11px !important;
  color: #64748b !important;
  margin-top: 2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.comm-endpoint-chip {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  padding: 3px 6px !important;
  border-radius: 7px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  font-family: var(--font-mono, 'JetBrains Mono', monospace) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.comm-gw-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#commGwTable {
  width: 100% !important;
  table-layout: fixed !important;
}

#commGwTable th, #commGwTable td {
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

#commGwTable th:first-child,
#commGwTable td:first-child,
#commGwTable th.col-gw-channel,
#commGwTable td.col-gw-channel {
  padding-left: 16px !important;
  padding-right: 8px !important;
}

#commGwTable th:nth-child(2),
#commGwTable td:nth-child(2),
#commGwTable th.col-gw-type,
#commGwTable td.col-gw-type {
  min-width: 130px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

#commGwTable th:nth-child(3),
#commGwTable td:nth-child(3),
#commGwTable th.col-gw-endpoint,
#commGwTable td.col-gw-endpoint {
  min-width: 170px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

#commGwTable th:nth-child(4),
#commGwTable td:nth-child(4),
#commGwTable th.col-gw-sender,
#commGwTable td.col-gw-sender {
  min-width: 120px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

#commGwTable th:nth-child(5),
#commGwTable td:nth-child(5),
#commGwTable th.col-gw-status,
#commGwTable td.col-gw-status {
  min-width: 126px !important;
  text-align: center !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

#commGwTable th:nth-child(5) span,
#commGwTable th.col-gw-status span {
  display: inline-block !important;
  text-align: center !important;
}

#commGwTable th:last-child,
#commGwTable td:last-child,
#commGwTable th.col-gw-actions,
#commGwTable td.col-gw-actions {
  min-width: 236px !important;
  text-align: right !important;
  padding-right: 16px !important;
  padding-left: 6px !important;
}

#commGwTable td:last-child .inv-btn-compact,
#commGwTable td.col-gw-actions .inv-btn-compact {
  padding: 0 6px !important;
  font-size: 11px !important;
  height: 26px !important;
  gap: 3px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Enforce Identical Uniform Pill Dimensions for BOTH Status States */
#commGwTable .comm-gw-status-badge,
#commGwTable td:nth-child(5) .fld-badge,
#commGwTable td.col-gw-status .fld-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 118px !important;
  width: 118px !important;
  height: 26px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}

[data-theme="dark"] .inv-table-card,
[data-theme="dark"] .inv-table-card-head {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

[data-theme="dark"] .inv-table-card-head h3 { color: #f8fafc !important; }

[data-theme="dark"] .comm-filter-topbar { border-color: var(--dark-border) !important; }

[data-theme="dark"] .comm-scenario-btn {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .comm-scenario-btn.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .comm-match-strip,
[data-theme="dark"] .comm-inspect-head,
[data-theme="dark"] .comm-static-field {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .comm-modal-textarea {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .comm-endpoint-chip {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .comm-quick-launch-btn {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: #92400e !important;
  color: #fbbf24 !important;
}

/* ============================================================
   v39 — MINIMALIST CREATE-TICKET STUDIO (/support/tickets/new)
   ============================================================ */
.supt-layout-2col-v39 {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: stretch;
}
.supt-form-select-38 { height: 38px !important; }
.supt-priority-segmented-38 { height: 38px !important; padding: 3px !important; }
.supt-priority-segmented-38 .supt-prio-seg-btn { height: 28px !important; font-size: 11.5px !important; }
.supt-empty-state-compact {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 230px !important;
  padding: 22px 16px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
.supt-sms-bar { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; }
.supt-sms-chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; margin: 0; }
.supt-sms-chk input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; margin: 0; }
.supt-sms-pill { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.supt-sms-pill-muted { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }
.supt-sms-preview-toggle { border: 1px solid #cbd5e1; background: #ffffff; color: #334155; font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; transition: all 0.15s ease; }
.supt-sms-preview-toggle:hover { border-color: #94a3b8; }
.supt-sms-preview-toggle.active { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.supt-sms-strip { margin-top: 9px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; overflow: hidden; }
.supt-sms-strip-cell { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 0; }
.supt-strip-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }
.supt-sms-body-cell { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supt-sms-strip-divider { width: 1px; height: 14px; background: #e2e8f0; flex-shrink: 0; }
.supt-sms-panel { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed #e2e8f0; padding-top: 10px; }
.supt-sms-panel-lbl { font-size: 9.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.supt-sms-panel-row { background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.55; color: #334155; white-space: pre-wrap; word-break: break-word; }
.supt-tele-tile { padding: 8px 10px !important; }
.supt-tele-lbl { font-size: 9.5px !important; font-weight: 800 !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; color: #64748b !important; margin-bottom: 3px !important; }
.supt-tele-val { font-size: 12.5px; font-weight: 700; color: #0f172a; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supt-tele-sub { font-size: 10.5px; color: #64748b; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supt-contact-strip { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #475569; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px; padding: 7px 10px; min-width: 0; }
.supt-contact-strip .scp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.supt-contact-strip .scp-sep { color: #cbd5e1; flex-shrink: 0; }

@media (max-width: 960px) {
  .supt-layout-2col-v39 { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 680px) {
  .supt-form-row-cat { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ============================================================
   v42 - MINIMALIST GATEWAY CONFIGURATION STUDIO (/communication/gateways?configure=)
   Single-screen 62/38 two-card studio: ONE setup card (provider pills,
   credentials, guardrails) + ONE guide/test card. Fits 100% above the fold
   at 1366x768 with zero page scrolling. Stacks at <= 960px.
   ============================================================ */
.gwc-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 62fr) minmax(0, 38fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

.gwc-col-left,
.gwc-col-right {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.gwc-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Studio header */
.gwc-header { margin-bottom: 12px !important; }
.gwc-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
.gwc-back-btn {
  height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
}
.gwc-status-pill { flex-shrink: 0 !important; }

/* Compact numbered section labels (no per-section cards, no helper essays) */
.gwc-section { display: flex !important; flex-direction: column !important; gap: 8px !important; min-width: 0 !important; }
.gwc-section-last { flex: 1 1 auto !important; }
.gwc-section-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
}
.gwc-sec-num {
  width: 18px !important;
  height: 18px !important;
  border-radius: 6px !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.gwc-divider { height: 1px !important; background: #f1f5f9 !important; margin: 12px 0 !important; flex-shrink: 0 !important; }

/* Section 1 — one-row provider pills (36px, text-only, no info banner) */
.gwc-pill-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.gwc-pill-bar::-webkit-scrollbar { display: none !important; }
.gwc-pill {
  height: 36px !important;
  padding: 0 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
}
.gwc-pill:hover { border-color: #93c5fd !important; background: #eff6ff !important; }
.gwc-pill.active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

/* Section 2 — clean 60/40 credential grid (4 essential fields only) */
.gwc-cred-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) !important;
  gap: 10px 12px !important;
}
.gwc-field { display: flex !important; flex-direction: column !important; gap: 4px !important; min-width: 0 !important; }
.gwc-label { font-size: 11px !important; font-weight: 700 !important; color: #475569 !important; }
.gwc-input {
  height: 34px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  width: 100% !important;
  font-family: inherit !important;
}
.gwc-input:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12) !important;
}
select.gwc-input { height: 34px !important; cursor: pointer !important; }
.gwc-key-wrap { position: relative !important; }
.gwc-key-wrap .gwc-input { padding-right: 32px !important; }
.gwc-key-eye {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 26px !important;
  height: 26px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}
.gwc-key-eye:hover { color: #2563eb !important; background: #eff6ff !important; }

/* Section 3 — delivery guardrails on ONE horizontal row */
.gwc-guard-row {
  display: flex !important;
  gap: 12px !important;
  align-items: flex-end !important;
  flex-wrap: nowrap !important;
}
.gwc-guard-field { display: flex !important; flex-direction: column !important; gap: 4px !important; min-width: 0 !important; }
.gwc-guard-field .gwc-input { width: 96px !important; }
.gwc-guard-quiet { flex: 1 1 auto !important; }
.gwc-quiet-inline {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 34px !important;
  min-width: 0 !important;
}
.gwc-quiet-inline .gwc-input { width: 86px !important; }
.gwc-quiet-hours-sep { font-size: 11px; font-weight: 700; color: #94a3b8; flex-shrink: 0; }

/* Right card — 3-bullet quick guide (top) + Send Test SMS (bottom) */
.gwc-guide {
  margin: 0 !important;
  padding: 0 0 0 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}
.gwc-guide li { font-size: 12px !important; line-height: 1.45 !important; color: #334155 !important; }
.gwc-verify-btn {
  height: 38px !important;
  border: none !important;
  border-radius: 9px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  margin-top: 2px !important;
}
.gwc-verify-btn:hover { background: #1d4ed8 !important; }
.gwc-verify-btn:disabled { opacity: 0.65 !important; cursor: wait !important; }
.gwc-verify-result {
  margin-top: 8px !important;
  border-radius: 10px !important;
  padding: 9px 11px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  /* display stays inline-controlled (none by default; JS sets flex when the
     probe runs) — an !important flex here would force the empty box visible */
  flex-direction: column !important;
  gap: 6px !important;
  overflow: hidden !important;
}
.gwc-verify-result[style*="flex"] { display: flex !important; }
.gwc-verify-status {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}
.gwc-verify-status.ok { color: #047857 !important; }
.gwc-verify-status.fail { color: #be123c !important; }
.gwc-verify-meta { font-size: 11px !important; color: #475569 !important; line-height: 1.45 !important; }
.gwc-req-preview {
  font-family: var(--font-mono) !important;
  font-size: 10.5px !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  padding: 6px 9px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.gwc-tip { font-size: 11px !important; line-height: 1.5 !important; color: #92400e !important; background: #fffbeb !important; border: 1px solid #fde68a !important; border-radius: 8px !important; padding: 7px 10px !important; }

/* Mobile stacking (v39 gotcha: always assert BOTH viewports) */
@media (max-width: 960px) {
  .gwc-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .gwc-guard-row { flex-wrap: wrap !important; }
  .gwc-guard-quiet { flex: 1 1 100% !important; }
}
@media (max-width: 480px) {
  .gwc-pill-bar { flex-wrap: wrap !important; }
}

/* ============================================================
   v43 - AUDIT REMEDIATION POLISH
   1) /network/olts mobile (375x812): KPI cards wrap cleanly with zero
      mid-word ellipsis; fleet/ONU tables scroll horizontally inside their
      wrapper (min-width 760px) instead of collapsing to single letters.
   2) /support/tickets mobile: page header wraps (title row 1, action
      buttons row 2, zero overlap); desktop thead stub hidden above the
      mobile ticket list.
   ============================================================ */

@media (max-width: 768px) {
  .nolt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .nolt-kpi-card { padding: 12px !important; }
  .nolt-kpi-label,
  .nolt-kpi-value,
  .nolt-kpi-pill {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
  }
  .nolt-kpi-value { font-size: 16px !important; line-height: 1.25 !important; }
  .nolt-kpi-top { align-items: flex-start !important; }
  .supt-v8-header { flex-wrap: wrap !important; row-gap: 10px !important; }
  .supt-v8-header > div:first-child { width: 100% !important; }
  .supt-v8-header h1,
  .supt-v8-header p { white-space: normal !important; }
  #ticketHeaderActions {
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .supt-clean-table thead { display: none !important; }
}

@media (max-width: 900px) {
  .nolt-page-container .nolt-table-scroll-wrap,
  .nolt-page-container .nolt-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .nolt-page-container .nolt-table-scroll-wrap .nolt-table,
  .nolt-page-container .nolt-table-wrap .nolt-table {
    min-width: 760px !important;
    table-layout: auto !important;
  }
  .nolt-page-container .nolt-table-scroll-wrap th,
  .nolt-page-container .nolt-table-scroll-wrap td,
  .nolt-page-container .nolt-table-wrap th,
  .nolt-page-container .nolt-table-wrap td {
    white-space: nowrap !important;
  }
}

/* =========================================================================
   RELEASE v49 — CLASSIC RESTORED & REFINED SLATE-NAVY SIDEBAR (#1e293b -> #172033)
   Exact Classic Original Visual Signature, Zero Muddy Grey Box on Active Parent,
   Clean Submenu (No Tree Lines), Subtle Royal Blue Active Child Pill,
   Fixed Unclipped 48px Footer, Smart Accordion, Zero White Scrollbar
   ========================================================================= */

/* 1.1 Classic Slate-Navy Surface & Refined Elevation */
.sidebar,
[data-theme="dark"] .sidebar,
body.dark-mode .sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  background: var(--color-sidebar-bg, linear-gradient(180deg, var(--color-sidebar-bg-start, var(--dark-bg-surface)) 0%, var(--color-sidebar-bg-end, var(--dark-bg-canvas)) 100%)) !important;
  color: var(--color-sidebar-text, #cbd5e1) !important;
  border-right: 1px solid var(--color-sidebar-border, rgba(15, 23, 42, 0.15)) !important;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06) !important;
}

/* 1.2 3-Tier Tonal Harmony: Canvas & Topbar Integration */
body,
.app-shell,
.main {
  background-color: var(--color-background, var(--bg-app-light-tint, #f4f7fb)) !important;
}

[data-theme="dark"] body,
[data-theme="dark"] .app-shell,
[data-theme="dark"] .main,
body.dark-mode,
body.dark-mode .app-shell,
body.dark-mode .main {
  background-color: var(--dark-bg-canvas, var(--bg-app-dark-tint, #0b1120)) !important;
}

.topbar {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* 1.3 Brand Header (56px) - Matching Theme Gradient Seamlessly */
.sidebar-brand,
[data-theme="dark"] .sidebar-brand,
body.dark-mode .sidebar-brand {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  flex: 0 0 56px !important;
  padding: 0 12px !important;
  gap: 9px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--color-sidebar-border, rgba(255, 255, 255, 0.07)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.sidebar-brand .brand-left {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.sidebar-brand .brand-actions {
  display: none !important;
}

/* Classic Royal Blue PS Emblem: 30x30px, border-radius: 8px, gradient 135deg var(--color-brand-mark-gradient) */
.brand-mark,
.brand-mark-logo,
.brand-mark-text {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  border-radius: 8px !important;
  background: var(--color-brand-mark-gradient, linear-gradient(135deg, var(--color-brand-hover-light, #3b82f6) 0%, var(--color-brand, #2563eb) 100%)) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Crisp Single-Line Brand Name: PLUSWEB SOLUTION LTD (Zero Ellipsis Truncation) */
.brand-name,
.sidebar-brand .brand-name,
[data-theme="dark"] .sidebar-brand .brand-name,
body.dark-mode .sidebar-brand .brand-name {
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.015em !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* 2.1 Navigation Container - Ultra-Slim 4px Custom Scrollbar & Zero Layout Shift */
.sidebar .sidebar-nav,
.sidebar-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 8px 0 6px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable !important;
  scrollbar-width: auto !important;
  scroll-behavior: smooth;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 2px !important;
  border: none !important;
}

@supports not selector(::-webkit-scrollbar) {
  .sidebar .sidebar-nav,
  .sidebar-nav {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent !important;
  }
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
  background: transparent !important;
  display: block !important;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent !important;
  margin: 4px 0 !important;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.26) !important;
  border-radius: 9999px !important;
  transition: background 150ms ease !important;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.48) !important;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.8) !important;
}

.sidebar.collapsed .sidebar-nav {
  scrollbar-gutter: auto !important;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
  width: 0px !important;
  display: none !important;
}

/* 2.2 Full Width Group Containers */
.sidebar .nav-group,
.nav-group {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2.3 Borderless, Slim Menu Items & Full-Width Buttons */
.sidebar .nav-item,
button.nav-item.has-submenu {
  border: 0px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
  margin: 1px 8px !important;
  border-radius: 7px !important;
  gap: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: calc(100% - 16px) !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  cursor: pointer !important;
  background: transparent !important;
  transition: background 120ms ease, color 120ms ease !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #e2e8f0 !important;
  text-align: left !important;
  font-family: inherit !important;
}

/* 2.4 Nav Label - Auto Flex Grow & Clean Ellipsis */
.sidebar .nav-item .nav-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: inherit !important;
  text-align: left !important;
}

/* 2.5 Right-Aligned Submenu Chevron Arrows in a Clean Vertical Column */
.sidebar .nav-item .nav-chevron {
  margin-left: auto !important;
  flex-shrink: 0 !important;
  opacity: 0.75 !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  transition: transform 200ms ease, opacity 150ms ease, color 120ms ease !important;
}

.sidebar .nav-item .nav-chevron svg {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
}

.sidebar .nav-item .nav-badge-soon,
.sidebar .nav-submenu .nav-item .nav-badge-soon,
.sidebar .nav-badge-soon,
.nav-badge-soon {
  font-size: 9.5px !important;
  font-weight: 600 !important;
  padding: 1.5px 6px !important;
  border-radius: 4px !important;
  background: rgba(148, 163, 184, 0.14) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  letter-spacing: 0.25px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.sidebar .nav-item:hover .nav-badge-soon,
.sidebar .nav-submenu .nav-item:hover .nav-badge-soon {
  background: rgba(148, 163, 184, 0.22) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.32) !important;
}

.sidebar .nav-item.active .nav-badge-soon,
.sidebar .nav-submenu .nav-item.active .nav-badge-soon {
  background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.2) !important;
  color: var(--color-brand-hover-light, #93c5fd) !important;
  border-color: rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important;
}

.sidebar .nav-item .nav-badge-soon.parent-soon,
.nav-badge-soon.parent-soon {
  margin-left: auto !important;
  margin-right: 6px !important;
}

.sidebar .nav-item > .nav-icon,
.sidebar .nav-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  color: #cbd5e1 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: color 120ms ease !important;
}

.sidebar .nav-item > .nav-icon svg,
.sidebar .nav-icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

/* Hover State */
.sidebar .nav-item:hover,
[data-theme="dark"] .sidebar .nav-item:hover,
body.dark-mode .sidebar .nav-item:hover {
  background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.08) !important;
  color: #ffffff !important;
  border: 0px solid transparent !important;
  transform: none !important;
}

.sidebar .nav-item:hover > .nav-icon,
.sidebar .nav-item:hover .nav-chevron {
  color: var(--color-brand-hover-light, #60a5fa) !important;
  opacity: 1 !important;
}

/* Active Standalone Item (e.g. Dashboard on /) */
.sidebar > .sidebar-nav > .nav-item.active,
.sidebar .sidebar-nav > .nav-item.active:not(.has-submenu),
[data-theme="dark"] .sidebar > .sidebar-nav > .nav-item.active,
body.dark-mode .sidebar > .sidebar-nav > .nav-item.active {
  background: var(--color-sidebar-active-gradient, linear-gradient(90deg, var(--color-brand) 0%, var(--color-brand-hover) 100%)) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 0px solid transparent !important;
  box-shadow: 0 3px 12px var(--color-sidebar-active-glow, rgba(var(--color-brand-rgb, 37, 99, 235), 0.35)) !important;
}

.sidebar > .sidebar-nav > .nav-item.active > .nav-icon,
.sidebar .sidebar-nav > .nav-item.active:not(.has-submenu) > .nav-icon {
  color: #ffffff !important;
}

/* Open / Active Parent Group (e.g. Customers on /customers, Network on /network/ip-pools) */
/* ZERO muddy grey box! Transparent background with crisp theme-accent text and icon */
.sidebar .nav-item.active-parent,
[data-theme="dark"] .sidebar .nav-item.active-parent,
body.dark-mode .sidebar .nav-item.active-parent {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--color-sidebar-parent-active, var(--color-brand-hover-light)) !important;
  font-weight: 600 !important;
  border: 0px solid transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-item.active-parent > .nav-icon,
.sidebar .nav-item.active-parent .nav-chevron {
  color: var(--color-sidebar-parent-active, var(--color-brand-hover-light)) !important;
  opacity: 1 !important;
}

.sidebar .nav-item.active-parent:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* 2.6 Subtle Unobtrusive Section Spacing (1px Whisper Divider) */
.sidebar .nav-section-label,
.nav-section-label {
  height: 1px !important;
  min-height: 1px !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: 6px 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  font-size: 0 !important;
  color: transparent !important;
  overflow: hidden !important;
  border: none !important;
  line-height: 0 !important;
  display: block !important;
}

.sidebar .nav-section-label.nav-section-label--first,
.sidebar .nav-section-label:first-child,
.nav-section-label.nav-section-label--first,
.nav-section-label:first-child {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2.7 Clean, Uncluttered Submenu List (ZERO vertical tree line or ::before bar!) */
.sidebar:not(.collapsed) .nav-submenu {
  position: relative !important;
  margin: 2px 0 4px 0 !important;
  padding: 2px 0 !important;
  border-left: none !important;
  border-left-width: 0px !important;
  display: none;
  flex-direction: column !important;
  gap: 2px !important;
}

.sidebar:not(.collapsed) .nav-submenu.open {
  display: flex !important;
  animation: skySidebarSubmenuIn 160ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes skySidebarSubmenuIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sidebar .nav-submenu .nav-item {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 8px 0 26px !important;
  margin: 1px 8px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #e2e8f0 !important;
  border: 0px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  width: calc(100% - 16px) !important;
  box-sizing: border-box !important;
}

.sidebar .nav-submenu .nav-item .nav-label {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: inherit !important;
  letter-spacing: -0.01em !important;
}

.sidebar .nav-submenu .nav-item:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 0px solid transparent !important;
}

/* Unified Active Submenu Child Selection (Release v77 spotlight glow standard) */
/* Moved to unified overhead spotlight glow block at line 45534+ */

/* 3.1 Fixed, Unclipped 48px Footer Pinned at Bottom */
.sidebar-footer,
[data-theme="dark"] .sidebar-footer,
body.dark-mode .sidebar-footer {
  padding: 0 8px !important;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border-top: 1px solid color-mix(in srgb, var(--color-brand, #2563eb) 16%, rgba(255, 255, 255, 0.06)) !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  flex: 0 0 36px !important;
  flex-shrink: 0 !important;
}

#logoutLink.sidebar-logout-btn,
.sidebar-footer #logoutLink,
.sidebar-footer .nav-signout,
.sidebar-footer .signout-btn,
[data-theme="dark"] #logoutLink.sidebar-logout-btn,
body.dark-mode #logoutLink.sidebar-logout-btn {
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  border-radius: 7px !important;
  border: 0px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: background 120ms ease, color 120ms ease !important;
}

#logoutLink.sidebar-logout-btn:hover,
.sidebar-footer #logoutLink:hover,
.sidebar-footer .nav-signout:hover,
.sidebar-footer .signout-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border: 0px solid transparent !important;
}

#logoutLink.sidebar-logout-btn:hover .nav-icon,
.sidebar-footer #logoutLink:hover .nav-icon,
.sidebar-footer .nav-signout:hover .nav-icon,
.sidebar-footer .signout-btn:hover .nav-icon {
  color: #ffffff !important;
}

/* 3.2 Floating Flyout Card in Collapsed Mini-Rail Mode */
.sidebar-flyout-card {
  position: fixed;
  left: 74px;
  min-width: 220px;
  max-width: 280px;
  background: #1e293b !important;
  background-color: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.45) !important;
  color: #f8fafc !important;
  padding: 8px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: skyFlyoutIn 120ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes skyFlyoutIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sidebar-flyout-card .flyout-header {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 4px;
}

.sidebar-flyout-card .flyout-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8 !important;
}

.sidebar-flyout-card .flyout-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-flyout-card .flyout-body::-webkit-scrollbar {
  display: none;
}

.sidebar-flyout-card .flyout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1 !important;
  text-decoration: none;
  border-radius: 7px;
  transition: all 120ms ease;
  min-height: 32px;
  border: 0px solid transparent !important;
}

.sidebar-flyout-card .flyout-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.sidebar-flyout-card .flyout-item.active {
  background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.22) !important;
  color: var(--color-brand-hover-light, #60a5fa) !important;
  font-weight: 600;
}

.sidebar-flyout-card .flyout-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* 4.1 Collapsed Mini-Rail Mode Overrides */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width, 68px) !important;
}

.sidebar.collapsed .sidebar-brand {
  padding: 0 !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-brand .brand-left {
  justify-content: center !important;
  margin: 0 auto !important;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .brand-actions,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-badge-soon,
.sidebar.collapsed .parent-soon,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .logout-hint {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: none !important;
}

.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .nav-submenu.open {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 0 !important;
  align-items: center !important;
}

.sidebar.collapsed .nav-item {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 2px auto !important;
  justify-content: center !important;
  border-radius: 8px !important;
  border: 0px solid transparent !important;
}

.sidebar.collapsed .nav-item > .nav-icon {
  margin: 0 !important;
  width: 20px !important;
  height: 20px !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 0 6px !important;
  justify-content: center !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: 0 0 36px !important;
  background: transparent !important;
  background-color: transparent !important;
  border-top: 1px solid color-mix(in srgb, var(--color-brand, #2563eb) 16%, rgba(255, 255, 255, 0.06)) !important;
}

.sidebar.collapsed #logoutLink.sidebar-logout-btn,
.sidebar.collapsed .sidebar-footer #logoutLink {
  width: 44px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  justify-content: center !important;
  border: 0px solid transparent !important;
}

.sidebar.collapsed #logoutLink .nav-icon {
  margin: 0 auto !important;
  width: 20px !important;
  height: 20px !important;
}

/* 4.2 Mobile Drawer (max-width: 992px) */
@media (max-width: 992px) {
  .sidebar {
    width: min(84vw, 280px) !important;
    height: 100vh !important;
background: var(--color-sidebar-bg, linear-gradient(180deg, var(--color-sidebar-bg-start, #0f172a) 0%, var(--color-sidebar-bg-end, #0b1120) 100%)) !important;
    background-color: var(--color-sidebar-bg-start, #0f172a) !important;
    background-image: var(--color-sidebar-bg, linear-gradient(180deg, var(--color-sidebar-bg-start, #0f172a) 0%, var(--color-sidebar-bg-end, #0b1120) 100%)) !important;
    color: #e2e8f0 !important;
    border-bottom: none !important;
    border-bottom-right-radius: 0 !important;
    z-index: 1000 !important;
  }

  .sidebar:not(.open) {
    box-shadow: none !important;
    visibility: hidden !important;
    transform: translateX(calc(-100% - 16px)) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.22s !important;
  }

  .sidebar.open {
    visibility: visible !important;
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.55) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }

  .sidebar-flyout-card {
    display: none !important;
  }

  .sidebar-brand .brand-actions {
    display: flex !important;
  }

  .sidebar-mobile-close {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: #cbd5e1 !important;
  }

  .sidebar .nav-item {
    min-height: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
  }

  .sidebar .nav-submenu .nav-item {
    min-height: 38px !important;
    height: 38px !important;
    font-size: 13.5px !important;
  }
}

/* =========================================================================
   RELEASE v56: AUTHORITATIVE UNIVERSAL MULTI-MONITOR RESPONSIVE ENGINE
   - Universal Fluid expansion across 1366x768, 1080p FHD, 2K QHD & 4K UHD
   - Eliminates artificial max-width constraints across all 64 pages / 68 routes
   - Guaranteed uniform 24px horizontal workspace margins on desktops
   - Full-bleed edge-to-edge login studio (0px sidebars on any resolution)
   - Preserves 100% mobile drawer responsiveness (scrollWidth <= 375px)
   - Preserves modal dialog max-widths (zero touch to modals)
   ========================================================================= */

.container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  padding: 24px !important;
}

@media (max-width: 992px) {
  .container-fluid {
    padding: 12px 14px !important;
  }
}

@media (min-width: 993px) {
  :root {
    --sidebar-width: 240px !important;
    --content-max-width: 100% !important;
    --page-padding: 24px !important;
    --page-padding-top: 20px !important;
  }

  .sidebar:not(.collapsed) {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
  }

  .sidebar:not(.collapsed) ~ .main,
  .sidebar:not(.collapsed) + .sidebar-backdrop + .main {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 240px) !important;
  }

  .content,
  .main-content,
  #mainContent {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #mainContent > *,
  [class$="-page"],
  [class$="-page-container"],
  .page-container,
  .main-container,
  .inv-page-container,
  .comm-studio-page,
  .nolt-page-container,
  .noft-page-container,
  .nrad-page-container,
  .supt-page-container,
  .pos-page-container,
  .router-studio-container,
  .payment-detail-page,
  .adjust-billing-page,
  .billing-settings-page,
  .settings-page,
  .custnew-page,
  .custedit-page,
  .pkgnew-layout,
  .import-export-container,
  .import-export-shell,
  .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}


/* ==========================================================================
   RELEASE v57: MASTER UNIFIED DARK MODE ARCHITECTURE OVERHAUL
   Cohesive Executive Obsidian-Slate Surface & Token System Across All 64 Pages
   ========================================================================== */

/* LAYER 0 — Global Page Canvas */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.dark-mode,
[data-theme="dark"] .app-shell,
body.dark-mode .app-shell,
[data-theme="dark"] .main,
body.dark-mode .main,
[data-theme="dark"] .content,
body.dark-mode .content,
[data-theme="dark"] .main-content,
body.dark-mode .main-content,
[data-theme="dark"] #mainContent,
body.dark-mode #mainContent,
[data-theme="dark"] [class$="-page"],
body.dark-mode [class$="-page"],
[data-theme="dark"] [class*="-container"],
body.dark-mode [class*="-container"],
[data-theme="dark"] .container-fluid,
body.dark-mode .container-fluid,
[data-theme="dark"] .page-container,
body.dark-mode .page-container,
[data-theme="dark"] .main-container,
body.dark-mode .main-container,
[data-theme="dark"] .comm-studio-page,
body.dark-mode .comm-studio-page,
[data-theme="dark"] .nolt-page-container,
body.dark-mode .nolt-page-container,
[data-theme="dark"] .noft-page-container,
body.dark-mode .noft-page-container,
[data-theme="dark"] .nrad-page-container,
body.dark-mode .nrad-page-container,
[data-theme="dark"] .supt-page-container,
body.dark-mode .supt-page-container,
[data-theme="dark"] .pos-page-container,
body.dark-mode .pos-page-container,
[data-theme="dark"] .router-studio-container,
body.dark-mode .router-studio-container,
[data-theme="dark"] .inv-page-container,
body.dark-mode .inv-page-container,
[data-theme="dark"] .billing-container,
body.dark-mode .billing-container,
[data-theme="dark"] .customers-container,
body.dark-mode .customers-container,
[data-theme="dark"] .packages-container,
body.dark-mode .packages-container {
  background: var(--dark-bg-canvas) !important;
  background-color: var(--dark-bg-canvas) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .revenue-chart-container,
body.dark-mode .revenue-chart-container {
  background: transparent !important;
  background-color: transparent !important;
}

/* LAYER 1 — Topbar (.topbar) */
[data-theme="dark"] .topbar,
body.dark-mode .topbar {
  background: color-mix(in srgb, var(--dark-bg-surface) 90%, transparent) !important;
  background-color: color-mix(in srgb, var(--dark-bg-surface) 90%, transparent) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

[data-theme="dark"] .breadcrumb .crumb-current,
body.dark-mode .breadcrumb .crumb-current,
[data-theme="dark"] #pageTitleCrumb,
body.dark-mode #pageTitleCrumb,
[data-theme="dark"] .breadcrumb-icon,
body.dark-mode .breadcrumb-icon {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] #themeToggle,
body.dark-mode .theme-toggle,
body.dark-mode #themeToggle {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid var(--dark-border-strong) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] #themeToggle:hover,
body.dark-mode .theme-toggle:hover,
body.dark-mode #themeToggle:hover {
  background: var(--dark-bg-hover) !important;
  color: #ffffff !important;
  border-color: var(--dark-border-strong) !important;
}

[data-theme="dark"] .admin-chip,
body.dark-mode .admin-chip,
[data-theme="dark"] #adminChip,
body.dark-mode #adminChip {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid var(--dark-border-strong) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .admin-name,
body.dark-mode .admin-name {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .admin-avatar,
body.dark-mode .admin-avatar {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .quick-search-box,
body.dark-mode .quick-search-box {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid var(--dark-border-strong) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .quick-search-box .search-placeholder,
body.dark-mode .quick-search-box .search-placeholder {
  color: #94a3b8 !important;
}

[data-theme="dark"] .quick-search-box .search-hint,
body.dark-mode .quick-search-box .search-hint {
  background: var(--dark-bg-subtle) !important;
  border: 1px solid var(--dark-border-strong) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .global-search-panel,
body.dark-mode .global-search-panel {
  background: var(--dark-bg-surface) !important;
  background-color: var(--dark-bg-surface) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .shell-footer,
body.dark-mode .shell-footer {
  background: var(--dark-footer-bg) !important;
  background-color: var(--dark-footer-bg) !important;
  border-top: 1px solid var(--dark-border) !important;
  color: #94a3b8 !important;
}

/* LAYER 2 — Elevated Cards, Panels, Studio Boxes & Modals */
[data-theme="dark"] .card,
body.dark-mode .card,
[data-theme="dark"] .stat-card,
body.dark-mode .stat-card,
[data-theme="dark"] .metric-card,
body.dark-mode .metric-card,
[data-theme="dark"] .studio-box,
body.dark-mode .studio-box,
[data-theme="dark"] .panel,
body.dark-mode .panel,
[data-theme="dark"] .box,
body.dark-mode .box,
[data-theme="dark"] .modal-content,
body.dark-mode .modal-content,
[data-theme="dark"] .modal-box,
body.dark-mode .modal-box,
[data-theme="dark"] .modal-container,
body.dark-mode .modal-container,
[data-theme="dark"] .dashboard-card,
body.dark-mode .dashboard-card,
[data-theme="dark"] .chart-card,
body.dark-mode .chart-card,
[data-theme="dark"] .nolt-card,
body.dark-mode .nolt-card,
[data-theme="dark"] .nolt-step-card,
body.dark-mode .nolt-step-card,
[data-theme="dark"] .nolt-preview-card,
body.dark-mode .nolt-preview-card,
[data-theme="dark"] .inv-card,
body.dark-mode .inv-card,
[data-theme="dark"] .inv-stat-card,
body.dark-mode .inv-stat-card,
[data-theme="dark"] .supt-card,
body.dark-mode .supt-card,
[data-theme="dark"] .supt-ticket-card,
body.dark-mode .supt-ticket-card,
[data-theme="dark"] .supt-ticket-item,
body.dark-mode .supt-ticket-item,
[data-theme="dark"] .comm-card,
body.dark-mode .comm-card,
[data-theme="dark"] .comm-studio-box,
body.dark-mode .comm-studio-box,
[data-theme="dark"] .pkg-card,
body.dark-mode .pkg-card,
[data-theme="dark"] .pkgnew-card,
body.dark-mode .pkgnew-card,
[data-theme="dark"] .custprofile-card,
body.dark-mode .custprofile-card,
[data-theme="dark"] .billing-card,
body.dark-mode .billing-card,
[data-theme="dark"] .gateway-card,
body.dark-mode .gateway-card,
[data-theme="dark"] .pos-card,
body.dark-mode .pos-card,
[data-theme="dark"] .admin-dropdown,
body.dark-mode .admin-dropdown,
[data-theme="dark"] .sidebar-flyout-card,
body.dark-mode .sidebar-flyout-card,
[data-theme="dark"] .router-settings-panel,
body.dark-mode .router-settings-panel,
[data-theme="dark"] .adjust-billing-identity-card,
body.dark-mode .adjust-billing-identity-card,
[data-theme="dark"] .adjust-billing-metric-tile,
body.dark-mode .adjust-billing-metric-tile {
  background: var(--dark-bg-surface) !important;
  background-color: var(--dark-bg-surface) !important;
  border: 1px solid var(--dark-border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .card-header,
body.dark-mode .card-header,
[data-theme="dark"] .panel-header,
body.dark-mode .panel-header,
[data-theme="dark"] .modal-header,
body.dark-mode .modal-header {
  background: transparent !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

[data-theme="dark"] .card-footer,
body.dark-mode .card-footer,
[data-theme="dark"] .modal-footer,
body.dark-mode .modal-footer {
  background: transparent !important;
  border-top: 1px solid var(--dark-border) !important;
}

[data-theme="dark"] .detail-card,
body.dark-mode .detail-card,
[data-theme="dark"] .kpi-pill,
body.dark-mode .kpi-pill,
[data-theme="dark"] .stat-pill,
body.dark-mode .stat-pill,
[data-theme="dark"] .nolt-sub-panel,
body.dark-mode .nolt-sub-panel,
[data-theme="dark"] .comm-box,
body.dark-mode .comm-box {
  background: var(--dark-bg-subtle) !important;
  background-color: var(--dark-bg-subtle) !important;
  border: 1px solid var(--dark-border) !important;
  color: #e2e8f0 !important;
}

/* Headings in Dark Mode — Crisp #f8fafc */
[data-theme="dark"] h1,
body.dark-mode h1,
[data-theme="dark"] h2,
body.dark-mode h2,
[data-theme="dark"] h3,
body.dark-mode h3,
[data-theme="dark"] h4,
body.dark-mode h4,
[data-theme="dark"] h5,
body.dark-mode h5,
[data-theme="dark"] h6,
body.dark-mode h6,
[data-theme="dark"] .page-title,
body.dark-mode .page-title,
[data-theme="dark"] .billing-page-title,
body.dark-mode .billing-page-title,
[data-theme="dark"] .dashboard-title,
body.dark-mode .dashboard-title,
[data-theme="dark"] .inv-page-title,
body.dark-mode .inv-page-title,
[data-theme="dark"] .nolt-page-title,
body.dark-mode .nolt-page-title,
[data-theme="dark"] .panel-title,
body.dark-mode .panel-title,
[data-theme="dark"] .card-title,
body.dark-mode .card-title,
[data-theme="dark"] .modal-title,
body.dark-mode .modal-title,
[data-theme="dark"] .studio-title,
body.dark-mode .studio-title,
[data-theme="dark"] .page-header-title,
body.dark-mode .page-header-title,
[data-theme="dark"] .metric-card-value,
body.dark-mode .metric-card-value,
[data-theme="dark"] .stat-value,
body.dark-mode .stat-value,
[data-theme="dark"] .kpi-val,
body.dark-mode .kpi-val {
  color: #f8fafc !important;
}

/* Subtitles and Meta Text — Crisp #94a3b8 */
[data-theme="dark"] p,
body.dark-mode p,
[data-theme="dark"] .page-subtitle,
body.dark-mode .page-subtitle,
[data-theme="dark"] .billing-page-subtitle,
body.dark-mode .billing-page-subtitle,
[data-theme="dark"] .inv-page-subtitle,
body.dark-mode .inv-page-subtitle,
[data-theme="dark"] .subtitle,
body.dark-mode .subtitle,
[data-theme="dark"] .card-subtitle,
body.dark-mode .card-subtitle,
[data-theme="dark"] .text-muted,
body.dark-mode .text-muted,
[data-theme="dark"] .helper-caption,
body.dark-mode .helper-caption,
[data-theme="dark"] .form-help,
body.dark-mode .form-help,
[data-theme="dark"] .metric-card-label,
body.dark-mode .metric-card-label,
[data-theme="dark"] .metric-card-meta,
body.dark-mode .metric-card-meta,
[data-theme="dark"] .kpi-label,
body.dark-mode .kpi-label,
[data-theme="dark"] .kpi-sub,
body.dark-mode .kpi-sub,
[data-theme="dark"] .stat-label,
body.dark-mode .stat-label {
  color: #94a3b8 !important;
}

/* LAYER 3 — Data Tables, Tabs, Filter Bars & Pagination */
[data-theme="dark"] table,
body.dark-mode table,
[data-theme="dark"] .table,
body.dark-mode .table,
[data-theme="dark"] .tx-table,
body.dark-mode .tx-table,
[data-theme="dark"] .supt-table,
body.dark-mode .supt-table,
[data-theme="dark"] .supt-table-practical,
body.dark-mode .supt-table-practical,
[data-theme="dark"] .supt-isp-grid-table,
body.dark-mode .supt-isp-grid-table,
[data-theme="dark"] .supt-clean-table,
body.dark-mode .supt-clean-table,
[data-theme="dark"] .cust-table,
body.dark-mode .cust-table,
[data-theme="dark"] .inv-table,
body.dark-mode .inv-table,
[data-theme="dark"] .billing-table,
body.dark-mode .billing-table,
[data-theme="dark"] .report-table,
body.dark-mode .report-table,
[data-theme="dark"] .packages-table,
body.dark-mode .packages-table,
[data-theme="dark"] .nolt-table,
body.dark-mode .nolt-table,
[data-theme="dark"] .olt-table,
body.dark-mode .olt-table {
  background: transparent !important;
  background-color: transparent !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] thead th,
body.dark-mode thead th,
[data-theme="dark"] .table thead th,
body.dark-mode .table thead th,
[data-theme="dark"] .tx-table thead th,
body.dark-mode .tx-table thead th,
[data-theme="dark"] .supt-table thead th,
body.dark-mode .supt-table thead th,
[data-theme="dark"] .supt-table-practical thead th,
body.dark-mode .supt-table-practical thead th,
[data-theme="dark"] .supt-isp-grid-table thead th,
body.dark-mode .supt-isp-grid-table thead th,
[data-theme="dark"] .supt-clean-table thead th,
body.dark-mode .supt-clean-table thead th,
[data-theme="dark"] .cust-table thead th,
body.dark-mode .cust-table thead th,
[data-theme="dark"] .inv-table thead th,
body.dark-mode .inv-table thead th,
[data-theme="dark"] .billing-table thead th,
body.dark-mode .billing-table thead th,
[data-theme="dark"] .report-table thead th,
body.dark-mode .report-table thead th,
[data-theme="dark"] .packages-table thead th,
body.dark-mode .packages-table thead th,
[data-theme="dark"] .nolt-table thead th,
body.dark-mode .nolt-table thead th,
[data-theme="dark"] .olt-table thead th,
body.dark-mode .olt-table thead th {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

[data-theme="dark"] tbody tr,
body.dark-mode tbody tr,
[data-theme="dark"] tbody td,
body.dark-mode tbody td,
[data-theme="dark"] .table tbody td,
body.dark-mode .table tbody td,
[data-theme="dark"] .tx-table tbody td,
body.dark-mode .tx-table tbody td,
[data-theme="dark"] .supt-table tbody td,
body.dark-mode .supt-table tbody td,
[data-theme="dark"] .supt-table-practical tbody td,
body.dark-mode .supt-table-practical tbody td,
[data-theme="dark"] .supt-isp-grid-table tbody td,
body.dark-mode .supt-isp-grid-table tbody td,
[data-theme="dark"] .supt-clean-table tbody td,
body.dark-mode .supt-clean-table tbody td,
[data-theme="dark"] .cust-table tbody td,
body.dark-mode .cust-table tbody td,
[data-theme="dark"] .inv-table tbody td,
body.dark-mode .inv-table tbody td,
[data-theme="dark"] .billing-table tbody td,
body.dark-mode .billing-table tbody td,
[data-theme="dark"] .report-table tbody td,
body.dark-mode .report-table tbody td,
[data-theme="dark"] .packages-table tbody td,
body.dark-mode .packages-table tbody td,
[data-theme="dark"] .nolt-table tbody td,
body.dark-mode .nolt-table tbody td,
[data-theme="dark"] .olt-table tbody td,
body.dark-mode .olt-table tbody td {
  background: transparent !important;
  background-color: transparent !important;
  color: #e2e8f0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10) !important;
}

[data-theme="dark"] tbody tr:hover,
body.dark-mode tbody tr:hover,
[data-theme="dark"] .table tbody tr:hover,
body.dark-mode .table tbody tr:hover,
[data-theme="dark"] .tx-table tbody tr:hover,
body.dark-mode .tx-table tbody tr:hover,
[data-theme="dark"] .supt-table tbody tr:hover,
body.dark-mode .supt-table tbody tr:hover,
[data-theme="dark"] .supt-table-practical tbody tr:hover,
body.dark-mode .supt-table-practical tbody tr:hover,
[data-theme="dark"] .supt-isp-grid-table tbody tr:hover,
body.dark-mode .supt-isp-grid-table tbody tr:hover,
[data-theme="dark"] .supt-clean-table tbody tr:hover,
body.dark-mode .supt-clean-table tbody tr:hover {
  background: rgba(var(--color-brand-rgb), 0.08) !important;
  background-color: rgba(var(--color-brand-rgb), 0.08) !important;
}

/* Filter Tabs / Segmented Pills */
[data-theme="dark"] .filter-tab,
body.dark-mode .filter-tab,
[data-theme="dark"] .filter-pill,
body.dark-mode .filter-pill,
[data-theme="dark"] .tab-btn,
body.dark-mode .tab-btn,
[data-theme="dark"] .nav-tab,
body.dark-mode .nav-tab,
[data-theme="dark"] .segmented-item,
body.dark-mode .segmented-item,
[data-theme="dark"] .pill-btn,
body.dark-mode .pill-btn,
[data-theme="dark"] .filter-tabs,
body.dark-mode .filter-tabs,
[data-theme="dark"] .filter-bar,
body.dark-mode .filter-bar,
[data-theme="dark"] .status-filter-tab,
body.dark-mode .status-filter-tab,
 {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .filter-tab.active,
body.dark-mode .filter-tab.active,
[data-theme="dark"] .filter-pill.active,
body.dark-mode .filter-pill.active,
[data-theme="dark"] .tab-btn.active,
body.dark-mode .tab-btn.active,
[data-theme="dark"] .nav-tab.active,
body.dark-mode .nav-tab.active,
[data-theme="dark"] .segmented-item.active,
body.dark-mode .segmented-item.active,
[data-theme="dark"] .pill-btn.active,
body.dark-mode .pill-btn.active,
[data-theme="dark"] .status-filter-tab.active,
body.dark-mode .status-filter-tab.active {
  background: var(--color-brand, #2563eb) !important;
  background-color: var(--color-brand, #2563eb) !important;
  border-color: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .pagination,
body.dark-mode .pagination,
[data-theme="dark"] .pagination-btn,
body.dark-mode .pagination-btn,
[data-theme="dark"] .page-btn,
body.dark-mode .page-btn {
  background: var(--dark-bg-elevated) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
}

/* LAYER 4 — Form Inputs, Selects, Textareas & Custom Dropdowns */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
[data-theme="dark"] select,
body.dark-mode select,
[data-theme="dark"] textarea,
body.dark-mode textarea,
[data-theme="dark"] .form-control,
body.dark-mode .form-control,
[data-theme="dark"] .form-select,
body.dark-mode .form-select,
[data-theme="dark"] .supt-form-control,
body.dark-mode .supt-form-control,
[data-theme="dark"] .supt-form-select,
body.dark-mode .supt-form-select,
[data-theme="dark"] .supt-form-textarea,
body.dark-mode .supt-form-textarea,
[data-theme="dark"] .search-input,
body.dark-mode .search-input,
[data-theme="dark"] .filter-input,
body.dark-mode .filter-input,
[data-theme="dark"] .nolt-form-control,
body.dark-mode .nolt-form-control,
[data-theme="dark"] .comm-form-control,
body.dark-mode .comm-form-control,
[data-theme="dark"] .inv-input,
body.dark-mode .inv-input,
[data-theme="dark"] .pos-input,
body.dark-mode .pos-input,
[data-theme="dark"] .global-search-input-wrap input,
body.dark-mode .global-search-input-wrap input {
  background: var(--dark-bg-subtle) !important;
  background-color: var(--dark-bg-subtle) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] input::placeholder,
body.dark-mode input::placeholder,
[data-theme="dark"] textarea::placeholder,
body.dark-mode textarea::placeholder,
[data-theme="dark"] .form-control::placeholder,
body.dark-mode .form-control::placeholder,
[data-theme="dark"] .supt-form-control::placeholder,
body.dark-mode .supt-form-control::placeholder,
[data-theme="dark"] .global-search-input-wrap input::placeholder,
body.dark-mode .global-search-input-wrap input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

[data-theme="dark"] input:focus,
body.dark-mode input:focus,
[data-theme="dark"] select:focus,
body.dark-mode select:focus,
[data-theme="dark"] textarea:focus,
body.dark-mode textarea:focus,
[data-theme="dark"] .form-control:focus,
body.dark-mode .form-control:focus,
[data-theme="dark"] .form-select:focus,
body.dark-mode .form-select:focus,
[data-theme="dark"] .supt-form-control:focus,
body.dark-mode .supt-form-control:focus,
[data-theme="dark"] .supt-form-select:focus,
body.dark-mode .supt-form-select:focus,
[data-theme="dark"] .supt-form-textarea:focus,
body.dark-mode .supt-form-textarea:focus,
[data-theme="dark"] .nolt-form-control:focus,
body.dark-mode .nolt-form-control:focus {
  border-color: var(--color-brand, #2563eb) !important;
  box-shadow: 0 0 0 3px var(--color-brand-soft, rgba(var(--color-brand-rgb, 37, 99, 235), 0.2)) !important;
  outline: none !important;
}

/* Custom <select> chevron SVG in Dark Mode (Single Chevron Enforcement) */
[data-theme="dark"] select,
body.dark-mode select,
[data-theme="dark"] .form-select,
body.dark-mode .form-select,
[data-theme="dark"] .supt-form-select,
body.dark-mode .supt-form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
}

/* Secondary Buttons in Dark Mode */
[data-theme="dark"] .btn-secondary,
body.dark-mode .btn-secondary,
[data-theme="dark"] .btn-outline,
body.dark-mode .btn-outline,
[data-theme="dark"] .btn-light,
body.dark-mode .btn-light {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .btn-secondary:hover,
body.dark-mode .btn-secondary:hover,
[data-theme="dark"] .btn-outline:hover,
body.dark-mode .btn-outline:hover,
[data-theme="dark"] .btn-light:hover,
body.dark-mode .btn-light:hover {
  background: var(--dark-bg-hover) !important;
  background-color: var(--dark-bg-hover) !important;
  border-color: var(--dark-border-strong) !important;
  color: #ffffff !important;
}


/* LAYER 5 — Alert Banners & Status Badges in Dark Mode */
[data-theme="dark"] .alert-danger,
body.dark-mode .alert-danger,
[data-theme="dark"] .customers-error-banner,
body.dark-mode .customers-error-banner,
[data-theme="dark"] .mbl-error-banner,
body.dark-mode .mbl-error-banner,
[data-theme="dark"] .status-badge.disconnected,
body.dark-mode .status-badge.disconnected,
[data-theme="dark"] .status-badge.suspended,
body.dark-mode .status-badge.suspended,
[data-theme="dark"] .status-badge.offline,
body.dark-mode .status-badge.offline,
[data-theme="dark"] .status-badge.overdue,
body.dark-mode .status-badge.overdue,
[data-theme="dark"] .badge-danger,
body.dark-mode .badge-danger,
[data-theme="dark"] .badge-critical,
body.dark-mode .badge-critical,
[data-theme="dark"] .badge-act-service-off,
body.dark-mode .badge-act-service-off {
  background: rgba(239, 68, 68, 0.15) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .alert-success,
body.dark-mode .alert-success,
[data-theme="dark"] .sim-success-banner,
body.dark-mode .sim-success-banner,
[data-theme="dark"] .status-badge.active,
body.dark-mode .status-badge.active,
[data-theme="dark"] .status-badge.online,
body.dark-mode .status-badge.online,
[data-theme="dark"] .status-badge.paid,
body.dark-mode .status-badge.paid,
[data-theme="dark"] .badge-success,
body.dark-mode .badge-success,
[data-theme="dark"] .badge-act-service-on,
body.dark-mode .badge-act-service-on {
  background: rgba(16, 185, 129, 0.15) !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-warning,
body.dark-mode .alert-warning,
[data-theme="dark"] .status-badge.warning,
body.dark-mode .status-badge.warning,
[data-theme="dark"] .status-badge.degraded,
body.dark-mode .status-badge.degraded,
[data-theme="dark"] .badge-warning,
body.dark-mode .badge-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  background-color: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: #fcd34d !important;
}

[data-theme="dark"] .alert-info,
body.dark-mode .alert-info,
[data-theme="dark"] .status-badge.info,
body.dark-mode .status-badge.info,
[data-theme="dark"] .badge-info,
body.dark-mode .badge-info {
  background: rgba(59, 130, 246, 0.15) !important;
  background-color: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] #dashboardRouterApiBadge,
body.dark-mode #dashboardRouterApiBadge {
  background: rgba(15, 23, 42, 0.8) !important;
  background-color: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}


/* =============================================================================
   SUPPORT MODULE & COMPONENT PRACTICAL DARK MODE POLISH (v57)
   ============================================================================= */

[data-theme="dark"] .supt-v8-kpi-card,
body.dark-mode .supt-v8-kpi-card,
[data-theme="dark"] .supt-kpi-card-112,
body.dark-mode .supt-kpi-card-112,
[data-theme="dark"] .supt-stream-card,
body.dark-mode .supt-stream-card,
[data-theme="dark"] .supt-clean-table-wrap,
body.dark-mode .supt-clean-table-wrap,
[data-theme="dark"] .supt-clean-table,
body.dark-mode .supt-clean-table,
[data-theme="dark"] .supt-table-wrap-practical,
body.dark-mode .supt-table-wrap-practical,
[data-theme="dark"] .supt-unified-toolbar,
body.dark-mode .supt-unified-toolbar,
[data-theme="dark"] .supt-command-toolbar,
body.dark-mode .supt-command-toolbar,
[data-theme="dark"] .supt-filter-popover,
body.dark-mode .supt-filter-popover,
[data-theme="dark"] .supt-stream-container,
body.dark-mode .supt-stream-container,
[data-theme="dark"] .supt-emp-work-summary-strip,
body.dark-mode .supt-emp-work-summary-strip,
[data-theme="dark"] .supt-emp-metric-pill,
body.dark-mode .supt-emp-metric-pill,
[data-theme="dark"] .supt-detail-card,
body.dark-mode .supt-detail-card,
[data-theme="dark"] .supt-canned-item,
body.dark-mode .supt-canned-item {
  background: var(--dark-bg-surface) !important;
  background-color: var(--dark-bg-surface) !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .supt-v8-kpi-title,
body.dark-mode .supt-v8-kpi-title,
[data-theme="dark"] .supt-kpi-title,
body.dark-mode .supt-kpi-title {
  color: #94a3b8 !important;
}

[data-theme="dark"] .supt-v8-kpi-val,
body.dark-mode .supt-v8-kpi-val,
[data-theme="dark"] .supt-kpi-val,
body.dark-mode .supt-kpi-val {
  color: #f8fafc !important;
}

[data-theme="dark"] .supt-v8-kpi-sub,
body.dark-mode .supt-v8-kpi-sub,
[data-theme="dark"] .supt-kpi-sub,
body.dark-mode .supt-kpi-sub {
  color: #64748b !important;
}

[data-theme="dark"] .supt-v8-kpi-icon-wrap,
body.dark-mode .supt-v8-kpi-icon-wrap,
[data-theme="dark"] .supt-kpi-icon-wrap,
body.dark-mode .supt-kpi-icon-wrap {
  background: rgba(30, 41, 59, 0.7) !important;
  border: 1px solid var(--dark-border-strong) !important;
}

[data-theme="dark"] .supt-clean-table thead th,
body.dark-mode .supt-clean-table thead th,
[data-theme="dark"] .supt-table-practical thead th,
body.dark-mode .supt-table-practical thead th {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

[data-theme="dark"] .supt-clean-table tbody tr,
body.dark-mode .supt-clean-table tbody tr,
[data-theme="dark"] .supt-clean-table tbody td,
body.dark-mode .supt-clean-table tbody td,
[data-theme="dark"] .supt-table-practical tbody tr,
body.dark-mode .supt-table-practical tbody tr,
[data-theme="dark"] .supt-table-practical tbody td,
body.dark-mode .supt-table-practical tbody td {
  background: transparent !important;
  background-color: transparent !important;
  color: #e2e8f0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
}

[data-theme="dark"] .supt-clean-table tbody tr:hover td,
body.dark-mode .supt-clean-table tbody tr:hover td,
[data-theme="dark"] .supt-table-practical tbody tr:hover td,
body.dark-mode .supt-table-practical tbody tr:hover td {
  background: rgba(var(--color-brand-rgb), 0.08) !important;
  background-color: rgba(var(--color-brand-rgb), 0.08) !important;
}

[data-theme="dark"] .supt-clean-sub-name,
body.dark-mode .supt-clean-sub-name {
  color: #f8fafc !important;
}

[data-theme="dark"] .supt-clean-sub-meta,
body.dark-mode .supt-clean-sub-meta {
  color: #94a3b8 !important;
}

[data-theme="dark"] .supt-clean-subject,
body.dark-mode .supt-clean-subject {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .supt-clean-date-age,
body.dark-mode .supt-clean-date-age {
  color: #64748b !important;
}

[data-theme="dark"] .supt-clean-tkt-id,
body.dark-mode .supt-clean-tkt-id {
  color: #60a5fa !important;
}

[data-theme="dark"] .supt-clean-code-badge,
body.dark-mode .supt-clean-code-badge {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

[data-theme="dark"] .supt-clean-inspect-btn,
body.dark-mode .supt-clean-inspect-btn,
[data-theme="dark"] .supt-inspect-btn-pill,
body.dark-mode .supt-inspect-btn-pill {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
}

[data-theme="dark"] .supt-clean-inspect-btn:hover,
body.dark-mode .supt-clean-inspect-btn:hover,
[data-theme="dark"] .supt-inspect-btn-pill:hover,
body.dark-mode .supt-inspect-btn-pill:hover {
  background: #2563eb !important;
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Tabs & Toolbar in Support */
[data-theme="dark"] .supt-segmented-tabs,
body.dark-mode .supt-segmented-tabs,
[data-theme="dark"] .supt-pri-filter-group,
body.dark-mode .supt-pri-filter-group {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid var(--dark-border-strong) !important;
}

[data-theme="dark"] .supt-seg-tab-btn,
body.dark-mode .supt-seg-tab-btn,
[data-theme="dark"] .supt-pri-pill-btn,
body.dark-mode .supt-pri-pill-btn {
  color: #94a3b8 !important;
  background: transparent !important;
}

[data-theme="dark"] .supt-seg-tab-btn:hover,
body.dark-mode .supt-seg-tab-btn:hover,
[data-theme="dark"] .supt-pri-pill-btn:hover,
body.dark-mode .supt-pri-pill-btn:hover {
  color: #f8fafc !important;
}

[data-theme="dark"] .supt-seg-tab-btn.active,
body.dark-mode .supt-seg-tab-btn.active,
[data-theme="dark"] .supt-pri-pill-btn.active,
body.dark-mode .supt-pri-pill-btn.active {
  background: #2563eb !important;
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .supt-seg-tab-badge,
body.dark-mode .supt-seg-tab-badge {
  background: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .supt-seg-tab-btn.active .supt-seg-tab-badge,
body.dark-mode .supt-seg-tab-btn.active .supt-seg-tab-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .supt-unified-filter-btn,
body.dark-mode .supt-unified-filter-btn,
[data-theme="dark"] .supt-reset-btn,
body.dark-mode .supt-reset-btn,
[data-theme="dark"] #suptFaultMapBtn,
body.dark-mode #suptFaultMapBtn,
[data-theme="dark"] #suptSettingsBtn,
body.dark-mode #suptSettingsBtn {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .supt-unified-filter-btn:hover,
body.dark-mode .supt-unified-filter-btn:hover,
[data-theme="dark"] .supt-reset-btn:hover,
body.dark-mode .supt-reset-btn:hover,
[data-theme="dark"] #suptFaultMapBtn:hover,
body.dark-mode #suptFaultMapBtn:hover,
[data-theme="dark"] #suptSettingsBtn:hover,
body.dark-mode #suptSettingsBtn:hover {
  background: var(--dark-bg-hover) !important;
  background-color: var(--dark-bg-hover) !important;
  color: #ffffff !important;
  border-color: var(--dark-border-strong) !important;
}

[data-theme="dark"] .supt-unified-search-input,
body.dark-mode .supt-unified-search-input,
[data-theme="dark"] .supt-search-input,
body.dark-mode .supt-search-input,
[data-theme="dark"] .supt-inline-staff-select,
body.dark-mode .supt-inline-staff-select,
[data-theme="dark"] .supt-filter-select,
body.dark-mode .supt-filter-select {
  background: var(--dark-bg-subtle) !important;
  background-color: var(--dark-bg-subtle) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #f8fafc !important;
}

/* Dashboard Traffic Alert Banner */
[data-theme="dark"] #uplinkWarningBanner,
body.dark-mode #uplinkWarningBanner {
  background: rgba(239, 68, 68, 0.15) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}


[data-theme="dark"] #toggleMapBtn,
body.dark-mode #toggleMapBtn,
[data-theme="dark"] #ticketHeaderActions .btn-outline-secondary,
body.dark-mode #ticketHeaderActions .btn-outline-secondary,
[data-theme="dark"] .btn-outline-secondary,
body.dark-mode .btn-outline-secondary {
  background: var(--dark-bg-elevated) !important;
  background-color: var(--dark-bg-elevated) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #toggleMapBtn:hover,
body.dark-mode #toggleMapBtn:hover,
[data-theme="dark"] #ticketHeaderActions .btn-outline-secondary:hover,
body.dark-mode #ticketHeaderActions .btn-outline-secondary:hover,
[data-theme="dark"] .btn-outline-secondary:hover,
body.dark-mode .btn-outline-secondary:hover {
  background: var(--dark-bg-hover) !important;
  background-color: var(--dark-bg-hover) !important;
  border-color: var(--dark-border-strong) !important;
  color: #ffffff !important;
}

/* =============================================================================
   RELEASE v58: MOBILE KPI CARD CORNER POLISH & ACCENT STRIP NORMALIZATION
   Fixes the dark curved corner artifact caused by asymmetric border-top on rounded cards.
   Enforces uniform 1px borders all around, inset 3px top accent strip, and refined
   mobile typography (375x812).
   ============================================================================= */

.supt-v8-kpi-card,
.supt-kpi-card,
.supt-kpi-card-112,
.kpi-card,
.stat-card,
.metric-card,
.report-kpi-card,
.nolt-kpi-card,
.pkg-kpi-card,
.nolt-kpi-grid .pkg-kpi-card,
.nolt-kpi-grid .nolt-kpi-card {
  position: relative !important;
  overflow: hidden !important;
  border-width: 1px !important;
  border-top-width: 1px !important;
  border-right-width: 1px !important;
  border-bottom-width: 1px !important;
  border-left-width: 1px !important;
  border-style: solid !important;
  border-radius: 12px !important;
}

/* Ensure any top accent bar is an inset strip with zero corner miter distortion */
.supt-v8-kpi-accent,
.supt-kpi-accent {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  border-radius: 12px 12px 0 0 !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

/* Mobile viewport refinement (<= 480px, e.g. 375x812) */
@media (max-width: 480px) {
  .supt-v8-kpi-card,
  .supt-kpi-card,
  .supt-kpi-card-112,
  .kpi-card,
  .stat-card {
    padding: 12px 12px !important;
    min-height: 104px !important;
  }

  .supt-v8-kpi-title,
  .supt-kpi-title,
  .kpi-title,
  .stat-title {
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .supt-v8-kpi-top {
    gap: 6px !important;
    align-items: flex-start !important;
    margin-bottom: 4px !important;
  }

  .supt-v8-kpi-icon-wrap,
  .supt-kpi-icon-wrap {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .supt-v8-kpi-icon-wrap svg,
  .supt-kpi-icon-wrap svg {
    width: 16px !important;
    height: 16px !important;
  }

  .supt-v8-kpi-val,
  .supt-kpi-val {
    font-size: 19px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
  }

  .supt-v8-kpi-sub,
  .supt-kpi-sub {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }
}

/* =============================================================================
   RELEASE v59: BULLETPROOF MOBILE SHADOW-BLEED FIX
   Eliminates the dark vertical shadow bleeding along the left edge (x = 0 to 52px).
   When the mobile drawer is closed (.sidebar:not(.open)), box-shadow is none,
   visibility is hidden, and transform is translateX(calc(-100% - 16px)).
   ============================================================================= */
@media (max-width: 992px) {
  .sidebar:not(.open) {
    box-shadow: none !important;
    visibility: hidden !important;
    transform: translateX(calc(-100% - 16px)) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.22s !important;
  }
  .sidebar.open {
    visibility: visible !important;
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }
}



/* =============================================================================
   RELEASE v63: THEME-AWARE ROUTER CONFIGURATION STUDIO & SECRET MODALS
   Crisp Light Mode (#ffffff surface, #0f172a text, WCAG >= 10:1) &
   Obsidian Dark Mode (#111827 surface, #f8fafc text, WCAG >= 10:1).
   Clean single-row desktop footer alignment & 100% desktop invariance.
   ============================================================================= */

/* Base & Light Mode Dialog Container (default / html:not([data-theme="dark"])) */
.router-studio-modal {
  max-width: 860px !important;
  width: 95vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

/* Light Mode Header */
.router-studio-modal .modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 18px 24px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
}

.router-studio-modal .modal-header > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.router-studio-modal .modal-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

.router-studio-modal .modal-header span,
.router-studio-modal .modal-subtitle {
  color: #64748b !important;
  font-size: 12px !important;
}

.router-studio-modal .modal-close {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.router-studio-modal .modal-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Light Mode Body */
.router-studio-modal .modal-body {
  background: #ffffff !important;
  padding: 20px 24px !important;
  overflow-y: auto !important;
}

/* Light Mode Section Cards */
.router-studio-modal .router-studio-section,
.router-studio-section {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 16px !important;
}

.router-studio-modal .router-studio-sec-header,
.router-studio-sec-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  color: #1d4ed8 !important;
  margin-bottom: 14px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.router-studio-modal .sec-badge,
.router-studio-sec-header .sec-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 6px !important;
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

/* Form Grids */
.router-studio-grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
  margin-bottom: 14px !important;
}

.router-studio-grid-2:last-child {
  margin-bottom: 0 !important;
}

/* Light Mode Form Labels & Hints */
.router-studio-modal .form-label {
  color: #1e293b !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  display: block !important;
  margin-bottom: 6px !important;
}

.router-studio-modal .router-field-hint,
.router-field-hint {
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: #64748b !important;
  display: block !important;
  margin-top: 5px !important;
}

.router-studio-modal .checkbox-group span {
  color: #1e293b !important;
  font-size: 13px !important;
}

/* Light Mode Inputs, Selects & Textarea */
.router-studio-modal input.form-control,
.router-studio-modal select.form-control,
.router-studio-modal textarea.form-control {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
}

.router-studio-modal input.form-control::placeholder,
.router-studio-modal textarea.form-control::placeholder {
  color: #94a3b8 !important;
}

.router-studio-modal input.form-control:focus,
.router-studio-modal select.form-control:focus,
.router-studio-modal textarea.form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

.router-input-btn-group {
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
}

.router-input-btn-group .form-control {
  padding-right: 76px !important;
}

.router-input-actions {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
}

.router-icon-btn {
  background: transparent !important;
  border: none !important;
  padding: 6px !important;
  border-radius: 6px !important;
  color: #64748b !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.router-icon-btn:hover {
  color: #0f172a !important;
  background: #e2e8f0 !important;
}

/* Light Mode Modal Footer */
.router-studio-modal .modal-footer,
.router-studio-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 14px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
}

.router-studio-footer .router-modal-actions,
.router-studio-modal .modal-footer > div:last-child {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.router-studio-footer .btn,
.router-studio-modal .modal-footer .btn {
  white-space: nowrap !important;
  padding: 8px 14px !important;
}

.router-sync-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  white-space: nowrap !important;
}

.router-sync-status-badge.warning {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.router-sync-status-badge.error {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.router-sync-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background-color: currentColor !important;
  box-shadow: 0 0 8px currentColor !important;
  display: inline-block !important;
  animation: routerPulse 2s infinite ease-in-out !important;
}

@keyframes routerPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Light Mode radiusSecretModal */
#radiusSecretModal .modal {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
  border-radius: 16px !important;
}

#radiusSecretModal .modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 18px 24px !important;
}

#radiusSecretModal .modal-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

#radiusSecretModal .modal-close,
#radiusSecretModal .icon-button {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
}

#radiusSecretModal .modal-body {
  background: #ffffff !important;
  padding: 20px 24px !important;
}

#radiusSecretModal .form-label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

#radiusSecretModal input.form-control {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

#radiusSecretModal .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 14px 24px !important;
}

/* =============================================================================
   DARK MODE OVERRIDES (html[data-theme="dark"], body.dark-mode)
   ============================================================================= */
html[data-theme="dark"] .router-studio-modal,
body.dark-mode .router-studio-modal {
  background: var(--dark-bg-surface) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .router-studio-modal .modal-header,
body.dark-mode .router-studio-modal .modal-header {
  background: var(--dark-bg-surface) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] .router-studio-modal .modal-title,
body.dark-mode .router-studio-modal .modal-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .router-studio-modal .modal-header span,
html[data-theme="dark"] .router-studio-modal .modal-subtitle,
body.dark-mode .router-studio-modal .modal-header span,
body.dark-mode .router-studio-modal .modal-subtitle {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .router-studio-modal .modal-close,
body.dark-mode .router-studio-modal .modal-close {
  color: #cbd5e1 !important;
  background: var(--dark-bg-surface) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .router-studio-modal .modal-close:hover,
body.dark-mode .router-studio-modal .modal-close:hover {
  background: var(--dark-bg-hover) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .router-studio-modal .modal-body,
body.dark-mode .router-studio-modal .modal-body {
  background: var(--dark-bg-surface) !important;
}

html[data-theme="dark"] .router-studio-modal .router-studio-section,
html[data-theme="dark"] .router-studio-section,
body.dark-mode .router-studio-modal .router-studio-section,
body.dark-mode .router-studio-section {
  background: var(--dark-bg-subtle) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] .router-studio-modal .router-studio-sec-header,
html[data-theme="dark"] .router-studio-sec-header,
body.dark-mode .router-studio-modal .router-studio-sec-header,
body.dark-mode .router-studio-sec-header {
  color: #38bdf8 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] .router-studio-modal .sec-badge,
html[data-theme="dark"] .router-studio-sec-header .sec-badge,
body.dark-mode .router-studio-modal .sec-badge,
body.dark-mode .router-studio-sec-header .sec-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

html[data-theme="dark"] .router-studio-modal .form-label,
body.dark-mode .router-studio-modal .form-label {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .router-studio-modal .router-field-hint,
html[data-theme="dark"] .router-field-hint,
body.dark-mode .router-studio-modal .router-field-hint,
body.dark-mode .router-field-hint {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .router-studio-modal .checkbox-group span,
body.dark-mode .router-studio-modal .checkbox-group span {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .router-studio-modal input.form-control,
html[data-theme="dark"] .router-studio-modal select.form-control,
html[data-theme="dark"] .router-studio-modal textarea.form-control,
body.dark-mode .router-studio-modal input.form-control,
body.dark-mode .router-studio-modal select.form-control,
body.dark-mode .router-studio-modal textarea.form-control {
  background: var(--dark-bg-subtle) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] .router-studio-modal input.form-control::placeholder,
html[data-theme="dark"] .router-studio-modal textarea.form-control::placeholder,
body.dark-mode .router-studio-modal input.form-control::placeholder,
body.dark-mode .router-studio-modal textarea.form-control::placeholder {
  color: #64748b !important;
}

html[data-theme="dark"] .router-studio-modal input.form-control:focus,
html[data-theme="dark"] .router-studio-modal select.form-control:focus,
html[data-theme="dark"] .router-studio-modal textarea.form-control:focus,
body.dark-mode .router-studio-modal input.form-control:focus,
body.dark-mode .router-studio-modal select.form-control:focus,
body.dark-mode .router-studio-modal textarea.form-control:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

html[data-theme="dark"] .router-icon-btn,
body.dark-mode .router-icon-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .router-icon-btn:hover,
body.dark-mode .router-icon-btn:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .router-studio-modal .modal-footer,
html[data-theme="dark"] .router-studio-footer,
body.dark-mode .router-studio-modal .modal-footer,
body.dark-mode .router-studio-footer {
  background: var(--dark-bg-surface) !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] .router-sync-status-badge,
body.dark-mode .router-sync-status-badge {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Dark Mode radiusSecretModal */
html[data-theme="dark"] #radiusSecretModal .modal,
body.dark-mode #radiusSecretModal .modal {
  background: var(--dark-bg-surface) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] #radiusSecretModal .modal-header,
body.dark-mode #radiusSecretModal .modal-header {
  background: var(--dark-bg-surface) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] #radiusSecretModal .modal-title,
body.dark-mode #radiusSecretModal .modal-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] #radiusSecretModal .modal-close,
html[data-theme="dark"] #radiusSecretModal .icon-button,
body.dark-mode #radiusSecretModal .modal-close,
body.dark-mode #radiusSecretModal .icon-button {
  color: #cbd5e1 !important;
  background: var(--dark-bg-surface) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] #radiusSecretModal .modal-body,
body.dark-mode #radiusSecretModal .modal-body {
  background: var(--dark-bg-surface) !important;
}

html[data-theme="dark"] #radiusSecretModal .form-label,
body.dark-mode #radiusSecretModal .form-label {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] #radiusSecretModal input.form-control,
body.dark-mode #radiusSecretModal input.form-control {
  background: var(--dark-bg-subtle) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] #radiusSecretModal .modal-footer,
body.dark-mode #radiusSecretModal .modal-footer {
  background: var(--dark-bg-surface) !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
}

/* =============================================================================
   MOBILE VIEWPORT OPTIMIZATIONS (STRICTLY <= 768px - DESKTOP 100% INVARIANT)
   ============================================================================= */
@media (max-width: 768px) {
  /* Modals on Mobile: Add, Edit & Change Secret */
  .router-studio-modal,
  #radiusSecretModal .modal,
  #settingsModal .modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 90dvh !important;
    margin: 12px auto !important;
    border-radius: 14px !important;
  }

  .router-studio-modal .modal-header,
  #radiusSecretModal .modal-header,
  #settingsModal .modal-header {
    padding: 14px 16px !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
  }

  .router-studio-modal .modal-body,
  #radiusSecretModal .modal-body,
  #settingsModal .modal-body {
    padding: 14px 16px !important;
  }

  .router-studio-section {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
  }

  .router-studio-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .router-studio-modal .modal-footer,
  .router-studio-footer,
  #radiusSecretModal .modal-footer,
  #settingsModal .modal-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 12px 16px !important;
  }

  .router-studio-footer .router-sync-status-badge {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .router-studio-footer .router-modal-actions,
  .router-studio-modal .modal-footer > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .router-studio-footer .btn,
  .router-studio-modal .modal-footer .btn,
  #radiusSecretModal .modal-footer .btn,
  #settingsModal .modal-footer .btn {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
  }

  /* /network/routers Page Elements on Mobile */
  .router-studio-container .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .router-studio-container .page-header > div:last-child,
  .router-header-actions {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .router-studio-container .page-header > div:last-child .btn,
  .router-header-actions .btn {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 38px !important;
    justify-content: center !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    padding: 8px 10px !important;
  }

  /* KPI Cards on Mobile */
  .router-studio-container .pkg-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
  }

  .router-studio-container .pkg-kpi-card {
    min-height: 100px !important;
    height: auto !important;
    padding: 10px 12px !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  .router-studio-container .pkg-kpi-label {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .router-studio-container .pkg-kpi-value {
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .router-studio-container .pkg-kpi-pill {
    font-size: 10px !important;
    padding: 1px 6px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Router Fleet Table & Actions */
  .router-fleet-card {
    margin-bottom: 16px !important;
  }

  .router-fleet-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }

  .fleet-action-btns {
    flex-wrap: wrap !important;
    gap: 4px !important;
    min-height: 36px !important;
  }

  /* Workspace Banner */
  .workspace-active-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
  }

  .workspace-active-title {
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 13px !important;
  }

  /* 2x2 Grid & Studio Cards */
  .router-studio-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .studio-btn-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .studio-btn-bar .btn {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 36px !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 6px 8px !important;
  }

  .studio-progress-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .studio-metadata-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .studio-status-item {
    padding: 8px 0 !important;
    font-size: 12px !important;
  }

  .studio-card-footer .btn {
    width: 100% !important;
    min-height: 36px !important;
    justify-content: center !important;
  }

  /* Core Pages Mobile Header Wrap */
  .nrad-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .nrad-header-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .nrad-header-actions .btn {
    flex: 1 1 0 !important;
    justify-content: center !important;
  }

  .inv-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .inv-kpi-card {
    min-width: 0 !important;
    overflow: hidden !important;
  }
}


/* ==========================================================================
   Release v64: Customer Profile UI/UX Overhaul & 2-Tier Studio Layout
   ========================================================================== */

/* Modern SaaS Identity Hero Header */
.custprofile-hero-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}

.custprofile-hero-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100% !important;
}

.custprofile-hero-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
  flex-wrap: wrap !important;
}

.custprofile-hero-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.custprofile-hero-avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
  border: 2px solid #ffffff !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.custprofile-hero-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.custprofile-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.custprofile-hero-name {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--color-text, #0f172a) !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
}

.custprofile-hero-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  flex-shrink: 0 !important;
}

.custprofile-hero-actions .btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.custprofile-hero-meta-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--color-border, #e2e8f0) !important;
  width: 100% !important;
}

/* 5-Card Live Telemetry KPI Strip */
.custprofile-live {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-top: 16px !important;
  margin-bottom: 20px !important;
}

.custprofile-tile {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 84px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  border-top: 3px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.custprofile-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.custprofile-tile:nth-child(1) { border-top-color: #10b981; }
.custprofile-tile:nth-child(2) { border-top-color: #3b82f6; }
.custprofile-tile:nth-child(3) { border-top-color: #8b5cf6; }
.custprofile-tile:nth-child(4) { border-top-color: #f59e0b; }
.custprofile-tile:nth-child(5) { border-top-color: #06b6d4; }

.custprofile-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}

.custprofile-tile-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2-Tier Studio Layout: Top Row 2-Card Balanced Grid */
.custoverview-two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.custoverview-subcard {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.custoverview-subcard-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg-secondary, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custoverview-subcard-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.custoverview-subcard-body {
  padding: 18px 20px;
}

.custoverview-split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

.custoverview-split-row:last-child {
  margin-bottom: 0;
}

.custoverview-field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 4px;
}

.custoverview-field-val-with-copy {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custoverview-copy-btn {
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  color: var(--color-text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.custoverview-copy-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Single-Line Wrap Prevention for MAC & Monospace */
#connCallerIdVal {
  white-space: nowrap !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
}

#pppoe-username-text,
#connIpv4Val,
#pppoe-password-text {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Compact Live Throughput Strip (Max-Height 180px) */
.compact-throughput-card {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  max-height: 180px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compact-throughput-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
  flex-shrink: 0;
}

.compact-throughput-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}

.compact-throughput-metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.throughput-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.2;
}

.throughput-pill.down {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.throughput-pill.up {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.compact-canvas-wrap {
  position: relative;
  width: 100%;
  height: 95px !important;
  margin-bottom: 0;
  flex: 1 1 auto;
}

/* Obsidian Dark Mode Parity */
:root[data-theme="dark"] .custprofile-hero-card,
:root[data-theme="dark"] .custoverview-card,
:root[data-theme="dark"] .custoverview-subcard,
:root[data-theme="dark"] .custprofile-tile,
:root[data-theme="dark"] .compact-throughput-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #f3f4f6 !important;
}

:root[data-theme="dark"] .custprofile-hero-meta-row {
  border-top-color: var(--dark-border) !important;
}

:root[data-theme="dark"] .custprofile-hero-avatar {
  border-color: var(--dark-border) !important;
}

:root[data-theme="dark"] .custprofile-hero-name,
:root[data-theme="dark"] .custprofile-tile-value,
:root[data-theme="dark"] .custoverview-subcard-title,
:root[data-theme="dark"] .compact-throughput-title {
  color: #f9fafb !important;
}

:root[data-theme="dark"] .custoverview-subcard-header {
  background: #1a2234 !important;
  border-bottom-color: var(--dark-border) !important;
}

:root[data-theme="dark"] .custoverview-copy-btn {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #9ca3af !important;
}

:root[data-theme="dark"] .custoverview-copy-btn:hover {
  background: #374151 !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .throughput-pill.down {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

:root[data-theme="dark"] .throughput-pill.up {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}

/* Mobile Layout Parity (375x812 - 0px Horizontal Overflow) */
@media (max-width: 640px) {
  .custprofile-hero-card {
    padding: 14px 16px !important;
  }

  .custprofile-hero-top-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .custprofile-hero-identity {
    width: 100% !important;
  }

  .custprofile-hero-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .custprofile-hero-actions .btn {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 34px !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 0 8px !important;
  }

  .custprofile-hero-meta-row {
    gap: 6px !important;
  }

  .custprofile-live {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .custprofile-tile:nth-child(5) {
    grid-column: span 2 !important;
  }

  .custoverview-two-col-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .custoverview-split-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .compact-throughput-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .compact-throughput-metrics {
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

/* ==========================================================================
   RELEASE v64: NEXT-GEN BENTO COMMAND-CENTER CUSTOMER PROFILE OVERHAUL
   Desktop & Mobile Responsive SaaS Architecture
   ========================================================================== */

/* --- Slim Core Sidebar & Horizon --- */
.sidebar {
  background: var(--color-sidebar-bg, linear-gradient(180deg, var(--color-sidebar-bg-start, #0f172a) 0%, var(--color-sidebar-bg-end, #0b1120) 100%)) !important;
  border-right: 1px solid var(--color-sidebar-border, #1f2937) !important;
}

[data-theme="dark"] .sidebar,
body.dark-mode .sidebar {
  background: var(--color-sidebar-bg, linear-gradient(180deg, var(--color-sidebar-bg-start, var(--dark-bg-surface)) 0%, var(--color-sidebar-bg-end, var(--dark-bg-canvas)) 100%)) !important;
  border-right: 1px solid var(--color-sidebar-border, var(--dark-border)) !important;
}

.sidebar-brand {
  background: transparent !important;
  border-bottom: 1px solid var(--color-sidebar-border, #1f2937) !important;
}

[data-theme="dark"] .sidebar-brand,
body.dark-mode .sidebar-brand {
  background: transparent !important;
  border-bottom: 1px solid var(--color-sidebar-border, var(--dark-border)) !important;
}

.sidebar .nav-item {
  color: #94a3b8 !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.sidebar .nav-item > .nav-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
}

.sidebar .nav-item > .nav-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.sidebar .nav-item:hover {
  background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.08) !important;
  color: #f8fafc !important;
}

.sidebar .nav-item:hover > .nav-icon,
.sidebar .nav-item:hover .nav-chevron {
  color: var(--color-brand-hover-light, #60a5fa) !important;
}

.sidebar .nav-item.active:not(.has-submenu),
.sidebar .nav-submenu .nav-item.active {
  background: var(--color-sidebar-active-gradient, linear-gradient(90deg, var(--color-brand) 0%, var(--color-brand-hover) 100%)) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 3px 14px var(--color-sidebar-active-glow, rgba(var(--color-brand-rgb, 37, 99, 235), 0.35)) !important;
}

.sidebar .nav-item.active:not(.has-submenu) > .nav-icon,
.sidebar .nav-submenu .nav-item.active > .nav-icon {
  color: #ffffff !important;
}

.topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="dark"] .topbar,
body.dark-mode .topbar {
  background: color-mix(in srgb, var(--dark-bg-surface) 90%, transparent) !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

.quick-search-box {
  border-radius: 999px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  padding: 6px 14px !important;
}

[data-theme="dark"] .quick-search-box,
body.dark-mode .quick-search-box {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

.connection-pill.connected {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.connection-pill.connected .pill-dot {
  background: #10b981 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6) !important;
}

[data-theme="dark"] .connection-pill.connected,
body.dark-mode .connection-pill.connected {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}

/* --- Upper Sculpted Hero Command Card --- */
.custprofile-hero-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 20px 24px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  margin-bottom: 16px !important;
}

[data-theme="dark"] .custprofile-hero-card,
body.dark-mode .custprofile-hero-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.custprofile-hero-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.custprofile-hero-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}

.custprofile-hero-identity {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  min-width: 0 !important;
}

.custprofile-hero-avatar-wrap {
  position: relative !important;
  display: inline-flex !important;
  flex-shrink: 0 !important;
}

.custprofile-hero-avatar {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28) !important;
  border: 2px solid #ffffff !important;
}

[data-theme="dark"] .custprofile-hero-avatar,
body.dark-mode .custprofile-hero-avatar {
  border-color: var(--dark-border) !important;
}

.custprofile-hero-avatar-status {
  position: absolute !important;
  bottom: -2px !important;
  right: -2px !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6) !important;
}

[data-theme="dark"] .custprofile-hero-avatar-status,
body.dark-mode .custprofile-hero-avatar-status {
  border-color: var(--dark-border) !important;
}

.custprofile-hero-name {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
}

[data-theme="dark"] .custprofile-hero-name,
body.dark-mode .custprofile-hero-name {
  color: #f8fafc !important;
}

.custprofile-hero-meta-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: #f8fafc !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="dark"] .custprofile-hero-meta-row,
body.dark-mode .custprofile-hero-meta-row {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
}

.custprofile-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

[data-theme="dark"] .custprofile-chip,
body.dark-mode .custprofile-chip {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

.custprofile-chip--password {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="dark"] .custprofile-chip--password,
body.dark-mode .custprofile-chip--password {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.custprofile-chip--expiry {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

[data-theme="dark"] .custprofile-chip--expiry,
body.dark-mode .custprofile-chip--expiry {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.custprofile-hero-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.custprofile-hero-actions .btn {
  height: 36px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.custprofile-hero-actions .btn-hero-edit {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

.custprofile-hero-actions .btn-hero-edit:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

[data-theme="dark"] .custprofile-hero-actions .btn-hero-edit,
body.dark-mode .custprofile-hero-actions .btn-hero-edit {
  background: var(--dark-bg-elevated) !important;
  color: #f8fafc !important;
  border-color: var(--dark-border) !important;
}

.custprofile-hero-actions .btn-hero-suspend {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.custprofile-hero-actions .btn-hero-suspend:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
}

.custprofile-hero-actions .btn-hero-deactivate {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

.custprofile-hero-actions .btn-hero-deactivate:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
}

.custprofile-hero-actions .btn-hero-adjust {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: #ffffff !important;
  border: 1px solid var(--dark-border-strong, rgba(148, 163, 184, 0.25)) !important;
}

.custprofile-hero-actions .btn-hero-adjust:hover {
  background: #0f172a !important;
}

.custprofile-hero-actions .btn-hero-support {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}

.custprofile-hero-actions .btn-hero-support:hover {
  background: #1d4ed8 !important;
}

.custprofile-hero-actions .btn-hero-sms {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

.custprofile-hero-actions .btn-hero-sms:hover {
  background: #f1f5f9 !important;
}

[data-theme="dark"] .custprofile-hero-actions .btn-hero-sms,
body.dark-mode .custprofile-hero-actions .btn-hero-sms {
  background: var(--dark-bg-elevated) !important;
  color: #f8fafc !important;
  border-color: var(--dark-border) !important;
}

/* --- Linear Underline Tab Bar --- */
.custnew-tabs-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 28px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-bottom: 1px solid #e2e8f0 !important;
  margin: 16px 0 20px 0 !important;
  padding: 0 4px !important;
}

[data-theme="dark"] .custnew-tabs-bar,
body.dark-mode .custnew-tabs-bar {
  border-bottom-color: var(--dark-border) !important;
}

.custnew-tabs-bar .custnew-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 10px 4px 12px 4px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.custnew-tabs-bar .custnew-tab:hover {
  color: #0f172a !important;
  background: transparent !important;
}

[data-theme="dark"] .custnew-tabs-bar .custnew-tab,
body.dark-mode .custnew-tabs-bar .custnew-tab {
  color: #94a3b8 !important;
}

[data-theme="dark"] .custnew-tabs-bar .custnew-tab:hover,
body.dark-mode .custnew-tabs-bar .custnew-tab:hover {
  color: #f8fafc !important;
}

.custnew-tabs-bar .custnew-tab.active {
  color: #2563eb !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #2563eb !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .custnew-tabs-bar .custnew-tab.active,
[data-theme="dark"] .custnew-tabs-bar .custnew-tab.active,
body.dark-mode .custnew-tabs-bar .custnew-tab.active {
  color: #60a5fa !important;
  border-bottom: 2px solid #60a5fa !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.25) !important;
}

:root[data-theme="dark"] .custnew-tabs-bar .custnew-tab.active svg,
[data-theme="dark"] .custnew-tabs-bar .custnew-tab.active svg,
body.dark-mode .custnew-tabs-bar .custnew-tab.active svg {
  color: #60a5fa !important;
}

.custprofile-page .custnew-layout {
  display: block !important;
  width: 100% !important;
  margin-top: 0 !important;
}

.custprofile-page .custnew-content {
  width: 100% !important;
  min-width: 0 !important;
}

/* --- High-Craft Bento Command-Center Grid (Release v68 Master UI/UX Upgrade) --- */
.cprof-bento-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.cprof-bento-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 2px !important;
}

.cprof-bento-head-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.cprof-bento-head-icon {
  color: #2563eb !important;
}

.cprof-bento-head-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
}

[data-theme="dark"] .cprof-bento-head-title,
body.dark-mode .cprof-bento-head-title {
  color: #f8fafc !important;
}

/* ==========================================================================
   UPGRADE 1: STRIPE / UNIFI STYLE KPI CARDS WITH PASTEL CORNER GLOW (RELEASE v70)
   ========================================================================== */
.cprof-bento-telemetry-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.cprof-tele-card {
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 16px 16px !important;
  border-radius: 14px !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  text-align: left !important;
  box-sizing: border-box !important;
  position: relative !important;
  cursor: pointer !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

[data-theme="dark"] .cprof-tele-card,
body.dark-mode .cprof-tele-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* Subtle, Refined Top-Right Pastel Gradient Wash */
.cprof-tele-card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 150px !important;
  height: 150px !important;
  pointer-events: none !important;
  border-radius: 0 14px 0 100% !important;
  z-index: 0 !important;
  opacity: 0.85 !important;
  transition: opacity 0.18s ease !important;
}

.cprof-kpi-throughput::before {
  background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.03) 48%, transparent 72%) !important;
}
.cprof-kpi-session::before {
  background: radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.16) 0%, rgba(6, 182, 212, 0.03) 48%, transparent 72%) !important;
}
.cprof-kpi-optical::before {
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.03) 48%, transparent 72%) !important;
}
.cprof-kpi-data::before {
  background: radial-gradient(circle at 100% 0%, rgba(79, 70, 229, 0.14) 0%, rgba(79, 70, 229, 0.03) 48%, transparent 72%) !important;
}
.cprof-kpi-billing::before {
  background: radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.14) 0%, rgba(124, 58, 237, 0.03) 48%, transparent 72%) !important;
}

/* Obsidian Dark Mode Corner Glows (Luminous Jewel Tones) */
[data-theme="dark"] .cprof-kpi-throughput::before,
body.dark-mode .cprof-kpi-throughput::before {
  background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0.05) 50%, transparent 75%) !important;
}
[data-theme="dark"] .cprof-kpi-session::before,
body.dark-mode .cprof-kpi-session::before {
  background: radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.22) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 75%) !important;
}
[data-theme="dark"] .cprof-kpi-optical::before,
body.dark-mode .cprof-kpi-optical::before {
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 75%) !important;
}
[data-theme="dark"] .cprof-kpi-data::before,
body.dark-mode .cprof-kpi-data::before {
  background: radial-gradient(circle at 100% 0%, rgba(79, 70, 229, 0.22) 0%, rgba(79, 70, 229, 0.05) 50%, transparent 75%) !important;
}
[data-theme="dark"] .cprof-kpi-billing::before,
body.dark-mode .cprof-kpi-billing::before {
  background: radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.22) 0%, rgba(124, 58, 237, 0.05) 50%, transparent 75%) !important;
}

/* Card Semantic Soft Borders */
.cprof-kpi-throughput { border-color: rgba(37, 99, 235, 0.20) !important; }
.cprof-kpi-session { border-color: rgba(6, 182, 212, 0.22) !important; }
.cprof-kpi-optical { border-color: rgba(16, 185, 129, 0.22) !important; }
.cprof-kpi-data { border-color: rgba(79, 70, 229, 0.20) !important; }
.cprof-kpi-billing { border-color: rgba(124, 58, 237, 0.20) !important; }

[data-theme="dark"] .cprof-kpi-throughput, body.dark-mode .cprof-kpi-throughput { border-color: rgba(37, 99, 235, 0.30) !important; }
[data-theme="dark"] .cprof-kpi-session, body.dark-mode .cprof-kpi-session { border-color: rgba(6, 182, 212, 0.30) !important; }
[data-theme="dark"] .cprof-kpi-optical, body.dark-mode .cprof-kpi-optical { border-color: rgba(16, 185, 129, 0.30) !important; }
[data-theme="dark"] .cprof-kpi-data, body.dark-mode .cprof-kpi-data { border-color: rgba(79, 70, 229, 0.30) !important; }
[data-theme="dark"] .cprof-kpi-billing, body.dark-mode .cprof-kpi-billing { border-color: rgba(124, 58, 237, 0.30) !important; }

/* KPI Clickable Cards & Hover Elevation */
.cprof-kpi-clickable {
  cursor: pointer !important;
}

.cprof-kpi-clickable:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

.cprof-kpi-throughput:hover { border-color: #2563eb !important; }
.cprof-kpi-session:hover { border-color: #0284c7 !important; }
.cprof-kpi-optical:hover { border-color: #059669 !important; }
.cprof-kpi-data:hover { border-color: #4f46e5 !important; }
.cprof-kpi-billing:hover { border-color: #7c3aed !important; }

[data-theme="dark"] .cprof-kpi-clickable:hover,
body.dark-mode .cprof-kpi-clickable:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* --------------------------------------------------------------------------
   Zone 1: Top Row (Left Label + Top-Right Floating 38px Icon Badge)
   -------------------------------------------------------------------------- */
.cprof-tele-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  position: relative !important;
  z-index: 1 !important;
  min-width: 0 !important;
}

.cprof-tele-label-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.cprof-tele-micro-icon {
  width: 22px !important;
  height: 22px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.tele-micro-throughput { background: rgba(37, 99, 235, 0.08) !important; color: #2563eb !important; }
.tele-micro-session { background: rgba(6, 182, 212, 0.10) !important; color: #0284c7 !important; }
.tele-micro-optical { background: rgba(16, 185, 129, 0.10) !important; color: #059669 !important; }
.tele-micro-data { background: rgba(79, 70, 229, 0.08) !important; color: #4f46e5 !important; }
.tele-micro-billing { background: rgba(124, 58, 237, 0.08) !important; color: #7c3aed !important; }

[data-theme="dark"] .tele-micro-throughput { background: rgba(37, 99, 235, 0.15) !important; color: #60a5fa !important; }
[data-theme="dark"] .tele-micro-session { background: rgba(6, 182, 212, 0.15) !important; color: #38bdf8 !important; }
[data-theme="dark"] .tele-micro-optical { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; }
[data-theme="dark"] .tele-micro-data { background: rgba(79, 70, 229, 0.15) !important; color: #818cf8 !important; }
[data-theme="dark"] .tele-micro-billing { background: rgba(124, 58, 237, 0.15) !important; color: #a78bfa !important; }

.cprof-tele-title {
  font-size: clamp(10px, 0.82vw, 11px) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  color: #475569 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
}

[data-theme="dark"] .cprof-tele-title,
body.dark-mode .cprof-tele-title {
  color: #94a3b8 !important;
}

/* Floating Pastel-Tinted Icon Container in Top Right */
.cprof-tele-float-badge {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.cprof-kpi-clickable:hover .cprof-tele-float-badge {
  transform: scale(1.04) !important;
}

.tele-float-throughput {
  background: rgba(37, 99, 235, 0.12) !important;
  border: 1px solid rgba(37, 99, 235, 0.20) !important;
  color: #2563eb !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18) !important;
}

.tele-float-session {
  background: rgba(6, 182, 212, 0.14) !important;
  border: 1px solid rgba(6, 182, 212, 0.22) !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.20) !important;
}

.tele-float-optical {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1px solid rgba(16, 185, 129, 0.22) !important;
  color: #059669 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.20) !important;
}

.tele-float-data {
  background: rgba(79, 70, 229, 0.12) !important;
  border: 1px solid rgba(79, 70, 229, 0.20) !important;
  color: #4f46e5 !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18) !important;
}

.tele-float-billing {
  background: rgba(124, 58, 237, 0.12) !important;
  border: 1px solid rgba(124, 58, 237, 0.20) !important;
  color: #7c3aed !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.18) !important;
}

[data-theme="dark"] .tele-float-throughput {
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

[data-theme="dark"] .tele-float-session {
  background: rgba(6, 182, 212, 0.18) !important;
  border-color: rgba(6, 182, 212, 0.35) !important;
  color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3) !important;
}

[data-theme="dark"] .tele-float-optical {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .tele-float-data {
  background: rgba(79, 70, 229, 0.18) !important;
  border-color: rgba(79, 70, 229, 0.35) !important;
  color: #818cf8 !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
}

[data-theme="dark"] .tele-float-billing {
  background: rgba(124, 58, 237, 0.18) !important;
  border-color: rgba(124, 58, 237, 0.35) !important;
  color: #a78bfa !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}

/* --------------------------------------------------------------------------
   Zone 2: Middle Row (Bold Primary Metric + Clean Sub-Line)
   -------------------------------------------------------------------------- */
.cprof-tele-metric-zone {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  min-width: 0 !important;
  width: 100% !important;
  position: relative !important;
  z-index: 1 !important;
}

.cprof-tele-status-pill {
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  border-radius: 9999px !important;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3.5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.cprof-tele-main-val {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary, #0f172a) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
  font-variant-numeric: tabular-nums !important;
  text-align: left !important;
  width: 100% !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-tele-main-val,
body.dark-mode .cprof-tele-main-val {
  color: #f8fafc !important;
}

.cprof-throughput-display {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
  width: auto !important;
  font-size: clamp(13px, 1.08vw, 14.5px) !important;
  font-weight: 700 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  line-height: 1.3 !important;
}

.cprof-tp-item {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cprof-tp-item > span:not(.cprof-tp-arrow) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.cprof-tp-divider {
  display: none !important;
}

[data-theme="dark"] .cprof-tp-divider,
body.dark-mode .cprof-tp-divider {
  display: none !important;
}

.cprof-tp-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  position: relative !important;
  top: 1px !important;
}

.cprof-tp-arrow.down { color: #2563eb !important; }
.cprof-tp-arrow.up { color: #7c3aed !important; }
.cprof-tp-arrow.emerald,
.cprof-tp-arrow.up.emerald { color: #10b981 !important; }

.cprof-cycle-metric-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  gap: 8px !important;
}

.cprof-inline-due-pill {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  letter-spacing: normal !important;
  font-family: var(--font-sans) !important;
}

[data-theme="dark"] .cprof-inline-due-pill {
  color: #94a3b8 !important;
}

.cprof-tele-sub-val {
  font-size: 11.5px !important;
  color: #64748b !important;
  margin-top: 6px !important;
  line-height: 1.3 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-tele-sub-val,
body.dark-mode .cprof-tele-sub-val {
  color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   Zone 3: Bottom Footer Bar (Status Pill on Left + Interactive Action Link on Right)
   -------------------------------------------------------------------------- */
.cprof-tele-footer-bar {
  margin-top: 12px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.18) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  position: relative !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-tele-footer-bar,
body.dark-mode .cprof-tele-footer-bar {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.cprof-tele-action {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: color 0.18s ease !important;
  margin-left: auto !important;
}

[data-theme="dark"] .cprof-tele-action,
body.dark-mode .cprof-tele-action {
  color: #94a3b8 !important;
}

.cprof-kpi-clickable:hover .cprof-tele-action {
  color: var(--brand-primary, #3b82f6) !important;
}

.cprof-tele-arrow {
  display: inline-block !important;
  font-size: 13px !important;
  line-height: 1 !important;
  color: inherit !important;
  transition: transform 0.18s ease !important;
}

.cprof-kpi-clickable:hover .cprof-tele-arrow {
  transform: translateX(3px) !important;
}

/* Status Pills */
.cprof-tag-emerald,
.cprof-tag-indigo,
.cprof-status-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 2.5px 8.5px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  line-height: 1.35 !important;
  color: #059669 !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.cprof-tag-indigo {
  color: #4f46e5 !important;
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
}

[data-theme="dark"] .cprof-tag-emerald,
[data-theme="dark"] .cprof-status-chip,
body.dark-mode .cprof-tag-emerald,
body.dark-mode .cprof-status-chip {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .cprof-tag-indigo,
body.dark-mode .cprof-tag-indigo {
  background: rgba(79, 70, 229, 0.15) !important;
  color: #a5b4fc !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
}

.cprof-status-chip.offline {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

[data-theme="dark"] .cprof-status-chip.offline,
body.dark-mode .cprof-status-chip.offline {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.cprof-live-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8) !important;
  animation: pulseLive 1.8s infinite !important;
  flex-shrink: 0 !important;
}

.cprof-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.cprof-dot.on {
  background: #10b981 !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7) !important;
}

.cprof-dot.off {
  background: #ef4444 !important;
}

/* ==========================================================================
   UPGRADE 2 & 3: STRUCTURED CELL-DIVIDED BOTTOM ROW & ZERO VOID
   ========================================================================== */
.cprof-bento-bottom-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.cprof-bento-card {
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  position: relative !important;
  overflow: hidden !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.cprof-bento-card.cprof-main-card {
  padding: 16px 20px !important;
}

[data-theme="dark"] .cprof-bento-card,
body.dark-mode .cprof-bento-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Uniform Card-Top Header Height Across All 3 Bento Cards */
.cprof-card-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 0 0 10px 0 !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-card-top,
body.dark-mode .cprof-card-top {
  border-bottom-color: var(--dark-border) !important;
}

.cprof-card-top-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.cprof-card-top-title {
  margin: 0 !important;
  font-size: 14.5px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .cprof-card-top-title,
body.dark-mode .cprof-card-top-title {
  color: #f8fafc !important;
}

.cprof-card-action-btn {
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  padding: 0 8px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  line-height: 28px !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.cprof-card-action-btn:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}

[data-theme="dark"] .cprof-card-action-btn:hover,
body.dark-mode .cprof-card-action-btn:hover {
  background: var(--dark-bg-hover) !important;
  color: #60a5fa !important;
}

/* Card Content: Flex-1 to push footer to bottom evenly with 0px top void */
.cprof-card-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Structured Cell-Divided Rows ("Ghar-Ghar" layout) */
.cprof-details-grid {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.cprof-details-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  align-items: center !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-details-row,
body.dark-mode .cprof-details-row {
  border-bottom-color: var(--dark-border) !important;
}

.cprof-details-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

#bentoCardHw .cprof-details-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 12px 0 !important;
}

.cprof-detail-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.cprof-detail-label {
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .cprof-detail-label,
body.dark-mode .cprof-detail-label {
  color: #94a3b8 !important;
}

.cprof-detail-val {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  word-break: break-word !important;
}

[data-theme="dark"] .cprof-detail-val,
body.dark-mode .cprof-detail-val {
  color: #f8fafc !important;
}

.cprof-detail-val-with-copy {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.cprof-card-footer-action {
  margin-top: 14px !important;
}

.cprof-btn-collect {
  width: 100% !important;
  height: 38px !important;
  border-radius: 8px !important;
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25) !important;
}

.cprof-btn-collect:hover {
  background: #4338ca !important;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35) !important;
}

/* Disconnect CoA: Zero overflow, compact 100% inside card bounds */
.cprof-btn-disconnect {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  border: 1px solid #dc2626 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  line-height: 28px !important;
  box-sizing: border-box !important;
}

.cprof-btn-disconnect:hover {
  background: #dc2626 !important;
}

#bentoCardHw {
  justify-content: flex-start !important;
}

#customerMacVal {
  white-space: nowrap !important;
  font-family: var(--font-mono) !important;
  font-size: 12.5px !important;
}

/* Remote Management Crisp Pill */
.cprof-remote-mgmt-pill {
  font-size: 12px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  color: #2563eb !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  transition: all 0.15s ease !important;
  width: fit-content !important;
}

.cprof-remote-mgmt-pill:hover {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

[data-theme="dark"] .cprof-remote-mgmt-pill,
body.dark-mode .cprof-remote-mgmt-pill {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .cprof-remote-mgmt-pill:hover,
body.dark-mode .cprof-remote-mgmt-pill:hover {
  background: rgba(37, 99, 235, 0.25) !important;
  color: #93c5fd !important;
}

/* Row 3 Subtle Status Strip Matching Card Height */
.cprof-hw-status-strip {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  font-size: 12px !important;
  color: #475569 !important;
  margin-top: 14px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .cprof-hw-status-strip,
body.dark-mode .cprof-hw-status-strip {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #cbd5e1 !important;
}

.cprof-hw-status-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7) !important;
  flex-shrink: 0 !important;
}

/* Network Tab Subcard Rows ("Ghar-Ghar" divider layout) */
.custoverview-row {
  padding: 11px 0 !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
}

.custoverview-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

[data-theme="dark"] .custoverview-row,
body.dark-mode .custoverview-row {
  border-bottom-color: var(--dark-border) !important;
}

.custoverview-field-label {
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .custoverview-field-label,
body.dark-mode .custoverview-field-label {
  color: #94a3b8 !important;
}

.custoverview-field-val {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .custoverview-field-val,
body.dark-mode .custoverview-field-val {
  color: #f8fafc !important;
}

/* ==========================================================================
   UPGRADE 2: BRANDING-ADAPTIVE OVERHEAD SPOTLIGHT SIDEBAR SELECTION (RELEASE v69)
   ========================================================================== */
.sidebar .nav-item.active,
.sidebar .nav-item.active:not(.has-submenu),
.sidebar .submenu-item.active,
.sidebar .nav-submenu .nav-item.active,
.sidebar a.active,
.sidebar-flyout-card .flyout-item.active,
[data-theme="dark"] .sidebar .nav-item.active,
[data-theme="dark"] .sidebar .nav-item.active:not(.has-submenu),
[data-theme="dark"] .sidebar .submenu-item.active,
[data-theme="dark"] .sidebar .nav-submenu .nav-item.active,
[data-theme="dark"] .sidebar a.active,
[data-theme="dark"] .sidebar-flyout-card .flyout-item.active,
body.dark-mode .sidebar .nav-item.active,
body.dark-mode .sidebar .nav-item.active:not(.has-submenu),
body.dark-mode .sidebar .submenu-item.active,
body.dark-mode .sidebar .nav-submenu .nav-item.active,
body.dark-mode .sidebar a.active,
body.dark-mode .sidebar-flyout-card .flyout-item.active {
  position: relative !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  background:
    radial-gradient(
      75% 135% at 50% -10%,
      color-mix(in srgb, var(--color-brand, #2563eb) 42%, #ffffff 18%) 0%,
      color-mix(in srgb, var(--color-brand, #2563eb) 20%, transparent) 48%,
      rgba(15, 23, 42, 0.06) 100%
    ) !important;
  border: 1px solid color-mix(in srgb, var(--color-brand, #2563eb) 35%, transparent) !important;
  border-top-color: color-mix(in srgb, var(--color-brand, #2563eb) 65%, #ffffff 25%) !important;
  box-shadow:
    inset 0 10px 18px -10px color-mix(in srgb, var(--color-brand, #2563eb) 55%, #ffffff 20%),
    0 4px 14px -4px var(--color-sidebar-active-glow, rgba(37, 99, 235, 0.35)) !important;
  overflow: hidden !important;
}

.sidebar .nav-item.active::after,
.sidebar .submenu-item.active::after,
.sidebar .nav-submenu .nav-item.active::after,
.sidebar a.active::after,
.sidebar-flyout-card .flyout-item.active::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 22% !important;
  right: 22% !important;
  height: 1.5px !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--color-brand, #2563eb) 70%, #ffffff 30%) 50%,
    transparent 100%
  ) !important;
  opacity: 0.85 !important;
  pointer-events: none !important;
}

.sidebar .nav-item.active::before,
.sidebar .submenu-item.active::before,
.sidebar .nav-submenu .nav-item.active::before,
.sidebar a.active::before,
.sidebar-flyout-card .flyout-item.active::before {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
}

.sidebar .nav-item.active > .nav-icon,
.sidebar .nav-item.active > .nav-icon svg,
.sidebar .nav-item.active .nav-label,
.sidebar .nav-submenu .nav-item.active .nav-label,
.sidebar a.active .nav-label {
  color: #ffffff !important;
}

/* --- Tablet Responsiveness (@media (min-width: 769px) and (max-width: 1024px)) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .cprof-bento-telemetry-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* --- Mobile Responsiveness (@media (max-width: 768px)) --- */
@media (max-width: 768px) {
  .cprof-bento-telemetry-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .cprof-bento-bottom-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .custprofile-hero-top-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  .custprofile-hero-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .custprofile-hero-actions .btn {
    flex: 1 1 calc(50% - 8px) !important;
    justify-content: center !important;
  }
  .custnew-tabs-bar {
    gap: 16px !important;
    padding-bottom: 2px !important;
  }
}


/* ==========================================================================
   RELEASE v75: TELEMETRY ROW CONDITIONAL ARCHITECTURE (50/50 VS 100%)
   ========================================================================== */
.telemetry-grid-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .telemetry-grid-split {
    grid-template-columns: 1fr !important;
  }
}

.telemetry-grid-full {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.telemetry-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.telemetry-card:hover {
  border-color: var(--color-border-hover, #cbd5e1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.telemetry-card-prominent {
  padding: 18px 22px;
}

.telemetry-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.telemetry-live-badge-prominent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.telemetry-live-badge .live-dot,
.telemetry-live-badge-prominent .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseLiveDot 1.5s infinite;
}

:root[data-theme="dark"] .telemetry-card,
body.dark-mode .telemetry-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #f3f4f6 !important;
}

:root[data-theme="dark"] .telemetry-card:hover,
body.dark-mode .telemetry-card:hover {
  border-color: #374151 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

:root[data-theme="dark"] .telemetry-live-badge,
body.dark-mode .telemetry-live-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

:root[data-theme="dark"] .telemetry-live-badge-prominent,
body.dark-mode .telemetry-live-badge-prominent {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

/* ==========================================================================
   RELEASE v76 — SHARED KPI DESIGN SYSTEM: PASTEL CORNER GLOW + KPI-ICO BADGE
   Recipe extracted from "UPGRADE 1: STRIPE / UNIFI STYLE KPI CARDS WITH PASTEL
   CORNER GLOW (RELEASE v70)" — the .cprof-tele-card block above:
     - ::before top-right radial pastel glow: 150x150px, absolute top:0 right:0,
       border-radius 0 14px 0 100%, radial-gradient(circle at 100% 0%) pastel
       stops (light 0.14 -> 0.03 @48% -> transparent @72%; Obsidian dark
       0.22 -> 0.05 @50% -> transparent @75%).
     - Pastel rounded-square icon badge (.cprof-tele-float-badge): tinted bg,
       1px tinted border, tinted ambient shadow, border-radius 9px.
     - Hover elevation: translateY(-2px) + 0 8px 24px shadow (desktop only).
   V76 adaptations: badge is 32x32 (30px on <=768px); six semantic variants are
   driven by ONE custom property (--kpi-glow-c = "R, G, B" triplet) so a variant
   class placed on the CARD or on the contained .kpi-ico BADGE re-tints glow,
   border tint and badge together. Pages add markup + variant classes only —
   never per-page copies of this CSS.
   Variants: cobalt 37,99,235 | mint 16,185,129 | cyan 6,182,212 |
             amber 245,158,11 | violet 79,70,229 | rose 244,63,94.
   NOTE: .cprof-tele-card / .cprof-kpi-* already ship the full recipe in the v70
   block above — they are included in the shared geometry base below (identical
   values, zero visual change) while keeping their own per-variant glow
   backgrounds and badge (.cprof-tele-float-badge, 34px reference).
   ========================================================================== */

/* ---- 1. Variant tokens: valid on the card OR on the .kpi-ico badge ---- */
.kpi-ico-brand { --kpi-glow-c: var(--color-brand-rgb, 37, 99, 235); --kpi-ico-ink: var(--color-brand, #2563eb); }
.kpi-ico-cobalt { --kpi-glow-c: 37, 99, 235; --kpi-ico-ink: #2563eb; }
.kpi-ico-mint { --kpi-glow-c: 16, 185, 129; --kpi-ico-ink: #059669; }
.kpi-ico-cyan { --kpi-glow-c: 6, 182, 212; --kpi-ico-ink: #0284c7; }
.kpi-ico-amber { --kpi-glow-c: 245, 158, 11; --kpi-ico-ink: #d97706; }
.kpi-ico-violet { --kpi-glow-c: 79, 70, 229; --kpi-ico-ink: #4f46e5; }
.kpi-ico-rose { --kpi-glow-c: 244, 63, 94; --kpi-ico-ink: #e11d48; }

/* Obsidian dark badge ink (dual selector per app-shell dark-mode mechanism:
   documentElement[data-theme=dark] AND body.dark-mode are set together) */
[data-theme="dark"] .kpi-ico-brand, body.dark-mode .kpi-ico-brand { --kpi-ico-ink: var(--color-brand-hover-light, #60a5fa); }
[data-theme="dark"] .kpi-ico-cobalt, body.dark-mode .kpi-ico-cobalt { --kpi-ico-ink: #60a5fa; }
[data-theme="dark"] .kpi-ico-mint, body.dark-mode .kpi-ico-mint { --kpi-ico-ink: #34d399; }
[data-theme="dark"] .kpi-ico-cyan, body.dark-mode .kpi-ico-cyan { --kpi-ico-ink: #38bdf8; }
[data-theme="dark"] .kpi-ico-amber, body.dark-mode .kpi-ico-amber { --kpi-ico-ink: #fbbf24; }
[data-theme="dark"] .kpi-ico-violet, body.dark-mode .kpi-ico-violet { --kpi-ico-ink: #818cf8; }
[data-theme="dark"] .kpi-ico-rose, body.dark-mode .kpi-ico-rose { --kpi-ico-ink: #fb7185; }

/* ---- 2. Corner-glow geometry (values = v70 recipe 44224-44236; no z-index /
   background here so the cprof families keep their own v70 stacking and
   per-variant glow backgrounds) ---- */
.kpi-card::before,
.stat-card::before,
.metric-card::before,
.summary-card::before,
.inv-kpi-card::before,
.pkg-kpi-card::before,
.cprof-tele-card::before,
.cprof-kpi-throughput::before,
.cprof-kpi-session::before,
.cprof-kpi-optical::before,
.cprof-kpi-data::before,
.cprof-kpi-billing::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 150px !important;
  height: 150px !important;
  pointer-events: none !important;
  border-radius: 0 14px 0 100% !important;
  opacity: 0.85 !important;
  transition: opacity 0.18s ease !important;
}

/* Non-cprof carriers: anchor + stack the glow UNDER card content. isolation
   keeps the negative z-index inside the card (negative-z children paint above
   the card's own background, below its text). The v58 block (42333-42353)
   already positions/rounds kpi/stat/metric/pkg cards; summary/inv get it here. */
.kpi-card,
.stat-card,
.metric-card,
.summary-card,
.inv-kpi-card,
.pkg-kpi-card {
  position: relative !important;
  isolation: isolate !important;
}

.kpi-card::before,
.stat-card::before,
.metric-card::before,
.summary-card::before,
.inv-kpi-card::before,
.pkg-kpi-card::before {
  z-index: -1 !important;
}

/* ---- 3. Glow wash: cobalt default, re-tinted via --kpi-glow-c ---- */
.kpi-card::before,
.stat-card::before,
.metric-card::before,
.summary-card::before,
.inv-kpi-card::before,
.pkg-kpi-card::before {
  background: radial-gradient(circle at 100% 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.14) 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.03) 48%, transparent 72%) !important;
}

[data-theme="dark"] .kpi-card::before,
[data-theme="dark"] .stat-card::before,
[data-theme="dark"] .metric-card::before,
[data-theme="dark"] .summary-card::before,
[data-theme="dark"] .inv-kpi-card::before,
[data-theme="dark"] .pkg-kpi-card::before,
body.dark-mode .kpi-card::before,
body.dark-mode .stat-card::before,
body.dark-mode .metric-card::before,
body.dark-mode .summary-card::before,
body.dark-mode .inv-kpi-card::before,
body.dark-mode .pkg-kpi-card::before {
  background: radial-gradient(circle at 100% 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.22) 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.05) 50%, transparent 75%) !important;
}

/* ---- 4. The .kpi-ico badge (32x32, radius 9px; 30px on <=768px) ---- */
.kpi-ico {
  width: 32px !important;
  height: 32px !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  background: rgba(var(--kpi-glow-c, 37, 99, 235), 0.12);
  border: 1px solid rgba(var(--kpi-glow-c, 37, 99, 235), 0.22);
  color: var(--kpi-ico-ink, #2563eb);
  box-shadow: 0 4px 14px rgba(var(--kpi-glow-c, 37, 99, 235), 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-ico svg {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
}

[data-theme="dark"] .kpi-ico,
body.dark-mode .kpi-ico {
  background: rgba(var(--kpi-glow-c, 37, 99, 235), 0.18);
  border-color: rgba(var(--kpi-glow-c, 37, 99, 235), 0.35);
  box-shadow: 0 4px 14px rgba(var(--kpi-glow-c, 37, 99, 235), 0.3);
}

/* ---- 5. Normalize existing icon badges into the badge language (their
   existing sizes are preserved — 44px billing, 36px metric, 40px summary —
   so no card grows) ---- */
.stat-card-icon--primary {
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}
.stat-card-icon--success {
  border: 1px solid rgba(16, 185, 129, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.stat-card-icon--warning {
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}
.stat-card-icon--danger {
  border: 1px solid rgba(244, 63, 94, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18);
}
.stat-card-icon--info {
  border: 1px solid rgba(6, 182, 212, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.18);
}

[data-theme="dark"] .stat-card-icon--primary, body.dark-mode .stat-card-icon--primary { background: rgba(var(--color-brand-rgb, 37, 99, 235), 0.18) !important; border-color: rgba(var(--color-brand-rgb, 37, 99, 235), 0.35) !important; color: var(--color-brand-hover-light, #60a5fa) !important; }
[data-theme="dark"] .stat-card-icon--success, body.dark-mode .stat-card-icon--success { background: rgba(16, 185, 129, 0.18) !important; border-color: rgba(16, 185, 129, 0.35) !important; color: #34d399 !important; }
[data-theme="dark"] .stat-card-icon--warning, body.dark-mode .stat-card-icon--warning { background: rgba(245, 158, 11, 0.18) !important; border-color: rgba(245, 158, 11, 0.35) !important; color: #fbbf24 !important; }
[data-theme="dark"] .stat-card-icon--danger, body.dark-mode .stat-card-icon--danger { background: rgba(244, 63, 94, 0.18) !important; border-color: rgba(244, 63, 94, 0.35) !important; color: #fb7185 !important; }
[data-theme="dark"] .stat-card-icon--info, body.dark-mode .stat-card-icon--info { background: rgba(6, 182, 212, 0.18) !important; border-color: rgba(6, 182, 212, 0.35) !important; color: #38bdf8 !important; }

.metric-card-icon.ok {
  border: 1px solid rgba(16, 185, 129, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.metric-card-icon.warning {
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}
.metric-card-icon.bad {
  border: 1px solid rgba(244, 63, 94, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18);
}

[data-theme="dark"] .metric-card-icon.ok, body.dark-mode .metric-card-icon.ok { color: #34d399; }
[data-theme="dark"] .metric-card-icon.warning, body.dark-mode .metric-card-icon.warning { color: #fbbf24; }
[data-theme="dark"] .metric-card-icon.bad, body.dark-mode .metric-card-icon.bad { color: #fb7185; }

.summary-card.total .summary-icon,
.summary-card.customers .summary-icon {
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}
.summary-card.active .summary-icon {
  border: 1px solid rgba(16, 185, 129, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.summary-card.inactive .summary-icon {
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

/* ---- 6. Semantic glow mapping: badge variant flows to its card via :has();
   card-carried variant classes work through rule 1 directly ---- */
.kpi-card:has(.kpi-ico-brand),
.stat-card:has(.kpi-ico-brand),
.metric-card:has(.kpi-ico-brand),
.summary-card:has(.kpi-ico-brand),
.inv-kpi-card:has(.kpi-ico-brand),
.pkg-kpi-card:has(.kpi-ico-brand) {
  --kpi-glow-c: var(--color-brand-rgb, 37, 99, 235);
}
.kpi-card:has(.kpi-ico-cobalt),
.stat-card:has(.kpi-ico-cobalt),
.metric-card:has(.kpi-ico-cobalt),
.summary-card:has(.kpi-ico-cobalt),
.inv-kpi-card:has(.kpi-ico-cobalt),
.pkg-kpi-card:has(.kpi-ico-cobalt) {
  --kpi-glow-c: 37, 99, 235;
}
.kpi-card:has(.kpi-ico-mint),
.stat-card:has(.kpi-ico-mint),
.metric-card:has(.kpi-ico-mint),
.summary-card:has(.kpi-ico-mint),
.inv-kpi-card:has(.kpi-ico-mint),
.pkg-kpi-card:has(.kpi-ico-mint) {
  --kpi-glow-c: 16, 185, 129;
}
.kpi-card:has(.kpi-ico-cyan),
.stat-card:has(.kpi-ico-cyan),
.metric-card:has(.kpi-ico-cyan),
.summary-card:has(.kpi-ico-cyan),
.inv-kpi-card:has(.kpi-ico-cyan),
.pkg-kpi-card:has(.kpi-ico-cyan) {
  --kpi-glow-c: 6, 182, 212;
}
.kpi-card:has(.kpi-ico-amber),
.stat-card:has(.kpi-ico-amber),
.metric-card:has(.kpi-ico-amber),
.summary-card:has(.kpi-ico-amber),
.inv-kpi-card:has(.kpi-ico-amber),
.pkg-kpi-card:has(.kpi-ico-amber) {
  --kpi-glow-c: 245, 158, 11;
}
.kpi-card:has(.kpi-ico-violet),
.stat-card:has(.kpi-ico-violet),
.metric-card:has(.kpi-ico-violet),
.summary-card:has(.kpi-ico-violet),
.inv-kpi-card:has(.kpi-ico-violet),
.pkg-kpi-card:has(.kpi-ico-violet) {
  --kpi-glow-c: 79, 70, 229;
}
.kpi-card:has(.kpi-ico-rose),
.stat-card:has(.kpi-ico-rose),
.metric-card:has(.kpi-ico-rose),
.summary-card:has(.kpi-ico-rose),
.inv-kpi-card:has(.kpi-ico-rose),
.pkg-kpi-card:has(.kpi-ico-rose) {
  --kpi-glow-c: 244, 63, 94;
}

/* Existing per-family icon classes map to the same semantic glows so current
   pages inherit tinted glows WITHOUT any markup rename */
.stat-card:has(.stat-card-icon--primary) { --kpi-glow-c: 37, 99, 235; }
.stat-card:has(.stat-card-icon--success) { --kpi-glow-c: 16, 185, 129; }
.stat-card:has(.stat-card-icon--warning) { --kpi-glow-c: 245, 158, 11; }
.stat-card:has(.stat-card-icon--danger) { --kpi-glow-c: 244, 63, 94; }
.stat-card:has(.stat-card-icon--info) { --kpi-glow-c: 6, 182, 212; }

.metric-card:has(.metric-card-icon.ok) { --kpi-glow-c: 16, 185, 129; }
.metric-card:has(.metric-card-icon.warning) { --kpi-glow-c: 245, 158, 11; }
.metric-card:has(.metric-card-icon.bad) { --kpi-glow-c: 244, 63, 94; }
.metric-card:has(.metric-card-icon.due) { --kpi-glow-c: 245, 158, 11; }
.metric-card:has(.metric-card-icon.primary) { --kpi-glow-c: 37, 99, 235; }
.metric-card:has(.metric-card-icon.danger) { --kpi-glow-c: 244, 63, 94; }

.summary-card.total { --kpi-glow-c: 37, 99, 235; }
.summary-card.customers { --kpi-glow-c: 37, 99, 235; }
.summary-card.active { --kpi-glow-c: 16, 185, 129; }
.summary-card.inactive { --kpi-glow-c: 245, 158, 11; }

.pkg-kpi-card:has(.pkg-kpi-icon.icon-blue),
.pkg-kpi-card:has(.nip-kpi-icon.icon-blue),
.pkg-kpi-card:has(.mbl-kpi-icon-blue),
.inv-kpi-card:has(.inv-kpi-icon.blue) {
  --kpi-glow-c: 37, 99, 235;
}
.pkg-kpi-card:has(.pkg-kpi-icon.icon-emerald),
.pkg-kpi-card:has(.nip-kpi-icon.icon-emerald),
.pkg-kpi-card:has(.mbl-kpi-icon-emerald),
.inv-kpi-card:has(.inv-kpi-icon.emerald) {
  --kpi-glow-c: 16, 185, 129;
}
.pkg-kpi-card:has(.pkg-kpi-icon.icon-amber),
.pkg-kpi-card:has(.nip-kpi-icon.icon-amber),
.pkg-kpi-card:has(.mbl-kpi-icon-amber),
.inv-kpi-card:has(.inv-kpi-icon.amber) {
  --kpi-glow-c: 245, 158, 11;
}
.pkg-kpi-card:has(.pkg-kpi-icon.icon-purple),
.pkg-kpi-card:has(.nip-kpi-icon.icon-purple),
.pkg-kpi-card:has(.mbl-kpi-icon-purple),
.inv-kpi-card:has(.inv-kpi-icon.purple),
.inv-kpi-card:has(.inv-kpi-icon.indigo) {
  --kpi-glow-c: 79, 70, 229;
}
.inv-kpi-card:has(.inv-kpi-icon.rose) {
  --kpi-glow-c: 244, 63, 94;
}

/* ---- 7. Semantic soft border tint on cards carrying a variant (via their own
   class or any contained .kpi-ico badge; recipe 44277-44287) ---- */
.kpi-card[class*="kpi-ico-"],
.stat-card[class*="kpi-ico-"],
.metric-card[class*="kpi-ico-"],
.summary-card[class*="kpi-ico-"],
.inv-kpi-card[class*="kpi-ico-"],
.pkg-kpi-card[class*="kpi-ico-"],
.kpi-card:has(.kpi-ico),
.stat-card:has(.kpi-ico),
.metric-card:has(.kpi-ico),
.summary-card:has(.kpi-ico),
.inv-kpi-card:has(.kpi-ico),
.pkg-kpi-card:has(.kpi-ico) {
  border-color: rgba(var(--kpi-glow-c, 37, 99, 235), 0.2) !important;
}

[data-theme="dark"] .kpi-card[class*="kpi-ico-"],
[data-theme="dark"] .stat-card[class*="kpi-ico-"],
[data-theme="dark"] .metric-card[class*="kpi-ico-"],
[data-theme="dark"] .summary-card[class*="kpi-ico-"],
[data-theme="dark"] .inv-kpi-card[class*="kpi-ico-"],
[data-theme="dark"] .pkg-kpi-card[class*="kpi-ico-"],
[data-theme="dark"] .kpi-card:has(.kpi-ico),
[data-theme="dark"] .stat-card:has(.kpi-ico),
[data-theme="dark"] .metric-card:has(.kpi-ico),
[data-theme="dark"] .summary-card:has(.kpi-ico),
[data-theme="dark"] .inv-kpi-card:has(.kpi-ico),
[data-theme="dark"] .pkg-kpi-card:has(.kpi-ico),
body.dark-mode .kpi-card[class*="kpi-ico-"],
body.dark-mode .stat-card[class*="kpi-ico-"],
body.dark-mode .metric-card[class*="kpi-ico-"],
body.dark-mode .summary-card[class*="kpi-ico-"],
body.dark-mode .inv-kpi-card[class*="kpi-ico-"],
body.dark-mode .pkg-kpi-card[class*="kpi-ico-"],
body.dark-mode .kpi-card:has(.kpi-ico),
body.dark-mode .stat-card:has(.kpi-ico),
body.dark-mode .metric-card:has(.kpi-ico),
body.dark-mode .summary-card:has(.kpi-ico),
body.dark-mode .inv-kpi-card:has(.kpi-ico),
body.dark-mode .pkg-kpi-card:has(.kpi-ico) {
  border-color: rgba(var(--kpi-glow-c, 37, 99, 235), 0.3) !important;
}

/* ---- 8. Hover elevation lift (desktop pointers only; recipe 44294-44308).
   Grid-scoped pkg selectors included to out-match the existing
   !important hover at 36724-36738 ---- */
@media (min-width: 769px) and (hover: hover) {
  .kpi-card:hover,
  .stat-card:hover,
  .card.stat-card:hover,
  .metric-card:hover,
  .summary-card:hover,
  .packages-summary-grid .summary-card:hover,
  .inv-kpi-card:hover,
  .pkg-kpi-card:hover,
  .mbl-kpi-card:hover,
  .gw-kpi-grid .pkg-kpi-card:hover,
  .recon-kpi-grid .pkg-kpi-card:hover,
  .tx-kpi-grid .pkg-kpi-card:hover,
  .pkg-changes-kpi-grid .pkg-kpi-card:hover,
  .pos-kpi-grid .pkg-kpi-card:hover,
  .pos-page-container .pkg-kpi-card:hover,
  .pos-page-container .pkg-kpi-grid .pkg-kpi-card:hover,
  .payments-collect-page .pkg-kpi-grid .pkg-kpi-card:hover,
  .mbl-kpi-grid .pkg-kpi-card:hover,
  .nrad-page-container .pkg-kpi-card:hover,
  .cprof-kpi-clickable:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(var(--kpi-glow-c, 37, 99, 235), 0.35) !important;
  }

  [data-theme="dark"] .kpi-card:hover,
  [data-theme="dark"] .stat-card:hover,
  [data-theme="dark"] .card.stat-card:hover,
  [data-theme="dark"] .metric-card:hover,
  [data-theme="dark"] .summary-card:hover,
  [data-theme="dark"] .packages-summary-grid .summary-card:hover,
  [data-theme="dark"] .inv-kpi-card:hover,
  [data-theme="dark"] .pkg-kpi-card:hover,
  [data-theme="dark"] .mbl-kpi-card:hover,
  [data-theme="dark"] .gw-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .recon-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .tx-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .pkg-changes-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .pos-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .pos-page-container .pkg-kpi-card:hover,
  [data-theme="dark"] .pos-page-container .pkg-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .payments-collect-page .pkg-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .mbl-kpi-grid .pkg-kpi-card:hover,
  [data-theme="dark"] .nrad-page-container .pkg-kpi-card:hover,
  [data-theme="dark"] .cprof-kpi-clickable:hover,
  body.dark-mode .kpi-card:hover,
  body.dark-mode .stat-card:hover,
  body.dark-mode .card.stat-card:hover,
  body.dark-mode .metric-card:hover,
  body.dark-mode .summary-card:hover,
  body.dark-mode .packages-summary-grid .summary-card:hover,
  body.dark-mode .inv-kpi-card:hover,
  body.dark-mode .pkg-kpi-card:hover,
  body.dark-mode .mbl-kpi-card:hover,
  body.dark-mode .gw-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .recon-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .tx-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .pkg-changes-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .pos-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .pos-page-container .pkg-kpi-card:hover,
  body.dark-mode .pos-page-container .pkg-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .payments-collect-page .pkg-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .mbl-kpi-grid .pkg-kpi-card:hover,
  body.dark-mode .nrad-page-container .pkg-kpi-card:hover,
  body.dark-mode .cprof-kpi-clickable:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    border-color: rgba(var(--kpi-glow-c, 37, 99, 235), 0.45) !important;
  }
}

/* ---- 9. Mobile (<=768px): badge shrinks to 30px; grid collapse is added ONLY
   for grids that have no existing <=768 collapse rule of their own (verified:
   .custprofile-kpi-grid3 is the only in-scope KPI grid without one — all other
   families collapse via style.css 36385/36641/36653/37957, page inline styles,
   or auto-fit tracks) ---- */
@media (max-width: 768px) {
  .kpi-ico {
    width: 30px !important;
    height: 30px !important;
  }

  .kpi-ico svg {
    width: 15px !important;
    height: 15px !important;
  }

  .custprofile-kpi-grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   RELEASE v76 — R2 COMPLETION PASS (KPI tile contract enforcement)
   1. Form controls join the typography system (bare INPUTs computed to the
      browser default "Arial" without an explicit rule; inherit pulls Inter
      from body while page-level mono rules still win).
   2. Tile height compaction to the <=125px desktop contract (trims the v58 /
      v74 16px paddings + 8px gaps; measured 126-136px -> ~110-124px).
   3. Billing hero ("billing-cmd") compaction: label/value/subline/pill scale
      trimmed so the tallest card (wrapped pills) stays <=125px.
   4. Glow geometry extended to .supt-diag-item (support ticket metadata
      tiles; overflow hidden clips the 150px radial inside the tile).
   5. .cprof-tele-float-badge joins the badge language while keeping the 34px
      v70 reference size (0-2-0 beats the 0-1-0 .kpi-ico 32px base).
   6. supt pill ellipsis — long canned-response names must not stretch tiles.
   ========================================================================== */
input, select, textarea, button, optgroup { font-family: inherit; }

/* Leaflet vendor stack ("Helvetica Neue", Arial / Tahoma) unified into the app
   typography — leaflet.css sets family on .leaflet-container AND a Tahoma
   shorthand on .leaflet-popup-close-button; element selectors below beat both */
.leaflet-container { font-family: inherit !important; }
.leaflet-container a,
.leaflet-container span,
.leaflet-container div { font-family: inherit !important; }

/* Tile compaction — selector list mirrors the v74 L36665 mega-block so the
   (0,2,0) grid-scoped !important rules are beaten by equal specificity later
   in the cascade (same-specify ties resolve by document order). */
.pkg-kpi-card,
.nip-kpi-card,
.nolt-kpi-card,
.nses-kpi-card,
.nrad-kpi-card,
.supt-kpi-card,
.package-summary-card,
.mbl-kpi-card,
.gw-kpi-grid .pkg-kpi-card,
.recon-kpi-grid .pkg-kpi-card,
.tx-kpi-grid .pkg-kpi-card,
.pkg-changes-kpi-grid .pkg-kpi-card,
.pos-kpi-grid .pkg-kpi-card,
.pos-page-container .pkg-kpi-card,
.pos-page-container .pkg-kpi-grid .pkg-kpi-card,
.payments-collect-page .pkg-kpi-grid .pkg-kpi-card,
.mbl-kpi-grid .pkg-kpi-card,
.packages-summary-grid .package-summary-card,
.packages-summary-grid .summary-card,
.nip-kpi-grid .pkg-kpi-card,
.nolt-kpi-grid .pkg-kpi-card,
.nses-kpi-grid .pkg-kpi-card {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
  gap: 5px !important;
}

.billing-cmd-kpi-card { padding: 11px 14px !important; min-height: 104px !important; }
.billing-cmd-kpi-label { font-size: 11px !important; margin-bottom: 2px !important; }
.billing-cmd-kpi-value { font-size: 19px !important; }
.billing-cmd-kpi-subline { margin-top: 3px !important; font-size: 12px !important; }
.billing-cmd-progress-wrap { margin-top: 6px !important; }
.billing-cmd-pills-row { margin-top: 6px !important; }
.billing-cmd-pill { font-size: 10px !important; padding: 1px 6px !important; }
.billing-cmd-action-link { margin-top: 6px !important; }

/* Card 2 figures: three 26px pills cannot fit a <=125px 4-up tile — compact
   text chips instead (ids preserved so the JS setters keep updating them). */
.billing-cmd-kpi-chipline {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--color-text-secondary);
}
.billing-cmd-chip { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }

/* supt values may carry long canned-response template names — force the
   ellipsis (the generic pkg ellipsis is overridden by the v74 L36806 block) */
.supt-kpi-card .pkg-kpi-value {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
}

/* Long words in narrow OLT-wizard stepper titles must break, not overflow */
.noft-step-title { overflow-wrap: anywhere; }

/* ---- R2 mobile containment (<=768px): tile content clips ITSELF (ellipsis),
   never the card; wide flex rows stack vertically ---- */
@media (max-width: 768px) {
  .inv-kpi-card,
  .nrad-kpi-card {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .inv-kpi-label,
  .inv-kpi-val,
  .inv-kpi-pill,
  .nrad-kpi-value,
  .nrad-kpi-pill {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .traffic-rx-tx {
    flex-direction: column !important;
    flex-wrap: wrap !important;
  }

  .dashboard-card-body {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .recon-search-row {
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }

  .recon-search-row > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .report-visual-card-head {
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }

  .report-visual-card-head > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

.supt-diag-item {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
}

.supt-diag-item::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 150px !important;
  height: 150px !important;
  pointer-events: none !important;
  border-radius: 0 14px 0 100% !important;
  opacity: 0.85 !important;
  z-index: -1 !important;
  background: radial-gradient(circle at 100% 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.14) 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.03) 48%, transparent 72%) !important;
}

[data-theme="dark"] .supt-diag-item::before,
body.dark-mode .supt-diag-item::before {
  background: radial-gradient(circle at 100% 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.22) 0%, rgba(var(--kpi-glow-c, 37, 99, 235), 0.05) 50%, transparent 75%) !important;
}

.cprof-tele-float-badge.kpi-ico { width: 34px !important; height: 34px !important; }

.supt-kpi-pills { min-width: 0; overflow: hidden; }
.supt-kpi-card .pkg-kpi-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   RELEASE v77 MASTER PRECISION POLISH & UNIFIED STYLING
   ========================================================================== */

/* FIX 1: Service Control Upper 3-Card Strip & Bottom 4x2 Bento Grid */
.service-control-page .sc-control-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 20px !important;
}

.service-control-page .sc-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 20px !important;
}

.service-control-page .sc-card {
  height: 100% !important;
  min-height: 100px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.service-control-page .sc-card-val-truncate {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  display: block !important;
}

@media (max-width: 1024px) {
  .service-control-page .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .service-control-page .sc-control-grid {
    grid-template-columns: 1fr !important;
  }
  .service-control-page .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

/* FIX 2: UNIFIED OVERHEAD SPOTLIGHT GLOW ON 100% OF ACTIVE SIDEBAR LINKS & SUBMENU ITEMS */
.sidebar .nav-item.active,
.sidebar .nav-item.active:not(.has-submenu),
.sidebar .submenu-item.active,
.sidebar .nav-submenu .nav-item.active,
.sidebar .nav-submenu a.active,
.sidebar a.nav-item.active,
.sidebar a.active,
.sidebar-flyout-card .flyout-item.active,
[data-theme="dark"] .sidebar .nav-item.active,
[data-theme="dark"] .sidebar .nav-item.active:not(.has-submenu),
[data-theme="dark"] .sidebar .submenu-item.active,
[data-theme="dark"] .sidebar .nav-submenu .nav-item.active,
[data-theme="dark"] .sidebar .nav-submenu a.active,
[data-theme="dark"] .sidebar a.nav-item.active,
[data-theme="dark"] .sidebar a.active,
[data-theme="dark"] .sidebar-flyout-card .flyout-item.active,
body.dark-mode .sidebar .nav-item.active,
body.dark-mode .sidebar .nav-item.active:not(.has-submenu),
body.dark-mode .sidebar .submenu-item.active,
body.dark-mode .sidebar .nav-submenu .nav-item.active,
body.dark-mode .sidebar .nav-submenu a.active,
body.dark-mode .sidebar a.nav-item.active,
body.dark-mode .sidebar a.active,
body.dark-mode .sidebar-flyout-card .flyout-item.active {
  position: relative !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  background:
    radial-gradient(
      75% 135% at 50% -10%,
      color-mix(in srgb, var(--color-brand, #2563eb) 42%, #ffffff 18%) 0%,
      color-mix(in srgb, var(--color-brand, #2563eb) 20%, transparent) 48%,
      rgba(15, 23, 42, 0.06) 100%
    ) !important;
  border: 1px solid color-mix(in srgb, var(--color-brand, #2563eb) 35%, transparent) !important;
  border-top-color: color-mix(in srgb, var(--color-brand, #2563eb) 65%, #ffffff 25%) !important;
  box-shadow:
    inset 0 10px 18px -10px color-mix(in srgb, var(--color-brand, #2563eb) 55%, #ffffff 20%),
    0 4px 14px -4px var(--color-sidebar-active-glow, rgba(37, 99, 235, 0.35)) !important;
  overflow: hidden !important;
}

.sidebar .nav-item.active::after,
.sidebar .submenu-item.active::after,
.sidebar .nav-submenu .nav-item.active::after,
.sidebar .nav-submenu a.active::after,
.sidebar a.nav-item.active::after,
.sidebar a.active::after,
.sidebar-flyout-card .flyout-item.active::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 12% !important;
  right: 12% !important;
  height: 2px !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--color-brand, #2563eb) 40%, #ffffff 60%) 50%,
    transparent 100%
  ) !important;
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--color-brand, #2563eb) 70%, #ffffff 30%) !important;
  pointer-events: none !important;
  display: block !important;
  z-index: 2 !important;
}

.sidebar .nav-item.active > .nav-icon,
.sidebar .nav-item.active > .nav-icon svg,
.sidebar .nav-item.active .nav-label,
.sidebar .nav-submenu .nav-item.active .nav-label,
.sidebar .nav-submenu a.active .nav-label,
.sidebar a.active .nav-label {
  color: #ffffff !important;
}

/* Standalone Top-Level Active Item (Dashboard): Pure Theme Pill without Border/After Clash */
/* Only targets DIRECT CHILDREN of .sidebar-nav (top-level items), NOT submenu links */
.sidebar .sidebar-nav > .nav-item.active:not(.has-submenu),
.sidebar > .sidebar-nav > .nav-item.active:not(.has-submenu),
[data-theme="dark"] .sidebar .sidebar-nav > .nav-item.active:not(.has-submenu),
body.dark-mode .sidebar .sidebar-nav > .nav-item.active:not(.has-submenu) {
  background: var(--color-sidebar-active-gradient, linear-gradient(90deg, var(--color-brand) 0%, var(--color-brand-hover) 100%)) !important;
  box-shadow: 0 3px 12px var(--color-sidebar-active-glow, rgba(var(--color-brand-rgb, 37, 99, 235), 0.35)) !important;
  border: none !important;
}

.sidebar .sidebar-nav > .nav-item.active:not(.has-submenu)::after,
.sidebar > .sidebar-nav > .nav-item.active:not(.has-submenu)::after {
  display: none !important;
}

/* FIX 3: GLOBAL UNIFIED ENTERPRISE PAGINATION STANDARD */
.table-pagination,
.customers-pagination,
.packages-pagination,
.pkg-pagination,
.pppoe-pagination,
.report-pagination,
.mbl-pagination-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 18px !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  flex-wrap: wrap !important;
  background: transparent !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pagination-info,
.report-pagination-info,
.mbl-pagination-info {
  font-size: 12.5px !important;
  color: #64748b !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

.pagination-controls,
.report-pagination-actions,
.mbl-pagination-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.page-btn {
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  background: var(--card-bg, #ffffff) !important;
  color: var(--text-color, #1e293b) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .page-btn,
body.dark-mode .page-btn {
  background: var(--dark-bg-elevated) !important;
  border-color: var(--dark-border) !important;
  color: #e2e8f0 !important;
}

.page-btn:hover:not(:disabled):not(.disabled) {
  background: var(--bg-hover, #f1f5f9) !important;
  border-color: var(--border-hover, #cbd5e1) !important;
  color: #0f172a !important;
}

[data-theme="dark"] .page-btn:hover:not(:disabled):not(.disabled),
body.dark-mode .page-btn:hover:not(:disabled):not(.disabled) {
  background: var(--dark-bg-hover) !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

.page-btn.active,
.page-btn[aria-current="page"] {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  border-color: var(--color-brand, #2563eb) !important;
  box-shadow: 0 1px 3px var(--color-brand-soft, rgba(37, 99, 235, 0.3)) !important;
}

[data-theme="dark"] .page-btn.active,
body.dark-mode .page-btn.active {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
  border-color: var(--color-brand, #2563eb) !important;
}

.page-btn:disabled,
.page-btn[disabled],
.page-btn.disabled {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.page-btn.btn-prev,
.page-btn.btn-next {
  padding: 0 12px !important;
  font-weight: 600 !important;
}

@media (max-width: 768px) {
  .table-pagination,
  .customers-pagination,
  .packages-pagination,
  .pkg-pagination,
  .pppoe-pagination,
  .report-pagination,
  .mbl-pagination-bar {
    justify-content: center !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  .pagination-controls,
  .report-pagination-actions,
  .mbl-pagination-controls {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }
}

/* FIX 4: ZERO-COLLISION TABLE ACTION COLUMN STANDARD */
.table-responsive,
.tx-table-card,
.customers-table-wrapper,
.packages-table-wrapper,
.inv-table-wrapper,
.comm-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

table th:last-child,
table td:last-child,
.tx-col-actions,
.col-actions,
th.actions-col,
td.actions-col {
  padding-right: 16px !important;
}

.tx-col-actions {
  min-width: 250px !important;
  text-align: right !important;
  padding-right: 14px !important;
}

.tx-action-btn {
  padding: 0 6px !important;
  font-size: 11.5px !important;
  gap: 3px !important;
}

.tx-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

.table-actions .btn,
td:last-child .btn,
.tx-action-btn,
.inv-btn-compact,
.comm-wa-btn {
  height: 28px !important;
  padding: 0 9px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  gap: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

.table-actions .btn svg,
td:last-child .btn svg,
.tx-action-btn svg,
.inv-btn-compact svg,
.comm-wa-btn svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0 !important;
}

/* FIX 5: KPI TOP ROW GAP & INVENTORY HEADER ROW ALIGNMENT */
.pkg-kpi-top,
.pkg-kpi-ribbon-top,
.kpi-card-header,
.kpi-card-top,
.kpi-header,
.cprof-kpi-top,
.custkpi-head,
.inv-kpi-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
}

.pkg-kpi-label,
.pkg-kpi-ribbon-label,
.kpi-card-label,
.kpi-label,
.custkpi-label,
.inv-kpi-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding-right: 6px !important;
}

.pkg-kpi-top .kpi-ico,
.pkg-kpi-ribbon-top .kpi-ico,
.kpi-card-top .kpi-ico,
.kpi-card-header .kpi-ico,
.kpi-header .kpi-ico,
.cprof-kpi-top .kpi-ico {
  flex-shrink: 0 !important;
}

/* Inventory Header Actions Right Alignment */
.inv-page-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}

.inv-title-area {
  flex: 1 1 auto !important;
  min-width: 280px !important;
}

.inv-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

@media (min-width: 993px) {
  .inv-page-header {
    flex-wrap: nowrap !important;
  }
  .inv-title-area {
    min-width: 0 !important;
    padding-right: 16px !important;
  }
  .inv-title-area p {
    white-space: normal !important;
  }
}

/* FIX 6: CUSTOMER PROFILE ROUTER & CPE GATEWAY BREATHING ROOM */
#bentoCardHw .cprof-details-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
  column-gap: 16px !important;
  row-gap: 10px !important;
}

#bentoCardHw #copyMacBtn,
#bentoCardHw .custoverview-copy-btn {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important;
}

#bentoCardHw #copyMacBtn svg,
#bentoCardHw .custoverview-copy-btn svg {
  width: 12px !important;
  height: 12px !important;
}

/* ==========================================================================
   RELEASE v79 SURGICAL TABLE HEADER & COLUMN ARCHITECTURE ENFORCEMENT
   ========================================================================== */

/* Strict native table semantics for reconciliation and all system data tables */
.recon-table,
.billing-table,
.data-table,
.tx-table,
.pos-corporate-table {
  display: table !important;
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

.packages-table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.mbl-table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.recon-table thead,
.mbl-table thead,
.billing-table thead,
.data-table thead,
.tx-table thead,
.packages-table thead,
.pos-corporate-table thead {
  display: table-header-group !important;
  width: 100% !important;
}

.recon-table thead tr,
.mbl-table thead tr,
.billing-table thead tr,
.data-table thead tr,
.tx-table thead tr,
.packages-table thead tr,
.pos-corporate-table thead tr {
  display: table-row !important;
}

.recon-table th,
.mbl-table th,
.billing-table th,
.data-table th,
.tx-table th,
.packages-table th,
.pos-corporate-table th {
  display: table-cell !important;
  position: static !important;
  white-space: nowrap !important;
  padding: 10px 10px !important;
  text-align: left !important;
  min-width: 50px !important;
}

@media (max-width: 1366px) {
  .recon-table th,
  .mbl-table th,
  .billing-table th,
  .data-table th,
  .tx-table th,
  .packages-table th,
  .pos-corporate-table th {
    padding: 8px 8px !important;
  }
}

/* Action column right alignment parity */
.packages-table th.col-actions,
.packages-table th:last-child,
.nip-table th.nip-col-actions,
.nip-table th:last-child,
.tx-table th.tx-col-actions,
.tx-table th:last-child {
  text-align: right !important;
}

/* Numeric & aligned column overrides */
.recon-table th.text-right,
.recon-table th[style*="text-align: right"],
.recon-table th[style*="text-align:right"],
.billing-table th.billing-amount-col,
.billing-table th[style*="text-align: right"],
.data-table th[style*="text-align: right"],
.pos-corporate-table th[style*="text-align: right"] {
  text-align: right !important;
}

.recon-table th.text-center,
.recon-table th[style*="text-align: center"],
.recon-table th[style*="text-align:center"],
.mbl-table th.text-center,
.mbl-table th.mbl-col-num,
.mbl-table th.mbl-col-actions {
  text-align: center !important;
}

/* Empty cell strict table-cell semantics with generous vertical padding */
td.table-empty-cell,
.table-empty-cell,
td.empty-state {
  display: table-cell !important;
  text-align: center !important;
  padding: 32px 16px !important;
  white-space: normal !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* 8-column proportional Mobile Banking Log column geometry (RELEASE v80: Total 100%) */
.mbl-table th.mbl-col-num,
.mbl-table td.mbl-col-num {
  width: 4% !important;
  min-width: 36px !important;
  text-align: center !important;
  padding: 11px 4px !important;
}

.mbl-table th.mbl-col-date,
.mbl-table td.mbl-col-date {
  width: 12% !important;
  min-width: 100px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-subscriber,
.mbl-table td.mbl-col-subscriber {
  width: 16% !important;
  min-width: 130px !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-amount,
.mbl-table td.mbl-col-amount {
  width: 12% !important;
  min-width: 95px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-trx-ref,
.mbl-table td.mbl-col-trx-ref {
  width: 15% !important;
  min-width: 120px !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-gateway-sender,
.mbl-table td.mbl-col-gateway-sender {
  width: 15% !important;
  min-width: 120px !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-status,
.mbl-table td.mbl-col-status {
  width: 13% !important;
  min-width: 110px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-actions,
.mbl-table td.mbl-col-actions {
  width: 13% !important;
  min-width: 115px !important;
  text-align: center !important;
  padding-right: 16px !important;
  white-space: nowrap !important;
}

/* Zero ellipsis truncation contract on critical financial cells */
.mbl-cust-badge,
.mbl-amount-val,
.badge-mbl-processed,
.badge-mbl-reversed,
.badge-mbl-transferred,
.badge-mbl-suspense,
.badge-mbl-failed,
.mbl-trx-bold,
.mbl-ref-pill-clean,
.mbl-date-day,
.mbl-date-time {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* ==========================================================================
   RELEASE v80: MASTER TABLE PROPORTION, ALIGNMENT & SERIAL ACTION ARCHITECTURE
   ========================================================================== */
.mbl-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.mbl-table th,
.mbl-table td {
  overflow: visible !important;
}

/* Exact Proportional 8-Column Grid Budget totaling 100% */
.mbl-table th.mbl-col-num,
.mbl-table td.mbl-col-num {
  width: 4% !important;
  text-align: center !important;
  padding: 11px 4px !important;
}

.mbl-table th.mbl-col-date,
.mbl-table td.mbl-col-date {
  width: 12% !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-subscriber,
.mbl-table td.mbl-col-subscriber {
  width: 16% !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-amount,
.mbl-table td.mbl-col-amount {
  width: 12% !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-trx-ref,
.mbl-table td.mbl-col-trx-ref {
  width: 15% !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-gateway-sender,
.mbl-table td.mbl-col-gateway-sender {
  width: 15% !important;
  text-align: left !important;
}

.mbl-table th.mbl-col-status,
.mbl-table td.mbl-col-status {
  width: 13% !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.mbl-table th.mbl-col-actions,
.mbl-table td.mbl-col-actions,
.mbl-table th.mbl-col-actions:last-child,
.mbl-table td.mbl-col-actions:last-child {
  width: 13% !important;
  text-align: center !important;
  padding-right: 16px !important;
  white-space: nowrap !important;
}

/* Razor-Straight Vertical Serial Alignment: 104px Action Column */
.mbl-quick-action-slot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.mbl-transfer-btn,
.mbl-btn-transfer,
.mbl-btn-assign,
.mbl-action-btn {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.mbl-no-action-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  height: 26px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  background: var(--color-surface-subtle, #f1f5f9) !important;
  color: var(--color-text-muted, #64748b) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  text-align: center !important;
  box-sizing: border-box !important;
  user-select: none !important;
}

:root[data-theme="dark"] .mbl-no-action-chip {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Filter Toolbar Polish: Widen search, eliminate select focus ring sticking */
.mbl-filter-row .mbl-search-wrap {
  flex: 1.5 !important;
  min-width: 250px !important;
}

.mbl-filter-row .mbl-provider-select:not(:focus) {
  outline: none !important;
  box-shadow: none !important;
}

.mbl-filter-row .mbl-provider-select:focus {
  outline: none !important;
  border-color: var(--color-primary, #2563eb) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

/* ==========================================================================
   RELEASE v81: STATUS COLUMN CENTERING ACROSS ALL PAYMENTS & BILLING TABLES
   ========================================================================== */
/* Billing Payments (tx-table) — already handled above */
/* Billing Invoices & Due Payments: STATUS td has data-label="Status" */
.data-table td[data-label="Status"] {
  text-align: center !important;
}
.data-table td[data-label="Status"] .badge {
  display: inline-flex !important;
  justify-content: center !important;
}
/* Billing Discounts & Credits: STATUS th/td precede actions-col */
.billing-table-card .data-table th:nth-last-child(2),
.billing-table-card .data-table td:nth-last-child(2) {
  text-align: center !important;
}
.billing-table-card .data-table td:nth-last-child(2) .badge {
  display: inline-flex !important;
  justify-content: center !important;
}

/* ==========================================================================
   RELEASE v86: LIVE TELEMETRY STUDIO REDESIGN & ACTIVITY FILTER BORDER ALIGNMENT
   ========================================================================== */

/* Live Traffic Studio Compact Layout */
.live-traffic-header-bar {
  padding: 10px 16px !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 10px !important;
  background: var(--color-surface, #ffffff) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  min-height: 44px !important;
}

.live-traffic-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
}

.live-traffic-kpi-tile {
  height: 82px !important;
  max-height: 88px !important;
  padding: 10px 14px !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 10px !important;
  background: var(--color-surface, #ffffff) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.live-traffic-canvas-wrap {
  position: relative !important;
  width: 100% !important;
  height: 310px !important;
  min-height: 310px !important;
  background: var(--color-bg, #f8fafc) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

#liveTrafficCanvas {
  display: block !important;
  width: 100% !important;
  height: 310px !important;
}

@media (max-width: 768px) {
  .live-traffic-kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .live-traffic-canvas-wrap {
    height: 240px !important;
    min-height: 240px !important;
  }
  #liveTrafficCanvas {
    height: 240px !important;
  }
}

/* Activity Tab Toolbar: All Time Filter Dropdown & Controls */
#activityTimeframeSelect,
.act-timeframe-select {
  height: 36px !important;
  line-height: 1.2 !important;
  padding: 0 32px 0 12px !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  background-color: var(--color-surface, #ffffff) !important;
  color: var(--color-text, #0f172a) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

[data-theme="dark"] #activityTimeframeSelect,
body.dark-mode #activityTimeframeSelect,
[data-theme="dark"] .act-timeframe-select,
body.dark-mode .act-timeframe-select {
  background-color: var(--dark-bg-surface) !important;
  border-color: var(--dark-border-strong) !important;
  color: var(--color-text, #f8fafc) !important;
}

/* ==========================================================================
   RELEASE v88: MASTER SERVICE CONTROL EXECUTIVE UI/UX REDESIGN & TABLE FIT
   ========================================================================== */

/* PART 1: Top Live Telemetry Bar */
.service-control-page .sc-telemetry-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  background: var(--color-surface, #ffffff) !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
  gap: 12px !important;
  overflow-x: auto !important;
}

[data-theme="dark"] .service-control-page .sc-telemetry-bar,
body.dark-mode .service-control-page .sc-telemetry-bar {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-telemetry-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  white-space: nowrap !important;
  color: var(--color-text, #0f172a) !important;
}

.service-control-page .sc-telemetry-label {
  color: var(--color-text-muted, #64748b) !important;
  font-weight: 500 !important;
}

.service-control-page .sc-telemetry-val {
  font-weight: 700 !important;
  color: var(--color-text, #0f172a) !important;
}

[data-theme="dark"] .service-control-page .sc-telemetry-chip,
body.dark-mode .service-control-page .sc-telemetry-chip {
  color: var(--color-text, #f8fafc) !important;
}

[data-theme="dark"] .service-control-page .sc-telemetry-label,
body.dark-mode .service-control-page .sc-telemetry-label {
  color: var(--color-text-muted, #94a3b8) !important;
}

[data-theme="dark"] .service-control-page .sc-telemetry-val,
body.dark-mode .service-control-page .sc-telemetry-val {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-telemetry-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.service-control-page .sc-telemetry-dot.dot-emerald {
  background: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
}

.service-control-page .sc-telemetry-dot.dot-rose {
  background: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

.service-control-page .sc-telemetry-dot.dot-amber {
  background: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25) !important;
}

.service-control-page .sc-telemetry-dot.dot-cobalt {
  background: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

.service-control-page .sc-telemetry-dot.dot-slate {
  background: #94a3b8 !important;
}

@media (max-width: 768px) {
  .service-control-page .sc-telemetry-bar {
    height: auto !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
    justify-content: flex-start !important;
  }
}

/* PART 1: Upper 3-Card Balanced Automation Deck */
.service-control-page .sc-control-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.22fr) !important;
  gap: 16px !important;
  margin-bottom: 20px !important;
}

.service-control-page .sc-control-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 14px 16px !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 12px !important;
  background: var(--color-surface, #ffffff) !important;
  height: 124px !important;
  min-height: 124px !important;
  max-height: 140px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

[data-theme="dark"] .service-control-page .sc-control-card,
body.dark-mode .service-control-page .sc-control-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-ctrl-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
}

.service-control-page .sc-ctrl-heading {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.service-control-page .sc-ctrl-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--color-text, #0f172a) !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .service-control-page .sc-ctrl-title,
body.dark-mode .service-control-page .sc-ctrl-title {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-ctrl-toggle-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.service-control-page .sc-switch {
  width: 38px !important;
  height: 20px !important;
  border-radius: 9999px !important;
  position: relative !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  outline: none !important;
  background-color: var(--color-border-hover, #cbd5e1) !important;
  transition: background-color 0.2s ease !important;
  flex-shrink: 0 !important;
}

[data-theme="dark"] .service-control-page .sc-switch,
body.dark-mode .service-control-page .sc-switch {
  background-color: var(--dark-bg-subtle) !important;
}

.service-control-page .sc-switch.is-on {
  background-color: #10b981 !important;
}

.service-control-page .sc-switch.is-on.switch-amber {
  background-color: #f59e0b !important;
}

.service-control-page .sc-switch:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.service-control-page .sc-switch-slider {
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28) !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.service-control-page .sc-switch.is-on .sc-switch-slider {
  transform: translateX(18px) !important;
}

.service-control-page .sc-switch-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.4px !important;
  min-width: 26px !important;
}

.service-control-page .sc-ctrl-desc {
  font-size: 11.5px !important;
  color: var(--color-text-muted, #64748b) !important;
  line-height: 1.35 !important;
  margin-top: auto !important;
}

[data-theme="dark"] .service-control-page .sc-ctrl-desc,
body.dark-mode .service-control-page .sc-ctrl-desc {
  color: var(--color-text-muted, #94a3b8) !important;
}

.service-control-page .sc-ctrl-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  margin-top: 10px !important;
}

.service-control-page .sc-btn-op {
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .service-control-page .sc-control-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .service-control-page .sc-control-card {
    height: auto !important;
    min-height: 124px !important;
    max-height: none !important;
  }
  .service-control-page .sc-ctrl-actions {
    flex-wrap: wrap !important;
  }
}

/* PART 2: 4x2 KPI Bento Grid with Zero Text Clipping */
.service-control-page .sc-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 20px !important;
}

.service-control-page .sc-card {
  height: 108px !important;
  min-height: 104px !important;
  max-height: 112px !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  background: var(--color-surface, #ffffff) !important;
}

[data-theme="dark"] .service-control-page .sc-card,
body.dark-mode .service-control-page .sc-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-card-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-width: 0 !important;
  width: 100% !important;
}

.service-control-page .sc-card-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-text-muted, #64748b) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

[data-theme="dark"] .service-control-page .sc-card-label,
body.dark-mode .service-control-page .sc-card-label {
  color: var(--color-text-muted, #94a3b8) !important;
}

.service-control-page .sc-card-value {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--color-text, #0f172a) !important;
  line-height: 1.1 !important;
}

[data-theme="dark"] .service-control-page .sc-card-value,
body.dark-mode .service-control-page .sc-card-value {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-kpi8-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  width: 100% !important;
}

.service-control-page .sc-kpi8-time {
  font-size: 15px !important;
  font-weight: 700 !important;
  font-family: 'JetBrains Mono', monospace !important;
  color: var(--color-text, #0f172a) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  display: block !important;
}

[data-theme="dark"] .service-control-page .sc-kpi8-time,
body.dark-mode .service-control-page .sc-kpi8-time {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-kpi-sublabel {
  font-size: 11px !important;
  color: var(--color-text-muted, #64748b) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  display: block !important;
  line-height: 1.3 !important;
}

[data-theme="dark"] .service-control-page .sc-kpi-sublabel,
body.dark-mode .service-control-page .sc-kpi-sublabel {
  color: var(--color-text-muted, #94a3b8) !important;
}

@media (max-width: 1024px) {
  .service-control-page .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .service-control-page .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .service-control-page .sc-kpi8-time {
    font-size: 11px !important;
  }
}

/* PART 3: Fixed Tables, Zero Clipping, Toolbars, Pagination */
.service-control-page .sc-table-card {
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 12px !important;
  background: var(--color-surface, #ffffff) !important;
  margin-bottom: 24px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="dark"] .service-control-page .sc-table-card,
body.dark-mode .service-control-page .sc-table-card {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-table-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--color-border, #e2e8f0) !important;
  background: var(--color-surface, #ffffff) !important;
}

[data-theme="dark"] .service-control-page .sc-table-toolbar,
body.dark-mode .service-control-page .sc-table-toolbar {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-toolbar-search {
  position: relative !important;
  width: 290px !important;
  max-width: 100% !important;
}

.service-control-page .sc-search-icon {
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--color-text-muted, #64748b) !important;
  pointer-events: none !important;
  display: flex !important;
}

.service-control-page .sc-search-input {
  height: 32px !important;
  width: 100% !important;
  padding: 0 10px 0 32px !important;
  font-size: 12.5px !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  border-radius: 8px !important;
  background: var(--color-bg, #ffffff) !important;
  color: var(--color-text, #0f172a) !important;
  box-sizing: border-box !important;
  outline: none !important;
}

[data-theme="dark"] .service-control-page .sc-search-input,
body.dark-mode .service-control-page .sc-search-input {
  background: var(--dark-bg-subtle) !important;
  border-color: var(--dark-border-strong) !important;
  color: #f8fafc !important;
}

.service-control-page .sc-filter-pills {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.service-control-page .sc-filter-pill {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  background: var(--color-surface, #ffffff) !important;
  color: var(--color-text-muted, #64748b) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

[data-theme="dark"] .service-control-page .sc-filter-pill,
body.dark-mode .service-control-page .sc-filter-pill {
  background: var(--dark-bg-surface) !important;
  border-color: var(--dark-border) !important;
  color: #94a3b8 !important;
}

.service-control-page .sc-filter-pill:hover {
  background: var(--color-bg, #f1f5f9) !important;
  color: var(--color-text, #0f172a) !important;
}

[data-theme="dark"] .service-control-page .sc-filter-pill:hover,
body.dark-mode .service-control-page .sc-filter-pill:hover {
  background: var(--dark-bg-hover) !important;
  color: #f8fafc !important;
}

.service-control-page .sc-filter-pill.is-active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.service-control-page .sc-table,
.sc-table {
  display: table !important;
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.service-control-page .sc-table thead,
.sc-table thead {
  display: table-header-group !important;
}

.service-control-page .sc-table tbody,
.sc-table tbody {
  display: table-row-group !important;
}

.service-control-page .sc-table tr,
.sc-table tr {
  display: table-row !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.service-control-page .sc-table th,
.service-control-page .sc-table td,
.sc-table th,
.sc-table td {
  display: table-cell !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
}

.service-control-page .sc-table th,
.sc-table th {
  font-size: 11px !important;
  letter-spacing: 0.02em !important;
  padding: 10px 8px !important;
}

/* State table column widths (total = 100%) */
.service-control-page .sc-state-table th:nth-child(1),
.service-control-page .sc-state-table td:nth-child(1),
.sc-state-table th:nth-child(1),
.sc-state-table td:nth-child(1) { width: 17% !important; }

.service-control-page .sc-state-table th:nth-child(2),
.service-control-page .sc-state-table td:nth-child(2),
.sc-state-table th:nth-child(2),
.sc-state-table td:nth-child(2) { width: 14% !important; }

.service-control-page .sc-state-table th:nth-child(3),
.service-control-page .sc-state-table td:nth-child(3),
.sc-state-table th:nth-child(3),
.sc-state-table td:nth-child(3) { width: 14% !important; }

.service-control-page .sc-state-table th:nth-child(4),
.service-control-page .sc-state-table td:nth-child(4),
.sc-state-table th:nth-child(4),
.sc-state-table td:nth-child(4) { width: 16% !important; }

.service-control-page .sc-state-table th:nth-child(5),
.service-control-page .sc-state-table td:nth-child(5),
.sc-state-table th:nth-child(5),
.sc-state-table td:nth-child(5) { width: 13% !important; }

.service-control-page .sc-state-table th:nth-child(6),
.service-control-page .sc-state-table td:nth-child(6),
.sc-state-table th:nth-child(6),
.sc-state-table td:nth-child(6) { width: 12% !important; }

.service-control-page .sc-state-table th:nth-child(7),
.service-control-page .sc-state-table td:nth-child(7),
.sc-state-table th:nth-child(7),
.sc-state-table td:nth-child(7),
.service-control-page .sc-col-actions,
.sc-col-actions {
  width: 14% !important;
  min-width: 144px !important;
  text-align: right !important;
  padding-right: 16px !important;
  overflow: visible !important;
}

/* History table column widths (total = 100%) */
.service-control-page .sc-history-table th:nth-child(1),
.service-control-page .sc-history-table td:nth-child(1),
.sc-history-table th:nth-child(1),
.sc-history-table td:nth-child(1) { width: 13% !important; }

.service-control-page .sc-history-table th:nth-child(2),
.service-control-page .sc-history-table td:nth-child(2),
.sc-history-table th:nth-child(2),
.sc-history-table td:nth-child(2) { width: 15% !important; }

.service-control-page .sc-history-table th:nth-child(3),
.service-control-page .sc-history-table td:nth-child(3),
.sc-history-table th:nth-child(3),
.sc-history-table td:nth-child(3) { width: 14% !important; }

.service-control-page .sc-history-table th:nth-child(4),
.service-control-page .sc-history-table td:nth-child(4),
.sc-history-table th:nth-child(4),
.sc-history-table td:nth-child(4) { width: 9% !important; }

.service-control-page .sc-history-table th:nth-child(5),
.service-control-page .sc-history-table td:nth-child(5),
.sc-history-table th:nth-child(5),
.sc-history-table td:nth-child(5) { width: 10% !important; }

.service-control-page .sc-history-table th:nth-child(6),
.service-control-page .sc-history-table td:nth-child(6),
.sc-history-table th:nth-child(6),
.sc-history-table td:nth-child(6) { width: 21% !important; }

.service-control-page .sc-history-table th:nth-child(7),
.service-control-page .sc-history-table td:nth-child(7),
.sc-history-table th:nth-child(7),
.sc-history-table td:nth-child(7),
.service-control-page .sc-hist-error,
.sc-hist-error {
  width: 18% !important;
  text-align: left !important;
  padding-left: 14px !important;
  padding-right: 16px !important;
}

.service-control-page .sc-customer-cell {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.service-control-page .sc-customer-name {
  font-weight: 600 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--color-text, #0f172a) !important;
}

[data-theme="dark"] .service-control-page .sc-customer-name,
body.dark-mode .service-control-page .sc-customer-name {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-customer-badge {
  font-size: 11px !important;
  color: var(--color-text-muted, #64748b) !important;
  white-space: nowrap !important;
}

.service-control-page .sc-pppoe-code {
  font-size: 12px !important;
  font-family: 'JetBrains Mono', monospace !important;
  background: var(--color-bg, #f1f5f9) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block !important;
  max-width: 100% !important;
}

[data-theme="dark"] .service-control-page .sc-pppoe-code,
body.dark-mode .service-control-page .sc-pppoe-code {
  background: var(--dark-bg-elevated) !important;
  color: #e2e8f0 !important;
}

.service-control-page .sc-action-result-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.service-control-page .sc-action-text {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--color-text, #0f172a) !important;
  text-transform: capitalize !important;
}

[data-theme="dark"] .service-control-page .sc-action-text,
body.dark-mode .service-control-page .sc-action-text {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-time-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  line-height: 1.25 !important;
}

.service-control-page .sc-time-date {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-text, #0f172a) !important;
  white-space: nowrap !important;
}

[data-theme="dark"] .service-control-page .sc-time-date,
body.dark-mode .service-control-page .sc-time-date {
  color: var(--color-text, #f8fafc) !important;
}

.service-control-page .sc-time-clock {
  font-size: 11px !important;
  color: var(--color-text-muted, #64748b) !important;
  white-space: nowrap !important;
}

[data-theme="dark"] .service-control-page .sc-time-clock,
body.dark-mode .service-control-page .sc-time-clock {
  color: var(--color-text-muted, #94a3b8) !important;
}

.service-control-page .sc-error-text,
.sc-error-text {
  font-size: 11.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  max-width: 100% !important;
  text-align: left !important;
}

.service-control-page .sc-error-text.has-error {
  color: #ef4444 !important;
}

.service-control-page .sc-error-text.is-none {
  color: var(--color-text-muted, #64748b) !important;
}

[data-theme="dark"] .service-control-page .sc-error-text.is-none,
body.dark-mode .service-control-page .sc-error-text.is-none {
  color: var(--color-text-muted, #94a3b8) !important;
}

.service-control-page .sc-actions-flex {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  width: 100% !important;
  white-space: nowrap !important;
}

.service-control-page .sc-btn-run {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  line-height: 26px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.service-control-page .sc-btn-detail {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}

.service-control-page .sc-reason-badge {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: var(--color-text, #0f172a) !important;
  background: var(--color-bg, #f1f5f9) !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block !important;
  max-width: 100% !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
}

[data-theme="dark"] .service-control-page .sc-reason-badge,
body.dark-mode .service-control-page .sc-reason-badge {
  background: var(--dark-bg-elevated) !important;
  color: #e2e8f0 !important;
  border-color: var(--dark-border) !important;
}

.service-control-page .sc-pagination-container {
  width: 100% !important;
}

@media (max-width: 768px) {
  .service-control-page .sc-table,
  .sc-table {
    min-width: 1076px !important;
  }
}

/* ==========================================================================
   RELEASE v104: ZERO-DEFECT CUSTOMERS DIRECTORY ARCHITECTURE & SEMANTIC TABLE
   ========================================================================== */

/* Strict Semantic Column Alignment & Horizontal Padding */
.customers-table th,
.customers-table td {
  padding: 10px 10px;
  vertical-align: middle;
  box-sizing: border-box;
}

.customers-table th.col-customer,
.customers-table td.col-customer {
  padding-left: 16px !important;
  text-align: left !important;
}

.customers-table th.col-actions,
.customers-table td.col-actions {
  padding-right: 16px !important;
  text-align: right !important;
}

.customers-table th.col-pppoe, .customers-table td.col-pppoe,
.customers-table th.col-ip, .customers-table td.col-ip,
.customers-table th.col-conn, .customers-table td.col-conn,
.customers-table th.col-uptime, .customers-table td.col-uptime,
.customers-table th.col-speed, .customers-table td.col-speed,
.customers-table th.col-package, .customers-table td.col-package,
.customers-table th.col-area, .customers-table td.col-area,
.customers-table th.col-due, .customers-table td.col-due,
.customers-table th.col-dueamount, .customers-table td.col-dueamount,
.customers-table th.col-daysleft, .customers-table td.col-daysleft,
.customers-table th.col-lastseen, .customers-table td.col-lastseen,
.customers-table th.col-daysoff, .customers-table td.col-daysoff,
.customers-table th.col-expiredon, .customers-table td.col-expiredon,
.customers-table th.col-overdue, .customers-table td.col-overdue,
.customers-table th.col-amount, .customers-table td.col-amount,
.customers-table th.col-suspendedat, .customers-table td.col-suspendedat,
.customers-table th.col-reason, .customers-table td.col-reason,
.customers-table th.col-pool, .customers-table td.col-pool,
.customers-table th.col-status, .customers-table td.col-status {
  text-align: left !important;
}

/* Full-Viewport Directory Card (Desktop >= 769px) — v105 empirical fill */
@media (min-width: 769px) {
  /* content + customers-page must be flex columns so the card can grow */
  .content:has(.customers-page),
  #mainContent:has(.customers-page) {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .customers-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* The card fills remaining height down to the shell footer.
     flex-basis:auto + grow:1 lets it expand; min-height:0 lets it shrink. */
  .customers-table-card.customers-directory-card,
  .customers-table-card {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .customers-card-toolbar,
  #filterToolbarWrap {
    flex-shrink: 0;
  }

  .customers-table-viewport,
  #customersContainer {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .customers-table-wrap {
    min-height: 520px;
    height: clamp(540px, 72vh, 780px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .customers-card-footer,
  #paginationContainer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-surface);
  }

  /* Compress pagination to a single 36px row (was 84px tall) */
  .customers-card-footer .table-pagination,
  #paginationContainer .table-pagination {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 36px !important;
    padding: 2px 0 !important;
    border-top: none !important;
  }
}

/* v105: scope the customers page to the viewport so the card can fill to the
   shell footer without the whole main area scrolling. The shell topbar is
   56px, footer 37px, and main content sits between them. We pin the
   customers-page height to the remaining viewport and let the card flex-fill
   inside it; the table wrap scrolls internally. */
@media (min-width: 769px) {
  html:has(.customers-page) body,
  body:has(.customers-page) {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-shell:has(.customers-page) .main,
  body:has(.customers-page) .main {
    min-height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-shell:has(.customers-page) .content,
  body:has(.customers-page) .content,
  .app-shell:has(.customers-page) #mainContent,
  body:has(.customers-page) #mainContent {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
  /* modal container must not consume flex space when empty */
  .app-shell:has(.customers-page) .content > #modalContainer,
  body:has(.customers-page) #modalContainer {
    display: none;
  }
  .app-shell:has(.customers-page) .customers-page,
  body:has(.customers-page) .customers-page {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
  }
  /* card fills remaining page height; no redundant margin (page padding
     provides the bottom gap above the footer) */
  .app-shell:has(.customers-page) .customers-table-card,
  body:has(.customers-page) .customers-table-card,
  .app-shell:has(.customers-page) .customers-directory-card,
  body:has(.customers-page) .customers-directory-card {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
  }
}

/* Frozen Sticky Header (100% Opaque Across All 5 Themes) */
.customers-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: var(--color-surface-subtle, #f8fafc) !important;
}

[data-theme="dark"] .customers-table thead th,
body.dark-mode .customers-table thead th {
  background: var(--dark-bg-elevated, #1a2234) !important;
  color: var(--dark-text-secondary, #94a3b8) !important;
  border-bottom-color: var(--dark-border, #2d3748) !important;
}

/* Crisp Category Header Badges in Light and Dark Mode */
.category-header-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  vertical-align: middle;
  margin-left: 8px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Light Mode Badges */
.category-badge-all {
  background: rgba(100, 116, 139, 0.12);
  color: #334155 !important;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.category-badge-online {
  background: rgba(16, 185, 129, 0.12);
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-badge-offline {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c !important;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.category-badge-due {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.category-badge-expired {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c !important;
  border: 1px solid rgba(225, 29, 72, 0.28);
}

.category-badge-suspended {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9 !important;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

/* Dark Mode Badges (Overriding .page-title #f8fafc) */
[data-theme="dark"] .category-badge-all,
body.dark-mode .category-badge-all {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

[data-theme="dark"] .category-badge-online,
body.dark-mode .category-badge-online {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
}

[data-theme="dark"] .category-badge-offline,
body.dark-mode .category-badge-offline {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.35) !important;
}

[data-theme="dark"] .category-badge-due,
body.dark-mode .category-badge-due {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
}

[data-theme="dark"] .category-badge-expired,
body.dark-mode .category-badge-expired {
  background: rgba(225, 29, 72, 0.18) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(251, 113, 133, 0.35) !important;
}

[data-theme="dark"] .category-badge-suspended,
body.dark-mode .category-badge-suspended {
  background: rgba(124, 58, 237, 0.18) !important;
  color: #a78bfa !important;
  border: 1px solid rgba(167, 139, 250, 0.35) !important;
}

/* Monospace IP & Subtle Pool Shift Cue */
.cust-ip-val {
  font-family: var(--font-mono);
  font-size: 12px;
}

.cust-ip-pool-shifted {
  color: #e11d48;
  font-weight: 500;
}

[data-theme="dark"] .cust-ip-pool-shifted,
body.dark-mode .cust-ip-pool-shifted {
  color: #fb7185 !important;
}

.cust-pool-cue {
  display: inline-block;
  margin-left: 3px;
  font-weight: bold;
  color: #e11d48;
}

[data-theme="dark"] .cust-pool-cue,
body.dark-mode .cust-pool-cue {
  color: #fb7185 !important;
}

/* ==========================================================================
   RELEASE v105: COLUMN BALANCE + CLEARANCE + VIEWPORT-FILL EMPIRICAL REMEDIATION
   ========================================================================== */

/* v105 Problem 2: PPPoE badge must never overflow its column into IP ADDRESS.
   Clamp to column width with ellipsis; cell clips any residual overflow. */
.customers-table td.col-pppoe,
.customers-table th.col-pppoe {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-pppoe-user,
.customers-table .customer-pppoe-user {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  box-sizing: border-box;
}

/* v105 Problem 2: equal, crisp gutters between every column (was 10px L + 10px R
   of unequal effective spacing). Enforce a consistent 12px visual breathing room
   by giving each content column 6px left + 6px right padding, with first/last
   columns keeping their edge padding. */
.customers-table th,
.customers-table td {
  padding: 10px 8px;
}
.customers-table th.col-customer,
.customers-table td.col-customer {
  padding-left: 16px !important;
  padding-right: 8px !important;
}
.customers-table th.col-actions,
.customers-table td.col-actions {
  padding-right: 16px !important;
  padding-left: 8px !important;
}

/* v105 Problem 2: CUSTOMER column clamp — full name + group badge fit without
   leaving a dead void, ellipsis on overflow so it never starves PPPOE. */
.customers-table .customer-name-text,
.customers-table .customer-name-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customers-table .customer-identity-stack {
  max-width: 100%;
  overflow: hidden;
}
.customers-table .customer-name-line {
  max-width: 100%;
  min-width: 0;
}

/* v105 Problem 2: SPEED pill right edge must clear AREA pill left edge.
   Speed pill is inline-flex; keep it inside its cell and let cell clip. */
.customers-table td.col-speed,
.customers-table th.col-speed,
.customers-table td.col-area,
.customers-table th.col-area {
  overflow: hidden;
}
.customers-table .speed-badge {
  max-width: 100%;
  box-sizing: border-box;
}

/* v105 Problem 2: IP ADDRESS is monospace — keep it from forcing column wider
   than its share; ellipsis with title tooltip preserved on the span. */
.customers-table td.col-ip,
.customers-table th.col-ip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customers-table .cust-ip-val {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* v106 Problem 3: Groups / Areas registry — zero horizontal overflow, no clipped
   Delete button, no clipped currency glyph. Single measured colgroup is set in JS;
   here we enforce table width + clip behaviour so actions never push past edge. */
.groups-table,
.areas-table,
table.groups-table,
table.areas-table,
.groups-table-card table,
.areas-table-card table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
.groups-table th,
.groups-table td,
.areas-table th,
.areas-table td {
  padding: 8px 6px !important;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* Headers must never clip: allow adequate width so text fits unclipped */
.groups-table th,
.areas-table th {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: center;
}
/* Actions header right-aligned over the action cluster */
.groups-table th.col-actions,
.areas-table th.col-actions {
  text-align: right !important;
  padding-right: 16px !important;
}
/* Currency cell must show full ৳ amount, never clip left edge */
.groups-table td.col-monthly,
.areas-table td.col-monthly,
.groups-table td[data-label="Monthly Value"],
.areas-table td[data-label="Monthly Value"] {
  overflow: visible !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
  padding: 0 12px !important;
}
/* Actions cell: keep buttons fully visible inside .col-actions with clearance */
.groups-table td.col-actions,
.areas-table td.col-actions,
.groups-table td:last-child,
.areas-table td:last-child {
  overflow: visible !important;
  white-space: nowrap !important;
  padding-right: 0 !important;
}
.groups-table .table-actions,
.areas-table .table-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  padding-right: 6px !important;
  box-sizing: border-box !important;
}
.groups-table .table-actions .btn,
.areas-table .table-actions .btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  padding: 3px 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}
/* keep row actions inside the cell box */
.groups-table .table-actions .btn svg,
.areas-table .table-actions .btn svg {
  flex-shrink: 0;
}

/* ============================================================================
 * MASTER RELEASE v109: Network Usage Studio Table Polish & Theme Alignment
 * ============================================================================ */

#networkStudioTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 860px;
}

#networkStudioTable thead th,
#networkStudioTable tbody td {
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  vertical-align: middle !important;
}

#networkStudioTable thead th.text-left,
#networkStudioTable tbody td.text-left {
  text-align: left !important;
}

#networkStudioTable thead th.text-right,
#networkStudioTable tbody td.text-right {
  text-align: right !important;
}

#networkStudioTable thead th.text-center,
#networkStudioTable tbody td.text-center {
  text-align: center !important;
}

/* Bandwidth Download / Upload Pill Alignment (0px drift with th header) */
.report-bw-pills-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.report-bw-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

.report-bw-pill--dl {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid rgba(4, 120, 87, 0.15) !important;
}

.report-bw-pill--ul {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid rgba(29, 78, 216, 0.15) !important;
}

/* Dark Mode Parity across all 5 themes */
[data-theme="dark"] .report-bw-pill--dl,
body.dark-mode .report-bw-pill--dl {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-theme="dark"] .report-bw-pill--ul,
body.dark-mode .report-bw-pill--ul {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.25) !important;
}

[data-theme="dark"] #networkStudioTable thead th,
body.dark-mode #networkStudioTable thead th {
  background: var(--dark-bg-surface, #1e293b) !important;
  color: var(--dark-text-muted, #94a3b8) !important;
  border-bottom: 1px solid var(--dark-border, #334155) !important;
}

[data-theme="dark"] #networkStudioTable tbody td,
body.dark-mode #networkStudioTable tbody td {
  color: var(--dark-text-primary, #f1f5f9) !important;
  border-bottom: 1px solid var(--dark-border, #334155) !important;
}

[data-theme="dark"] #networkStudioTable tbody tr:hover td,
body.dark-mode #networkStudioTable tbody tr:hover td {
  background: var(--dark-bg-hover, rgba(255, 255, 255, 0.03)) !important;
}

[data-theme="dark"] .report-customer-link,
body.dark-mode .report-customer-link,
[data-theme="dark"] .report-customer-name,
body.dark-mode .report-customer-name,
[data-theme="dark"] .report-total-bytes,
body.dark-mode .report-total-bytes,
[data-theme="dark"] .report-tj-code,
body.dark-mode .report-tj-code,
[data-theme="dark"] .report-tj-ports-val,
body.dark-mode .report-tj-ports-val {
  color: var(--dark-text-primary, #f8fafc) !important;
}

[data-theme="dark"] .report-package-name,
body.dark-mode .report-package-name,
[data-theme="dark"] .report-tj-name,
body.dark-mode .report-tj-name {
  color: var(--dark-text-secondary, #cbd5e1) !important;
}

[data-theme="dark"] .report-session-count,
body.dark-mode .report-session-count,
[data-theme="dark"] .report-pop-name,
body.dark-mode .report-pop-name,
[data-theme="dark"] .report-pppoe-ip,
body.dark-mode .report-pppoe-ip,
[data-theme="dark"] .report-sync-hint,
body.dark-mode .report-sync-hint {
  color: var(--dark-text-muted, #94a3b8) !important;
}




/* ============================================================
   Release v112: Communication Gateways & Administration 4K Parity
   ============================================================ */
.comm-studio-page {
  max-width: 1440px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .comm-studio-page .inv-table-card,
body.dark-mode .comm-studio-page .inv-table-card,
[data-theme="dark"] .comm-studio-page .inv-kpi-card,
body.dark-mode .comm-studio-page .inv-kpi-card,
[data-theme="dark"] .gwc-card,
body.dark-mode .gwc-card {
  background: var(--dark-bg-surface, #111827) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] .comm-studio-page .inv-kpi-val,
body.dark-mode .comm-studio-page .inv-kpi-val,
[data-theme="dark"] .comm-studio-page .inv-page-title,
body.dark-mode .comm-studio-page .inv-page-title,
[data-theme="dark"] .comm-gw-channel-name,
body.dark-mode .comm-gw-channel-name {
  color: #f8fafc !important;
}

[data-theme="dark"] .comm-studio-page .inv-kpi-label,
body.dark-mode .comm-studio-page .inv-kpi-label,
[data-theme="dark"] .comm-studio-page .inv-page-subtitle,
body.dark-mode .comm-studio-page .inv-page-subtitle,
[data-theme="dark"] .comm-gw-channel-sub,
body.dark-mode .comm-gw-channel-sub {
  color: #94a3b8 !important;
}

[data-theme="dark"] #btnGlobalGuardrails,
body.dark-mode #btnGlobalGuardrails {
  background: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border-strong, rgba(148, 163, 184, 0.25)) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] #btnGlobalGuardrails:hover,
body.dark-mode #btnGlobalGuardrails:hover {
  background: var(--dark-bg-hover, #334155) !important;
}

[data-theme="dark"] .comm-endpoint-chip,
body.dark-mode .comm-endpoint-chip {
  background: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.18)) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #commGwTable tbody tr:hover td,
body.dark-mode #commGwTable tbody tr:hover td {
  background: var(--dark-bg-subtle, #161f33) !important;
}

[data-theme="dark"] #commGwTable .fld-badge.emerald,
body.dark-mode #commGwTable .fld-badge.emerald {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] #commGwTable .fld-badge.slate,
body.dark-mode #commGwTable .fld-badge.slate {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}



/* ============================================================
   Release v112 Refinement: Dark Mode Table Parity & 4K Centering
   ============================================================ */
[data-theme="dark"] .inv-table-wrap,
body.dark-mode .inv-table-wrap,
[data-theme="dark"] .comm-studio-page .inv-table-wrap,
body.dark-mode .comm-studio-page .inv-table-wrap {
  background: var(--dark-bg-surface, #111827) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] #commGwTable,
body.dark-mode #commGwTable,
[data-theme="dark"] #commGwTable tbody,
body.dark-mode #commGwTable tbody,
[data-theme="dark"] #commGwTable tbody tr,
body.dark-mode #commGwTable tbody tr,
[data-theme="dark"] #commGwTable tbody td,
body.dark-mode #commGwTable tbody td {
  background: var(--dark-bg-surface, #111827) !important;
  color: #e2e8f0 !important;
  border-bottom-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}

[data-theme="dark"] #commGwTable tbody tr:hover td,
body.dark-mode #commGwTable tbody tr:hover td {
  background: var(--dark-bg-subtle, #161f33) !important;
}

[data-theme="dark"] #commGwTable thead th,
body.dark-mode #commGwTable thead th {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid var(--dark-border, rgba(148, 163, 184, 0.18)) !important;
}

/* 4K Ultra-Wide Centering override for Administration & Field pages */
@media (min-width: 1441px) {
  html body #mainContent > div.sched-canvas,
  html body #mainContent > div.comm-studio-page,
  html body #mainContent > div.service-control-page,
  html body #mainContent > div.stg-canvas,
  html body #mainContent > div.fld-mnt-container,
  html body #mainContent > div.billing-settings-page,
  body #mainContent > div.sched-canvas,
  body #mainContent > div.comm-studio-page,
  body #mainContent > div.service-control-page,
  body #mainContent > div.stg-canvas,
  body #mainContent > div.fld-mnt-container,
  body #mainContent > div.billing-settings-page,
  #mainContent > .sched-canvas,
  #mainContent > .comm-studio-page,
  #mainContent > .service-control-page,
  #mainContent > .stg-canvas,
  #mainContent > .fld-mnt-container,
  #mainContent > .billing-settings-page,
  .sched-canvas,
  .comm-studio-page,
  .service-control-page,
  .stg-canvas,
  .fld-mnt-container,
  .billing-settings-page {
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}



/* =============================================================================
   RELEASE v115 MASTER UI SUITE:
   GLOBAL DARK-MODE WHITE-FLASH ERADICATION • 3 UNSTYLED BUTTON SETS POLISH •
   DASHBOARD CONTRAST & COBALT LEAK FIX • 4K ULTRA-WIDE CONTENT CENTERING
   ============================================================================= */

/* Part 1.1: KPI Cards, Filter Cards & Modals Dark Mode Harmonization */
[data-theme="dark"] .inv-kpi-card,
body.dark-mode .inv-kpi-card,
[data-theme="dark"] .inv-filter-card,
body.dark-mode .inv-filter-card,
[data-theme="dark"] .report-modal-card,
body.dark-mode .report-modal-card {
  background: var(--dark-bg-surface, #111827) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
  color: var(--color-text, #f8fafc) !important;
}

[data-theme="dark"] .inv-filter-card input,
body.dark-mode .inv-filter-card input,
[data-theme="dark"] .inv-filter-card select,
body.dark-mode .inv-filter-card select {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.20)) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .inv-kpi-label,
body.dark-mode .inv-kpi-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .inv-kpi-value,
body.dark-mode .inv-kpi-value {
  color: #f8fafc !important;
}

/* Part 1.2: Global Dark-Mode Translucent Tinted Badges Palette */
[data-theme="dark"] .inv-badge.emerald, body.dark-mode .inv-badge.emerald,
[data-theme="dark"] .inv-status-pill.emerald, body.dark-mode .inv-status-pill.emerald,
[data-theme="dark"] .inv-health-pill.emerald, body.dark-mode .inv-health-pill.emerald,
[data-theme="dark"] .inv-type-pill.emerald, body.dark-mode .inv-type-pill.emerald,
[data-theme="dark"] .inv-po-status-pill.emerald, body.dark-mode .inv-po-status-pill.emerald,
[data-theme="dark"] .inv-kpi-pill.emerald, body.dark-mode .inv-kpi-pill.emerald,
[data-theme="dark"] .fld-badge.emerald, body.dark-mode .fld-badge.emerald,
[data-theme="dark"] .fld-status-pill.emerald, body.dark-mode .fld-status-pill.emerald,
[data-theme="dark"] .fld-type-pill.emerald, body.dark-mode .fld-type-pill.emerald,
[data-theme="dark"] .fld-priority-pill.emerald, body.dark-mode .fld-priority-pill.emerald,
[data-theme="dark"] .inv-badge.green, body.dark-mode .inv-badge.green,
[data-theme="dark"] .fld-badge.green, body.dark-mode .fld-badge.green {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.32) !important;
}

[data-theme="dark"] .inv-badge.blue, body.dark-mode .inv-badge.blue,
[data-theme="dark"] .inv-status-pill.blue, body.dark-mode .inv-status-pill.blue,
[data-theme="dark"] .inv-health-pill.blue, body.dark-mode .inv-health-pill.blue,
[data-theme="dark"] .inv-type-pill.blue, body.dark-mode .inv-type-pill.blue,
[data-theme="dark"] .inv-po-status-pill.blue, body.dark-mode .inv-po-status-pill.blue,
[data-theme="dark"] .inv-kpi-pill.blue, body.dark-mode .inv-kpi-pill.blue,
[data-theme="dark"] .fld-badge.blue, body.dark-mode .fld-badge.blue,
[data-theme="dark"] .fld-status-pill.blue, body.dark-mode .fld-status-pill.blue,
[data-theme="dark"] .fld-type-pill.blue, body.dark-mode .fld-type-pill.blue,
[data-theme="dark"] .fld-priority-pill.blue, body.dark-mode .fld-priority-pill.blue {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(37, 99, 235, 0.32) !important;
}

[data-theme="dark"] .inv-badge.indigo, body.dark-mode .inv-badge.indigo,
[data-theme="dark"] .inv-status-pill.indigo, body.dark-mode .inv-status-pill.indigo,
[data-theme="dark"] .inv-health-pill.indigo, body.dark-mode .inv-health-pill.indigo,
[data-theme="dark"] .inv-type-pill.indigo, body.dark-mode .inv-type-pill.indigo,
[data-theme="dark"] .inv-po-status-pill.indigo, body.dark-mode .inv-po-status-pill.indigo,
[data-theme="dark"] .inv-kpi-pill.indigo, body.dark-mode .inv-kpi-pill.indigo,
[data-theme="dark"] .fld-badge.indigo, body.dark-mode .fld-badge.indigo,
[data-theme="dark"] .fld-status-pill.indigo, body.dark-mode .fld-status-pill.indigo,
[data-theme="dark"] .fld-type-pill.indigo, body.dark-mode .fld-type-pill.indigo,
[data-theme="dark"] .fld-priority-pill.indigo, body.dark-mode .fld-priority-pill.indigo {
  background: rgba(99, 102, 241, 0.16) !important;
  color: #a5b4fc !important;
  border: 1px solid rgba(99, 102, 241, 0.32) !important;
}

[data-theme="dark"] .inv-badge.amber, body.dark-mode .inv-badge.amber,
[data-theme="dark"] .inv-status-pill.amber, body.dark-mode .inv-status-pill.amber,
[data-theme="dark"] .inv-health-pill.amber, body.dark-mode .inv-health-pill.amber,
[data-theme="dark"] .inv-type-pill.amber, body.dark-mode .inv-type-pill.amber,
[data-theme="dark"] .inv-po-status-pill.amber, body.dark-mode .inv-po-status-pill.amber,
[data-theme="dark"] .inv-kpi-pill.amber, body.dark-mode .inv-kpi-pill.amber,
[data-theme="dark"] .fld-badge.amber, body.dark-mode .fld-badge.amber,
[data-theme="dark"] .fld-status-pill.amber, body.dark-mode .fld-status-pill.amber,
[data-theme="dark"] .fld-type-pill.amber, body.dark-mode .fld-type-pill.amber,
[data-theme="dark"] .fld-priority-pill.amber, body.dark-mode .fld-priority-pill.amber {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
}

[data-theme="dark"] .inv-badge.rose, body.dark-mode .inv-badge.rose,
[data-theme="dark"] .inv-status-pill.rose, body.dark-mode .inv-status-pill.rose,
[data-theme="dark"] .inv-health-pill.rose, body.dark-mode .inv-health-pill.rose,
[data-theme="dark"] .inv-type-pill.rose, body.dark-mode .inv-type-pill.rose,
[data-theme="dark"] .inv-po-status-pill.rose, body.dark-mode .inv-po-status-pill.rose,
[data-theme="dark"] .inv-kpi-pill.rose, body.dark-mode .inv-kpi-pill.rose,
[data-theme="dark"] .fld-badge.rose, body.dark-mode .fld-badge.rose,
[data-theme="dark"] .fld-status-pill.rose, body.dark-mode .fld-status-pill.rose,
[data-theme="dark"] .fld-type-pill.rose, body.dark-mode .fld-type-pill.rose,
[data-theme="dark"] .fld-priority-pill.rose, body.dark-mode .fld-priority-pill.rose,
[data-theme="dark"] .inv-badge.red, body.dark-mode .inv-badge.red,
[data-theme="dark"] .fld-badge.red, body.dark-mode .fld-badge.red {
  background: rgba(244, 63, 94, 0.16) !important;
  color: #fda4af !important;
  border: 1px solid rgba(244, 63, 94, 0.32) !important;
}

[data-theme="dark"] .inv-badge.purple, body.dark-mode .inv-badge.purple,
[data-theme="dark"] .inv-status-pill.purple, body.dark-mode .inv-status-pill.purple,
[data-theme="dark"] .inv-health-pill.purple, body.dark-mode .inv-health-pill.purple,
[data-theme="dark"] .inv-type-pill.purple, body.dark-mode .inv-type-pill.purple,
[data-theme="dark"] .inv-po-status-pill.purple, body.dark-mode .inv-po-status-pill.purple,
[data-theme="dark"] .inv-kpi-pill.purple, body.dark-mode .inv-kpi-pill.purple,
[data-theme="dark"] .fld-badge.purple, body.dark-mode .fld-badge.purple,
[data-theme="dark"] .fld-status-pill.purple, body.dark-mode .fld-status-pill.purple,
[data-theme="dark"] .fld-type-pill.purple, body.dark-mode .fld-type-pill.purple,
[data-theme="dark"] .fld-priority-pill.purple, body.dark-mode .fld-priority-pill.purple {
  background: rgba(168, 85, 247, 0.16) !important;
  color: #d8b4fe !important;
  border: 1px solid rgba(168, 85, 247, 0.32) !important;
}

[data-theme="dark"] .inv-badge.slate, body.dark-mode .inv-badge.slate,
[data-theme="dark"] .inv-status-pill.slate, body.dark-mode .inv-status-pill.slate,
[data-theme="dark"] .inv-health-pill.slate, body.dark-mode .inv-health-pill.slate,
[data-theme="dark"] .inv-type-pill.slate, body.dark-mode .inv-type-pill.slate,
[data-theme="dark"] .inv-po-status-pill.slate, body.dark-mode .inv-po-status-pill.slate,
[data-theme="dark"] .inv-kpi-pill.slate, body.dark-mode .inv-kpi-pill.slate,
[data-theme="dark"] .fld-badge.slate, body.dark-mode .fld-badge.slate,
[data-theme="dark"] .fld-status-pill.slate, body.dark-mode .fld-status-pill.slate,
[data-theme="dark"] .fld-type-pill.slate, body.dark-mode .fld-type-pill.slate,
[data-theme="dark"] .fld-priority-pill.slate, body.dark-mode .fld-priority-pill.slate {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .inv-count-badge, body.dark-mode .inv-count-badge,
[data-theme="dark"] .inv-cat-pill, body.dark-mode .inv-cat-pill,
[data-theme="dark"] .pkg-count-pill, body.dark-mode .pkg-count-pill,
[data-theme="dark"] .pkg-kpi-ribbon-pill, body.dark-mode .pkg-kpi-ribbon-pill {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

/* Guardrail 3: Crisp translucent rose for suspended pool-badge in dark mode */
[data-theme="dark"] .pool-badge,
body.dark-mode .pool-badge {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

/* Support tickets category & SMS pills in dark mode */
[data-theme="dark"] .supt-clean-cat-badge,
body.dark-mode .supt-clean-cat-badge {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .supt-sms-pill,
body.dark-mode .supt-sms-pill {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .supt-sms-pill-muted,
body.dark-mode .supt-sms-pill-muted {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

/* Part 1.3: Dashboard Contrast & Customer Profile Theme Tokens */
[data-theme="dark"] .dash-fleet-pill.is-offline,
body.dark-mode .dash-fleet-pill.is-offline {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.40) !important;
  color: #fca5a5 !important;
}
[data-theme="dark"] .dash-fleet-pill.is-offline .fleet-pill-text,
body.dark-mode .dash-fleet-pill.is-offline .fleet-pill-text {
  color: #fca5a5 !important;
}

[data-theme="dark"] .dash-fleet-pill.is-degraded,
body.dark-mode .dash-fleet-pill.is-degraded {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.40) !important;
  color: #fcd34d !important;
}
[data-theme="dark"] .dash-fleet-pill.is-degraded .fleet-pill-text,
body.dark-mode .dash-fleet-pill.is-degraded .fleet-pill-text {
  color: #fcd34d !important;
}

[data-theme="dark"] .custprofile-hero-actions .btn-hero-adjust,
body.dark-mode .custprofile-hero-actions .btn-hero-adjust {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: #f8fafc !important;
  border: 1px solid var(--dark-border-strong, rgba(148, 163, 184, 0.25)) !important;
}
[data-theme="dark"] .custprofile-hero-actions .btn-hero-adjust:hover,
body.dark-mode .custprofile-hero-actions .btn-hero-adjust:hover {
  background: var(--dark-bg-hover, #261922) !important;
  border-color: var(--color-brand, #e11d48) !important;
}

/* Part 2: 3 Polished Button Sets */

/* 2.1: /customers/new Stepper */
.wizard-stepper {
  display: inline-flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  background: var(--color-bg-secondary, #f1f5f9) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 16px 0 24px !important;
}
.wizard-stepper::before {
  display: none !important;
}

.wizard-step-item {
  position: relative !important;
  z-index: 2 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--color-text-secondary, #64748b) !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}
.wizard-step-item:hover {
  color: var(--color-text, #0f172a) !important;
  background: rgba(0, 0, 0, 0.04) !important;
}
.wizard-step-item.active {
  background: var(--color-surface, #ffffff) !important;
  color: var(--color-brand, #2563eb) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}
.wizard-step-item.completed {
  color: var(--color-text, #0f172a) !important;
}

.wizard-step-circle {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: rgba(148, 163, 184, 0.2) !important;
  border: none !important;
  color: var(--color-text-secondary, #64748b) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}
.wizard-step-item.active .wizard-step-circle {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
}
.wizard-step-item.completed .wizard-step-circle {
  background: var(--color-success, #10b981) !important;
  color: #ffffff !important;
}
.wizard-step-title {
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
.wizard-step-item.active .wizard-step-title {
  color: var(--color-brand, #2563eb) !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .wizard-stepper,
body.dark-mode .wizard-stepper {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}
[data-theme="dark"] .wizard-step-item:hover,
body.dark-mode .wizard-step-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .wizard-step-item.active,
body.dark-mode .wizard-step-item.active {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: #f8fafc !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.30) !important;
}
[data-theme="dark"] .wizard-step-item.completed,
body.dark-mode .wizard-step-item.completed {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .wizard-step-circle,
body.dark-mode .wizard-step-circle {
  background: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}
[data-theme="dark"] .wizard-step-item.active .wizard-step-circle,
body.dark-mode .wizard-step-item.active .wizard-step-circle {
  background: var(--color-brand, #2563eb) !important;
  color: #ffffff !important;
}
[data-theme="dark"] .wizard-step-item.completed .wizard-step-circle,
body.dark-mode .wizard-step-item.completed .wizard-step-circle {
  background: #10b981 !important;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .wizard-stepper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 4px !important;
    width: 100% !important;
  }
  .wizard-step-item {
    flex: 1 1 calc(50% - 6px) !important;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    justify-content: flex-start !important;
  }
}

/* 2.2: /customers/:id Protocol Selector */
.mgmt-proto-toggle {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--color-bg-secondary, #f1f5f9) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 8px !important;
  padding: 3px !important;
  gap: 3px !important;
  height: 38px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
.mgmt-proto-btn {
  flex: 1 !important;
  height: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  background: transparent !important;
  color: var(--color-text-muted, #64748b) !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}
.mgmt-proto-btn:hover {
  color: var(--color-text, #0f172a) !important;
}
.mgmt-proto-btn.active {
  background: var(--color-surface, #ffffff) !important;
  color: var(--color-brand, #2563eb) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .mgmt-proto-toggle,
body.dark-mode .mgmt-proto-toggle {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}
[data-theme="dark"] .mgmt-proto-btn,
body.dark-mode .mgmt-proto-btn {
  color: #94a3b8 !important;
}
[data-theme="dark"] .mgmt-proto-btn:hover,
body.dark-mode .mgmt-proto-btn:hover {
  color: #f8fafc !important;
}
[data-theme="dark"] .mgmt-proto-btn.active,
body.dark-mode .mgmt-proto-btn.active {
  background: var(--dark-bg-elevated, #1e293b) !important;
  color: #f8fafc !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

/* 2.3: /support/tickets/new Priority Toggle */
.supt-priority-segmented {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: var(--color-bg-secondary, #f1f5f9) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 10px !important;
  padding: 4px !important;
  height: 40px !important;
  box-sizing: border-box !important;
}
.supt-prio-seg-btn {
  flex: 1 !important;
  height: 32px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  padding: 7px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-text-secondary, #64748b) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}
.supt-prio-seg-btn:hover {
  color: var(--color-text, #0f172a) !important;
  background: rgba(255, 255, 255, 0.5) !important;
}
.supt-prio-seg-btn.active[data-priority="normal"] {
  background: #ffffff !important;
  border-color: #93c5fd !important;
  color: #2563eb !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15) !important;
}
.supt-prio-seg-btn.active[data-priority="high"] {
  background: #ffffff !important;
  border-color: #fde68a !important;
  color: #d97706 !important;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.15) !important;
}
.supt-prio-seg-btn.active[data-priority="critical"] {
  background: #ffffff !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.15) !important;
}

[data-theme="dark"] .supt-priority-segmented,
body.dark-mode .supt-priority-segmented {
  background: var(--dark-bg-subtle, #161f33) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.14)) !important;
}
[data-theme="dark"] .supt-prio-seg-btn,
body.dark-mode .supt-prio-seg-btn {
  color: #94a3b8 !important;
}
[data-theme="dark"] .supt-prio-seg-btn:hover,
body.dark-mode .supt-prio-seg-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .supt-prio-seg-btn.active[data-priority="normal"],
body.dark-mode .supt-prio-seg-btn.active[data-priority="normal"] {
  background: rgba(37, 99, 235, 0.20) !important;
  border-color: rgba(37, 99, 235, 0.45) !important;
  color: #60a5fa !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}
[data-theme="dark"] .supt-prio-seg-btn.active[data-priority="high"],
body.dark-mode .supt-prio-seg-btn.active[data-priority="high"] {
  background: rgba(245, 158, 11, 0.20) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fbbf24 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}
[data-theme="dark"] .supt-prio-seg-btn.active[data-priority="critical"],
body.dark-mode .supt-prio-seg-btn.active[data-priority="critical"] {
  background: rgba(225, 29, 72, 0.20) !important;
  border-color: rgba(225, 29, 72, 0.45) !important;
  color: #fb7185 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

/* Part 3: 4K Ultra-Wide Content Centering with Full-Width Topbar & Shell-Footer */
@media (min-width: 1920px) {
  #mainContent {
    max-width: 1680px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
}

/* Release v122: Single-chevron custom select styling for Billing Settings */
.billing-settings-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  cursor: pointer !important;
}
.billing-settings-select::-ms-expand {
  display: none !important;
}
[data-theme="dark"] .billing-settings-select,
body.dark-mode .billing-settings-select {
  background-color: var(--dark-bg-elevated, #1e293b) !important;
  border-color: var(--dark-border, rgba(148, 163, 184, 0.2)) !important;
  color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* ==========================================================================
