@import url('_design-tokens.css');

/* ============================================================
   TSMS Global Design System — BOLD EDITION
   Distinctive mission-control aesthetic with deep navy-to-indigo
   gradients inspired by modern admin dashboards.
   Unified across all modules: service-calls, billing, payroll,
   finance, employees, reports, and gatepass.
   Tokens are imported from _design-tokens.css; only dark-mode
   overrides and Nexus-specific accents remain here.
   ============================================================ */

/* Dark mode overrides for Nexus-specific tokens.
   Primary mechanism: html[data-theme="dark"]
   Fallbacks: html.theme-dark, body.dark-mode */
html[data-theme="dark"],
html.theme-dark,
body.dark-mode {
  --nexus-surface: #1e293b;
  --nexus-muted: #94a3b8;
  --nexus-border: #334155;
  --nexus-accent: #3b82f6;
  --kinpaku-gold: oklch(84% 0.19 80.46);
  --kinpaku-gold-dim: oklch(77% 0.14 82);
  --verdigris-patina: oklch(70% 0.12 188);
  --lacquer-deep: oklch(4% 0.004 95);
  --champagne: oklch(84% 0.035 82);
}

/* Light mode page background — single source used by all layouts that load this file */
body:not(.dark-mode),
body:not(.dark-mode) .page,
body:not(.dark-mode) .page-wrapper {
  background-color: #eef2f6;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes tsmsFadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tsmsPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}
@keyframes tsmsSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nexus-animate {
  animation: tsmsFadeInUp 0.5s ease-out forwards;
  opacity: 0;
}
.nexus-animate-1 { animation-delay: 0.05s; }
.nexus-animate-2 { animation-delay: 0.12s; }
.nexus-animate-3 { animation-delay: 0.20s; }
.nexus-animate-4 { animation-delay: 0.28s; }
.nexus-animate-5 { animation-delay: 0.36s; }

/* ============================================================
   SIDEBAR COLLAPSE
   ============================================================ */
@media (min-width: 992px) {
  body.sidebar-collapsed aside.main-sidebar,
  body.sidebar-collapsed aside.navbar-vertical,
  body.sidebar-collapsed .main-sidebar,
  body.sidebar-collapsed .navbar-vertical {
    display: none !important;
  }
  body.sidebar-collapsed .page-vertical-menu > header.navbar {
    margin: 0 0.0625rem 0 0.0625rem;
    width: auto;
    border-radius: 0 0 var(--nexus-radius-lg) var(--nexus-radius-lg);
  }
  body.sidebar-collapsed .page-vertical-menu > .page-wrapper {
    margin: 0 0.0625rem 0 0.0625rem;
    width: auto;
    max-width: none;
    overflow-x: hidden;
  }
  body.sidebar-collapsed .page {
    display: flex !important;
  }
}

/* ============================================================
   MOBILE SIDEBAR DRAWER
   ============================================================ */
@media (max-width: 991.98px) {
  .navbar-vertical,
  .main-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    max-width: 80vw !important;
    z-index: 1080 !important;
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    will-change: transform, opacity !important;
    transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    align-items: stretch !important;
    border-radius: 0 !important;
  }

  .navbar-vertical .container-fluid,
  .main-sidebar .container-fluid {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
  }

  .navbar-vertical .navbar-brand,
  .main-sidebar .navbar-brand {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .navbar-vertical .navbar-toggler,
  .main-sidebar .navbar-toggler {
    display: none !important;
  }

  body.mobile-sidebar-open .navbar-vertical,
  body.mobile-sidebar-open .main-sidebar {
    transform: translateX(0) !important;
    opacity: 1 !important;
  }

  body.mobile-sidebar-open .navbar-vertical .navbar-collapse,
  body.mobile-sidebar-open .navbar-vertical .navbar-collapse.collapse,
  body.mobile-sidebar-open .navbar-vertical .navbar-collapse.collapse:not(.show),
  body.mobile-sidebar-open .main-sidebar .navbar-collapse,
  body.mobile-sidebar-open .main-sidebar .navbar-collapse.collapse,
  body.mobile-sidebar-open .main-sidebar .navbar-collapse.collapse:not(.show) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
  }

  body.mobile-sidebar-open .navbar-vertical .nav-link,
  body.mobile-sidebar-open .main-sidebar .nav-link,
  body.mobile-sidebar-open .navbar-vertical .navbar-nav .nav-link,
  body.mobile-sidebar-open .main-sidebar .navbar-nav .nav-link {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    gap: 0.75rem !important;
    min-height: 44px !important;
    min-width: 44px !important;
  }

  body.mobile-sidebar-open .navbar-vertical .nav-link .nav-link-title,
  body.mobile-sidebar-open .main-sidebar .nav-link .nav-link-title,
  body.mobile-sidebar-open .navbar-vertical .navbar-nav .nav-link .nav-link-title,
  body.mobile-sidebar-open .main-sidebar .navbar-nav .nav-link .nav-link-title,
  body.mobile-sidebar-open .navbar-vertical .nav-link p,
  body.mobile-sidebar-open .main-sidebar .nav-link p,
  body.mobile-sidebar-open .navbar-vertical .navbar-nav .nav-link p,
  body.mobile-sidebar-open .main-sidebar .navbar-nav .nav-link p {
    display: inline-block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: inherit !important;
    font-size: 0.9rem !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body.mobile-sidebar-open .navbar-vertical .nav-title,
  body.mobile-sidebar-open .main-sidebar .nav-title,
  body.mobile-sidebar-open .navbar-vertical .navbar-nav .nav-title,
  body.mobile-sidebar-open .main-sidebar .navbar-nav .nav-title {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* ============================================================
   HERO HEADER
   ============================================================ */
.card.nexus-hero-header {
  display: flex !important;
  flex-direction: row !important;
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
  border-radius: var(--nexus-radius-lg);
  padding: 1.5rem 1.75rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  box-shadow: var(--nexus-shadow-lg);
  position: relative;
  overflow: hidden;
  border: none;
}
.card.nexus-hero-header h1,
.card.nexus-hero-header h2,
.card.nexus-hero-header h3 {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  position: relative;
  z-index: var(--tsms-z-base);
}
.card.nexus-hero-header .nexus-hero-sub,
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item,
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item a,
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item.active {
  color: #c8d2dc;
}
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item a:hover {
  color: #ffffff;
}
.card.nexus-hero-header .nexus-hero-body {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  gap: 0.75rem;
  position: relative;
  z-index: var(--tsms-z-base);
  background: transparent !important;
  width: 100%;
}
.card.nexus-hero-header .nexus-hero-icon-col {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 2.5rem;
  align-self: stretch;
}
.card.nexus-hero-header .nexus-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(245,158,11,0.15);
  color: var(--nexus-amber);
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid rgba(245,158,11,0.25);
}
.card.nexus-hero-header .nexus-hero-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem;
  background: transparent !important;
  width: 100%;
}
.card.nexus-hero-header .nexus-hero-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  background: transparent !important;
}
.card.nexus-hero-header .nexus-hero-title-row h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card.nexus-hero-header .nexus-hero-desc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}
.card.nexus-hero-header .nexus-hero-sub {
  color: var(--nexus-sidebar-text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.card.nexus-hero-header .nexus-hero-back,
.card.nexus-hero-header .nexus-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.card.nexus-hero-header .nexus-hero-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  max-width: 60%;
  text-align: right;
}
.card.nexus-hero-header .nexus-hero-breadcrumbs {
  position: relative;
  z-index: var(--tsms-z-base);
}
.card.nexus-hero-header .nexus-hero-breadcrumb {
  margin: 0;
  padding: 0;
  background: transparent;
  justify-content: flex-end;
  --tblr-breadcrumb-divider-color: var(--nexus-sidebar-text-muted);
}
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item,
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item a,
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item.active {
  color: var(--nexus-sidebar-text);
  font-size: 0.8rem;
}
.card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item a:hover {
  color: var(--nexus-sidebar-text);
  text-decoration: underline;
}
.card.nexus-hero-header .btn-light {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--nexus-radius-sm);
  transition: all 0.2s ease;
}
.card.nexus-hero-header .btn-light:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}
.card.nexus-hero-header .nexus-hero-back .btn {
  color: #ffffff;
}
.card.nexus-hero-header .btn-warning {
  background: var(--nexus-amber);
  border: none;
  color: var(--nexus-midnight);
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-sm);
  transition: all 0.2s ease;
}
.card.nexus-hero-header .btn-warning:hover {
  background: #fbbf24;
  transform: translateY(-1px);
  box-shadow: var(--nexus-shadow-md);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.nexus-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.nexus-stat-card {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
/* Tabler card extension: keep the stat-card look when wrapped in .card */
.nexus-stat-card.card {
  padding: 0;
  border-radius: var(--nexus-radius-sm);
}
.nexus-stat-card.card .card-body {
  padding: 1rem 1.25rem;
}
.nexus-stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: var(--nexus-amber);
  border-radius: var(--nexus-radius-sm) var(--nexus-radius-sm) 0 0;
}
.nexus-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--nexus-shadow-lg);
  border-color: var(--nexus-border);
}
.nexus-stat-card.nexus-stat-teal::before   { background: var(--nexus-teal); }
.nexus-stat-card.nexus-stat-rose::before   { background: var(--nexus-rose); }
.nexus-stat-card.nexus-stat-emerald::before{ background: var(--nexus-emerald); }
.nexus-stat-card.nexus-stat-indigo::before { background: var(--nexus-indigo); }

.nexus-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--nexus-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.15);
  color: var(--nexus-amber);
}
.nexus-stat-teal   .nexus-stat-icon { background: rgba(20, 184, 166, 0.15); color: var(--nexus-teal); }
.nexus-stat-rose   .nexus-stat-icon { background: rgba(244, 63, 94, 0.15);  color: var(--nexus-rose); }
.nexus-stat-emerald .nexus-stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--nexus-emerald); }
.nexus-stat-indigo .nexus-stat-icon { background: rgba(55, 48, 163, 0.15);  color: var(--nexus-indigo); }

.nexus-stat-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--nexus-midnight);
  letter-spacing: -0.03em;
}
.nexus-stat-val.zero { color: var(--nexus-muted); }
.nexus-stat-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nexus-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   DATA CARDS & TABLES
   ============================================================ */
.nexus-data-card,
.nexus-data-card.card {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-lg);
  box-shadow: var(--nexus-shadow-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.nexus-data-card:hover,
.nexus-data-card.card:hover {
  box-shadow: var(--nexus-shadow-lg);
}
.nexus-data-card-header,
.nexus-data-card-header.card-header {
  background: var(--tsms-bg-subtle);
  border-bottom: 1px solid var(--nexus-border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nexus-data-card-header h5,
.nexus-data-card-header.card-header h5 {
  font-weight: 700;
  color: var(--nexus-slate);
  margin: 0;
  font-size: 1rem;
}

.nexus-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.nexus-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.nexus-table-wrap::-webkit-scrollbar-thumb {
  background: var(--nexus-muted);
  border-radius: var(--nexus-radius-sm);
}
.nexus-table-wrap .table {
  font-size: 0.95rem;
  margin: 0;
}
.nexus-table-wrap .table thead th {
  background: var(--tsms-bg-subtle);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nexus-slate);
  border-bottom: 2px solid var(--nexus-border);
  white-space: nowrap;
  padding: 0.6rem 0.75rem;
}
.nexus-table-wrap .table td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--tsms-bg-subtle);
}
.nexus-table-wrap .table tbody tr:hover td {
  background: var(--tsms-bg-subtle);
}
.nexus-table-wrap .table tbody tr {
  transition: background 0.15s ease;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.nexus-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: var(--nexus-radius-pill);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nexus-badge-pending    { background: var(--tsms-warning-light); color: var(--nexus-amber); }
.nexus-badge-enroute    { background: var(--tsms-info-light);     color: var(--tsms-primary); }
.nexus-badge-working    { background: var(--tsms-info-light);     color: var(--tsms-primary); }
.nexus-badge-onsite     { background: var(--tsms-info-light);     color: var(--nexus-indigo); }
.nexus-badge-completed  { background: var(--tsms-success-light);  color: var(--nexus-emerald); }
.nexus-badge-open       { background: var(--tsms-info-light);     color: var(--tsms-primary); }
.nexus-badge-resolved   { background: var(--tsms-success-light);  color: var(--nexus-emerald); }
.nexus-badge-closed     { background: var(--tsms-bg-subtle);      color: var(--nexus-slate); }
.nexus-badge-cancelled  { background: var(--tsms-danger-light);   color: var(--nexus-rose); }

/* ============================================================
   BUTTONS
   ============================================================ */
.nexus-btn-primary,
.nexus-btn-primary.btn,
.nexus-btn-primary.btn-primary {
  background: var(--nexus-indigo);
  border: none;
  color: var(--nexus-sidebar-text);
  font-weight: 600;
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-sm);
  transition: all 0.2s ease;
}
.nexus-btn-primary:hover,
.nexus-btn-primary.btn:hover,
.nexus-btn-primary.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--nexus-shadow-md);
  color: var(--nexus-sidebar-text);
}
.nexus-btn-success,
.nexus-btn-success.btn,
.nexus-btn-success.btn-success {
  background: var(--nexus-emerald);
  border: none;
  color: var(--nexus-sidebar-text);
  font-weight: 600;
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-sm);
  transition: all 0.2s ease;
}
.nexus-btn-success:hover,
.nexus-btn-success.btn:hover,
.nexus-btn-success.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--nexus-shadow-md);
  color: var(--nexus-sidebar-text);
}

/* ============================================================
   FORM CARDS
   ============================================================ */
.card.nexus-form-hero {
  background: var(--nexus-midnight);
  border-radius: var(--nexus-radius-lg);
  padding: 1.75rem 2rem;
  color: var(--nexus-sidebar-text);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  border: none;
}
.card.nexus-form-hero h2 {
  color: var(--nexus-sidebar-text);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  position: relative;
  z-index: var(--tsms-z-base);
}
.card.nexus-form-hero p {
  color: var(--nexus-sidebar-text-muted);
  margin: 0.3rem 0 0;
  position: relative;
  z-index: var(--tsms-z-base);
}

.nexus-form-card,
.nexus-form-card.card {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-top: 3px solid var(--nexus-indigo);
  border-radius: var(--nexus-radius-lg);
  box-shadow: var(--nexus-shadow-md);
  overflow: hidden;
}
.nexus-form-card-header,
.nexus-form-card-header.card-header {
  background: var(--tsms-bg-subtle);
  border-bottom: 1px solid var(--nexus-border);
  padding: 1rem 1.5rem;
  font-weight: 700;
  color: var(--nexus-slate);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nexus-form-card-body,
.nexus-form-card-body.card-body,
.nexus-form-card.card-body {
  padding: 1.5rem !important;
}

/* ============================================================
   ADVANCED FILTER
   ============================================================ */
.nexus-advanced-filter {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.nexus-advanced-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;

}

.nexus-advanced-filter-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--nexus-indigo);
  font-size: 0.95rem;
}

.nexus-advanced-filter-hint {
  font-size: 0.8rem;
  color: var(--nexus-muted);
}

.nexus-advanced-filter-form .row {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  align-items: stretch;
}

.nexus-advanced-filter-form [class*='col-'] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.nexus-advanced-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
}

.nexus-advanced-filter-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nexus-slate);
  min-height: 1.25rem;
  line-height: 1.25;
}

.nexus-advanced-filter-field-label:empty::before,
.nexus-advanced-filter-field-label.nexus-advanced-filter-field-label-empty::before {
  content: '\00a0';
  visibility: hidden;
}

.nexus-advanced-filter-field-body {
  display: flex;
  align-items: center;
  min-height: 31px;
  flex: 1 0 auto;
}

.nexus-advanced-filter-form .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nexus-advanced-filter-form .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nexus-slate);
  margin-bottom: 0;
}

.nexus-advanced-filter-form .form-control {
  min-height: 36px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}

.nexus-advanced-filter-form .form-control-sm {
  min-height: 31px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.nexus-advanced-filter-form .form-group .help-block:empty {
  display: none;
}

.nexus-advanced-filter-form .form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  padding-left: 0;
  min-height: 31px;
}

.nexus-advanced-filter-form .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0;
  flex-shrink: 0;
}

.nexus-advanced-filter-form .form-check-label {
  font-size: 0.85rem;
  padding-left: 0.4rem;
  cursor: pointer;
  margin-bottom: 0;
}

.nexus-advanced-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 31px;
  flex-wrap: wrap;
}

.nexus-advanced-filter-actions .btn {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .nexus-advanced-filter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .nexus-advanced-filter-form .row {
    row-gap: 0.75rem;
  }

  .nexus-advanced-filter-actions {
    justify-content: flex-start;
  }
}

/* ============================================================
   TABLE STRIPING IN DARK MODE
   ============================================================ */
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > th,
html.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > td,
html.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > th,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: var(--nexus-dark-border-faint) !important;
  color: var(--nexus-dark-text) !important;
}
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] .table > thead > tr > th,
html.theme-dark .table > tbody > tr > td,
html.theme-dark .table > tbody > tr > th,
html.theme-dark .table > thead > tr > th,
body.dark-mode .table > tbody > tr > td,
body.dark-mode .table > tbody > tr > th,
body.dark-mode .table > thead > tr > th {
  color: var(--nexus-dark-text) !important;
  border-color: var(--nexus-dark-border-subtle) !important;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar.nexus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--tsms-bg-subtle);
  border-radius: var(--nexus-radius-sm);
  border: 1px solid var(--nexus-border);
}

/* ============================================================
   LEGACY INDEX.PHP STYLES (retained for compatibility)
   ============================================================ */
.service-calls-shell .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.service-calls-shell .card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.service-calls-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 10px;
}
.service-calls-toolbar .btn { white-space: nowrap; }
.service-calls-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.service-calls-stat {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  padding: 10px 12px;
  background: var(--nexus-surface);
  cursor: pointer;
  transition: all .2s ease;
}
.service-calls-stat:hover {
  border-color: var(--tsms-primary);
  box-shadow: var(--nexus-shadow-sm);
}
.service-calls-shell .card-header .d-flex { gap: .5rem; }
.service-calls-shell .card-header-actions { gap: .5rem; }
.service-calls-stat .label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--nexus-muted);
}
.service-calls-stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--nexus-midnight);
}
.service-calls-grid-wrap { overflow-x: auto; }

/* ============================================================
   GLOBAL: Remove vertical (column) borders from grid tables.
   Keeps only horizontal row separators for a cleaner look.
   Applies to every GridView/DetailView/data-card table.
   ============================================================ */
.grid-view .table td,
.grid-view .table th,
.nexus-data-card .table td,
.nexus-data-card .table th,
.nexus-table-wrap .table td,
.nexus-table-wrap .table th,
.table-responsive .table td,
.table-responsive .table th,
.card .table td,
.card .table th,
.page-body .table td,
.page-body .table th {
  border-left: 0 !important;
  border-right: 0 !important;
}

#index_table .table td,
#index_table .table th {
  padding: 0.32rem 0.4rem;
  vertical-align: middle;
}
#index_table .table td > div {
  width: auto;
  min-width: 90px;
}

/* --- itss-index.php styles --- */
.itss-index .content-header { display: none; }
.itss-toolbar {
  border: 1px solid var(--nexus-border);
  background: var(--tsms-bg-subtle);
  border-radius: var(--nexus-radius-md);
  padding: 12px;
  margin-bottom: 12px;
}
.itss-summary {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  background: var(--nexus-surface);
  padding: 10px 12px;
  text-align: center;
}
.itss-summary .count {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}
.itss-summary .label {
  color: var(--nexus-muted);
  font-size: 0.78rem;
  margin-bottom: 0;
}
.itss-status-badge {
  font-size: 0.75rem;
  border-radius: var(--nexus-radius-pill);
  padding: 4px 8px;
  font-weight: 600;
}
#itss-index-grid .table { margin-bottom: 0; }
#itss-index-grid .table td,
#itss-index-grid .table th {
  white-space: nowrap;
  vertical-align: middle;
}
.itss-datetime { font-size: 0.9rem; }
.itss-datetime .date { font-weight: 600; color: var(--nexus-midnight); }
.itss-datetime .time { color: var(--nexus-muted); }

/* --- view.php styles --- */
.view_table table {
  overflow: auto;
  word-wrap: break-word;
  width: 100%;
  font-size: 0.95rem;
}
.view_table .table td,
.view_table .table th {
  padding: 0.5rem 0.6rem;
}

/* --- _form.php styles --- */
.card.nexus-flow-card {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  padding: 1.25rem;
  margin: 0 0 1.5rem 0;
  background: var(--nexus-surface);
  box-shadow: var(--nexus-shadow-sm);
}
.nexus-flow-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--nexus-slate);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .85rem;
  border-bottom: 1px solid var(--nexus-border);
  padding-bottom: .5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) and (min-width: 769px) {
  .service-calls-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itss-toolbar { padding: 10px; }
}

@media (max-width: 768px) {
  .card.nexus-hero-header { padding: 1rem 1.25rem; }
  .card.nexus-hero-header h2 { font-size: 1.4rem; }
  .card.nexus-hero-header .nexus-hero-body {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.75rem;
  }
  .card.nexus-hero-header .nexus-hero-icon {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
  }
  .card.nexus-hero-header .nexus-hero-icon-col {
    align-items: flex-start;
    width: 2rem;
  }
  .card.nexus-hero-header .nexus-hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .card.nexus-hero-header .nexus-hero-right-col {
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    text-align: left;
  }
  .card.nexus-hero-header .nexus-hero-breadcrumb {
    justify-content: flex-start;
  }
  .card.nexus-hero-header .nexus-hero-back,
  .card.nexus-hero-header .nexus-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .card.nexus-hero-header .nexus-hero-back .btn,
  .card.nexus-hero-header .nexus-hero-actions .btn { flex: 1 1 auto; }
  .card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item,
  .card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item a,
  .card.nexus-hero-header .nexus-hero-breadcrumb .breadcrumb-item.active {
    font-size: 0.75rem;
  }
  .nexus-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nexus-stat-val { font-size: 1.5rem; }
  .nexus-stat-card { padding: 1rem; }
  .nexus-data-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .service-calls-shell .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .service-calls-shell .card-title { font-size: 1.1rem; }
  .service-calls-toolbar { grid-template-columns: 1fr; gap: 8px; }
  .service-calls-toolbar .btn {
    width: 100%;
    white-space: normal;
    min-height: 44px;
  }
  .service-calls-stats { grid-template-columns: 1fr; gap: 8px; }
  .service-calls-stat { padding: 8px 10px; }
  .service-calls-stat .value { font-size: 1.1rem; }

  .itss-toolbar { padding: 8px; margin-bottom: 8px; }
  .itss-summary { padding: 8px; margin-bottom: 8px; }
  .itss-summary .count { font-size: 1rem; }
  .itss-status-badge { font-size: 0.7rem; padding: 3px 6px; }

  .view_table .table td,
  .view_table .table th {
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.35rem 0.45rem;
  }
  .service-calls-grid-wrap,
  #itss-index-grid {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .service-calls-grid-wrap::-webkit-scrollbar,
  #itss-index-grid::-webkit-scrollbar {
    height: 6px;
  }
  .service-calls-grid-wrap::-webkit-scrollbar-thumb,
  #itss-index-grid::-webkit-scrollbar-thumb {
    background: var(--nexus-muted);
    border-radius: var(--nexus-radius-sm);
  }
  .view_table .btn-sm { min-height: 36px; min-width: 44px; padding: 6px 10px; font-size: 0.9rem; }
  .chat-popup {
    width: 100% !important;
    max-width: 320px;
    left: auto !important;
    right: 10px !important;
  }
  .card.nexus-flow-card { padding: 10px !important; }
  .select2-container { max-width: 100%; }

  /* Mobile touch targets: 44px minimum for buttons, nav links, dropdown items, icon-only actions */
  .btn,
  .btn-sm,
  .btn-xs,
  .btn-lg,
  .btn-action-mini,
  .nav-link,
  .dropdown-item,
  .view_table .btn,
  .action-column .btn,
  .grid-actions-cell .btn,
  .liq-actions-cell .btn,
  .nexus-action-toolbar .btn,
  .itss-toolbar .btn,
  .card.nexus-hero-header .btn,
  .security-setup .btn,
  .security-setup .btn-sm,
  .error-actions .btn,
  .btn-user,
  .register-type-btn,
  .nexus-tab-link,
  .nexus-list-group-item {
    min-height: 44px;
    min-width: 44px;
  }
  .btn-icon,
  .nexus-icon-btn,
  .action-column .btn i:only-child,
  .grid-actions-cell .btn i:only-child,
  .liq-actions-cell .btn i:only-child,
  .btn.btn-sm i:only-child {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Tablet breakpoints for dashboard grids */
@media (max-width: 1023px) and (min-width: 768px) {
  .nexus-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-stat-card {
    padding: 1.25rem;
  }
  .stat-val-big {
    font-size: 1.75rem;
  }
}


/* --- index.php styles --- */
.service-calls-shell .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-calls-shell .card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.service-calls-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 10px;
}

.service-calls-toolbar .btn {
  white-space: nowrap;
}

.service-calls-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.service-calls-stat {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  padding: 10px 12px;
  background: var(--nexus-surface);
  cursor: pointer;
  transition: all .2s ease;
}

.service-calls-stat:hover {
  border-color: var(--tsms-primary);
  box-shadow: var(--nexus-shadow-sm);
}

.service-calls-shell .card-header .d-flex {
  gap: .5rem;
}

.service-calls-shell .card-header-actions {
  gap: .5rem;
}

.service-calls-stat .label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--nexus-muted);
}

.service-calls-stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--nexus-midnight);
}

.service-calls-grid-wrap {
  overflow-x: auto;
}

#index_table .table td,
#index_table .table th {
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
  font-size: 0.9rem;
}

#index_table .table td > div {
  width: auto;
  min-width: 90px;
}

@media (max-width: 991.98px) {
  .service-calls-toolbar {
    grid-template-columns: 1fr;
  }

  .service-calls-toolbar .btn {
    width: 100%;
  }

  .service-calls-stats {
    grid-template-columns: 1fr;
  }
}

/* --- itss-index.php styles --- */
.itss-index .content-header {
  display: none;
}

.itss-toolbar {
  border: 1px solid var(--nexus-border);
  background: var(--tsms-bg-subtle);
  border-radius: var(--nexus-radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.itss-summary {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  background: var(--nexus-surface);
  padding: 10px 12px;
  text-align: center;
}

.itss-summary .count {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}

.itss-summary .label {
  color: var(--nexus-muted);
  font-size: 0.78rem;
  margin-bottom: 0;
}

.itss-status-badge {
  font-size: 0.75rem;
  border-radius: var(--nexus-radius-pill);
  padding: 4px 8px;
  font-weight: 600;
}

#itss-index-grid .table {
  margin-bottom: 0;
}

#itss-index-grid .table td,
#itss-index-grid .table th {
  white-space: nowrap;
  vertical-align: middle;
}

.itss-datetime {
  font-size: 0.82rem;
}

.itss-datetime .date {
  font-weight: 600;
  color: var(--nexus-midnight);
}

.itss-datetime .time {
  color: var(--nexus-muted);
}

/* --- view.php styles --- */
.view_table table {
  overflow: auto;
  word-wrap: break-word;
  width: 100%;
  font-size: 0.95rem;
}
.view_table .table td,
.view_table .table th {
  padding: 0.5rem 0.6rem;
}

/* --- _form.php styles (extracted from inline) --- */
.card.nexus-flow-card {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-md);
  padding: 1.25rem;
  margin: 0 0 1.5rem 0;
  background: var(--nexus-surface);
  box-shadow: var(--nexus-shadow-sm);
}

.nexus-flow-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--nexus-slate);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .85rem;
  border-bottom: 1px solid var(--nexus-border);
  padding-bottom: .5rem;
}

/* ============================================================
   KINTONE HUB STYLES
   ============================================================ */
.kintone-hub-header {
  background: var(--nexus-midnight);
  border-radius: var(--nexus-radius-lg);
  padding: 1.5rem 1.75rem;
  color: var(--nexus-sidebar-text);
  margin-bottom: 1.25rem;
}
.kintone-hub-header h2 {
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}
.kintone-nav-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.kintone-nav-bar .btn {
  border-radius: var(--nexus-radius-md);
  font-weight: 500;
}
.kintone-info-box {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-lg);
  padding: 1rem;
  box-shadow: var(--nexus-shadow-sm);
  text-align: center;
  border-top: 3px solid transparent;
}
.kintone-info-box.border-danger { border-top-color: var(--nexus-rose); }
.kintone-info-box.border-success { border-top-color: var(--nexus-emerald); }
.kintone-info-box .number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tsms-primary);
}
.kintone-info-box .label {
  font-size: 0.875rem;
  color: var(--nexus-muted);
}
.badge-success { background: var(--nexus-emerald); color: var(--nexus-sidebar-text); }
.badge-danger  { background: var(--nexus-rose);   color: var(--nexus-sidebar-text); }
.badge-warning { background: var(--nexus-amber);  color: var(--nexus-midnight); }

/* ============================================================
   KINTONE LOCAL DB STYLES
   ============================================================ */
.kintone-local { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

.kintone-header {
  background: var(--nexus-midnight);
  border-radius: var(--nexus-radius-lg);
  padding: 24px;
  color: var(--nexus-sidebar-text);
  margin-bottom: 20px;
}
.kintone-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}
.kintone-header p {
  margin: 8px 0 0 0;
  color: var(--nexus-sidebar-text-muted);
  font-size: 0.875rem;
}

.kintone-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-md);
  box-shadow: var(--nexus-shadow-sm);
}
.kintone-nav .btn {
  border-radius: var(--nexus-radius-sm);
  font-size: 0.8125rem;
  padding: 8px 16px;
}

.kintone-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--nexus-border);
}
.kintone-tab {
  padding: 12px 20px;
  color: var(--nexus-muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.kintone-tab:hover {
  color: var(--nexus-slate);
  text-decoration: none;
}
.kintone-tab.active {
  color: var(--tsms-primary);
  border-bottom-color: var(--tsms-primary);
}

.kintone-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--nexus-shadow-sm);
  flex: 1;
  min-width: 200px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--nexus-shadow-md);
  text-decoration: none;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--nexus-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-sidebar-text);
  font-size: 1.125rem;
}
.stat-content { flex: 1; }
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--nexus-muted);
  margin-top: 4px;
}

.kintone-search {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--nexus-shadow-sm);
}

.kintone-table-container {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-md);
  padding: 20px;
  box-shadow: var(--nexus-shadow-sm);
}
.kintone-table {
  width: 100%;
  border-collapse: collapse;
}
.kintone-table th {
  background-color: var(--tsms-bg-subtle);
  color: var(--nexus-midnight);
  font-weight: 600;
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--nexus-border);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kintone-table td {
  background-color: var(--nexus-surface);
  color: var(--nexus-slate);
  padding: 12px;
  border-bottom: 1px solid var(--nexus-border);
  font-size: 0.875rem;
}
.kintone-table tr:nth-child(even) td { background-color: var(--tsms-bg-subtle); }
.kintone-table tr:hover td { background-color: var(--tsms-info-light); }
.kintone-table a {
  color: var(--tsms-primary);
  text-decoration: none;
}
.kintone-table a:hover {
  color: var(--nexus-indigo);
  text-decoration: underline;
}

.ticket-counter {
  background: var(--tsms-bg-subtle);
  padding: 8px 16px;
  border-radius: var(--nexus-radius-md);
  font-weight: 600;
  color: var(--nexus-slate);
  display: inline-block;
}

.table-summary {
  text-align: right;
  color: #6b7280;
  font-size: 0.8125rem;
  margin-top: 12px;
}

/* ============================================================
   GATEPASS HUB STYLES
   ============================================================ */
:root {
  --gp-indigo: #6366f1;
  --gp-orange: #f97316;
  --gp-purple: #8b5cf6;
  --gp-teal: #14b8a6;
}

.gp-hub-header {
  background: var(--nexus-midnight);
  border-radius: var(--nexus-radius-lg);
  padding: 1.5rem 1.75rem;
  color: var(--nexus-sidebar-text);
  margin-bottom: 1.25rem;
}
.gp-hub-header h2 {
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0;
}
.gp-hub-sub {
  color: var(--nexus-sidebar-text-muted);
  font-size: .85rem;
  margin-top: .25rem;
}

.gp-pipeline-strip {
  display: flex;
  align-items: stretch;
  border-radius: var(--nexus-radius-lg);
  overflow: hidden;
  border: 1px solid var(--nexus-border);
  margin-bottom: 1.25rem;
  background: var(--nexus-surface);
  box-shadow: var(--nexus-shadow-sm);
}
.gp-pl-lane {
  flex: 1;
  padding: .6rem .75rem;
  border-right: 1px solid var(--nexus-border);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none !important;
}
.gp-pl-lane:last-child { border-right: none; }
.gp-pl-lane:hover { background: var(--tsms-bg-subtle); }
.gp-pl-lane.gp-active { background: var(--tsms-info-light); border-bottom: 3px solid var(--tsms-primary); }
.gp-pl-lane.gp-exc.gp-active { background: var(--tsms-warning-light); border-bottom-color: var(--nexus-amber); }
.gp-pl-icon { font-size: .9rem; margin-bottom: 2px; }
.gp-pl-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--nexus-muted);
  white-space: nowrap;
}
.gp-pl-count {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  color: var(--nexus-midnight);
}
.gp-pl-count.zero { color: var(--nexus-border); }
.gp-pl-sub { font-size: .58rem; color: var(--nexus-muted); margin-top: 1px; }

.gp-tabs .nav-link {
  font-size: .78rem;
  font-weight: 600;
  padding: .45rem .85rem;
  color: var(--nexus-muted);
  border-bottom: 3px solid transparent;
}
.gp-tabs .nav-link.active {
  color: var(--tsms-primary);
  background: var(--tsms-info-light);
  border-bottom-color: var(--tsms-primary);
}
.gp-tabs .nav-link.gp-wh.active  { color: var(--gp-indigo);  border-bottom-color: var(--gp-indigo);  background: var(--tsms-info-light); }
.gp-tabs .nav-link.gp-pa.active  { color: var(--nexus-slate); border-bottom-color: var(--nexus-slate); background: var(--tsms-bg-subtle); }
.gp-tabs .nav-link.gp-gsd.active { color: var(--tsms-primary); border-bottom-color: var(--tsms-primary); background: var(--tsms-info-light); }
.gp-tabs .nav-link.gp-hd.active  { color: var(--nexus-amber); border-bottom-color: var(--nexus-amber); background: var(--tsms-warning-light); }
.gp-tabs .nav-link.gp-exc.active { color: var(--gp-orange);   border-bottom-color: var(--gp-orange);   background: var(--tsms-warning-light); }
.gp-tabs .nav-link.gp-bil.active { color: var(--gp-purple);  border-bottom-color: var(--gp-purple);  background: var(--tsms-info-light); }
.gp-tabs .nav-link.gp-af.active  { color: var(--nexus-emerald); border-bottom-color: var(--nexus-emerald); background: var(--tsms-success-light); }
.gp-tabs .nav-link .badge { font-size: .6rem; padding: 2px 5px; margin-left: 3px; vertical-align: middle; }
.gp-tabs .nav-link.gp-single-link { color: var(--nexus-slate); border-bottom-color: transparent; }
.gp-tabs .nav-link.gp-single-link:hover { background: var(--tsms-bg-subtle); color: var(--tsms-primary); }

.gp-metric-card {
  border-radius: var(--nexus-radius-lg);
  border: 1px solid var(--nexus-border);
  padding: .9rem 1.1rem;
  background: var(--nexus-surface);
  display: flex;
  align-items: center;
  gap: .8rem;
  transition: border-color .15s, box-shadow .15s;
}
.gp-metric-card:hover { border-color: var(--tsms-primary); box-shadow: var(--nexus-shadow-md); }
.gp-metric-card.gp-active-card { border-color: var(--tsms-primary); box-shadow: var(--nexus-shadow-sm); }
.gp-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--nexus-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.gp-metric-val {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--nexus-midnight);
}
.gp-metric-val.zero { color: var(--nexus-muted); }
.gp-metric-lbl {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--nexus-muted);
}

.gp-grid-wrap { border-radius: 0 0 var(--nexus-radius-lg) var(--nexus-radius-lg); overflow: hidden; }
.gp-grid-wrap .table { font-size: .78rem; margin: 0; }
.gp-grid-wrap thead th {
  background: var(--tsms-bg-subtle);
  font-weight: 700;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--nexus-slate);
  border-bottom: 2px solid var(--nexus-border);
  white-space: nowrap;
  padding: .5rem .6rem;
}
.gp-grid-wrap td { padding: .42rem .6rem; vertical-align: middle; }
.gp-grid-wrap tr:hover td { background: var(--tsms-bg-subtle); }

.gp-dr-link { font-weight: 700; color: var(--tsms-primary); font-size: .8rem; }
.btn-xs { padding: .18rem .42rem; font-size: .7rem; }
.gp-quick-btn { font-size: .65rem !important; padding: 2px 7px !important; border-radius: var(--nexus-radius-sm); white-space: nowrap; margin: 1px; }

.gp-lane-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: .75rem;
  padding: .6rem;
  background: var(--tsms-bg-subtle);
  border-radius: var(--nexus-radius-md);
  border: 1px solid var(--nexus-border);
}
.gp-lane-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--nexus-radius-pill);
  border: 1px solid currentColor;
}

.gp-filter-bar {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-md);
  border: 1px solid var(--nexus-border);
  padding: .55rem .8rem;
  margin-bottom: .65rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.gp-filter-bar select,
.gp-filter-bar input[type=text] {
  font-size: .75rem;
  height: 28px;
  border-radius: var(--nexus-radius-sm);
  border: 1px solid var(--nexus-border);
  padding: 0 .45rem;
  color: var(--nexus-slate);
}
.gp-filter-bar .btn { font-size: .73rem; padding: .22rem .6rem; border-radius: var(--nexus-radius-sm); }

.badge-urgency-normal   { background: var(--tsms-bg-subtle); color: var(--nexus-slate); border: 1px solid var(--nexus-border); }
.badge-urgency-urgent   { background: var(--tsms-warning-light); color: var(--nexus-amber); }
.badge-urgency-critical { background: var(--tsms-danger-light); color: var(--nexus-rose); }

.wh-merge-ready-row td { background: var(--tsms-success-light); }
.wh-merge-row-selected td { background: var(--tsms-info-light) !important; }
.wh-merge-row-ineligible td { opacity: .58; background: var(--tsms-bg-subtle); }
.wh-merge-badge { font-weight: 700; letter-spacing: .2px; }
.wh-merge-hint { margin-top: .55rem; font-size: .78rem; color: var(--nexus-muted); }

.gp-scroll { overflow-x: auto; }
.gp-empty { text-align: center; padding: 3rem; color: var(--nexus-muted); }
.gp-empty i { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.gp-admin-bar {
  background: var(--nexus-amber);
  border-radius: var(--nexus-radius-md);
  padding: .6rem 1rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}

.gp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.gp-pipeline-strip { overflow-x: auto; }
.gp-pl-lane { flex-shrink: 0; min-width: 100px; }

/* ============================================================
   SERVICE PROVIDERS UTILITIES
   ============================================================ */
.scx-nexus-nexus-hero-card {
  background: var(--nexus-midnight);
}
.btn-white {
  background: var(--nexus-surface);
  color: var(--nexus-indigo);
}
.btn-white:hover {
  background: var(--tsms-info-light);
  color: var(--nexus-indigo);
}
.border-left-primary { border-top: 3px solid var(--tsms-primary) !important; }
.border-left-info    { border-top: 3px solid var(--nexus-teal) !important; }
.border-left-danger  { border-top: 3px solid var(--nexus-rose) !important; }
.border-left-success { border-top: 3px solid var(--nexus-emerald) !important; }
.border-left-warning { border-top: 3px solid var(--nexus-amber) !important; }
.text-gray-300 { color: var(--tsms-gray-300) !important; }
.text-gray-800 { color: var(--tsms-gray-600) !important; }
.bg-primary-soft { background-color: rgba(43, 171, 228, 0.08); }
.border-dashed { border-style: dashed !important; border-width: 2px !important; }
.opacity-50 { opacity: 0.5; }
.bg-black-50 { background-color: var(--nexus-border); }
.dashed { border: 2px dashed var(--nexus-border) !important; }

.nexus-bg-primary {
  background: var(--nexus-indigo);
}
.letter-spacing-2 { letter-spacing: 2px; }

/* ============================================================
   KINTONE IMPORT STYLES
   ============================================================ */
:root {
  --ki-primary: #2563eb;
  --ki-primary-hover: #1d4ed8;
  --ki-primary-light: #eff6ff;
  --ki-success: #10b981;
  --ki-success-light: #f0fdf4;
  --ki-warning: #f59e0b;
  --ki-warning-light: #fffbeb;
  --ki-danger: #ef4444;
  --ki-danger-hover: #dc2626;
  --ki-danger-light: #fef2f2;
  --ki-info: #06b6d4;
  --ki-info-light: #ecfeff;

  --ki-ink: #111827;
  --ki-ink-secondary: #374151;
  --ki-ink-muted: #6b7280;
  --ki-ink-faint: #9ca3af;

  --ki-surface: var(--nexus-surface);
  --ki-surface-hover: #f9fafb;
  --ki-surface-inset: #f3f4f6;
  --ki-surface-elevated: var(--nexus-surface);

  --ki-border: #e5e7eb;
  --ki-border-hover: #d1d5db;
  --ki-border-focus: var(--ki-primary);

  --ki-radius-sm: 6px;
  --ki-radius-md: 8px;
  --ki-radius-lg: 12px;
  --ki-radius-xl: 16px;
  --ki-radius-pill: 999px;

  --ki-space-1: 4px;
  --ki-space-2: 8px;
  --ki-space-3: 12px;
  --ki-space-4: 16px;
  --ki-space-5: 20px;
  --ki-space-6: 24px;

  --ki-transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);

  --ki-font-mono: "SF Mono", Monaco, Consolas, "Roboto Mono", monospace;
  --ki-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ki-dashboard { font-family: var(--ki-font-sans); }
.ki-dashboard .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ki-header {
  background: var(--nexus-midnight);
  border-radius: var(--ki-radius-xl);
  padding: var(--ki-space-6);
  color: var(--nexus-sidebar-text);
  margin-bottom: var(--ki-space-6);
}
.ki-header h1 { font-size: 1.75rem; font-weight: 700; margin: 0; }
.ki-header p { color: var(--nexus-sidebar-text-muted); margin: var(--ki-space-2) 0 0; font-size: 0.9375rem; }

.ki-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ki-space-4);
  margin-bottom: var(--ki-space-6);
}
.ki-stat-card {
  background: var(--ki-surface);
  border: 1px solid var(--ki-border);
  border-radius: var(--ki-radius-lg);
  padding: var(--ki-space-5);
  display: flex;
  align-items: center;
  gap: var(--ki-space-3);
  box-shadow: var(--nexus-shadow-sm);
  transition: transform var(--ki-transition), box-shadow var(--ki-transition), border-color var(--ki-transition);
}
.ki-stat-card:hover { transform: translateY(-2px); box-shadow: var(--nexus-shadow-lg); border-color: var(--ki-border-hover); }
.ki-stat-card.ki-stat-clickable { cursor: pointer; }
.ki-stat-card.ki-stat-clickable:focus-visible { outline: 2px solid var(--ki-warning); outline-offset: 2px; }
.ki-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ki-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-sidebar-text);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.ki-stat-content { flex: 1; min-width: 0; }
.ki-stat-number { font-size: 1.625rem; font-weight: 700; line-height: 1; color: var(--ki-ink); }
.ki-stat-label { font-size: 0.8125rem; color: var(--ki-ink-muted); margin-top: var(--ki-space-1); }
.ki-stat-delta { font-size: 0.75rem; margin-top: var(--ki-space-1); color: var(--ki-ink-faint); }
.ki-stat-delta.up { color: var(--ki-success); }
.ki-stat-delta.down { color: var(--ki-danger); }

.ki-panel {
  background: var(--ki-surface);
  border: 1px solid var(--ki-border);
  border-radius: var(--ki-radius-xl);
  padding: var(--ki-space-6);
  margin-bottom: var(--ki-space-6);
  box-shadow: var(--nexus-shadow-sm);
}
.ki-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ki-space-5);
  flex-wrap: wrap;
  gap: var(--ki-space-3);
}
.ki-panel-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ki-ink);
  display: flex;
  align-items: center;
  gap: var(--ki-space-2);
}
.ki-panel-title i { color: var(--ki-primary); }

.ki-toggle { display: flex; align-items: center; gap: var(--ki-space-3); cursor: pointer; user-select: none; }
.ki-toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--ki-border-hover);
  border-radius: var(--ki-radius-pill);
  position: relative;
  transition: background var(--ki-transition);
  flex-shrink: 0;
}
.ki-toggle-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--nexus-surface);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left var(--ki-transition);
  box-shadow: var(--nexus-shadow-md);
}
.ki-toggle.active .ki-toggle-switch { background: var(--ki-success); }
.ki-toggle.active .ki-toggle-switch::after { left: 24px; }
.ki-toggle-label { font-size: 0.875rem; font-weight: 500; color: var(--ki-ink-secondary); }
.ki-toggle-status { font-size: 0.75rem; color: var(--ki-ink-faint); }

.ki-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--ki-space-4);
}
.ki-app-card {
  background: var(--ki-surface);
  border: 1px solid var(--ki-border);
  border-radius: var(--ki-radius-lg);
  padding: var(--ki-space-4);
  transition: border-color var(--ki-transition), box-shadow var(--ki-transition);
  position: relative;
}
.ki-app-card:hover { border-color: var(--ki-border-hover); box-shadow: var(--nexus-shadow-md); }
.ki-app-card.syncing { border-color: var(--ki-primary); background: var(--ki-primary-light); }
.ki-app-card.error { border-color: var(--ki-danger); background: var(--ki-danger-light); }
.ki-app-card.synced { border-color: var(--ki-success); background: var(--ki-success-light); box-shadow: 0 0 0 1px var(--ki-success); }
.ki-app-card.synced .ki-app-meta h3 { color: var(--nexus-emerald); }
.ki-app-card.synced .ki-app-meta span { color: var(--ki-success); }

.ki-app-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--ki-space-3); }
.ki-app-info { display: flex; align-items: center; gap: var(--ki-space-3); min-width: 0; }
.ki-app-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--ki-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--nexus-sidebar-text);
  flex-shrink: 0;
}
.ki-app-icon.primary { background: var(--ki-primary); }
.ki-app-icon.success { background: var(--ki-success); }
.ki-app-icon.warning { background: var(--ki-warning); }
.ki-app-icon.info { background: var(--ki-info); }
.ki-app-icon.secondary { background: var(--ki-ink-muted); }
.ki-app-icon.dark { background: var(--ki-ink); }

.ki-app-meta { min-width: 0; }
.ki-app-meta h3 { font-size: 0.9375rem; font-weight: 600; color: var(--ki-ink); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-app-meta span { font-size: 0.75rem; color: var(--ki-ink-faint); }

.ki-app-badge { padding: 3px 10px; border-radius: var(--ki-radius-pill); font-size: 0.6875rem; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.ki-app-badge.completed, .ki-app-badge.scheduled { background: var(--ki-success-light); color: var(--nexus-emerald); }
.ki-app-badge.running { background: var(--ki-primary-light); color: var(--ki-primary); }
.ki-app-badge.pending { background: var(--ki-surface-inset); color: var(--ki-ink-muted); }
.ki-app-badge.error, .ki-app-badge.failed { background: var(--ki-danger-light); color: var(--ki-danger-hover); }
.ki-app-badge.partial { background: var(--ki-warning-light); color: var(--nexus-amber); }
.ki-app-badge.stopped { background: var(--ki-ink-muted); color: var(--nexus-sidebar-text); }

@media (prefers-reduced-motion: reduce) {
  .ki-log-live::before { animation: none; }
}

.ki-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ki-space-3);
  margin: var(--ki-space-3) 0;
  padding: var(--ki-space-3);
  background: var(--ki-surface-hover);
  border-radius: var(--ki-radius-md);
}
.ki-app-card.synced .ki-counts { background: var(--ki-success-light); }
.ki-count { text-align: center; }
.ki-count-value { font-size: 1.375rem; font-weight: 700; color: var(--ki-ink); line-height: 1.2; }
.ki-count-label { font-size: 0.6875rem; color: var(--ki-ink-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ki-count-delta { font-size: 0.75rem; margin-top: var(--ki-space-1); color: var(--ki-ink-faint); }
.ki-count-delta.match { color: var(--ki-success); }
.ki-count-delta.diff { color: var(--ki-warning); }

.ki-actions { display: flex; flex-direction: column; gap: var(--ki-space-2); margin-top: var(--ki-space-3); }
.ki-actions-row { display: flex; gap: var(--ki-space-2); }
.ki-actions-row > .ki-btn { flex: 1 1 0; justify-content: center; }
.ki-btn {
  padding: 7px 12px;
  border-radius: var(--ki-radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ki-transition), border-color var(--ki-transition), transform var(--ki-transition), box-shadow var(--ki-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ki-space-1);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.3;
}
.ki-btn:active { transform: scale(0.98); }
.ki-btn:focus-visible { outline: 2px solid var(--ki-primary); outline-offset: 2px; }
.ki-btn-primary { background: var(--ki-primary); color: var(--nexus-sidebar-text); }
.ki-btn-primary:hover { background: var(--ki-primary-hover); box-shadow: var(--nexus-shadow-sm); }
.ki-btn-danger { background: var(--ki-danger-hover); color: var(--nexus-sidebar-text); }
.ki-btn-danger:hover { background: #b91c1c; }
.ki-btn-danger:focus-visible { outline-color: var(--ki-danger); }
.ki-btn-outline { background: var(--ki-surface); color: var(--ki-ink-secondary); border: 1px solid var(--ki-border-hover); }
.ki-btn-outline:hover { background: var(--ki-surface-hover); border-color: var(--ki-ink-faint); }
.ki-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.ki-log-panel {
  background: var(--nexus-midnight);
  border-radius: var(--ki-radius-lg);
  padding: var(--ki-space-4);
  font-family: var(--ki-font-mono);
  font-size: 0.8125rem;
  color: var(--nexus-sidebar-text);
  max-height: 300px;
  overflow-y: auto;
}
.ki-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ki-space-3);
  padding-bottom: var(--ki-space-3);
  border-bottom: 1px solid var(--nexus-slate);
}
.ki-log-title { font-size: 0.875rem; font-weight: 600; color: var(--nexus-sidebar-text); display: flex; align-items: center; gap: var(--ki-space-2); }
.ki-log-live { display: flex; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--ki-success); }
.ki-log-live::before { content: ""; width: 8px; height: 8px; background: var(--ki-success); border-radius: 50%; animation: kiBlink 1.5s infinite; }
@keyframes kiBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.ki-log-entry { padding: 3px 0; border-bottom: 1px solid var(--nexus-slate); display: flex; gap: var(--ki-space-3); align-items: baseline; }
.ki-log-entry:last-child { border-bottom: none; }
.ki-log-time { color: var(--nexus-muted); font-size: 0.6875rem; min-width: 60px; flex-shrink: 0; }
.ki-log-level { font-size: 0.625rem; padding: 2px 6px; border-radius: var(--ki-radius-sm); font-weight: 600; text-transform: uppercase; flex-shrink: 0; }
.ki-log-level.info { background: var(--tsms-info-light); color: var(--tsms-primary); }
.ki-log-level.success { background: var(--tsms-success-light); color: var(--nexus-emerald); }
.ki-log-level.error { background: var(--tsms-danger-light); color: var(--nexus-rose); }
.ki-log-level.warn, .ki-log-level.warning { background: var(--tsms-warning-light); color: var(--nexus-amber); }
.ki-log-msg { flex: 1; color: var(--nexus-sidebar-text); word-break: break-word; }

.ki-log-toolbar {
  display: flex;
  align-items: center;
  gap: var(--ki-space-2);
  margin-bottom: var(--ki-space-3);
  padding: var(--ki-space-2);
  background: var(--nexus-midnight);
  border-radius: var(--ki-radius-md);
}
.ki-log-toolbar select { background: var(--nexus-slate); color: var(--nexus-sidebar-text); border: none; border-radius: var(--ki-radius-sm); padding: 4px 8px; font-size: 0.75rem; }
.ki-log-toolbar select:focus-visible { outline: 2px solid var(--ki-info); outline-offset: 1px; }
.ki-log-toolbar button { color: var(--nexus-sidebar-text); }

.ki-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ki-space-3) var(--ki-space-4);
  background: var(--ki-surface-inset);
  border-radius: var(--ki-radius-md);
  margin-top: var(--ki-space-4);
}
.ki-refresh-info { font-size: 0.8125rem; color: var(--ki-ink-muted); }

.ki-quick-actions { display: flex; gap: var(--ki-space-3); flex-wrap: wrap; align-items: center; margin-top: var(--ki-space-5); padding-top: var(--ki-space-5); border-top: 1px solid var(--ki-border); }

.ki-bg-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--ki-space-2) 0;
  padding: var(--ki-space-2) 0;
  border-top: 1px dashed var(--ki-border);
}
.ki-next-sync { font-size: 0.6875rem; color: var(--ki-ink-muted); }
.ki-app-card.synced .ki-bg-sync-row { border-top-color: rgba(16, 185, 129, 0.2); }

.ki-toggle-sm { display: flex; align-items: center; gap: var(--ki-space-2); cursor: pointer; user-select: none; }
.ki-toggle-switch-sm {
  width: 36px;
  height: 20px;
  background: var(--ki-border-hover);
  border-radius: var(--ki-radius-pill);
  position: relative;
  transition: background var(--ki-transition);
  flex-shrink: 0;
}
.ki-toggle-switch-sm::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--nexus-surface);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left var(--ki-transition);
  box-shadow: var(--nexus-shadow-md);
}
.ki-toggle-sm.active .ki-toggle-switch-sm { background: var(--ki-success); }
.ki-toggle-sm.active .ki-toggle-switch-sm::before { left: 18px; }
.ki-toggle-label-sm { font-size: 0.6875rem; font-weight: 500; color: var(--ki-ink-secondary); }
.ki-toggle-status-sm { font-size: 0.625rem; color: var(--ki-ink-muted); }

/* Sync Status Styles */
:root {
  --ks-primary: #2563eb;
  --ks-success: #10b981;
  --ks-warning: #f59e0b;
  --ks-danger: #ef4444;
}

.ks-dashboard { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.ks-header {
  background: var(--nexus-midnight);
  border-radius: var(--nexus-radius-xl);
  padding: 24px;
  color: var(--nexus-sidebar-text);
  margin-bottom: 24px;
}
.ks-header h1 { font-size: 1.75rem; font-weight: 700; margin: 0; }
.ks-header p { color: var(--nexus-sidebar-text-muted); margin: 8px 0 0; }

.ks-panel {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--nexus-shadow-sm);
}
.ks-panel-title { font-size: 1.125rem; font-weight: 700; color: var(--nexus-midnight); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }

.ks-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ks-table th {
  background: var(--tsms-bg-subtle);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nexus-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--nexus-border);
}
.ks-table td { padding: 16px; border-bottom: 1px solid var(--tsms-bg-subtle); vertical-align: middle; }
.ks-table tr:hover td { background: var(--tsms-bg-subtle); }
.ks-table tr.syncing td { background: var(--tsms-info-light); }
.ks-table tr.error td { background: var(--tsms-danger-light); }

.ks-app-cell { display: flex; align-items: center; gap: 12px; }
.ks-app-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--nexus-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-sidebar-text);
  font-size: 1rem;
}
.ks-app-info h4 { font-size: 0.875rem; font-weight: 600; color: var(--nexus-midnight); margin: 0; }
.ks-app-info span { font-size: 0.75rem; color: var(--nexus-muted); }

.ks-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--nexus-radius-pill); font-size: 0.75rem; font-weight: 500; }
.ks-status-badge.success { background: var(--tsms-success-light); color: var(--nexus-emerald); }
.ks-status-badge.primary { background: var(--tsms-info-light); color: var(--tsms-primary); }
.ks-status-badge.warning { background: var(--tsms-warning-light); color: var(--nexus-amber); }
.ks-status-badge.danger { background: var(--tsms-danger-light); color: var(--nexus-rose); }

.ks-counts { display: flex; gap: 16px; }
.ks-count { text-align: center; min-width: 80px; }
.ks-count-value { font-size: 1.125rem; font-weight: 700; color: var(--nexus-midnight); }
.ks-count-value.mismatch { color: var(--ks-warning); }
.ks-count-value.synced { color: var(--ks-success); }
.ks-count-label { font-size: 0.625rem; color: var(--nexus-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.ks-count-bar { height: 4px; background: var(--nexus-border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.ks-count-bar-fill { height: 100%; background: var(--ks-success); border-radius: 2px; }
.ks-count-bar-fill.partial { background: var(--ks-warning); }

.ks-delta { font-size: 0.6875rem; margin-top: 4px; }
.ks-delta.synced { color: var(--ks-success); }
.ks-delta.pending { color: var(--ks-warning); }
.ks-delta.error { color: var(--ks-danger); }

.ks-progress { display: flex; align-items: center; gap: 12px; }
.ks-progress-bar { flex: 1; height: 8px; background: var(--nexus-border); border-radius: var(--nexus-radius-sm); overflow: hidden; }
.ks-progress-fill { height: 100%; border-radius: var(--nexus-radius-sm); }
.ks-progress-fill.success { background: var(--ks-success); }
.ks-progress-fill.warning { background: var(--ks-warning); }
.ks-progress-fill.danger { background: var(--ks-danger); }
.ks-progress-text { font-size: 0.75rem; font-weight: 600; min-width: 40px; text-align: right; }

.ks-btn { padding: 8px 14px; border-radius: var(--nexus-radius-md); font-size: 0.75rem; font-weight: 500; border: none; cursor: pointer; transition: all .2s; }
.ks-btn-primary { background: var(--ks-primary); color: var(--nexus-sidebar-text); }
.ks-btn-primary:hover { background: #1d4ed8; }
.ks-btn-outline { background: var(--nexus-surface); color: var(--nexus-slate); border: 1px solid var(--nexus-border); }
.ks-btn-outline:hover { background: var(--tsms-bg-subtle); }

.ks-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.ks-summary-card {
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-lg);
  padding: 20px;
  box-shadow: var(--nexus-shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}
.ks-summary-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--nexus-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.ks-summary-content { flex: 1; }
.ks-summary-value { font-size: 1.5rem; font-weight: 700; color: var(--nexus-midnight); }
.ks-summary-label { font-size: 0.8125rem; color: var(--nexus-muted); }

.ks-legend { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px; background: var(--tsms-bg-subtle); border-radius: var(--nexus-radius-md); margin-top: 16px; }
.ks-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--nexus-muted); }
.ks-legend-dot { width: 12px; height: 12px; border-radius: 50%; }

/* ============================================================
   SITE MODULE STYLES
   ============================================================ */

/* --- Login & Auth --- */
body.login-page {
  background: var(--nexus-midnight);
  position: relative;
  overflow-x: hidden;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: var(--tsms-z-base);
}

.login-card {
  max-width: 440px;
  width: 100%;
  background: var(--nexus-surface);
  border-radius: var(--nexus-radius-xl);
  box-shadow: var(--nexus-shadow-xl);
  overflow: hidden;
  animation: slideUp .6s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-header {
  background: var(--nexus-midnight);
  padding: 40px 32px 36px;
  text-align: center;
  color: var(--nexus-sidebar-text);
  position: relative;
  overflow: hidden;
}
.login-header img { height: 52px; margin-bottom: 16px; }
.login-header h4 {
  margin: 0;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--nexus-sidebar-text);
}
.login-header p {
  margin: 8px 0 0;
  color: var(--nexus-amber);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-body { padding: 32px; }

/* Spacing system: tight 8, normal 16, generous 24, section 32 */
.login-form-fields { display: flex; flex-direction: column; gap: 16px; }
.login-form-fields .form-group { margin-bottom: 0; }
.login-form-fields .form-group label {
  font-weight: 600;
  font-size: .8rem;
  color: var(--nexus-midnight);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-form-fields .form-control {
  border-radius: var(--nexus-radius-md);
  padding: 11px 14px;
  border: 1.5px solid var(--nexus-border);
  background: var(--nexus-surface);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.login-form-fields .form-control:focus {
  border-color: var(--nexus-amber);
  box-shadow: 0 0 0 2px var(--tsms-border-focus);
  outline: none;
}
.login-form-fields .form-control::placeholder { color: var(--nexus-muted); }

.login-primary-action { margin-top: 28px; }

.btn-login {
  background: var(--nexus-amber);
  border: none;
  border-radius: var(--nexus-radius-md);
  padding: 14px;
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nexus-midnight);
  box-shadow: var(--nexus-shadow-md);
  transition: .2s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  display: block;
}
.btn-login:hover {
  background: #b45309;
  transform: translateY(-1px);
  box-shadow: var(--nexus-shadow-lg);
}
.btn-login:active { transform: translateY(0); }

.login-dynamic-actions { margin-top: 24px; }
.login-dynamic-actions .face-actions,
.login-dynamic-actions .mfa-actions { display: flex; flex-direction: column; gap: 8px; }
.login-dynamic-actions .mfa-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--nexus-border);
}

.btn-face-action { width: 100%; }

.login-status { margin-top: 12px; padding: 8px; min-height: 32px; }

.login-separator {
  margin-top: 24px;
  height: 1px;
  background: #e7e5e4;
}

.login-links {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.login-links a {
  color: #b45309;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: .2s;
  white-space: nowrap;
  flex: 0 0 auto;
}
.login-links a:hover { color: #92400e; text-decoration: underline; }
.login-links span { font-size: .8rem; line-height: 1.35; color: #78716c; margin-left: auto; text-align: right; flex: 1 1 auto; }

.login-footer { text-align: center; margin-top: 20px; color: var(--nexus-sidebar-text-muted); font-size: .8rem; }
.login-footer a { color: var(--nexus-sidebar-accent); }

/* Password toggle */
#toggle-password {
  border-color: var(--nexus-border);
  background: var(--tsms-bg-surface);
  color: var(--nexus-muted);
  transition: all 0.2s;
  padding: 10px 14px;
  position: relative;
}
#toggle-password:hover { background: var(--tsms-bg-subtle); color: var(--nexus-slate); }
#toggle-password:focus { box-shadow: none; border-color: var(--nexus-amber); }
#toggle-password::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.auth-note {
  margin-bottom: 20px;
  padding: .875rem 1rem;
  border-radius: var(--nexus-radius-md);
  background: var(--tsms-warning-light);
  color: var(--tsms-warning-dark);
  font-size: .875rem;
  line-height: 1.5;
  border: 1px solid var(--tsms-warning);
  font-weight: 500;
}

/* --- MPTNS Dashboard --- */
.dashboard-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  min-height: 100vh;
}

.kpi-card {
  background: var(--tsms-bg-surface);
  border-radius: var(--nexus-radius-md);
  padding: 20px;
  box-shadow: var(--nexus-shadow-sm);
  border-left: 4px solid transparent;
  transition: transform 0.2s;
  height: 100%;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--nexus-shadow-md); }
.kpi-card.teal-border { border-left-color: #008eb4; }
.kpi-card.green-border { border-left-color: #28a745; }
.kpi-card.purple-border { border-left-color: #6f42c1; }
.kpi-card.orange-border { border-left-color: #fd7e14; }
.kpi-card.red-border { border-left-color: #dc3545; }

.kpi-icon {
  width: 40px; height: 40px; border-radius: var(--nexus-radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: 15px;
}
.bg-icon-teal { background: #e0f7fa; color: #008eb4; }
.bg-icon-green { background: #e8f5e9; color: #28a745; }
.bg-icon-purple { background: #f3e5f5; color: #6f42c1; }
.bg-icon-orange { background: #fff3e0; color: #fd7e14; }
.bg-icon-red { background: #ffebee; color: #dc3545; }

.kpi-value { font-size: 1.8rem; font-weight: 700; color: #2c3e50; margin-bottom: 5px; }
.kpi-label { font-size: 0.85rem; color: #5f6368; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.kpi-subtext { font-size: 0.75rem; color: #95a5a6; margin-top: 5px; }

.insight-section { background: var(--tsms-bg-surface); border-radius: var(--nexus-radius-md); padding: 15px; margin-bottom: 20px; border: 1px solid #dee2e6; }
.insight-title { color: #6f42c1; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; margin-bottom: 10px; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.insight-item { font-size: 0.8rem; color: #555; border-left: 2px solid #ddd; padding-left: 10px; }
.insight-item strong { color: #333; display: block; margin-bottom: 3px; }

.chart-panel { background: var(--tsms-bg-surface); border-radius: var(--nexus-radius-md); padding: 20px; margin-bottom: 20px; box-shadow: var(--nexus-shadow-sm); }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.chart-title { font-size: 1rem; font-weight: 600; color: #1f505c; display: flex; align-items: center; }

/* --- Finance --- */
.finance-card { transition: transform 0.2s ease-in-out; }
.finance-card:hover { transform: translateY(-3px); }

.expense-card { transition: transform 0.2s ease-in-out; border: 1px solid #e5e7eb; }
.expense-card:hover { transform: translateY(-3px); box-shadow: var(--nexus-shadow-md); }

/* --- Security --- */
.device-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--nexus-radius-lg);
  padding: 20px;
  margin-bottom: 15px;
  background: var(--tsms-bg-surface);
  transition: all 0.2s ease;
}
.device-card:hover { box-shadow: var(--nexus-shadow-md); }

.device-icon {
  width: 48px; height: 48px;
  background: var(--nexus-indigo);
  border-radius: var(--nexus-radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--tsms-text-inverse); font-size: 1.3rem;
}
.device-name { font-weight: 600; font-size: 1.1rem; color: #1f2937; }
.device-meta { color: #6b7280; font-size: 0.85rem; }

.btn-delete-device { color: #ef4444; background: none; border: none; padding: 5px 10px; cursor: pointer; transition: all 0.2s; }
.btn-delete-device:hover { color: #dc2626; background: #fee2e2; border-radius: var(--nexus-radius-sm); }

.section-title { font-size: 1.25rem; font-weight: 600; color: #374151; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb; }

.register-type-btn {
  flex: 1; padding: 15px; border: 2px solid #e5e7eb;
  background: var(--tsms-bg-surface); border-radius: var(--nexus-radius-md); cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.register-type-btn:hover { border-color: #667eea; background: #f8f9ff; }
.register-type-btn.active { border-color: #667eea; background: #eef2ff; }
.register-type-btn i { font-size: 2rem; margin-bottom: 10px; display: block; }
.register-type-btn .label { font-weight: 600; font-size: 1rem; }
.register-type-btn .hint { font-size: 0.8rem; color: #6b7280; margin-top: 5px; }

.security-setup .form-check-input { min-width: 1.125rem; min-height: 1.125rem; cursor: pointer; }
.security-setup .form-check-label { cursor: pointer; padding-left: 0.25rem; user-select: none; }

@media (max-width: 767.98px) {
  .security-setup { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .security-setup .card-body { padding: 1rem; }
  .security-setup .form-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .security-setup .form-inline .form-check { margin-right: 0 !important; min-height: 44px; display: flex; align-items: center; }
  .security-setup .form-inline .form-check-input { width: 1.25rem; height: 1.25rem; margin-top: 0; }
  .security-setup .form-inline #save-pref { margin-left: 0 !important; min-height: 44px; padding: 0.5rem 1.25rem; }
  .security-setup .btn-block { min-height: 48px; font-size: 1rem; }
  .security-setup .btn-sm { min-height: 40px; padding: 0.5rem 1rem; }
  .security-setup .col-lg-6 { margin-bottom: 1rem !important; }
  .security-setup .badge { font-size: 0.85rem; padding: 0.5em 0.75em; }
  .security-setup .card .d-flex.justify-content-between { flex-direction: column !important; gap: 1rem; }
  .security-setup .card .d-flex.justify-content-between > div:last-child { align-self: stretch; }
  .security-setup .card .d-flex.justify-content-between .btn { width: 100%; min-height: 48px; }
  #faceEnrollModal .modal-dialog { margin: 0.5rem; max-width: calc(100% - 1rem); }
  #faceEnrollModal .modal-body { padding: 0.75rem; }
  #faceEnrollModal .modal-footer { flex-direction: column; gap: 0.5rem; }
  #faceEnrollModal .modal-footer .btn { width: 100%; min-height: 48px; }
  .security-setup .alert { padding: 0.875rem; }
  .face-enroll-container .camera-preview { max-width: 100% !important; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .security-setup .col-lg-6 { margin-bottom: 1.5rem; }
}

/* --- Face Enrollment --- */
.face-enroll-container {
  max-width: 500px; margin: 50px auto; background: var(--tsms-bg-surface);
  border-radius: var(--nexus-radius-xl); padding: 30px 25px;
  box-shadow: var(--nexus-shadow-xl);
  font-family: 'Inter', Arial, sans-serif;
}

.camera-preview { position: relative; overflow: hidden; border-radius: var(--nexus-radius-xl); background: #1f2937; }
.face-enroll-container .camera-preview { max-width: 350px; margin: 0 auto 25px; padding-top: 100%; }
.face-enroll-container .camera-preview video,
.face-enroll-container .camera-preview canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

.status-message {
  margin-top: 18px; padding: 12px; border-radius: var(--nexus-radius-md);
  text-align: center; font-weight: 500; font-size: 1.05rem; display: none;
}
.status-message.success { background: #d1fae5; color: #065f46; }
.status-message.error { background: #fee2e2; color: #991b1b; }
.status-message.info { background: #dbeafe; color: #1e40af; }

/* --- Error Page --- */
.error-container { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.error-card { background: var(--tsms-bg-surface); border-radius: var(--nexus-radius-xl); box-shadow: var(--nexus-shadow-xl); max-width: 600px; width: 100%; overflow: hidden; text-align: center; }
.error-header { padding: 48px 40px 32px; position: relative; }
.error-header.warning-gradient { background: var(--nexus-amber); }
.error-header.danger-gradient { background: var(--nexus-rose); }
.error-header::before { content: ''; position: absolute; top: -50px; right: -50px; width: 200px; height: 200px; background: var(--nexus-dark-border); border-radius: 50%; opacity: 0.2; }

.error-icon { width: 80px; height: 80px; background: var(--nexus-dark-border); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; opacity: 0.3; }
.error-icon i { font-size: 2.5rem; color: var(--tsms-text-inverse); }
.error-code { font-size: 4rem; font-weight: 800; color: var(--tsms-text-inverse); line-height: 1; margin-bottom: 8px; }
.error-title { color: var(--tsms-text-inverse); font-size: 1.25rem; font-weight: 500; margin: 0; }
.error-body { padding: 32px 40px 40px; }
.error-message { color: var(--nexus-muted); font-size: 1rem; line-height: 1.6; margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.error-actions .btn { padding: 12px 28px; border-radius: var(--nexus-radius-md); font-weight: 600; transition: all 0.2s ease; }
.btn-back-home { background: var(--nexus-indigo); color: var(--tsms-text-inverse); border: none; }
.btn-back-home:hover { transform: translateY(-2px); box-shadow: var(--nexus-shadow-md); color: var(--tsms-text-inverse); }
.btn-go-back { background: var(--tsms-bg-subtle); color: var(--nexus-slate); border: none; }
.btn-go-back:hover { background: var(--nexus-border); }
.error-help { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--nexus-border); color: var(--nexus-muted); font-size: 0.85rem; }
.error-help a { color: var(--nexus-indigo); }

/* --- Navbar --- */
#btn_logout:hover::before { content: 'Logout  '; }
.page-wrapper > header.navbar,
.page > header.navbar {
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
  border-bottom: none !important;
  border-radius: var(--nexus-radius-lg);
  margin: 0.25rem 0.5rem 0;
  width: calc(100% - 1rem);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: none !important;
}
.page-wrapper > header.navbar .navbar-brand,
.page > header.navbar .navbar-brand {
  background: transparent;
  border: none;
  color: #ffffff !important;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.15s ease;
}
.page-wrapper > header.navbar .navbar-brand:hover,
.page > header.navbar .navbar-brand:hover {
  color: #c8d2dc !important;
  transform: translateY(-1px);
}
.page-wrapper > header.navbar .nav-link,
.page > header.navbar .nav-link {
  color: #c8d2dc !important;
  border-radius: var(--nexus-radius-md);
  padding: 0.45rem 0.75rem;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.page-wrapper > header.navbar .nav-link:hover,
.page-wrapper > header.navbar .nav-link.active,
.page > header.navbar .nav-link:hover,
.page > header.navbar .nav-link.active {
  background: rgba(79, 70, 229, 0.25) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}
.page-wrapper > header.navbar .nav-link i,
.page > header.navbar .nav-link i {
  transition: transform 0.2s ease, color 0.2s ease;
}
.page-wrapper > header.navbar .nav-link:hover i,
.page > header.navbar .nav-link:hover i {
  transform: scale(1.1);
}
html[data-theme="dark"] .page-wrapper > header.navbar,
html[data-theme="dark"] .page > header.navbar,
html.theme-dark .page-wrapper > header.navbar,
html.theme-dark .page > header.navbar,
body.dark-mode .page-wrapper > header.navbar,
body.dark-mode .page > header.navbar {
  background: linear-gradient(135deg, #0a1d3a 0%, #0f172a 100%) !important;
  border-bottom-color: #020617 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}
html[data-theme="dark"] .page-wrapper > header.navbar .navbar-brand,
html[data-theme="dark"] .page > header.navbar .navbar-brand,
html.theme-dark .page-wrapper > header.navbar .navbar-brand,
html.theme-dark .page > header.navbar .navbar-brand,
body.dark-mode .page-wrapper > header.navbar .navbar-brand,
body.dark-mode .page > header.navbar .navbar-brand {
  background: transparent;
  border: none;
  color: #ffffff !important;
}
html[data-theme="dark"] .page-wrapper > header.navbar .nav-link,
html[data-theme="dark"] .page > header.navbar .nav-link,
html.theme-dark .page-wrapper > header.navbar .nav-link,
html.theme-dark .page > header.navbar .nav-link,
body.dark-mode .page-wrapper > header.navbar .nav-link,
body.dark-mode .page > header.navbar .nav-link { color: #c8d2dc !important; }
html[data-theme="dark"] .page-wrapper > header.navbar .nav-link:hover,
html[data-theme="dark"] .page-wrapper > header.navbar .nav-link.active,
html[data-theme="dark"] .page > header.navbar .nav-link:hover,
html[data-theme="dark"] .page > header.navbar .nav-link.active,
html.theme-dark .page-wrapper > header.navbar .nav-link:hover,
html.theme-dark .page-wrapper > header.navbar .nav-link.active,
html.theme-dark .page > header.navbar .nav-link:hover,
html.theme-dark .page > header.navbar .nav-link.active,
body.dark-mode .page-wrapper > header.navbar .nav-link:hover,
body.dark-mode .page-wrapper > header.navbar .nav-link.active,
body.dark-mode .page > header.navbar .nav-link:hover,
body.dark-mode .page > header.navbar .nav-link.active {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

/* Vertical sidebar layout: push top navbar and content to the right of the fixed sidebar */
@media (min-width: 992px) {
  .page-vertical-menu {
    display: flex;
  }
  .page-vertical-menu > header.navbar {
    margin: 0 0.0625rem 0 16.0625rem;
    width: auto;
    border-radius: 0 0 var(--nexus-radius-lg) var(--nexus-radius-lg);
  }
  .page-vertical-menu > .page-wrapper {
    margin: 0 0.0625rem 0 16.0625rem;
    width: auto;
    max-width: none;
    overflow-x: hidden;
  }
}

.page-wrapper > header.navbar .dropdown-menu,
.page > header.navbar .dropdown-menu {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%) !important;
  border-color: #1a1a2e !important;
  border-radius: var(--nexus-radius-lg);
  box-shadow: var(--tsms-shadow-lg);
  animation: nexusDropdownIn 0.2s ease-out;
  transform-origin: top center;
  z-index: 1100;
}

/* Ensure user-info dropdown links are clickable above other layers */
.page-wrapper > header.navbar .nav-item.dropdown,
.page > header.navbar .nav-item.dropdown {
  position: relative;
  z-index: 1100;
}
.page-wrapper > header.navbar .dropdown-menu .dropdown-item,
.page > header.navbar .dropdown-menu .dropdown-item {
  position: relative;
  z-index: 1101;
  pointer-events: auto;
}

/* Service-calls create layout: form on left (70%), summary extends to right edge */
.service-calls-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-right: -1.5rem; /* Negative margin to extend summary to card edge */
}
.service-calls-form-area {
  flex: 0 0 70%;
  max-width: 70%;
}
.service-calls-summary {
  flex: 1 1 auto;
  min-width: 320px;
  align-self: flex-start;
  padding-right: 1.5rem; /* Restore padding for summary content */
}
.service-calls-summary-inner {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: var(--nexus-radius-lg);
  padding: 1rem;
}
.sf-summary-header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  color: #212529;
}

/* Summary grid: 2-column label/value */
.service-flow-summary-grid {
  display: grid;
  grid-template-columns: minmax(120px, 40%) 1fr;
  gap: 0.4rem 0.75rem;
  align-items: center;
}
.service-flow-summary-grid .sf-summary-label {
  font-weight: 600;
  color: #495057;
  text-align: right;
  padding-right: 0.25rem;
  font-size: 0.85rem;
}
.service-flow-summary-grid .sf-summary-value {
  color: #212529;
  font-weight: 500;
  font-size: 0.85rem;
  word-break: break-word;
}
.service-flow-summary-grid .sf-summary-section-header {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: 0.9rem;
  color: #198754;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid #dee2e6;
}

/* Service-calls form: compact inputs, smaller vertical gaps */
.service-calls-form .row {
  --bs-gutter-y: 0.5rem;
  margin-bottom: 0.5rem;
}
.service-calls-form .form-group {
  margin-bottom: 0.5rem;
}
.service-calls-form .form-group .form-control,
.service-calls-form .select2-container--default .select2-selection--single,
.service-calls-form .column3 .form-control,
.service-calls-form .column4 .form-control {
  width: 100%;
  max-width: 280px;
  min-width: 120px;
}
.service-calls-form textarea.form-control {
  max-width: 100%;
}
.service-calls-form .serial-number-field,
.service-calls-form .model-field {
  max-width: 220px;
}
.service-calls-form .brand-field,
.service-calls-form .machine-type-field {
  max-width: 180px;
}

/* Activity meta row: 2-column label/input grid */
#activity-meta-row .activity-meta-grid {
  display: grid;
  grid-template-columns: minmax(140px, 25%) 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
}
#activity-meta-row .activity-meta-grid label {
  margin-bottom: 0;
  font-weight: 500;
}
#activity-meta-row .activity-meta-grid input {
  width: 100%;
  max-width: 220px;
}

html[data-theme="dark"] .service-calls-summary-inner,
html.theme-dark .service-calls-summary-inner,
body.dark-mode .service-calls-summary-inner {
  background: #16213e;
  border-color: #1a1a2e;
}
html[data-theme="dark"] .sf-summary-header,
html.theme-dark .sf-summary-header,
body.dark-mode .sf-summary-header {
  color: #f8f9fa;
  border-color: #1a1a2e;
}
html[data-theme="dark"] .service-flow-summary-grid .sf-summary-label,
html.theme-dark .service-flow-summary-grid .sf-summary-label,
body.dark-mode .service-flow-summary-grid .sf-summary-label {
  color: #adb5bd;
}
html[data-theme="dark"] .service-flow-summary-grid .sf-summary-value,
html.theme-dark .service-flow-summary-grid .sf-summary-value,
body.dark-mode .service-flow-summary-grid .sf-summary-value {
  color: #f8f9fa;
}
html[data-theme="dark"] .page-wrapper > header.navbar .dropdown-menu,
html[data-theme="dark"] .page > header.navbar .dropdown-menu,
html.theme-dark .page-wrapper > header.navbar .dropdown-menu,
html.theme-dark .page > header.navbar .dropdown-menu,
body.dark-mode .page-wrapper > header.navbar .dropdown-menu,
body.dark-mode .page > header.navbar .dropdown-menu {
  background: linear-gradient(135deg, #0a1d3a 0%, #0f172a 100%) !important;
  border-color: #020617 !important;
}
.page-wrapper > header.navbar .dropdown-item,
.page > header.navbar .dropdown-item {
  color: #c8d2dc !important;
  border-radius: var(--nexus-radius-md);
  margin: 0.15rem 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
html[data-theme="dark"] .page-wrapper > header.navbar .dropdown-item,
html[data-theme="dark"] .page > header.navbar .dropdown-item,
html.theme-dark .page-wrapper > header.navbar .dropdown-item,
html.theme-dark .page > header.navbar .dropdown-item,
body.dark-mode .page-wrapper > header.navbar .dropdown-item,
body.dark-mode .page > header.navbar .dropdown-item { color: #c8d2dc !important; }
.page-wrapper > header.navbar .dropdown-item:hover,
.page-wrapper > header.navbar .dropdown-item.active,
.page > header.navbar .dropdown-item:hover,
.page > header.navbar .dropdown-item.active {
  background: rgba(79, 70, 229, 0.25) !important;
  color: #ffffff !important;
  transform: translateX(2px);
}
html[data-theme="dark"] .page-wrapper > header.navbar .dropdown-item:hover,
html[data-theme="dark"] .page-wrapper > header.navbar .dropdown-item.active,
html[data-theme="dark"] .page > header.navbar .dropdown-item:hover,
html[data-theme="dark"] .page > header.navbar .dropdown-item.active,
html.theme-dark .page-wrapper > header.navbar .dropdown-item:hover,
html.theme-dark .page-wrapper > header.navbar .dropdown-item.active,
html.theme-dark .page > header.navbar .dropdown-item:hover,
html.theme-dark .page > header.navbar .dropdown-item.active,
body.dark-mode .page-wrapper > header.navbar .dropdown-item:hover,
body.dark-mode .page-wrapper > header.navbar .dropdown-item.active,
body.dark-mode .page > header.navbar .dropdown-item:hover,
body.dark-mode .page > header.navbar .dropdown-item.active {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #ffffff !important;
}
@keyframes nexusDropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.flash-danger { animation: alertFlash 1s ease-in-out infinite; }
.navbar-nav .dropdown-menu { min-width: 220px; }
.navbar-nav .dropdown-item { padding: 0.5rem 1rem; }
.navbar-nav .dropdown-item i { width: 20px; margin-right: 8px; }

/* --- Dashboard Stats Grid --- */
.dashboard-stat-card {
  background: var(--tsms-bg-surface); border-radius: var(--nexus-radius-lg); padding: 1.5rem;
  position: relative; box-shadow: var(--nexus-shadow-md);
  border: 1px solid var(--nexus-border); transition: all 0.3s ease;
  height: 100%; cursor: pointer; overflow: hidden;
}
.dashboard-stat-card:hover { box-shadow: var(--nexus-shadow-lg); border-color: var(--tsms-primary); }

.stat-icon-circle { width: 48px; height: 48px; border-radius: var(--nexus-radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.stat-val-big { font-size: 2rem; font-weight: 800; color: var(--nexus-midnight); line-height: 1; margin-bottom: 0.25rem; }
.stat-label-text { color: var(--nexus-muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.stat-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--tsms-bg-subtle); font-size: 0.85rem; color: var(--nexus-muted); display: flex; justify-content: space-between; align-items: center; }

.trend-badge { padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.trend-up { background: var(--tsms-success-light); color: var(--tsms-success-dark); }
.trend-neutral { background: var(--tsms-bg-subtle); color: var(--nexus-muted); }

.theme-blue .stat-icon-circle { background: var(--tsms-primary-light); color: var(--tsms-primary); }
.theme-orange .stat-icon-circle { background: var(--tsms-warning-light); color: var(--tsms-warning); }
.theme-red .stat-icon-circle { background: var(--tsms-danger-light); color: var(--tsms-danger); }
.theme-green .stat-icon-circle { background: var(--tsms-success-light); color: var(--tsms-success); }
.theme-teal .stat-icon-circle { background: var(--tsms-info-light); color: var(--nexus-teal); }
.theme-purple .stat-icon-circle { background: var(--tsms-bg-subtle); color: var(--nexus-indigo); }
.theme-indigo .stat-icon-circle { background: var(--tsms-primary-light); color: var(--tsms-primary); }
.theme-gray .stat-icon-circle { background: var(--tsms-bg-subtle); color: var(--nexus-muted); }

@media (max-width: 576px) {
  .login-card { max-width: 95%; border-radius: var(--nexus-radius-xl); }
  .login-body { padding: 25px; }
  .dashboard-stat-card { padding: 1rem; }
  .stat-val-big { font-size: 1.5rem; }
  .stat-icon-circle { width: 40px; height: 40px; font-size: 1.25rem; }
}

/* --- Kintone --- */
.status-badge { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--nexus-radius-pill); font-weight: 600; font-size: 0.8125rem; }
.push-status-card { border-radius: var(--nexus-radius-md); border: none; box-shadow: var(--nexus-shadow-md); margin-bottom: 20px; }

/* --- Two-Factor Verify --- */
.btn-user { padding: 0.75rem 1rem; border-radius: 10rem; font-size: 1rem; }
.form-control-user { border-radius: 10rem; padding: 1.5rem 1rem; border: 1px solid var(--nexus-border); }
.form-control-user:focus { border-color: var(--tsms-border-focus); box-shadow: 0 0 0 0.2rem var(--tsms-border-focus); }

/* --- Login Particles & Toggle --- */
#particles-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; overflow: hidden; pointer-events: none;
}
#particles-bg::before,
#particles-bg::after {
  content: ''; position: absolute; border-radius: 50%;
  animation: float 15s infinite ease-in-out;
}
#particles-bg::before {
  width: 300px; height: 300px; background: rgba(102, 126, 234, 0.15);
  top: -100px; right: -100px;
}
#particles-bg::after {
  width: 400px; height: 400px; background: rgba(118, 75, 162, 0.1);
  bottom: -150px; left: -150px; animation-delay: -7s;
}

.floating-shape {
  position: fixed; border-radius: 50%; opacity: 0.1; z-index: -1;
  animation: floatShape 20s infinite ease-in-out;
}
.floating-shape:nth-child(1) { width: 80px; height: 80px; background: #667eea; top: 20%; left: 10%; animation-duration: 18s; }
.floating-shape:nth-child(2) { width: 120px; height: 120px; background: #764ba2; top: 60%; right: 15%; animation-duration: 22s; animation-delay: -5s; }
.floating-shape:nth-child(3) { width: 60px; height: 60px; background: #f59e0b; bottom: 20%; left: 20%; animation-duration: 16s; animation-delay: -10s; }

/* --- Keyframes --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes alertFlash { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, 30px) rotate(5deg); }
  50% { transform: translate(0, 50px) rotate(0deg); }
  75% { transform: translate(-30px, 30px) rotate(-5deg); }
}
@keyframes floatShape {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-40px) scale(1.1); }
}

/* ============================================================
   SECURITY LAYOUT (security.php)
   ============================================================ */

.nexus-security-body {
  min-height: 100vh;
  background: var(--nexus-midnight);
  background-attachment: fixed;
  color: var(--nexus-midnight);
}

.nexus-security-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 16px;
}

.nexus-security-brand {
  text-align: center;
  margin-bottom: 32px;
  color: var(--tsms-text-inverse);
}

.nexus-security-brand img {
  height: 48px;
  margin-bottom: 12px;
}

.nexus-security-container {
  width: 100%;
  max-width: 1200px;
  background: var(--tsms-bg-surface);
  border-radius: var(--nexus-radius-lg);
  box-shadow: var(--nexus-shadow-xl);
  padding: 32px;
}

/* ============================================================
   Responsive Adaptations
   ============================================================ */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 769px) {
  .service-calls-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .itss-toolbar {
    padding: 10px;
  }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
  .service-calls-shell .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .service-calls-shell .card-title {
    font-size: 1.1rem;
  }

  .service-calls-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .service-calls-toolbar .btn {
    width: 100%;
    white-space: normal;
    min-height: 44px;
  }

  .service-calls-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .service-calls-stat {
    padding: 8px 10px;
  }

  .service-calls-stat .value {
    font-size: 1.1rem;
  }

  /* ITSS index mobile */
  .itss-toolbar {
    padding: 8px;
    margin-bottom: 8px;
  }

  .itss-summary {
    padding: 8px;
    margin-bottom: 8px;
  }

  .itss-summary .count {
    font-size: 1rem;
  }

  .itss-status-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
  }

  /* View page mobile */
  .view_table .table td,
  .view_table .table th {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.25rem 0.35rem;
  }

  /* Ensure grids scroll horizontally on mobile */
  .service-calls-grid-wrap,
  #itss-index-grid {
    -webkit-overflow-scrolling: touch;
  }

  /* Touch-friendly buttons in action columns */
  .view_table .btn-sm {
    min-height: 36px;
    min-width: 44px;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  /* Chat popup: position within viewport on mobile */
  .chat-popup {
    width: 100% !important;
    max-width: 320px;
    left: auto !important;
    right: 10px !important;
  }

  /* Security layout mobile */
  .nexus-security-container {
    padding: 20px;
  }

  .nexus-security-wrapper {
    padding: 24px 12px;
  }

  /* Form flow card padding reduction */
  .card.nexus-flow-card {
    padding: 10px !important;
  }

  /* Ensure select2 dropdowns don't overflow */
  .select2-container {
    max-width: 100%;
  }
}

/* ============================================================
   SELECT2 — match Bootstrap form-control height / padding
   ============================================================ */
.select2-container--default .select2-selection--single {
  height: auto !important;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--nexus-border) !important;
  border-radius: var(--nexus-radius-sm) !important;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5;
  padding-left: 0;
  padding-right: 1.5rem;
  color: var(--nexus-slate);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.75rem;
  top: 0;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  margin-right: 1.25rem;
  color: var(--nexus-muted);
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
  border-color: var(--nexus-indigo) !important;
  box-shadow: 0 0 0 3px var(--nexus-border);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--nexus-muted);
}

/* Dark mode Select2 */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html.theme-dark .select2-container--default .select2-selection--single,
body.dark-mode .select2-container--default .select2-selection--single {
  background-color: var(--nexus-dark-surface);
  border-color: var(--nexus-dark-border) !important;
  color: var(--nexus-dark-text);
}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered,
body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--nexus-dark-text);
}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
html.theme-dark .select2-container--default .select2-selection--single .select2-selection__placeholder,
body.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--nexus-dark-text-muted);
}

/* Dark mode overrides for .card.nexus-flow-card */
html.theme-dark .card.nexus-flow-card,
html[data-theme="dark"] .card.nexus-flow-card {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
  color: #e5e5e5 !important;
}

html.theme-dark .card.nexus-flow-card .form-control,
html[data-theme="dark"] .card.nexus-flow-card .form-control {
  background: #1a1a1a !important;
  border-color: #3e3e42 !important;
  color: #e5e5e5 !important;
}

html.theme-dark .card.nexus-flow-card label,
html.theme-dark .card.nexus-flow-card .nexus-flow-title,
html[data-theme="dark"] .card.nexus-flow-card label,
html[data-theme="dark"] .card.nexus-flow-card .nexus-flow-title {
  color: #d4d4d4 !important;
}

/* --- Global KPI Card Component --- */
.kpi-card {
  position: relative;
  border-radius: var(--nexus-radius-md);
  padding: 14px 16px;
  color: var(--tsms-text-inverse);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--nexus-shadow-xl);
}

.kpi-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  color: var(--tsms-text-inverse);
  line-height: 1.2;
}

.kpi-card p {
  font-size: 0.78rem;
  margin: 4px 0 0 0;
  color: var(--nexus-sidebar-text);
  line-height: 1.3;
  font-weight: 500;
}

.kpi-card .ico {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 1.6rem;
  opacity: 0.35;
  color: var(--tsms-text-inverse);
  line-height: 1;
}

.kpi-card .ico i,
.kpi-card .ico .fas,
.kpi-card .ico .fa {
  color: var(--tsms-text-inverse);
}

/* Dark mode: keep kpi-card colors vibrant */
html.theme-dark .kpi-card,
html[data-theme="dark"] .kpi-card {
  filter: brightness(1.08) saturate(1.1);
}

html.theme-dark .kpi-card h3,
html[data-theme="dark"] .kpi-card h3 {
  color: var(--tsms-text-inverse) !important;
}

html.theme-dark .kpi-card p,
html[data-theme="dark"] .kpi-card p {
  color: var(--nexus-dark-text-secondary) !important;
}

html.theme-dark .kpi-card .ico,
html[data-theme="dark"] .kpi-card .ico {
  color: var(--tsms-text-inverse) !important;
  opacity: 0.4;
}

html.theme-dark .kpi-card .ico i,
html[data-theme="dark"] .kpi-card .ico i {
  color: var(--tsms-text-inverse) !important;
}

html.theme-dark .itss-toolbar,
html[data-theme="dark"] .itss-toolbar {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .itss-summary,
html[data-theme="dark"] .itss-summary {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .itss-summary .count,
html[data-theme="dark"] .itss-summary .count {
  color: #e5e5e5 !important;
}

html.theme-dark .itss-summary .label,
html[data-theme="dark"] .itss-summary .label {
  color: #a3a3a3 !important;
}

html.theme-dark .filter-card,
html[data-theme="dark"] .filter-card {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .filter-card .filter-label,
html[data-theme="dark"] .filter-card .filter-label {
  color: #d4d4d4 !important;
}

html.theme-dark .gp-filter-bar,
html[data-theme="dark"] .gp-filter-bar {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .gp-filter-bar select,
html.theme-dark .gp-filter-bar input,
html[data-theme="dark"] .gp-filter-bar select,
html[data-theme="dark"] .gp-filter-bar input {
  background: #1a1a1a !important;
  border-color: #3e3e42 !important;
  color: #e5e5e5 !important;
}

html.theme-dark .gp-admin-bar,
html[data-theme="dark"] .gp-admin-bar {
  background: #1a1a1a !important;
  border: 1px solid #3e3e42 !important;
}

html.theme-dark .gp-admin-bar .text-white,
html.theme-dark .gp-admin-bar span,
html[data-theme="dark"] .gp-admin-bar .text-white,
html[data-theme="dark"] .gp-admin-bar span {
  color: #e5e5e5 !important;
}

html.theme-dark .gp-lane-badge,
html[data-theme="dark"] .gp-lane-badge {
  background: #1a1a1a !important;
  border-color: #3e3e42 !important;
}

html.theme-dark .gp-lane-badge strong,
html[data-theme="dark"] .gp-lane-badge strong {
  color: #e5e5e5 !important;
}

html.theme-dark .bulk-wrap,
html[data-theme="dark"] .bulk-wrap {
  background: #1a1a1a !important;
  border-color: #3e3e42 !important;
}

html.theme-dark .bulk-wrap .toolbar-label,
html[data-theme="dark"] .bulk-wrap .toolbar-label {
  color: #e5e5e5 !important;
}

html.theme-dark .bulk-wrap .text-muted,
html[data-theme="dark"] .bulk-wrap .text-muted {
  color: #a3a3a3 !important;
}

html.theme-dark .bulk-wrap label,
html[data-theme="dark"] .bulk-wrap label {
  color: #d4d4d4 !important;
}

html.theme-dark .liq-page,
html.theme-dark .liq-filters,
html.theme-dark .liq-table-wrap,
html[data-theme="dark"] .liq-page,
html[data-theme="dark"] .liq-filters,
html[data-theme="dark"] .liq-table-wrap {
  background: #0d0d0d !important;
}

html.theme-dark .liq-table-card,
html[data-theme="dark"] .liq-table-card {
  background: #1f1f1f !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .liq-legend,
html[data-theme="dark"] .liq-legend {
  background: #1a1a1a !important;
  border-color: #2d2d2d !important;
}

html.theme-dark .liq-legend .leg-item,
html.theme-dark .liq-legend .nexus-legend-label,
html[data-theme="dark"] .liq-legend .leg-item,
html[data-theme="dark"] .liq-legend .nexus-legend-label {
  color: #a3a3a3 !important;
}

html.theme-dark .liq-table-card .table tbody td,
html[data-theme="dark"] .liq-table-card .table tbody td {
  background: #1f1f1f !important;
  color: #d4d4d4 !important;
}

html.theme-dark .liq-table-card .table tbody tr:nth-child(even) td,
html[data-theme="dark"] .liq-table-card .table tbody tr:nth-child(even) td {
  background: #1a1a1a !important;
}

html.theme-dark .liq-table-card .table tbody tr:hover td,
html[data-theme="dark"] .liq-table-card .table tbody tr:hover td {
  background: #252525 !important;
}

html.theme-dark .liq-table-card .table thead th,
html[data-theme="dark"] .liq-table-card .table thead th {
  background: #1a1a1a !important;
  color: #94a3b8 !important;
}

html.theme-dark .liq-table-card .table .empty,
html[data-theme="dark"] .liq-table-card .table .empty {
  color: #a3a3a3 !important;
}

/* ============================================================
   DARK MODE OVERRIDES — employees/index and similar pages
   ============================================================ */
html[data-theme="dark"] .nexus-stat-card,
html.theme-dark .nexus-stat-card,
body.dark-mode .nexus-stat-card {
  background: #254870 !important;
  border-color: #5a7fa0 !important;
}
html[data-theme="dark"] .nexus-stat-card .nexus-stat-val,
html[data-theme="dark"] .nexus-stat-card .nexus-stat-lbl,
html.theme-dark .nexus-stat-card .nexus-stat-val,
html.theme-dark .nexus-stat-card .nexus-stat-lbl,
body.dark-mode .nexus-stat-card .nexus-stat-val,
body.dark-mode .nexus-stat-card .nexus-stat-lbl {
  color: #e5e5e5 !important;
}
html[data-theme="dark"] .nexus-stat-card .nexus-stat-icon,
html.theme-dark .nexus-stat-card .nexus-stat-icon,
body.dark-mode .nexus-stat-card .nexus-stat-icon {
  background: var(--nexus-dark-border-faint) !important;
  color: var(--nexus-dark-text) !important;
}

/* ============================================================
   GRIDVIEW TABLE STRIPING
   ============================================================ */

/* Light mode — subtle alternating rows instead of pure white */
.page-body .grid-view .table-striped tbody tr:nth-of-type(odd) td,
.page-body .grid-view .table-striped tbody tr:nth-of-type(odd) th {
  background-color: var(--tsms-bg-subtle) !important;
}
.page-body .grid-view .table-striped tbody tr:nth-of-type(even) td,
.page-body .grid-view .table-striped tbody tr:nth-of-type(even) th {
  background-color: var(--tsms-bg-surface) !important;
}
.page-body .grid-view .table tbody td,
.page-body .grid-view .table tbody th {
  border-bottom-color: var(--nexus-border) !important;
}

/* Dark mode */
html[data-theme="dark"] .page-body .grid-view .table-striped tbody tr:nth-of-type(odd),
html.theme-dark .page-body .grid-view .table-striped tbody tr:nth-of-type(odd),
body.dark-mode .page-body .grid-view .table-striped tbody tr:nth-of-type(odd) {
  background-color: #162d4a !important;
}
html[data-theme="dark"] .page-body .grid-view .table-striped tbody tr:nth-of-type(even),
html.theme-dark .page-body .grid-view .table-striped tbody tr:nth-of-type(even),
body.dark-mode .page-body .grid-view .table-striped tbody tr:nth-of-type(even) {
  background-color: #254870 !important;
}
html[data-theme="dark"] .page-body .grid-view .table tbody td,
html.theme-dark .page-body .grid-view .table tbody td,
body.dark-mode .page-body .grid-view .table tbody td {
  background-color: transparent !important;
  border-bottom-color: #2a4a6f !important;
  color: #d4d4d4 !important;
}
html[data-theme="dark"] .page-body .grid-view .table tbody tr:hover td,
html.theme-dark .page-body .grid-view .table tbody tr:hover td,
body.dark-mode .page-body .grid-view .table tbody tr:hover td {
  background: #1f3d5c !important;
}
html[data-theme="dark"] .page-body .grid-view .table thead th,
html.theme-dark .page-body .grid-view .table thead th,
body.dark-mode .page-body .grid-view .table thead th {
  background: #162d4a !important;
  border-bottom-color: #3d5a7f !important;
  color: #e5e5e5 !important;
}

/* ============================================================
   GENERIC / DETAILVIEW TABLES IN DARK MODE
   ============================================================ */
html[data-theme="dark"] .table,
html.theme-dark .table,
body.dark-mode .table,
html[data-theme="dark"] .detail-view,
html.theme-dark .detail-view,
body.dark-mode .detail-view {
  --bs-table-bg: transparent;
  --bs-table-color: var(--nexus-dark-text);
  --bs-table-border-color: var(--nexus-dark-border-subtle);
  color: var(--nexus-dark-text) !important;
}

html[data-theme="dark"] .table > tbody > tr,
html.theme-dark .table > tbody > tr,
body.dark-mode .table > tbody > tr,
html[data-theme="dark"] .detail-view > tbody > tr,
html.theme-dark .detail-view > tbody > tr,
body.dark-mode .detail-view > tbody > tr {
  background-color: transparent !important;
}

html[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(odd) > td,
html.theme-dark .table.table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .table.table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(odd) > th,
html.theme-dark .table.table-striped > tbody > tr:nth-of-type(odd) > th,
body.dark-mode .table.table-striped > tbody > tr:nth-of-type(odd) > th,
html[data-theme="dark"] .detail-view.table-striped > tbody > tr:nth-of-type(odd) > td,
html.theme-dark .detail-view.table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .detail-view.table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-theme="dark"] .detail-view.table-striped > tbody > tr:nth-of-type(odd) > th,
html.theme-dark .detail-view.table-striped > tbody > tr:nth-of-type(odd) > th,
body.dark-mode .detail-view.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: #162d4a !important;
  color: var(--nexus-dark-text) !important;
}

html[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(even) > td,
html.theme-dark .table.table-striped > tbody > tr:nth-of-type(even) > td,
body.dark-mode .table.table-striped > tbody > tr:nth-of-type(even) > td,
html[data-theme="dark"] .table.table-striped > tbody > tr:nth-of-type(even) > th,
html.theme-dark .table.table-striped > tbody > tr:nth-of-type(even) > th,
body.dark-mode .table.table-striped > tbody > tr:nth-of-type(even) > th,
html[data-theme="dark"] .detail-view.table-striped > tbody > tr:nth-of-type(even) > td,
html.theme-dark .detail-view.table-striped > tbody > tr:nth-of-type(even) > td,
body.dark-mode .detail-view.table-striped > tbody > tr:nth-of-type(even) > td,
html[data-theme="dark"] .detail-view.table-striped > tbody > tr:nth-of-type(even) > th,
html.theme-dark .detail-view.table-striped > tbody > tr:nth-of-type(even) > th,
body.dark-mode .detail-view.table-striped > tbody > tr:nth-of-type(even) > th {
  background-color: #1e3a5f !important;
  color: var(--nexus-dark-text) !important;
}

html[data-theme="dark"] .table > tbody > tr > td,
html.theme-dark .table > tbody > tr > td,
body.dark-mode .table > tbody > tr > td,
html[data-theme="dark"] .detail-view > tbody > tr > td,
html.theme-dark .detail-view > tbody > tr > td,
body.dark-mode .detail-view > tbody > tr > td {
  color: var(--nexus-dark-text) !important;
  border-color: var(--nexus-dark-border-subtle) !important;
}

/* ============================================================
   STATUS BADGE
   ============================================================ */

.status-badge,
.itss-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  max-width: 160px;
  min-height: 1.6em;
  padding: 0.35rem 0.6rem;
}

/* ============================================================
   HARDENING UTILITIES
   ============================================================ */

/* Text overflow: single-line ellipsis */
.nexus-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Text overflow: multi-line clamp */
.nexus-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nexus-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Force word break for long strings (URLs, IDs, hashes) */
.nexus-wrap {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Extra small text utility */
.text-xs { font-size: 0.75rem; }

/* Detail view label widths */
.detail-label-sm { width: 20%; }
.detail-label-md { width: 35%; }
.detail-label-lg { width: 65%; }
.detail-label-md-40 { width: 40%; }
.detail-label-lg-60 { width: 60%; }
.detail-label-sm-30 { width: 30%; }
.detail-label-lg-70 { width: 70%; }

/* Dimension utilities */
.nexus-icon-32 { width: 32px; height: 32px; }
.nexus-icon-38 { width: 38px; height: 38px; }
.nexus-icon-40 { width: 40px; height: 40px; }
.nexus-icon-48 { width: 48px; height: 48px; }
.nexus-min-w-180 { min-width: 180px; }

/* Object fit */
.nexus-object-cover { object-fit: cover; }

/* Scrollable containers */
.nexus-scroll-y-300 { max-height: 300px; overflow-y: auto; }
.nexus-scroll-y-400 { max-height: 400px; overflow-y: auto; }

/* Card transition */
.nexus-card-trans { transition: all 0.2s ease; }

/* Flex gap (Bootstrap 3 compat) */
.nexus-gap-2 { gap: 0.5rem; }
.nexus-gap-3 { gap: 0.75rem; }
.nexus-gap-4 { gap: 1rem; }

/* Letter spacing */
.nexus-tracking-wide { letter-spacing: 0.025em; }

/* Border bottom light gray */
.nexus-border-bottom-light { border-bottom: 1px solid #e9ecef; }

/* Border radius top only */
.nexus-rounded-t-12 { border-radius: var(--nexus-radius-lg) var(--nexus-radius-lg) 0 0; }

/* Gradient backgrounds - replaced with solid tokens for a quieter, consistent palette */
.nexus-gradient-primary { background: var(--nexus-indigo); }
.nexus-gradient-header { background: var(--tsms-bg-subtle); }
.nexus-gradient-success { background: var(--nexus-emerald); }
.nexus-gradient-danger { background: var(--nexus-rose); }
.nexus-gradient-info { background: var(--tsms-primary); }
.nexus-gradient-cyan { background: var(--nexus-teal); }
.nexus-bg-cyan-soft { background: var(--tsms-bg-surface); }

/* Soft backgrounds - solid, tokenized surfaces */
.nexus-bg-light-soft { background: var(--tsms-bg-surface); }
.nexus-bg-warm-soft { background: var(--tsms-bg-surface); }
.nexus-bg-gray-200 { background: var(--tsms-bg-subtle); }

/* Tab transition */
.nexus-tab-trans { transition: all 0.3s ease; }

/* Font size utilities */
.nexus-text-lg { font-size: 1.1rem; }
.nexus-text-xl { font-size: 1.25rem; }
.nexus-text-sm { font-size: 0.9rem; }
.nexus-text-2xs { font-size: 0.65rem; }
.nexus-text-1_2 { font-size: 1.2em; }

/* Table column widths */
.nexus-w-7 { width: 7%; }
.nexus-w-10 { width: 10%; }
.nexus-w-12 { width: 12%; }
.nexus-w-15 { width: 15%; }
.nexus-w-20 { width: 20%; }

/* Fixed widths */
.nexus-w-28 { width: 28px; }
.nexus-w-40 { width: 40px; }
.nexus-w-50 { width: 50px; }
.nexus-w-60 { width: 60px; }
.nexus-w-100 { width: 100px; }
.nexus-w-110 { width: 110px; }
.nexus-w-120 { width: 120px; }
.nexus-w-130 { width: 130px; }
.nexus-w-140 { width: 140px; }
.nexus-w-150 { width: 150px; }
.nexus-w-220 { width: 220px; }

/* Cursor */
.nexus-cursor-pointer { cursor: pointer; }

/* White space */
.nexus-nowrap { white-space: nowrap; }

/* Signature line for print reports */
.nexus-signature-line { width: 80%; margin: 0 auto; }

/* ============================================================
   DARK MODE — screenshot-aligned deep-navy palette
   ============================================================ */

/* Base page / surface */
html[data-theme="dark"],
html.theme-dark {
  background-color: var(--nexus-midnight);
}

html[data-theme="dark"] body,
html.theme-dark body,
body.dark-mode {
  background-color: var(--nexus-midnight);
  color: #f8fafc;
}

html[data-theme="dark"] .page,
html[data-theme="dark"] .page-wrapper,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .container,
html[data-theme="dark"] .container-fluid,
html.theme-dark .page,
html.theme-dark .page-wrapper,
html.theme-dark .footer,
html.theme-dark .container,
html.theme-dark .container-fluid,
body.dark-mode .page,
body.dark-mode .page-wrapper,
body.dark-mode .footer,
body.dark-mode .container,
body.dark-mode .container-fluid {
  background-color: var(--nexus-midnight);
  color: #f8fafc;
}

/* Generic cards */
html[data-theme="dark"] .card,
html.theme-dark .card,
body.dark-mode .card {
  background-color: var(--nexus-surface);
  border-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .card-header,
html.theme-dark .card-header,
body.dark-mode .card-header {
  background-color: var(--nexus-surface);
  border-bottom-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .card-footer,
html.theme-dark .card-footer,
body.dark-mode .card-footer {
  background-color: var(--nexus-surface);
  border-top-color: var(--nexus-border);
  color: var(--nexus-muted);
}

html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-text,
html[data-theme="dark"] .card-label,
html.theme-dark .card-title,
html.theme-dark .card-text,
html.theme-dark .card-label,
body.dark-mode .card-title,
body.dark-mode .card-text,
body.dark-mode .card-label {
  color: #f8fafc;
}

/* Hero header */
html[data-theme="dark"] .card.nexus-hero-header,
html.theme-dark .card.nexus-hero-header,
body.dark-mode .card.nexus-hero-header {
  background: linear-gradient(135deg, #0a1d3a 0%, #0f172a 100%) !important;
  border-color: #020617 !important;
  color: #ffffff;
}

html[data-theme="dark"] .card.nexus-hero-header h2,
html[data-theme="dark"] .card.nexus-hero-header .nexus-hero-sub,
html[data-theme="dark"] .card.nexus-hero-header .breadcrumb-item,
html[data-theme="dark"] .card.nexus-hero-header .breadcrumb-item a,
html[data-theme="dark"] .card.nexus-hero-header .breadcrumb-item.active,
html.theme-dark .card.nexus-hero-header h2,
html.theme-dark .card.nexus-hero-header .nexus-hero-sub,
html.theme-dark .card.nexus-hero-header .breadcrumb-item,
html.theme-dark .card.nexus-hero-header .breadcrumb-item a,
html.theme-dark .card.nexus-hero-header .breadcrumb-item.active,
body.dark-mode .card.nexus-hero-header h2,
body.dark-mode .card.nexus-hero-header .nexus-hero-sub,
body.dark-mode .card.nexus-hero-header .breadcrumb-item,
body.dark-mode .card.nexus-hero-header .breadcrumb-item a,
body.dark-mode .card.nexus-hero-header .breadcrumb-item.active {
  color: #c8d2dc;
}

html[data-theme="dark"] .card.nexus-hero-header .nexus-hero-breadcrumb,
html.theme-dark .card.nexus-hero-header .nexus-hero-breadcrumb,
body.dark-mode .card.nexus-hero-header .nexus-hero-breadcrumb {
  --tblr-breadcrumb-divider-color: rgba(248, 250, 252, 0.5);
}

html[data-theme="dark"] .card.nexus-hero-header .btn-light,
html.theme-dark .card.nexus-hero-header .btn-light,
body.dark-mode .card.nexus-hero-header .btn-light {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

html[data-theme="dark"] .card.nexus-hero-header .btn-light:hover,
html.theme-dark .card.nexus-hero-header .btn-light:hover,
body.dark-mode .card.nexus-hero-header .btn-light:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

/* Stat cards */
html[data-theme="dark"] .nexus-stat-card,
html.theme-dark .nexus-stat-card,
body.dark-mode .nexus-stat-card {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .nexus-stat-card .nexus-stat-val,
html.theme-dark .nexus-stat-card .nexus-stat-val,
body.dark-mode .nexus-stat-card .nexus-stat-val {
  color: #f8fafc;
}

html[data-theme="dark"] .nexus-stat-card .nexus-stat-lbl,
html.theme-dark .nexus-stat-card .nexus-stat-lbl,
body.dark-mode .nexus-stat-card .nexus-stat-lbl {
  color: var(--nexus-muted);
}

/* Data cards / tables */
html[data-theme="dark"] .nexus-data-card,
html.theme-dark .nexus-data-card,
body.dark-mode .nexus-data-card {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .nexus-data-card-header,
html.theme-dark .nexus-data-card-header,
body.dark-mode .nexus-data-card-header {
  background: var(--nexus-surface);
  border-bottom-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .nexus-table-wrap,
html.theme-dark .nexus-table-wrap,
body.dark-mode .nexus-table-wrap {
  background: var(--nexus-surface);
}

html[data-theme="dark"] .nexus-table-wrap .table,
html.theme-dark .nexus-table-wrap .table,
body.dark-mode .nexus-table-wrap .table {
  color: #e2e8f0;
}

html[data-theme="dark"] .nexus-table-wrap .table thead th,
html.theme-dark .nexus-table-wrap .table thead th,
body.dark-mode .nexus-table-wrap .table thead th {
  background: var(--nexus-midnight);
  border-bottom-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .nexus-table-wrap .table td,
html.theme-dark .nexus-table-wrap .table td,
body.dark-mode .nexus-table-wrap .table td {
  border-bottom-color: var(--nexus-border);
  color: #e2e8f0;
}

html[data-theme="dark"] .nexus-table-wrap .table tbody tr:hover td,
html.theme-dark .nexus-table-wrap .table tbody tr:hover td,
body.dark-mode .nexus-table-wrap .table tbody tr:hover td {
  background: var(--nexus-dark-border-faint);
}

/* ITSS components */
html[data-theme="dark"] .itss-toolbar,
html.theme-dark .itss-toolbar,
body.dark-mode .itss-toolbar {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .itss-summary,
html.theme-dark .itss-summary,
body.dark-mode .itss-summary {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .itss-summary .count,
html.theme-dark .itss-summary .count,
body.dark-mode .itss-summary .count {
  color: #f8fafc;
}

html[data-theme="dark"] .itss-summary .label,
html.theme-dark .itss-summary .label,
body.dark-mode .itss-summary .label {
  color: var(--nexus-muted);
}

/* Flow card */
html[data-theme="dark"] .card.nexus-flow-card,
html.theme-dark .card.nexus-flow-card,
body.dark-mode .card.nexus-flow-card {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .card.nexus-flow-card .nexus-flow-title,
html[data-theme="dark"] .card.nexus-flow-card label,
html.theme-dark .card.nexus-flow-card .nexus-flow-title,
html.theme-dark .card.nexus-flow-card label,
body.dark-mode .card.nexus-flow-card .nexus-flow-title,
body.dark-mode .card.nexus-flow-card label {
  color: #e2e8f0;
}

/* Forms */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html.theme-dark .form-control,
html.theme-dark .form-select,
body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: var(--nexus-midnight);
  border-color: var(--nexus-border);
  color: #f8fafc;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html.theme-dark .form-control:focus,
html.theme-dark .form-select:focus,
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background-color: var(--nexus-midnight);
  border-color: var(--nexus-accent);
  color: var(--tsms-text-inverse);
  box-shadow: 0 0 0 0.2rem var(--nexus-dark-border);
}

html[data-theme="dark"] .input-group-text,
html.theme-dark .input-group-text,
body.dark-mode .input-group-text {
  background-color: var(--nexus-midnight);
  border-color: var(--nexus-border);
  color: #e2e8f0;
}

/* Buttons */
html[data-theme="dark"] .btn-light,
html.theme-dark .btn-light,
body.dark-mode .btn-light {
  background-color: var(--nexus-dark-border-faint);
  border-color: var(--nexus-border);
  color: var(--tsms-text-inverse);
}

html[data-theme="dark"] .btn-light:hover,
html.theme-dark .btn-light:hover,
body.dark-mode .btn-light:hover {
  background-color: var(--nexus-dark-border-subtle);
  color: var(--tsms-text-inverse);
}

html[data-theme="dark"] .btn-primary,
html.theme-dark .btn-primary,
body.dark-mode .btn-primary {
  background-color: var(--nexus-accent);
  border-color: var(--nexus-accent);
  color: var(--tsms-text-inverse);
}

html[data-theme="dark"] .btn-secondary,
html.theme-dark .btn-secondary,
body.dark-mode .btn-secondary {
  background-color: #334155;
  border-color: var(--nexus-border);
  color: #f8fafc;
}

/* Text helpers */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html.theme-dark .text-muted,
html.theme-dark .text-secondary,
body.dark-mode .text-muted,
body.dark-mode .text-secondary {
  color: var(--nexus-muted) !important;
}

html[data-theme="dark"] .text-dark,
html.theme-dark .text-dark,
body.dark-mode .text-dark {
  color: #f8fafc !important;
}

html[data-theme="dark"] .text-primary,
html.theme-dark .text-primary,
body.dark-mode .text-primary {
  color: var(--nexus-accent) !important;
}

/* Dropdowns */
html[data-theme="dark"] .dropdown-menu,
html.theme-dark .dropdown-menu,
body.dark-mode .dropdown-menu {
  background-color: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .dropdown-item,
html.theme-dark .dropdown-item,
body.dark-mode .dropdown-item {
  color: #e2e8f0;
}

html[data-theme="dark"] .dropdown-item:hover,
html.theme-dark .dropdown-item:hover,
body.dark-mode .dropdown-item:hover {
  background-color: var(--nexus-dark-surface);
  color: var(--tsms-text-inverse);
}

/* GP / filter components */
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .gp-filter-bar,
html.theme-dark .filter-card,
html.theme-dark .gp-filter-bar,
body.dark-mode .filter-card,
body.dark-mode .gp-filter-bar {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .filter-card .filter-label,
html.theme-dark .filter-card .filter-label,
body.dark-mode .filter-card .filter-label {
  color: #e2e8f0;
}

html[data-theme="dark"] .gp-admin-bar,
html.theme-dark .gp-admin-bar,
body.dark-mode .gp-admin-bar {
  background: var(--nexus-midnight);
  border: 1px solid var(--nexus-border);
}

html[data-theme="dark"] .gp-lane-badge,
html.theme-dark .gp-lane-badge,
body.dark-mode .gp-lane-badge {
  background: var(--nexus-midnight);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .bulk-wrap,
html.theme-dark .bulk-wrap,
body.dark-mode .bulk-wrap {
  background: var(--nexus-midnight);
  border-color: var(--nexus-border);
}

/* Liq components */
html[data-theme="dark"] .liq-page,
html[data-theme="dark"] .liq-filters,
html[data-theme="dark"] .liq-table-wrap,
html.theme-dark .liq-page,
html.theme-dark .liq-filters,
html.theme-dark .liq-table-wrap,
body.dark-mode .liq-page,
body.dark-mode .liq-filters,
body.dark-mode .liq-table-wrap {
  background: var(--nexus-midnight);
}

html[data-theme="dark"] .liq-table-card,
html[data-theme="dark"] .liq-legend,
html.theme-dark .liq-table-card,
html.theme-dark .liq-legend,
body.dark-mode .liq-table-card,
body.dark-mode .liq-legend {
  background: var(--nexus-surface);
  border-color: var(--nexus-border);
}

html[data-theme="dark"] .liq-table-card .table thead th,
html.theme-dark .liq-table-card .table thead th,
body.dark-mode .liq-table-card .table thead th {
  background: var(--nexus-midnight);
  color: var(--nexus-muted);
}

html[data-theme="dark"] .liq-table-card .table tbody td,
html.theme-dark .liq-table-card .table tbody td,
body.dark-mode .liq-table-card .table tbody td {
  background: var(--nexus-surface);
  color: #e2e8f0;
}

html[data-theme="dark"] .liq-table-card .table tbody tr:nth-child(even) td,
html.theme-dark .liq-table-card .table tbody tr:nth-child(even) td,
body.dark-mode .liq-table-card .table tbody tr:nth-child(even) td {
  background: var(--nexus-midnight);
}

html[data-theme="dark"] .liq-table-card .table tbody tr:hover td,
html.theme-dark .liq-table-card .table tbody tr:hover td,
body.dark-mode .liq-table-card .table tbody tr:hover td {
  background: var(--nexus-dark-border-faint);
}

/* GridView table striping */
html[data-theme="dark"] .page-body .grid-view .table-striped tbody tr:nth-of-type(odd),
html.theme-dark .page-body .grid-view .table-striped tbody tr:nth-of-type(odd),
body.dark-mode .page-body .grid-view .table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--nexus-midnight);
}

html[data-theme="dark"] .page-body .grid-view .table tbody td,
html.theme-dark .page-body .grid-view .table tbody td,
body.dark-mode .page-body .grid-view .table tbody td {
  background: var(--nexus-surface);
  border-bottom-color: var(--nexus-border);
  color: #e2e8f0;
}

html[data-theme="dark"] .page-body .grid-view .table tbody tr:hover td,
html.theme-dark .page-body .grid-view .table tbody tr:hover td,
body.dark-mode .page-body .grid-view .table tbody tr:hover td {
  background: var(--nexus-dark-border-faint);
}

html[data-theme="dark"] .page-body .grid-view .table thead th,
html.theme-dark .page-body .grid-view .table thead th,
body.dark-mode .page-body .grid-view .table thead th {
  background: var(--nexus-midnight);
  border-bottom-color: var(--nexus-border);
  color: #f8fafc;
}

/* Subtotal row background */
.nexus-bg-subtotal { background-color: #f0f0f5; }

/* Custom badge colors */
.nexus-badge-purple { background-color: var(--nexus-indigo); color: var(--tsms-text-inverse); }

/* Font size utilities */
.nexus-text-75 { font-size: 75%; }
.nexus-text-2xs { font-size: 0.5rem; }
.nexus-text-1_05 { font-size: 1.05rem; }

/* Opacity */
.opacity-85 { opacity: 0.85; }

/* Outline badge purple */
.badge-outline-purple { border: 1px solid #6f42c1; color: #6f42c1; background: none; }

/* Spacing utilities */
.nexus-ml-1 { margin-left: 5px; }
.nexus-mr-2 { margin-right: 10px; }
.nexus-mt-0 { margin-top: 0; }
.nexus-mt-1 { margin-top: 5px; }
.nexus-mt-2 { margin-top: 10px; }
.nexus-mt-3 { margin-top: 13px; }
.nexus-mr-1 { margin-right: 5px; }
.nexus-mb-1 { margin-bottom: 5px; }
.nexus-mb-2 { margin-bottom: 10px; }
.nexus-mb-3 { margin-bottom: 15px; }
.nexus-pr-1 { padding-right: 5px; }
.nexus-pr-2 { padding-right: 10px; }
.nexus-pl-1 { padding-left: 5px; }
.nexus-p-1 { padding: 5px; }
.nexus-p-2 { padding: 8px 10px; }

/* Display */
.nexus-d-block { display: block; }

/* Text alignment */
.nexus-text-center { text-align: center; }

/* Font weights */
.nexus-font-bold { font-weight: bold; }

/* Font sizes */
.nexus-text-11px { font-size: 0.6875rem; }

/* Sizing */
.nexus-h-34 { height: 34px; }
.nexus-h-59 { height: 59px; }
.nexus-w-full { width: 100%; }
.nexus-max-h-200 { max-height: 200px; }
.nexus-min-h-34 { min-height: 34px; }

/* Backgrounds */
.nexus-bg-black { background: var(--nexus-midnight); }

/* Resize */
.nexus-resize-v { resize: vertical; }

/* Auto margins */
.nexus-mx-auto { margin-left: auto; margin-right: auto; }

/* Max widths */
.nexus-max-w-150 { max-width: 150px; }
.nexus-max-w-180 { max-width: 180px; }
.nexus-max-w-200 { max-width: 200px; }
.nexus-max-w-220 { max-width: 220px; }
.nexus-max-w-270 { max-width: 270px; }
.nexus-max-w-280 { max-width: 280px; }
.nexus-max-w-300 { max-width: 300px; }
.nexus-max-w-320 { max-width: 320px; }
.nexus-max-w-460 { max-width: 460px; }

/* Min widths */
.nexus-min-w-170 { min-width: 170px; }
.nexus-min-w-220 { min-width: 220px; }

/* Extra large decorative font sizes */
.nexus-text-12rem { font-size: 12rem; }

/* Avatar sizes */
.nexus-avatar-sm { width: 35px; height: 35px; }

/* Border radius utilities */
.nexus-rounded-xl { border-radius: var(--nexus-radius-xl); }
.nexus-rounded-t-xl { border-radius: var(--nexus-radius-xl) var(--nexus-radius-xl) 0 0; }
.nexus-rounded-b-xl { border-radius: 0 0 var(--nexus-radius-xl) var(--nexus-radius-xl); }

/* Scroll containers with max-height */
.nexus-scroll-y-400 { max-height: 400px; overflow-y: auto; }
.nexus-scroll-y-450 { max-height: 450px; overflow-y: auto; }
.nexus-scroll-y-500 { max-height: 500px; overflow-y: auto; }

/* Progress bar sizing */
.nexus-progress-thin { width: 60px; height: 6px; border-radius: var(--nexus-radius-md); }
.nexus-progress-thick { height: 20px; }
.nexus-progress-30 { height: 30px; }

/* Custom progress bar children */
.nexus-progress-thin .nexus-progress-bar-info { height: 100%; background: #17a2b8; border-radius: var(--nexus-radius-sm); }

/* Light background utility */
.nexus-bg-light { background-color: #f8f9fa; }

/* Gray soft background */
.nexus-bg-gray-soft { background: var(--tsms-bg-subtle); }

/* Line height */
.nexus-leading-relaxed { line-height: 1.7; }
.nexus-leading-snug { line-height: 1.4; }

/* Overflow auto max-height */
.nexus-scroll-auto-300 { overflow: auto; max-height: 300px; }

/* Visibility */
.nexus-invisible { visibility: hidden; }

/* ------------------------------------------------------------------
   Legacy stat card component (curved, indented)
   ------------------------------------------------------------------ */
.nexus-stat-legacy {
  position: relative;
  border-radius: var(--nexus-radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 155px;
  margin-bottom: 1rem;
}

.nexus-stat-legacy .inner {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem;
  padding-right: 4.5rem;
}

.nexus-stat-legacy .inner h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.nexus-stat-legacy .inner p {
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.nexus-stat-legacy .icon {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.25rem;
  opacity: 0.35;
  line-height: 1;
}

.nexus-stat-legacy .nexus-stat-legacy-footer {
  flex-shrink: 0;
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  background: var(--tsms-bg-subtle);
  border-top: 1px solid var(--nexus-border);
}

/* Skeleton loader sizing */
.nexus-skeleton-md { width: 50%; height: 2rem; }

/* Border radius */
.nexus-rounded-12 { border-radius: var(--nexus-radius-lg); }
.nexus-rounded-16 { border-radius: var(--nexus-radius-xl); }

/* Badge position offset (requires position-relative/absolute) */
.nexus-badge-offset { top: -5px; right: -5px; }

/* Prevent flex/grid items from overflowing their container */
.nexus-min-w-0 { min-width: 0; }
.nexus-min-h-0 { min-height: 0; }

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .nexus-animate,
  .nexus-animate-1,
  .nexus-animate-2,
  .nexus-animate-3,
  .nexus-animate-4,
  .nexus-animate-5 {
    animation: none;
    opacity: 1;
  }
  .card.nexus-hero-header,
  .card.nexus-hero-header::before,
  .card.nexus-hero-header::after {
    transition: none;
  }
  .nexus-stat-card,
  .nexus-stat-card:hover,
  .nexus-btn,
  .nexus-btn:hover {
    transition: none;
    transform: none;
  }
  .nexus-tab-link { transition: none; }
  .nexus-table-row { transition: none; }
  .nexus-timeline-item { transition: none; }
  .navbar-vertical,
  .main-sidebar,
  .nexus-data-card,
  .nexus-data-card-header,
  .nexus-list-group-item,
  .service-calls-stat,
  .dashboard-stat-card,
  .register-type-btn,
  .error-actions .btn,
  .btn-user,
  .ki-app-badge.running,
  .ki-log-live::before,
  .flash-danger,
  .nexus-skeleton,
  .skeleton {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* Focus-visible for keyboard navigation */
.nexus-btn:focus-visible,
.nexus-tab-link:focus-visible,
.nexus-table-row a:focus-visible {
  outline: 2px solid var(--nexus-amber);
  outline-offset: 2px;
}

/* Loading skeleton for async content */
.nexus-skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: nexusSkeletonShimmer 1.5s infinite;
  border-radius: var(--nexus-radius-sm);
}
@keyframes nexusSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nexus-skeleton { animation: none; background: #e2e8f0; }
}

/* Grid utilities */
.nexus-grid-col-full { grid-column: 1 / -1; }

/* Route map containers */
.nexus-route-map-lg { width: 100%; border-radius: var(--nexus-radius-lg); border: 2px solid #e2e8f0; box-shadow: var(--nexus-shadow-md); background: #f8fafc; }
.nexus-route-map-md { width: 100%; border-radius: var(--nexus-radius-md); border: 2px solid #e2e8f0; background: #f8fafc; }

/* Heights */
.nexus-h-450 { height: 450px; }
.nexus-h-500 { height: 500px; }
.nexus-h-100 { height: 100%; }
.nexus-min-h-680 { min-height: 680px; }

/* Flex center */
.nexus-flex-center { display: flex; align-items: center; justify-content: center; }

/* Text colors */
.nexus-text-slate-400 { color: #94a3b8; }

/* Font sizes */
.nexus-text-sm { font-size: 0.9rem; }
.nexus-text-12px { font-size: 0.75rem; }
.nexus-badge-xs { font-size: 0.65rem; }
.nexus-badge-sm { font-size: 0.72rem; }

/* List reset */
.nexus-list-plain { list-style: none; padding: 0; margin: 0; }
.nexus-list-plain-left { list-style: none; padding-left: 0; margin-bottom: 0; }

/* Cursor */
.nexus-cursor-pointer { cursor: pointer; }

/* Yellow light background */
.nexus-bg-yellow-light { background: #fffde7; border: 1px solid #ffe082; }

/* Table auto wrap */
.nexus-table-auto-wrap { overflow: auto; word-wrap: break-word; }

/* Date/time split display for GridView columns */
.nexus-datetime-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  gap: 0.1rem;
  white-space: nowrap;
}
.nexus-datetime-split .nexus-date {
  font-weight: 600;
}
.nexus-datetime-split .nexus-time {
  font-size: 0.75rem;
  color: var(--nexus-muted);
}

/* Image preview box */
.nexus-img-preview { height: 100px; overflow: hidden; background: #eee; }
.nexus-img-cover { width: 100%; height: 100%; object-fit: cover; }

/* Icon sizes */
.nexus-text-3xl { font-size: 3rem; }

/* Brand colors */
.nexus-text-indigo { color: var(--nexus-indigo); }

/* Border accents */
.nexus-border-left-indigo { border: 1px solid var(--nexus-indigo) !important; }

/* Transitions */
.nexus-transition-transform { transition: transform 0.3s ease; }

/* Badge small offset */
.nexus-badge-offset-sm { position: absolute; top: -5px; right: -5px; font-size: 0.5625rem; border: 1px solid #ddd; }

/* Legend label */
.nexus-legend-label { font-size: 0.7rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; }

/* Overflow visible */
.nexus-overflow-visible { overflow: visible; }

/* Extra small margin-left */
.nexus-ml-1-sm { margin-left: 3px; }

/* Percentage widths */
.nexus-w-35p { width: 35%; }
.nexus-w-65p { width: 65%; }

/* Fixed pixel widths */
.nexus-w-50px { width: 50px; }
.nexus-w-60px { width: 60px; }
.nexus-w-80px { width: 80px; }
.nexus-w-100px { width: 100px; }
.nexus-w-130px { width: 130px; }
.nexus-w-190px { width: 190px; }
.nexus-w-1000px { width: 1000px; }

/* Overflow utilities */
.nexus-overflow-auto { overflow: auto; }
.nexus-word-wrap { word-wrap: break-word; }

/* Delete image overlay button */
.nexus-img-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  font-size: 0.875rem;
  text-decoration: none;
  opacity: 0.9;
}

/* Live map utilities */
.nexus-max-h-600 { max-height: 600px; }
.nexus-w-150 { width: 150px; }
.nexus-w-80 { width: 80px; }
.nexus-ml-2 { margin-left: 8px; }
.nexus-min-w-160 { min-width: 160px; }

/* Max-height utilities */
.nexus-max-h-120 { max-height: 120px; }
.nexus-max-h-150 { max-height: 150px; }
.nexus-max-h-180 { max-height: 180px; }
.nexus-max-h-200 { max-height: 200px; }
.nexus-max-h-300 { max-height: 300px; }

/* Overflow-y utility */
.nexus-overflow-y-auto { overflow-y: auto; }

/* Font-size utilities */
.nexus-fs-6px { font-size: 0.375rem; }
.nexus-fs-8px { font-size: 0.5rem; }
.nexus-fs-75 { font-size: 0.75rem; }
.nexus-fs-85 { font-size: 0.85rem; }
.nexus-fs-15 { font-size: 1.5rem; }

/* Progress bar height */
.nexus-progress-h-6 { height: 6px; }
.nexus-progress-h-16 { height: 16px; }

/* Border utilities */
.nexus-border-dashed { border: 2px dashed #ccc; }
.nexus-border-left-success { border: 1px solid #28a745; }
.nexus-border-left-info { border: 1px solid #17a2b8; }
.nexus-border-left-purple { border: 1px solid #6f42c1; }
.nexus-border-top-dark { border-top: 1px solid var(--nexus-midnight); }

/* Signature image */
.nexus-signature-img { max-height: 80px; max-width: 200px; }

/* Cursor */
.nexus-cursor-crosshair { cursor: crosshair; }

/* Color utilities */
.nexus-text-orange { color: #fd7e14; }

/* Height */
.nexus-h-200 { height: 200px; }
.nexus-h-300 { height: 300px; }
.nexus-h-400 { height: 400px; }

/* Max-height */
.nexus-max-h-350 { max-height: 350px; }

/* Border-radius */
.nexus-rounded-8 { border-radius: var(--nexus-radius-md); }

/* Min-width */
.nexus-min-w-250 { min-width: 250px; }

/* Customer marker */
.nexus-customer-marker {
  width: 10px;
  height: 10px;
  background: var(--nexus-indigo);
  border: 2px solid var(--tsms-bg-surface);
  border-radius: 50%;
  box-shadow: var(--nexus-shadow-md);
}

/* ============================================================
   ENGAGEMENT CONSOLE FORM POLISH
   ============================================================ */
.ec-form-header {
  justify-content: space-between !important;
}
.ec-form-header-title {
  font-weight: 700;
  color: var(--nexus-slate);
}
.ec-form-close {
  background: transparent;
  border: none;
  color: var(--nexus-muted);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: var(--nexus-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ec-form-close:hover {
  background: #f1f5f9;
  color: var(--nexus-rose);
}

/* Select2 polish inside engagement console forms */
.ec-form-wrapper .select2-container--default .select2-selection--single {
  border: 1px solid var(--nexus-border) !important;
  border-radius: var(--nexus-radius-sm) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ec-form-wrapper .select2-container--default .select2-selection--single:focus,
.ec-form-wrapper .select2-container--open .select2-selection--single {
  border-color: var(--nexus-indigo) !important;
  box-shadow: 0 0 0 3px var(--nexus-border) !important;
}
.ec-form-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--nexus-slate) !important;
}

/* Form labels: tracked uppercase like Nexus badges */
.ec-form-wrapper form .form-group label,
.ec-form-wrapper form .form-group .col-form-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nexus-muted);
  margin-bottom: 0.35rem;
}

/* Inputs polish */
.ec-form-wrapper .form-control {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ============================================================
   SIDEBAR THEME-AWARE STYLING
   Light theme: soft blue-tinted sidebar
   Dark theme: deep navy sidebar
   ============================================================ */
.main-sidebar,
.navbar-vertical,
aside.main-sidebar,
aside.navbar-vertical {
  background: linear-gradient(180deg, #e8f4fc 0%, #d4ebf7 100%) !important;
  border-right: 1px solid #b9dcef !important;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme="dark"] .main-sidebar,
html[data-theme="dark"] .navbar-vertical,
html[data-theme="dark"] aside.main-sidebar,
html[data-theme="dark"] aside.navbar-vertical,
html.theme-dark .main-sidebar,
html.theme-dark .navbar-vertical,
html.theme-dark aside.main-sidebar,
html.theme-dark aside.navbar-vertical,
body.dark-mode .main-sidebar,
body.dark-mode .navbar-vertical,
body.dark-mode aside.main-sidebar,
body.dark-mode aside.navbar-vertical {
  background: linear-gradient(180deg, var(--nexus-sidebar-bg-mid) 0%, var(--nexus-sidebar-bg-end) 100%) !important;
  border-right-color: var(--nexus-sidebar-bg-end) !important;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
}

.nav-sidebar .nav-link,
.navbar-vertical .nav-link,
.main-sidebar .nav-link {
  color: var(--nexus-slate) !important;
  border-radius: var(--nexus-radius-md);
  margin: 0.15rem 0.5rem;
  padding: 0.55rem 0.75rem;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

html[data-theme="dark"] .nav-sidebar .nav-link,
html[data-theme="dark"] .navbar-vertical .nav-link,
html[data-theme="dark"] .main-sidebar .nav-link,
html.theme-dark .nav-sidebar .nav-link,
html.theme-dark .navbar-vertical .nav-link,
html.theme-dark .main-sidebar .nav-link,
body.dark-mode .nav-sidebar .nav-link,
body.dark-mode .navbar-vertical .nav-link,
body.dark-mode .main-sidebar .nav-link {
  color: var(--nexus-sidebar-text) !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active,
.navbar-vertical .nav-link:hover,
.navbar-vertical .nav-link.active,
.main-sidebar .nav-link:hover,
.main-sidebar .nav-link.active {
  background: rgba(43, 171, 228, 0.15) !important;
  color: #0c4a6e !important;
  box-shadow: inset 0 0 0 1px rgba(43, 171, 228, 0.3);
  transform: translateY(-1px);
}

html[data-theme="dark"] .nav-sidebar .nav-link:hover,
html[data-theme="dark"] .nav-sidebar .nav-link.active,
html[data-theme="dark"] .navbar-vertical .nav-link:hover,
html[data-theme="dark"] .navbar-vertical .nav-link.active,
html[data-theme="dark"] .main-sidebar .nav-link:hover,
html[data-theme="dark"] .main-sidebar .nav-link.active,
html.theme-dark .nav-sidebar .nav-link:hover,
html.theme-dark .nav-sidebar .nav-link.active,
html.theme-dark .navbar-vertical .nav-link:hover,
html.theme-dark .navbar-vertical .nav-link.active,
html.theme-dark .main-sidebar .nav-link:hover,
html.theme-dark .main-sidebar .nav-link.active,
body.dark-mode .nav-sidebar .nav-link:hover,
body.dark-mode .nav-sidebar .nav-link.active,
body.dark-mode .navbar-vertical .nav-link:hover,
body.dark-mode .navbar-vertical .nav-link.active,
body.dark-mode .main-sidebar .nav-link:hover,
body.dark-mode .main-sidebar .nav-link.active {
  background: rgba(79, 70, 229, 0.2) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.nav-sidebar .nav-link .nav-icon,
.navbar-vertical .nav-link .nav-icon,
.main-sidebar .nav-link .nav-icon,
.nav-sidebar .nav-link i,
.navbar-vertical .nav-link i,
.main-sidebar .nav-link i {
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-sidebar .nav-link:hover .nav-icon,
.nav-sidebar .nav-link.active .nav-icon,
.navbar-vertical .nav-link:hover .nav-icon,
.navbar-vertical .nav-link.active .nav-icon,
.main-sidebar .nav-link:hover .nav-icon,
.main-sidebar .nav-link.active .nav-icon,
.nav-sidebar .nav-link:hover i,
.nav-sidebar .nav-link.active i,
.navbar-vertical .nav-link:hover i,
.navbar-vertical .nav-link.active i,
.main-sidebar .nav-link:hover i,
.main-sidebar .nav-link.active i {
  transform: scale(1.1);
}

.nav-sidebar .nav-title,
.navbar-vertical .nav-title,
.main-sidebar .nav-title {
  color: var(--nexus-muted) !important;
  transition: color 0.3s ease;
}

html[data-theme="dark"] .nav-sidebar .nav-title,
html[data-theme="dark"] .navbar-vertical .nav-title,
html[data-theme="dark"] .main-sidebar .nav-title,
html.theme-dark .nav-sidebar .nav-title,
html.theme-dark .navbar-vertical .nav-title,
html.theme-dark .main-sidebar .nav-title,
body.dark-mode .nav-sidebar .nav-title,
body.dark-mode .navbar-vertical .nav-title,
body.dark-mode .main-sidebar .nav-title {
  color: var(--nexus-sidebar-text-muted) !important;
}

.nav-sidebar .nav-treeview .nav-link,
.navbar-vertical .nav-treeview .nav-link,
.main-sidebar .nav-treeview .nav-link {
  color: var(--nexus-slate) !important;
  border-radius: var(--nexus-radius-md);
  margin: 0.1rem 0.25rem 0.1rem 0.75rem;
}

html[data-theme="dark"] .nav-sidebar .nav-treeview .nav-link,
html[data-theme="dark"] .navbar-vertical .nav-treeview .nav-link,
html[data-theme="dark"] .main-sidebar .nav-treeview .nav-link,
html.theme-dark .nav-sidebar .nav-treeview .nav-link,
html.theme-dark .navbar-vertical .nav-treeview .nav-link,
html.theme-dark .main-sidebar .nav-treeview .nav-link,
body.dark-mode .nav-sidebar .nav-treeview .nav-link,
body.dark-mode .navbar-vertical .nav-treeview .nav-link,
body.dark-mode .main-sidebar .nav-treeview .nav-link {
  color: var(--nexus-sidebar-text) !important;
}

.nav-sidebar .nav-treeview .nav-link:hover,
.nav-sidebar .nav-treeview .nav-link.active,
.navbar-vertical .nav-treeview .nav-link:hover,
.navbar-vertical .nav-treeview .nav-link.active,
.main-sidebar .nav-treeview .nav-link:hover,
.main-sidebar .nav-treeview .nav-link.active {
  background: rgba(43, 171, 228, 0.12) !important;
  color: #0c4a6e !important;
}

html[data-theme="dark"] .nav-sidebar .nav-treeview .nav-link:hover,
html[data-theme="dark"] .nav-sidebar .nav-treeview .nav-link.active,
html[data-theme="dark"] .navbar-vertical .nav-treeview .nav-link:hover,
html[data-theme="dark"] .navbar-vertical .nav-treeview .nav-link.active,
html[data-theme="dark"] .main-sidebar .nav-treeview .nav-link:hover,
html[data-theme="dark"] .main-sidebar .nav-treeview .nav-link.active,
html.theme-dark .nav-sidebar .nav-treeview .nav-link:hover,
html.theme-dark .nav-sidebar .nav-treeview .nav-link.active,
html.theme-dark .navbar-vertical .nav-treeview .nav-link:hover,
html.theme-dark .navbar-vertical .nav-treeview .nav-link.active,
html.theme-dark .main-sidebar .nav-treeview .nav-link:hover,
html.theme-dark .main-sidebar .nav-treeview .nav-link.active,
body.dark-mode .nav-sidebar .nav-treeview .nav-link:hover,
body.dark-mode .nav-sidebar .nav-treeview .nav-link.active,
body.dark-mode .navbar-vertical .nav-treeview .nav-link:hover,
body.dark-mode .navbar-vertical .nav-treeview .nav-link.active,
body.dark-mode .main-sidebar .nav-treeview .nav-link:hover,
body.dark-mode .main-sidebar .nav-treeview .nav-link.active {
  background: rgba(79, 70, 229, 0.15) !important;
  color: #ffffff !important;
}

/* Sidebar submenu expand/collapse animation */
.nav-sidebar .nav-treeview,
.navbar-vertical .nav-treeview,
.main-sidebar .nav-treeview {
  transition: height 0.25s ease, opacity 0.25s ease;
}
.ec-form-wrapper .form-control:focus {
  border-color: var(--nexus-indigo);
  box-shadow: 0 0 0 3px var(--nexus-border);
}

/* Button overrides inside EC forms */
.ec-form-wrapper .btn-success {
  background: var(--nexus-emerald);
  border: none;
  color: var(--tsms-text-inverse);
  font-weight: 600;
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-sm);
  transition: all 0.2s ease;
}
.ec-form-wrapper .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--nexus-shadow-md);
  color: var(--tsms-text-inverse);
}
.ec-form-wrapper .btn-default,
.ec-form-wrapper .btn-cancel,
.ec-form-wrapper a.btn-default {
  background: #f8fafc;
  border: 1px solid var(--nexus-border);
  color: var(--nexus-muted);
  font-weight: 600;
  border-radius: var(--nexus-radius-sm);
  transition: all 0.2s ease;
}
.ec-form-wrapper .btn-default:hover,
.ec-form-wrapper .btn-cancel:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* Feedback alerts */
.ec-form-feedback {
  border-radius: var(--nexus-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ec-form-feedback.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.ec-form-feedback.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ============================================================
   ACTION TOOLBAR & TOAST
   ============================================================ */
.nexus-action-toolbar .btn {
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--nexus-radius-sm);
  transition: all 0.2s ease;
}
.nexus-action-toolbar .btn:hover {
  transform: translateY(-1px);
}
.nexus-action-toolbar .btn:focus-visible {
  outline: 2px solid var(--nexus-amber);
  outline-offset: 2px;
}

/* ============================================================
   DASHBOARD PANELS
   ============================================================ */
.nexus-dash-stat {
  transition: all 0.3s ease;
  border: none;
  box-shadow: var(--nexus-shadow-sm);
  overflow: hidden;
  position: relative;
}
.nexus-dash-stat:hover {
  transform: translateY(-5px);
  box-shadow: var(--nexus-shadow-lg);
}
.nexus-dash-stat .card-body {
  padding: 1.5rem;
}
.nexus-dash-stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.nexus-dash-stat-label {
  font-size: 0.85rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.nexus-dash-panel {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-md);
}
.nexus-chart-container {
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 5px;
}
.nexus-chart-container::-webkit-scrollbar {
  width: 4px;
}
.nexus-chart-container::-webkit-scrollbar-thumb {
  background-color: #dee2e6;
  border-radius: var(--nexus-radius-sm);
}
.nexus-section-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--nexus-slate);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}
.nexus-section-title i {
  margin-right: 0.75rem;
  color: var(--nexus-indigo);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
}
@keyframes skeleton-loading {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-text {
  height: 1em;
  border-radius: var(--nexus-radius-sm);
  display: inline-block;
  width: 80%;
}
.skeleton-number {
  height: 2.5rem;
  width: 60%;
  border-radius: var(--nexus-radius-sm);
  margin: 0 auto 0.5rem;
  display: block;
}
.skeleton-bar {
  height: 10px;
  width: 100%;
  border-radius: var(--nexus-radius-sm);
  margin-top: 5px;
}
.nexus-skeleton-md { width: 60%; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .nexus-animate,
  .nexus-animate-1,
  .nexus-animate-2,
  .nexus-animate-3,
  .nexus-animate-4,
  .nexus-animate-5 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .nexus-stat-card,
  .nexus-data-card,
  .nexus-btn-primary,
  .nexus-btn-success,
  .nexus-action-toolbar .btn,
  .card.nexus-hero-header .btn-light,
  .card.nexus-hero-header .btn-warning {
    transition: none !important;
  }
  .nexus-stat-card:hover,
  .nexus-btn-primary:hover,
  .nexus-btn-success:hover,
  .nexus-action-toolbar .btn:hover {
    transform: none !important;
  }
}

/* ============================================================
   GRIDVIEW TABLE DARK MODE FIX
   Force every table inside a Nexus data card, table wrap, or
   GridView container to use dark backgrounds in dark mode.
   Covers grids with custom options classes (table-responsive,
   overflow-auto, etc.) that may not include 'grid-view'.
   ============================================================ */
html[data-theme="dark"] .nexus-table-wrap .table,
html.theme-dark .nexus-table-wrap .table,
body.dark-mode .nexus-table-wrap .table,
html[data-theme="dark"] .nexus-data-card .table,
html.theme-dark .nexus-data-card .table,
body.dark-mode .nexus-data-card .table,
html[data-theme="dark"] .grid-view .table,
html.theme-dark .grid-view .table,
body.dark-mode .grid-view .table,
html[data-theme="dark"] .table-responsive .table,
html.theme-dark .table-responsive .table,
body.dark-mode .table-responsive .table,
html[data-theme="dark"] .page-body .table,
html.theme-dark .page-body .table,
body.dark-mode .page-body .table,
html[data-theme="dark"] .card .table,
html.theme-dark .card .table,
body.dark-mode .card .table,
html[data-theme="dark"] .nexus-table-wrap .table tbody,
html.theme-dark .nexus-table-wrap .table tbody,
body.dark-mode .nexus-table-wrap .table tbody,
html[data-theme="dark"] .nexus-data-card .table tbody,
html.theme-dark .nexus-data-card .table tbody,
body.dark-mode .nexus-data-card .table tbody,
html[data-theme="dark"] .grid-view .table tbody,
html.theme-dark .grid-view .table tbody,
body.dark-mode .grid-view .table tbody,
html[data-theme="dark"] .table-responsive .table tbody,
html.theme-dark .table-responsive .table tbody,
body.dark-mode .table-responsive .table tbody,
html[data-theme="dark"] .page-body .table tbody,
html.theme-dark .page-body .table tbody,
body.dark-mode .page-body .table tbody,
html[data-theme="dark"] .card .table tbody,
html.theme-dark .card .table tbody,
body.dark-mode .card .table tbody,
html[data-theme="dark"] .nexus-table-wrap .table tr,
html.theme-dark .nexus-table-wrap .table tr,
body.dark-mode .nexus-table-wrap .table tr,
html[data-theme="dark"] .nexus-data-card .table tr,
html.theme-dark .nexus-data-card .table tr,
body.dark-mode .nexus-data-card .table tr,
html[data-theme="dark"] .grid-view .table tr,
html.theme-dark .grid-view .table tr,
body.dark-mode .grid-view .table tr,
html[data-theme="dark"] .table-responsive .table tr,
html.theme-dark .table-responsive .table tr,
body.dark-mode .table-responsive .table tr,
html[data-theme="dark"] .page-body .table tr,
html.theme-dark .page-body .table tr,
body.dark-mode .page-body .table tr,
html[data-theme="dark"] .card .table tr,
html.theme-dark .card .table tr,
body.dark-mode .card .table tr,
html[data-theme="dark"] .nexus-table-wrap .table td,
html.theme-dark .nexus-table-wrap .table td,
body.dark-mode .nexus-table-wrap .table td,
html[data-theme="dark"] .nexus-data-card .table td,
html.theme-dark .nexus-data-card .table td,
body.dark-mode .nexus-data-card .table td,
html[data-theme="dark"] .grid-view .table td,
html.theme-dark .grid-view .table td,
body.dark-mode .grid-view .table td,
html[data-theme="dark"] .table-responsive .table td,
html.theme-dark .table-responsive .table td,
body.dark-mode .table-responsive .table td,
html[data-theme="dark"] .page-body .table td,
html.theme-dark .page-body .table td,
body.dark-mode .page-body .table td,
html[data-theme="dark"] .card .table td,
html.theme-dark .card .table td,
body.dark-mode .card .table td,
html[data-theme="dark"] .nexus-table-wrap .table th,
html.theme-dark .nexus-table-wrap .table th,
body.dark-mode .nexus-table-wrap .table th,
html[data-theme="dark"] .nexus-data-card .table th,
html.theme-dark .nexus-data-card .table th,
body.dark-mode .nexus-data-card .table th,
html[data-theme="dark"] .grid-view .table th,
html.theme-dark .grid-view .table th,
body.dark-mode .grid-view .table th,
html[data-theme="dark"] .table-responsive .table th,
html.theme-dark .table-responsive .table th,
body.dark-mode .table-responsive .table th,
html[data-theme="dark"] .page-body .table th,
html.theme-dark .page-body .table th,
body.dark-mode .page-body .table th,
html[data-theme="dark"] .card .table th,
html.theme-dark .card .table th,
body.dark-mode .card .table th {
  --bs-table-bg: transparent !important;
  --bs-table-color: var(--nexus-dark-text) !important;
  --bs-table-border-color: var(--nexus-dark-border-subtle) !important;
  color: var(--nexus-dark-text) !important;
  border-color: var(--nexus-dark-border-subtle) !important;
}

html[data-theme="dark"] .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .nexus-data-card .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .nexus-data-card .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .nexus-data-card .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .grid-view .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .grid-view .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .grid-view .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-responsive .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .table-responsive .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .table-responsive .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .page-body .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .page-body .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .page-body .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .card .table-striped tbody tr:nth-of-type(odd) td,
html.theme-dark .card .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .card .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .nexus-table-wrap .table-striped tbody tr:nth-of-type(odd) th,
html[data-theme="dark"] .nexus-data-card .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .nexus-data-card .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .nexus-data-card .table-striped tbody tr:nth-of-type(odd) th,
html[data-theme="dark"] .grid-view .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .grid-view .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .grid-view .table-striped tbody tr:nth-of-type(odd) th,
html[data-theme="dark"] .table-responsive .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .table-responsive .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .table-responsive .table-striped tbody tr:nth-of-type(odd) th,
html[data-theme="dark"] .page-body .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .page-body .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .page-body .table-striped tbody tr:nth-of-type(odd) th,
html[data-theme="dark"] .card .table-striped tbody tr:nth-of-type(odd) th,
html.theme-dark .card .table-striped tbody tr:nth-of-type(odd) th,
body.dark-mode .card .table-striped tbody tr:nth-of-type(odd) th {
  background-color: #162d4a !important;
  --bs-table-bg: #162d4a !important;
}

html[data-theme="dark"] .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .nexus-data-card .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .nexus-data-card .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .nexus-data-card .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .grid-view .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .grid-view .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .grid-view .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .table-responsive .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .table-responsive .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .table-responsive .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .page-body .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .page-body .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .page-body .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .card .table-striped tbody tr:nth-of-type(even) td,
html.theme-dark .card .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .card .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .nexus-table-wrap .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="dark"] .nexus-data-card .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .nexus-data-card .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .nexus-data-card .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="dark"] .grid-view .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .grid-view .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .grid-view .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="dark"] .table-responsive .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .table-responsive .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .table-responsive .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="dark"] .page-body .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .page-body .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .page-body .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="dark"] .card .table-striped tbody tr:nth-of-type(even) th,
html.theme-dark .card .table-striped tbody tr:nth-of-type(even) th,
body.dark-mode .card .table-striped tbody tr:nth-of-type(even) th {
  background-color: #1e3a5f !important;
  --bs-table-bg: #1e3a5f !important;
}

html[data-theme="dark"] .nexus-table-wrap .table tbody tr:hover td,
html.theme-dark .nexus-table-wrap .table tbody tr:hover td,
body.dark-mode .nexus-table-wrap .table tbody tr:hover td,
html[data-theme="dark"] .nexus-data-card .table tbody tr:hover td,
html.theme-dark .nexus-data-card .table tbody tr:hover td,
body.dark-mode .nexus-data-card .table tbody tr:hover td,
html[data-theme="dark"] .grid-view .table tbody tr:hover td,
html.theme-dark .grid-view .table tbody tr:hover td,
body.dark-mode .grid-view .table tbody tr:hover td,
html[data-theme="dark"] .table-responsive .table tbody tr:hover td,
html.theme-dark .table-responsive .table tbody tr:hover td,
body.dark-mode .table-responsive .table tbody tr:hover td,
html[data-theme="dark"] .page-body .table tbody tr:hover td,
html.theme-dark .page-body .table tbody tr:hover td,
body.dark-mode .page-body .table tbody tr:hover td,
html[data-theme="dark"] .card .table tbody tr:hover td,
html.theme-dark .card .table tbody tr:hover td,
body.dark-mode .card .table tbody tr:hover td,
html[data-theme="dark"] .nexus-table-wrap .table tbody tr:hover th,
html.theme-dark .nexus-table-wrap .table tbody tr:hover th,
body.dark-mode .nexus-table-wrap .table tbody tr:hover th,
html[data-theme="dark"] .nexus-data-card .table tbody tr:hover th,
html.theme-dark .nexus-data-card .table tbody tr:hover th,
body.dark-mode .nexus-data-card .table tbody tr:hover th,
html[data-theme="dark"] .grid-view .table tbody tr:hover th,
html.theme-dark .grid-view .table tbody tr:hover th,
body.dark-mode .grid-view .table tbody tr:hover th,
html[data-theme="dark"] .table-responsive .table tbody tr:hover th,
html.theme-dark .table-responsive .table tbody tr:hover th,
body.dark-mode .table-responsive .table tbody tr:hover th,
html[data-theme="dark"] .page-body .table tbody tr:hover th,
html.theme-dark .page-body .table tbody tr:hover th,
body.dark-mode .page-body .table tbody tr:hover th,
html[data-theme="dark"] .card .table tbody tr:hover th,
html.theme-dark .card .table tbody tr:hover th,
body.dark-mode .card .table tbody tr:hover th {
  background-color: #254870 !important;
  --bs-table-bg: #254870 !important;
}

html[data-theme="dark"] .nexus-table-wrap .table thead th,
html.theme-dark .nexus-table-wrap .table thead th,
body.dark-mode .nexus-table-wrap .table thead th,
html[data-theme="dark"] .nexus-data-card .table thead th,
html.theme-dark .nexus-data-card .table thead th,
body.dark-mode .nexus-data-card .table thead th,
html[data-theme="dark"] .grid-view .table thead th,
html.theme-dark .grid-view .table thead th,
body.dark-mode .grid-view .table thead th,
html[data-theme="dark"] .table-responsive .table thead th,
html.theme-dark .table-responsive .table thead th,
body.dark-mode .table-responsive .table thead th,
html[data-theme="dark"] .page-body .table thead th,
html.theme-dark .page-body .table thead th,
body.dark-mode .page-body .table thead th,
html[data-theme="dark"] .card .table thead th,
html.theme-dark .card .table thead th,
body.dark-mode .card .table thead th {
  background-color: #162d4a !important;
  --bs-table-bg: #162d4a !important;
  color: #f8fafc !important;
}

/*
 * Service-call create form: sticky Ticket Summary panel.
 * The layout uses a flex row so the summary can stick while the form scrolls.
 */
.service-calls-form-card.nexus-form-card.card,
.service-calls-form-card .nexus-form-card-body,
.service-calls-form-card .card-body {
  overflow: visible;
}

.service-calls-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-right: -1.5rem;
}

.service-calls-form-area {
  flex: 0 0 70%;
  max-width: 70%;
}

.service-calls-summary {
  flex: 1 1 auto;
  min-width: 320px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  height: auto;
  max-height: none;
  overflow-y: visible;
  padding-right: 1.5rem;
}

@media (max-width: 991px) {
  .service-calls-layout {
    flex-direction: column;
  }
  .service-calls-summary {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    max-height: none;
  }
}
