/* Supplier Update Automation - Custom Styles */

body {
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  padding-top: 52px;
  padding-left: 184px;
  transition: padding-left 0.2s ease;
}

body.sidebar-collapsed {
  padding-left: 52px;
}

.dark-mode body,
body.dark-mode {
  background: #111827;
  color: #e5e7eb;
}

.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .user-dropdown,
.dark-mode .timezone-dropdown,
.dark-mode .template-panel {
  background: #1f2937;
  color: #e5e7eb;
}

.dark-mode .card-header,
.dark-mode .table-filter-bar,
.dark-mode .table-light,
.dark-mode .bg-white {
  background: #111827 !important;
  color: #e5e7eb;
}

.dark-mode .table,
.dark-mode .form-control,
.dark-mode .form-select {
  color: #e5e7eb;
  background-color: #111827;
  border-color: #374151;
}

.dark-mode .table-hover tbody tr:hover {
  background: #1f2937;
}

.dark-mode .text-muted,
.dark-mode .form-text {
  color: #9ca3af !important;
}

.dark-mode .filter-result-count,
.dark-mode .template-send-preview {
  background: #111827;
  color: #e5e7eb;
  border-color: #374151;
}

/* Navbar */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 184px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  background: #394b59;
  color: #fff;
  box-shadow: 2px 0 12px rgba(15,23,42,0.16);
  transition: width 0.2s ease, transform 0.2s ease;
  overflow-x: hidden;
}

body.sidebar-collapsed .app-sidebar {
  width: 52px;
}

.app-sidebar-brand {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

.app-sidebar-brand:hover {
  color: #fff;
}

.app-sidebar-brand i {
  font-size: 1rem;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem;
}

.app-sidebar-link {
  position: relative;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.app-sidebar-link i {
  width: 16px;
  text-align: center;
  font-size: 0.92rem;
}

.app-sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
}

.app-sidebar-link.active {
  color: #fff;
  background: #2563eb;
}

body.sidebar-collapsed .app-sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .app-sidebar-brand span,
body.sidebar-collapsed .app-sidebar-link span:not(.badge) {
  display: none;
}

body.sidebar-collapsed .app-sidebar-nav {
  padding: 0.45rem 0.35rem;
}

body.sidebar-collapsed .app-sidebar-link {
  justify-content: center;
  gap: 0;
  padding: 0.45rem 0;
}

body.sidebar-collapsed .app-sidebar-link i {
  width: auto;
}

body.sidebar-collapsed .app-sidebar-link .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
}

.app-sidebar-backdrop {
  display: none;
}

.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 184px;
  z-index: 1035;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.9rem;
  background: #394b59;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: left 0.2s ease;
}

body.sidebar-collapsed .app-topbar {
  left: 52px;
}

.app-topbar-spacer {
  flex: 1;
}

.app-sidebar-toggle {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(255,255,255,0.82);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.app-sidebar-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.app-sidebar-toggle:focus {
  outline: none;
}

.app-sidebar-toggle:focus-visible {
  outline: 2px solid rgba(96,165,250,0.85);
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.sidebar-toggle-icon-collapsed,
.sidebar-toggle-icon-mobile {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle-icon-expanded {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle-icon-collapsed {
  display: inline-block;
}

/* Main Admin work surfaces */
.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.admin-kicker {
  margin-bottom: 0.15rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-summary-tile,
.admin-filter-panel,
.admin-table-panel,
.admin-form-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-summary-tile {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.85rem 1rem;
}

.admin-summary-label {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-summary-tile strong {
  margin-top: 0.1rem;
  color: #0f172a;
  font-size: 1.45rem;
  line-height: 1.1;
}

.admin-filter-panel {
  padding: 1rem;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-panel-title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.admin-panel-body {
  padding: 1rem;
}

.admin-data-table th {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-data-table td {
  vertical-align: middle;
}

.admin-db-path {
  max-width: 520px;
}

.admin-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.admin-row-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.dark-mode .admin-kicker,
.dark-mode .admin-summary-label {
  color: #9ca3af;
}

.dark-mode .admin-summary-tile,
.dark-mode .admin-filter-panel,
.dark-mode .admin-table-panel,
.dark-mode .admin-form-panel {
  background: #1f2937;
  border-color: #374151;
  box-shadow: none;
}

.dark-mode .admin-summary-tile strong,
.dark-mode .admin-panel-title {
  color: #f9fafb;
}

.dark-mode .admin-panel-header {
  border-color: #374151;
}

.dark-mode .admin-data-table th {
  color: #cbd5e1;
}

@media (max-width: 991.98px) {
  .admin-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    display: flex;
    justify-content: flex-start;
  }
}

.navbar-dark.bg-dark {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: -0.3px;
}

.nav-link {
  font-size: 0.9rem;
  padding: 0.5rem 1rem !important;
  border-radius: 6px;
  margin: 0 2px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.1);
}

.nav-link.active {
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}

.navbar-user-menu {
  position: relative;
}

.navbar-user-cluster {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.navbar-timezone-control {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 30px;
  padding: 0.15rem 0.3rem 0.15rem 0.45rem;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 6px;
}

.navbar-clock {
  color: rgba(255,255,255,0.86);
  font-size: 0.65rem;
  line-height: 1.3;
  text-align: right;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.navbar-clock-date {
  color: rgba(255,255,255,0.6);
}

.navbar-user-button,
.navbar-alert-button {
  width: 36px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar-timezone-button {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.86);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 0.75rem;
}

.navbar-timezone-button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.user-dropdown,
.timezone-dropdown {
  position: fixed;
  top: 58px;
  right: 12px;
  width: 260px;
  z-index: 1050;
  display: none;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.timezone-dropdown {
  width: 300px;
}

.user-dropdown.show,
.timezone-dropdown.show {
  display: block;
}

.user-dropdown-name {
  font-weight: 700;
  color: #111827;
}

.user-dropdown-email,
.user-dropdown-version {
  color: #6b7280;
  font-size: 0.8rem;
}

.user-dropdown-version {
  border-top: 1px solid #e5e7eb;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  text-align: center;
}

.dark-mode .user-dropdown-name {
  color: #f9fafb;
}

/* Reports */
.reports-page {
  padding-bottom: 2rem;
}

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.reports-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.report-kpi {
  min-height: 112px;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}

.report-kpi-label {
  display: block;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-kpi strong {
  display: block;
  margin-top: 0.35rem;
  color: #111827;
  font-size: 1.75rem;
  line-height: 1.1;
}

.report-kpi-date {
  font-size: 1.2rem !important;
}

.report-kpi small {
  display: block;
  margin-top: 0.4rem;
  color: #6b7280;
  font-size: 0.78rem;
}

.report-tabs {
  border-bottom-color: #d1d5db;
}

.report-tabs .nav-link {
  color: #4b5563;
  border-radius: 6px 6px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.report-tabs .nav-link.active {
  color: #1d4ed8;
  background: #fff;
  border-color: #d1d5db #d1d5db #fff;
}

.report-panel {
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  overflow: hidden;
}

.report-panel-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.report-panel-header h2 {
  margin: 0;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 800;
}

.report-panel-header i {
  color: #64748b;
}

.report-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.report-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
}

.report-bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.report-bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  border-radius: inherit;
}

.report-table th {
  white-space: nowrap;
}

.report-table td {
  vertical-align: middle;
}

.report-list {
  max-height: 360px;
  overflow: auto;
}

.report-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #eef2f7;
}

.report-list-item:hover {
  background: #f8fafc;
}

.report-list-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.report-list-item small,
.report-empty {
  color: #6b7280;
}

.report-empty {
  padding: 1rem;
  font-size: 0.86rem;
}

.dark-mode .report-kpi,
.dark-mode .report-panel,
.dark-mode .report-tabs .nav-link.active {
  background: #1f2937;
  border-color: #374151;
}

.dark-mode .report-panel-header {
  border-color: #374151;
}

.dark-mode .report-kpi strong,
.dark-mode .report-panel-header h2,
.dark-mode .report-list-item {
  color: #f9fafb;
}

.dark-mode .report-list-item {
  border-color: #374151;
}

.dark-mode .report-list-item:hover {
  background: #111827;
}

.dark-mode .report-bar-track {
  background: #374151;
}

/* Auth */
.auth-page {
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.18), transparent 32rem),
    linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #111827 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(100%, 420px);
  padding: 1.5rem;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}

.auth-reset-card {
  border-color: #facc15;
}

.auth-brand,
.auth-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-brand-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #2563eb;
  border-radius: 8px;
  font-size: 1.25rem;
}

.auth-brand h1,
.auth-section-title h2 {
  margin: 0;
  color: #111827;
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-brand p,
.auth-section-title p {
  margin: 0.15rem 0 0;
  color: #6b7280;
  font-size: 0.85rem;
}

.auth-section-title i {
  color: #b45309;
  font-size: 1.4rem;
}

.auth-form .btn {
  min-height: 42px;
}

/* Cards */
.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 12px !important;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-weight: 700;
  color: #1f2937;
}

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

.followup-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  max-width: 230px;
}

.followup-stat-box {
  min-height: 54px;
  padding: 0.42rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.followup-stat-label {
  margin-bottom: 0.15rem;
  color: #6b7280;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.followup-stat-value {
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-kpi-row {
  align-items: stretch;
}

.dashboard-kpi-row > [class*="col-"] {
  display: flex;
}

.dashboard-kpi-card {
  width: 100%;
  min-height: 132px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e5eaf1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

.dashboard-kpi-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  padding: 1.5rem;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09) !important;
}

.dashboard-kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-kpi-eyebrow {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.dashboard-kpi-card .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.95rem;
  opacity: 0.72;
}

.dashboard-kpi-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.dashboard-kpi-metrics.single {
  grid-template-columns: 1fr;
}

.dashboard-kpi-metric {
  min-width: 0;
}

.dashboard-kpi-metric + .dashboard-kpi-metric {
  border-left: 1px solid #e2e8f0;
  padding-left: 1rem;
}

.dashboard-kpi-value {
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: #0f172a;
  white-space: nowrap;
}

.dashboard-kpi-label {
  margin: 0.5rem 0 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

@media (max-width: 575.98px) {
  .dashboard-kpi-card,
  .dashboard-kpi-card .card-body {
    min-height: 124px;
  }

  .dashboard-kpi-card .card-body {
    padding: 1rem;
  }

  .dashboard-kpi-metrics {
    gap: 0.75rem;
  }

  .dashboard-kpi-metric + .dashboard-kpi-metric {
    padding-left: 0.75rem;
  }

  .dashboard-kpi-value {
    font-size: 1.45rem;
  }
}

/* Tables */
.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: #6b7280;
  border-bottom-width: 2px;
  vertical-align: middle;
}

.table td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.table.compact-suppliers-table th,
.table.compact-suppliers-table td {
  height: 40px;
  padding: 0 12px;
}

.compact-suppliers-table .tracking-toggle {
  width: 2.75rem;
  height: 1.45rem;
  cursor: pointer;
}

.compact-suppliers-table .btn-group-sm > .btn,
.compact-suppliers-table .btn-sm {
  height: 28px;
  min-height: 28px;
  padding: 0 0.38rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.compact-suppliers-table .btn-group-sm {
  height: 28px;
}

.email-history-icon {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
}

.supplier-email-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 260px;
  white-space: nowrap;
}

.supplier-email-primary {
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-email-more {
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 600;
}

.supplier-email-warning {
  color: #b45309;
  font-weight: 700;
}

.supplier-note-readonly {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 260px;
  max-width: 420px;
  height: 32px;
}

.template-panel {
  background: #fff;
}

.template-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.template-panel-body {
  border-top: 1px solid #e5e7eb;
  padding: 1rem;
}

.template-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #111827;
  text-decoration: none;
  padding: 0;
}

.template-collapse-toggle:hover {
  color: #4338ca;
}

.template-collapse-toggle[aria-expanded="true"] .template-collapse-icon {
  transform: rotate(90deg);
}

.template-collapse-icon {
  transition: transform 0.2s;
}

.email-editor-shell {
  display: grid;
  gap: 0.55rem;
}

.email-editor-toolbar,
.email-editor-visual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.email-editor-visual-toolbar {
  display: none;
  padding: 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.email-html-editor {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
  tab-size: 2;
}

.email-editor-shell .CodeMirror {
  min-height: 260px;
  height: min(54vh, 520px);
  border: 1px solid #b6c2d1;
  border-radius: 7px;
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.email-editor-shell .CodeMirror-scroll {
  min-height: 260px;
}

.email-editor-shell .CodeMirror-gutters {
  border-radius: 8px 0 0 8px;
}

.email-editor-shell .CodeMirror-focused {
  border-color: #4f7df3;
  box-shadow: 0 0 0 0.2rem rgba(79, 125, 243, 0.18), 0 10px 24px rgba(15, 23, 42, 0.1);
}

.email-editor-shell .CodeMirror-dialog {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #cbd5e1;
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, monospace;
}

.email-editor-shell .CodeMirror-dialog input {
  min-height: 30px;
  margin-left: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #94a3b8;
  border-radius: 5px;
}

.email-editor-shell .cm-s-email-light.CodeMirror {
  color: #1f2937;
  background: #fbfcfe;
}

.email-editor-shell .cm-s-email-light .CodeMirror-gutters {
  color: #64748b;
  background: #eef3f8;
  border-right: 1px solid #d4dde8;
}

.email-editor-shell .cm-s-email-light .CodeMirror-cursor {
  border-left-color: #1d4ed8;
}

.email-editor-shell .cm-s-email-light .CodeMirror-activeline-background {
  background: #eef6ff;
}

.email-editor-shell .cm-s-email-light .CodeMirror-matchingtag,
.email-editor-shell .cm-s-email-light .CodeMirror-matchingbracket {
  color: #0f172a !important;
  background: rgba(59, 130, 246, 0.18);
  outline: 1px solid rgba(59, 130, 246, 0.35);
}

.email-editor-shell .cm-s-email-light span.cm-tag,
.email-editor-shell .cm-s-email-light span.cm-bracket {
  color: #0f6db7;
}

.email-editor-shell .cm-s-email-light span.cm-attribute {
  color: #9a3412;
}

.email-editor-shell .cm-s-email-light span.cm-string {
  color: #15803d;
}

.email-editor-shell .cm-s-email-light span.cm-keyword {
  color: #7c3aed;
}

.email-editor-shell .cm-s-email-light span.cm-variable,
.email-editor-shell .cm-s-email-light span.cm-variable-2 {
  color: #b45309;
}

.email-editor-shell .cm-s-email-light span.cm-comment {
  color: #64748b;
  font-style: italic;
}

.email-editor-shell .cm-s-email-light span.cm-def,
.email-editor-shell .cm-s-email-light span.cm-property {
  color: #be185d;
}

.email-editor-shell .cm-s-email-dark.CodeMirror {
  color: #d7e2f1;
  background: #101820;
  border-color: #334155;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.36);
}

.email-editor-shell .cm-s-email-dark .CodeMirror-gutters {
  color: #7c8da5;
  background: #0b1118;
  border-right: 1px solid #273244;
}

.email-editor-shell .cm-s-email-dark .CodeMirror-cursor {
  border-left-color: #93c5fd;
}

.email-editor-shell .cm-s-email-dark .CodeMirror-activeline-background {
  background: #162536;
}

.email-editor-shell .cm-s-email-dark .CodeMirror-selected {
  background: #264766;
}

.email-editor-shell .cm-s-email-dark .CodeMirror-line::selection,
.email-editor-shell .cm-s-email-dark .CodeMirror-line > span::selection,
.email-editor-shell .cm-s-email-dark .CodeMirror-line > span > span::selection {
  background: #264766;
}

.email-editor-shell .cm-s-email-dark .CodeMirror-matchingtag,
.email-editor-shell .cm-s-email-dark .CodeMirror-matchingbracket {
  color: #f8fafc !important;
  background: rgba(14, 165, 233, 0.24);
  outline: 1px solid rgba(125, 211, 252, 0.45);
}

.email-editor-shell .cm-s-email-dark span.cm-tag,
.email-editor-shell .cm-s-email-dark span.cm-bracket {
  color: #7dd3fc;
}

.email-editor-shell .cm-s-email-dark span.cm-attribute {
  color: #fdba74;
}

.email-editor-shell .cm-s-email-dark span.cm-string {
  color: #86efac;
}

.email-editor-shell .cm-s-email-dark span.cm-keyword {
  color: #c4b5fd;
}

.email-editor-shell .cm-s-email-dark span.cm-variable,
.email-editor-shell .cm-s-email-dark span.cm-variable-2 {
  color: #fde68a;
}

.email-editor-shell .cm-s-email-dark span.cm-comment {
  color: #94a3b8;
  font-style: italic;
}

.email-editor-shell .cm-s-email-dark span.cm-def,
.email-editor-shell .cm-s-email-dark span.cm-property {
  color: #f9a8d4;
}

.email-editor-shell .cm-searching {
  background: rgba(250, 204, 21, 0.42);
  outline: 1px solid rgba(202, 138, 4, 0.45);
}

.email-editor-shell[data-editor-theme="light"] .email-html-editor {
  color: #111827;
  background: #ffffff;
  border-color: #cbd5e1;
}

.email-editor-shell[data-editor-theme="dark"] .email-html-editor {
  color: #dbeafe;
  background: #0f172a;
  border-color: #334155;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.email-editor-shell[data-editor-theme="dark"] .email-html-editor:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.22);
}

.email-visual-editor {
  display: none;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  padding: 0.85rem;
  color: #111827;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.email-visual-editor:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.16);
}

.email-editor-shell[data-editor-mode="visual"] .email-html-editor {
  display: none;
}

.email-editor-shell[data-editor-mode="visual"] .CodeMirror {
  display: none;
}

.email-editor-shell[data-editor-mode="visual"] .email-visual-editor,
.email-editor-shell[data-editor-mode="visual"] .email-editor-visual-toolbar {
  display: flex;
}

.email-editor-shell[data-editor-mode="visual"] .email-visual-editor {
  display: block;
}

@media (max-width: 767.98px) {
  .email-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .email-editor-toolbar .btn-group {
    width: 100%;
  }

  .email-editor-toolbar .btn {
    flex: 1 1 0;
  }

  .email-editor-toolbar .ms-auto {
    margin-left: 0 !important;
  }

  .email-editor-shell .CodeMirror {
    height: min(58vh, 420px);
    min-height: 240px;
    font-size: 0.84rem;
  }
}

.dark-mode .email-editor-visual-toolbar {
  background: #111827;
  border-color: #374151;
}

.dark-mode .email-visual-editor {
  color: #111827;
  background: #ffffff;
}

.supplier-note-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
  font-size: 0.84rem;
}

.supplier-note-empty {
  color: #9ca3af;
  font-style: italic;
}

.supplier-note-has-value {
  font-weight: 700;
}

.table-hover tbody tr:hover {
  background: #f8fafc;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.resizable-header {
  position: relative;
  overflow: visible;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 25%;
  right: 3px;
  width: 1px;
  height: 50%;
  background: #cbd5e1;
}

.is-resizing-column,
.is-resizing-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

.sortable-header .sort-icon {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.sortable-header.sort-asc .sort-icon,
.sortable-header.sort-desc .sort-icon {
  color: #4f46e5;
}

.table-filter-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem;
}

.compact-search-input {
  max-width: 260px;
  height: 32px;
  min-height: 32px;
  font-size: 0.85rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.settings-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-sidebar {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem;
}

.settings-nav-button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0.7rem 0.75rem;
  color: #374151;
  font-weight: 600;
}

.settings-nav-button.active,
.settings-nav-button:hover {
  background: #eef2ff;
  color: #4338ca;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.supplier-name-link {
  color: #1d4ed8;
  text-decoration: none;
}

.supplier-name-link:hover {
  text-decoration: underline;
}

.supplier-row-status {
  min-width: 58px;
  display: inline-block;
}

.compact-suppliers-table .supplier-row-status {
  display: none;
}

.readonly-display {
  color: #111827;
  font-weight: 600;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.profile-url-plain {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  color: #374151;
  overflow-wrap: anywhere;
}

.email-row-primary-badge {
  min-width: 70px;
}

.edit-card-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 1rem 0;
}

.form-label.extra-small {
  font-size: 0.7rem;
  margin-bottom: 0.15rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}

.filter-col {
  min-width: 140px;
}

.group-edit-col {
  min-width: 190px;
}

.group-edit-panel {
  display: none;
}

.table-filter-bar .form-control-sm,
.table-filter-bar .form-select-sm {
  height: 32px;
  min-height: 32px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  line-height: 1.35;
}

.compact-log-search {
  width: 220px;
}

.compact-log-date {
  width: 150px;
}

.filter-result-count {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 700;
}

.template-send-preview {
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  background: #fff;
  padding: 1rem;
}

.navbar-alert-menu {
  position: relative;
}

.navbar-alert-button {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar-alert-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
}

.supplier-alert-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 1055;
  display: none;
  width: min(360px, calc(100vw - 2rem));
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.supplier-alert-dropdown.show {
  display: block;
}

.supplier-alert-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  color: #111827;
}

.supplier-alert-list {
  display: grid;
}

.supplier-alert-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}

.supplier-alert-item:hover {
  background: #fffbeb;
  color: #111827;
}

.supplier-alert-item small {
  display: block;
  color: #6b7280;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.supplier-alert-empty {
  padding: 1rem;
  color: #6b7280;
  text-align: center;
}

.dark-mode .supplier-alert-dropdown {
  background: #111827;
  border-color: #374151;
}

.dark-mode .supplier-alert-dropdown-header,
.dark-mode .supplier-alert-item {
  color: #f9fafb;
  border-color: #374151;
}

.dark-mode .supplier-alert-item:hover {
  background: rgba(245, 158, 11, 0.16);
}

.dark-mode .supplier-alert-item small,
.dark-mode .supplier-alert-empty {
  color: #cbd5e1;
}

.supplier-alert-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.supplier-status-review-alert {
  border-radius: 8px;
}

.threshold-order-table tbody tr {
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.threshold-drag-handle {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.threshold-drag-handle:active {
  cursor: grabbing;
}

.threshold-row-dragging {
  opacity: 0.55;
  background: #fff7ed;
}

.dark-mode .threshold-row-dragging {
  background: rgba(245, 158, 11, 0.16);
}

.alert-review-highlight {
  border: 2px solid #dc3545 !important;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
  animation: alertReviewBlink 1s ease-in-out 4;
}

@keyframes alertReviewBlink {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(220, 53, 69, 0.12);
  }
}

.compact-select {
  min-height: 28px;
  height: 28px;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  font-size: 0.8rem;
}

.log-badge {
  min-width: 58px;
}

.log-badge-debug {
  background: #e5e7eb;
  color: #374151;
}

.log-badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.log-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.log-badge-error,
.log-badge-fatal {
  background: #fee2e2;
  color: #b91c1c;
}

.log-level-debug {
  background: #f9fafb;
}

.log-level-info {
  background: #eff6ff;
}

.log-level-warn {
  background: #fffbeb;
}

.log-level-error,
.log-level-fatal {
  background: #fef2f2;
}

.log-level-fatal {
  font-weight: 700;
}

.log-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.log-detail-grid pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  background: #111827;
  color: #e5e7eb;
  border-radius: 6px;
  font-size: 0.75rem;
}

.activity-feed {
  display: grid;
  gap: 0.65rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4338ca;
}

.outcome-success {
  background: #dcfce7;
  color: #166534;
}

.outcome-warning {
  background: #fef3c7;
  color: #92400e;
}

.outcome-fail {
  background: #fee2e2;
  color: #b91c1c;
}

.compact-suppliers-table .form-select-sm,
.compact-suppliers-table .form-control-sm {
  min-height: 28px;
  height: 28px;
  font-size: 0.8rem;
}

#emailHistoryModal .modal-body .table th {
  font-size: 0.7rem;
  padding: 0.4rem 0.5rem;
}

#emailHistoryModal .modal-body .table td {
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
}

.operations-title {
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
  color: #000;
}

.operations-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.operations-tab-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}

.operations-tab-switch a {
  padding: 0.28rem 0.65rem;
  color: #374151;
  font-size: 0.78rem;
  text-decoration: none;
  border-right: 1px solid #cbd5e1;
}

.operations-tab-switch a:last-child {
  border-right: 0;
}

.operations-tab-switch a.active {
  background: #1679b9;
  color: #fff;
}

.operations-tab-switch a:not(.active):hover {
  background: #f1f5f9;
  color: #111827;
}

.operations-retention {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.5rem;
  background: #d9ebfb;
  color: #000;
  border-radius: 3px;
  font-size: 0.8rem;
}

.operations-retention i {
  color: #0b73b7;
  font-size: 1rem;
}

.operations-filter-panel {
  max-width: 873px;
  margin-bottom: 0.45rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
}

.operations-filter-grid {
  display: grid;
  grid-template-columns: 260px 260px 260px;
  gap: 0.75rem 1.8rem;
  align-items: end;
}

.operations-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #000;
  font-size: 0.8rem;
}

.operations-input {
  height: 27px;
  min-height: 27px;
  border-radius: 2px;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
}

.operations-search-wrap,
.operations-date-range {
  position: relative;
  display: flex;
  align-items: center;
}

.operations-search-wrap i,
.operations-date-range i {
  position: absolute;
  left: 0.45rem;
  color: #5f6f7f;
  z-index: 1;
}

.operations-search-wrap .operations-input {
  padding-left: 1.65rem;
}

.operations-date-range {
  gap: 0.35rem;
}

.operations-date-range .operations-input {
  width: 117px;
}

.operations-date-range .operations-input:first-of-type {
  padding-left: 1.65rem;
}

.operations-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding-top: 1.35rem;
}

.operations-actions .btn,
.operations-pager .btn {
  border-radius: 3px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

.operations-actions .btn-primary {
  background: #1679b9;
  border: 1px solid #0f6ca8;
  box-shadow: none;
}

.operations-actions .btn-primary:hover {
  background: #0f6ca8;
  transform: none;
  box-shadow: none;
}

.operations-table-wrap {
  overflow-x: auto;
  background: #fff;
}

.operations-table {
  min-width: 940px;
  border: 1px solid #d1d5db;
}

.operations-table thead th {
  background: #e2e6ea;
  color: #000;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #cdd3d8;
  padding: 0.35rem 0.6rem;
}

.operations-table tbody td {
  color: #000;
  border: 1px solid #d9d9d9;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.operations-table a,
.operations-result-link {
  color: #0067b1;
  text-decoration: underline;
}

.operations-result-link {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.operations-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  color: #4b5563;
  font-size: 0.82rem;
}

.operations-detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 0.45rem 1rem;
  margin-bottom: 1rem;
}

.operations-detail-list dt {
  color: #6b7280;
  font-size: 0.78rem;
}

.operations-detail-list dd {
  margin: 0;
  color: #111827;
  overflow-wrap: anywhere;
}

.operations-modal-heading {
  margin: 1rem 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.operations-state-list {
  display: grid;
  gap: 0.6rem;
}

.operations-state-item {
  padding: 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
}

.operations-state-label {
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: #111827;
}

.operations-state-caption {
  display: inline-block;
  min-width: 108px;
  color: #6b7280;
  font-weight: 700;
}

.operations-json {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.76rem;
}

.dark-mode .operations-title,
.dark-mode .operations-label,
.dark-mode .operations-table thead th,
.dark-mode .operations-table tbody td {
  color: #e5e7eb;
}

.dark-mode .operations-filter-panel,
.dark-mode .operations-table-wrap,
.dark-mode .operations-tab-switch {
  background: #1f2937;
  border-color: #374151;
}

.dark-mode .operations-tab-switch a {
  color: #e5e7eb;
  border-color: #374151;
}

.dark-mode .operations-tab-switch a:not(.active):hover {
  background: #111827;
  color: #fff;
}

.dark-mode .operations-table thead th {
  background: #374151;
}

.dark-mode .operations-table tbody td {
  background: #111827;
  border-color: #374151;
}

@media (max-width: 992px) {
  body {
    padding-left: 0;
  }

  body.sidebar-collapsed {
    padding-left: 0;
  }

  .app-topbar {
    left: 0;
  }

  body.sidebar-collapsed .app-topbar {
    left: 0;
  }

  .app-sidebar {
    width: 184px;
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .app-sidebar {
    width: 184px;
  }

  body.sidebar-collapsed .app-sidebar-brand {
    justify-content: flex-start;
    padding: 0 0.8rem;
  }

  body.sidebar-collapsed .app-sidebar-brand span,
  body.sidebar-collapsed .app-sidebar-link span:not(.badge) {
    display: inline;
  }

  body.sidebar-collapsed .app-sidebar-nav {
    padding: 0.45rem;
  }

  body.sidebar-collapsed .app-sidebar-link {
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
  }

  body.sidebar-collapsed .app-sidebar-link i {
    width: 16px;
  }

  body.sidebar-collapsed .app-sidebar-link .badge {
    position: static;
    min-width: auto;
    height: auto;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1038;
    background: rgba(15,23,42,0.42);
  }

  body.sidebar-open .app-sidebar-backdrop {
    display: block;
  }

  .app-sidebar-toggle {
    width: 34px;
    height: 32px;
    color: #fff;
    background: transparent;
    border-color: rgba(255,255,255,0.28);
    border-radius: 6px;
    box-shadow: none;
    transform: none;
  }

  .app-sidebar-toggle:hover {
    background: rgba(255,255,255,0.12);
    transform: none;
  }

  .sidebar-toggle-icon-expanded,
  .sidebar-toggle-icon-collapsed {
    display: none !important;
  }

  .sidebar-toggle-icon-mobile {
    display: inline-block;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }

  .operations-filter-grid {
    grid-template-columns: 1fr;
  }

  .operations-filter-panel {
    max-width: none;
  }

  .operations-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  .operations-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .reports-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .reports-header-meta {
    justify-content: flex-start;
  }

  .reports-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Buttons */
.btn {
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.btn-outline-primary:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
}

/* Badges */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

.bg-success-subtle {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.bg-danger-subtle {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.bg-warning-subtle {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.bg-info-subtle {
  background: #e0f2fe !important;
  color: #075985 !important;
}

.bg-primary-subtle {
  background: #e0e7ff !important;
  color: #3730a3 !important;
}

/* Forms */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-text {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Card headers */
.card {
  border-radius: 12px !important;
}

.card-header:first-child {
  border-radius: 12px 12px 0 0 !important;
}

/* Modal */
.modal-content {
  border-radius: 12px;
  border: none;
}

.modal-header {
  border-radius: 12px 12px 0 0;
  border-bottom-color: #e5e7eb;
}

/* Check summary */
.check-summary {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .reports-kpi-grid {
    grid-template-columns: 1fr;
  }

  .report-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
  }

  .report-tabs .nav-link {
    white-space: nowrap;
  }

  .stat-card .card-body {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* UI/UX Pro Max design refresh */
:root {
  color-scheme: light;
  --app-bg: #f6f8fb;
  --app-surface: #ffffff;
  --app-surface-raised: #ffffff;
  --app-surface-muted: #f1f5f9;
  --app-border: #dbe3ee;
  --app-border-strong: #c6d0de;
  --app-text: #172033;
  --app-muted: #5b6b80;
  --app-muted-strong: #39485c;
  --app-primary: #2563eb;
  --app-primary-strong: #1d4ed8;
  --app-primary-soft: #dbeafe;
  --app-accent: #0f766e;
  --app-accent-soft: #ccfbf1;
  --app-warning: #b45309;
  --app-danger: #b91c1c;
  --app-success: #15803d;
  --app-sidebar-width: 220px;
  --app-sidebar-collapsed-width: 64px;
  --app-topbar-height: 56px;
  --app-radius: 8px;
  --app-radius-sm: 6px;
  --app-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 8px rgba(15, 23, 42, 0.04);
  --app-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.10);
  --app-focus: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.dark-mode,
html.dark-mode {
  color-scheme: dark;
  --app-bg: #0d1117;
  --app-surface: #151b23;
  --app-surface-raised: #1c2430;
  --app-surface-muted: #111827;
  --app-border: #2f3b4b;
  --app-border-strong: #44546a;
  --app-text: #f3f6fb;
  --app-muted: #b1bfce;
  --app-muted-strong: #d3dbe6;
  --app-primary: #60a5fa;
  --app-primary-strong: #93c5fd;
  --app-primary-soft: rgba(59, 130, 246, 0.18);
  --app-accent: #2dd4bf;
  --app-accent-soft: rgba(45, 212, 191, 0.16);
  --app-warning: #fbbf24;
  --app-danger: #f87171;
  --app-success: #4ade80;
  --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 1px 12px rgba(0, 0, 0, 0.18);
  --app-shadow-md: 0 18px 40px rgba(0, 0, 0, 0.34);
  --app-focus: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  padding-top: var(--app-topbar-height);
  padding-left: var(--app-sidebar-width);
  background: var(--app-bg);
  color: var(--app-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.925rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  transition: padding-left 0.18s ease;
}

body.sidebar-collapsed {
  padding-left: var(--app-sidebar-collapsed-width);
}

.dark-mode body,
body.dark-mode {
  background: var(--app-bg);
  color: var(--app-text);
}

a {
  color: var(--app-primary-strong);
}

a:hover {
  color: var(--app-primary);
}

.container-fluid {
  max-width: 1560px;
}

body > .container-fluid {
  padding-bottom: 2rem;
}

.text-muted,
.form-text,
small.text-muted {
  color: var(--app-muted) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.operations-title {
  color: var(--app-text);
  letter-spacing: 0;
}

.h3,
h1.h3 {
  font-size: 1.45rem;
  line-height: 1.2;
}

.fw-bold {
  font-weight: 750 !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1060;
  transform: translateY(-160%);
  padding: 0.55rem 0.75rem;
  color: #fff;
  background: var(--app-primary-strong);
  border-radius: var(--app-radius-sm);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

/* Shared chrome */
.app-sidebar {
  width: var(--app-sidebar-width);
  color: var(--app-text);
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-sm);
  transition: width 0.18s ease, transform 0.18s ease;
}

body.sidebar-collapsed .app-sidebar {
  width: var(--app-sidebar-collapsed-width);
}

.app-sidebar-brand {
  min-height: var(--app-topbar-height);
  padding: 0 1rem;
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border);
  font-size: 0.9rem;
  font-weight: 800;
}

.app-sidebar-brand i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--app-primary-strong);
  border-radius: var(--app-radius-sm);
}

.app-sidebar-brand:hover {
  color: var(--app-primary-strong);
}

.app-sidebar-nav {
  gap: 0.25rem;
  padding: 0.75rem;
}

.app-sidebar-link {
  min-height: 40px;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  color: var(--app-muted-strong);
  border-radius: var(--app-radius-sm);
  font-size: 0.875rem;
  font-weight: 650;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.app-sidebar-link i {
  width: 18px;
  color: var(--app-muted);
}

.app-sidebar-link:hover {
  color: var(--app-text);
  background: var(--app-surface-muted);
}

.app-sidebar-link:hover i,
.app-sidebar-link.active i {
  color: currentColor;
}

.app-sidebar-link.active {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
  box-shadow: inset 3px 0 0 var(--app-primary-strong);
}

body.sidebar-collapsed .app-sidebar-link {
  min-height: 42px;
}

.app-topbar {
  left: var(--app-sidebar-width);
  height: var(--app-topbar-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 10px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  transition: left 0.18s ease;
}

body.sidebar-collapsed .app-topbar {
  left: var(--app-sidebar-collapsed-width);
}

.dark-mode .app-topbar {
  background: rgba(21, 27, 35, 0.92);
  box-shadow: 0 1px 16px rgba(0, 0, 0, 0.24);
}

.app-sidebar-toggle,
.navbar-timezone-button,
.navbar-user-button,
.navbar-alert-button {
  min-width: 40px;
  min-height: 40px;
  color: var(--app-muted-strong);
  border-radius: var(--app-radius-sm);
  cursor: pointer;
}

.app-sidebar-toggle:hover,
.navbar-timezone-button:hover,
.navbar-user-button:hover,
.navbar-alert-button:hover {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}

.navbar-user-button.btn-outline-light,
.navbar-alert-button.btn-outline-light {
  color: var(--app-muted-strong);
  border-color: var(--app-border-strong);
}

.navbar-timezone-control {
  min-height: 40px;
  padding: 0.2rem 0.35rem 0.2rem 0.65rem;
  border-color: var(--app-border);
  background: var(--app-surface);
  border-radius: var(--app-radius);
}

.navbar-clock {
  color: var(--app-text);
  font-size: 0.72rem;
  font-weight: 650;
}

.navbar-clock-date {
  color: var(--app-muted);
  font-weight: 600;
}

.user-dropdown,
.timezone-dropdown {
  top: 64px;
  color: var(--app-text);
  background: var(--app-surface-raised);
  border-color: var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-md);
}

.user-dropdown-name {
  color: var(--app-text);
}

.user-dropdown-email,
.user-dropdown-version {
  color: var(--app-muted);
}

.user-dropdown-version {
  border-top-color: var(--app-border);
}

/* Surfaces */
.card,
.report-kpi,
.report-panel,
.settings-sidebar,
.operations-filter-panel,
.operations-table-wrap,
.template-panel,
.modal-content,
.auth-card {
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.card-header,
.report-panel-header,
.modal-header,
.modal-footer,
.table-filter-bar,
.template-panel-body,
.template-panel-header {
  border-color: var(--app-border) !important;
}

.card-header,
.bg-white,
.report-tabs .nav-link.active {
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
}

.card-header:first-child,
.modal-header {
  border-radius: var(--app-radius) var(--app-radius) 0 0 !important;
}

.table-filter-bar {
  background: var(--app-surface-muted);
  padding: 0.9rem 1rem;
}

.stat-card {
  border-radius: var(--app-radius) !important;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat-card:hover {
  transform: none;
  border-color: var(--app-border-strong) !important;
  box-shadow: var(--app-shadow-md) !important;
}

.stat-label,
.report-kpi-label,
.form-label.extra-small {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.stat-value,
.report-kpi strong,
.report-panel-header h2 {
  color: var(--app-text);
}

.stat-icon,
.activity-icon,
.auth-brand-icon {
  border-radius: var(--app-radius);
}

.stat-icon {
  width: 44px;
  height: 44px;
}

.dashboard-kpi-card {
  min-height: 132px;
  background: linear-gradient(180deg, var(--app-surface) 0%, #fbfdff 100%);
  border: 1px solid var(--app-border) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.dashboard-kpi-card .card-body {
  min-height: 132px;
  padding: 1.5rem;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--app-border-strong) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10) !important;
}

.dashboard-kpi-card .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--app-radius);
  font-size: 0.95rem;
  opacity: 0.72;
}

/* Tables */
.table {
  color: var(--app-text);
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  color: inherit;
  background-color: transparent;
  border-color: var(--app-border);
}

.table-light,
.table thead th,
.operations-table thead th {
  color: var(--app-muted-strong) !important;
  background: var(--app-surface-muted) !important;
}

.table th {
  height: 42px;
  padding: 0.65rem 0.8rem;
  color: var(--app-muted-strong);
  border-bottom: 1px solid var(--app-border-strong);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.table td {
  padding: 0.68rem 0.8rem;
  font-size: 0.875rem;
  border-color: var(--app-border);
}

.table-hover tbody tr:hover,
.report-list-item:hover {
  background: var(--app-surface-muted);
}

.compact-suppliers-table th,
.compact-suppliers-table td {
  height: 44px !important;
}

.table-responsive,
.operations-table-wrap {
  border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.sortable-header:hover {
  color: var(--app-primary-strong);
}

.column-resize-handle::after {
  background: var(--app-border-strong);
}

code,
.font-monospace,
.operations-json,
.log-detail-grid pre {
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, monospace;
}

code {
  color: #075985;
  background: #e0f2fe;
  border-radius: 4px;
  padding: 0.08rem 0.25rem;
  font-size: 0.84em;
}

.dark-mode code {
  color: #bae6fd;
  background: rgba(14, 116, 144, 0.28);
}

/* Forms and buttons */
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border-radius: var(--app-radius-sm);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn-sm,
.btn-group-sm > .btn {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.compact-suppliers-table .btn-group-sm > .btn,
.compact-suppliers-table .btn-sm {
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.btn-primary {
  color: #fff;
  background: var(--app-primary-strong);
  border: 1px solid var(--app-primary-strong);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
  color: #fff;
  background: #1e40af;
  border-color: #1e40af;
  transform: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.btn-success {
  background-color: var(--app-success);
  border-color: var(--app-success);
}

.btn-warning {
  color: #111827;
  background-color: #facc15;
  border-color: #eab308;
}

.btn-outline-primary {
  color: var(--app-primary-strong);
  border-color: rgba(37, 99, 235, 0.42);
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
}

.btn-outline-secondary {
  color: var(--app-muted-strong);
  border-color: var(--app-border-strong);
}

.btn-outline-secondary:hover {
  color: var(--app-text);
  background: var(--app-surface-muted);
  border-color: var(--app-border-strong);
}

.btn-outline-danger {
  color: var(--app-danger);
  border-color: rgba(185, 28, 28, 0.42);
}

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
  cursor: not-allowed;
  opacity: 0.58;
}

.form-control,
.form-select,
.input-group-text {
  min-height: 40px;
  color: var(--app-text);
  background-color: var(--app-surface);
  border-color: var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  font-size: 0.9rem;
}

.form-control-sm,
.form-select-sm,
.table-filter-bar .form-control-sm,
.table-filter-bar .form-select-sm,
.operations-input,
.compact-select {
  min-height: 36px;
  height: 36px;
  font-size: 0.84rem;
}

.form-control::placeholder {
  color: #8b98aa;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
.settings-nav-button:focus-visible,
.app-sidebar-link:focus-visible,
.template-collapse-toggle:focus-visible,
.operations-result-link:focus-visible {
  border-color: var(--app-primary);
  box-shadow: var(--app-focus);
  outline: 0;
}

.form-check-input {
  cursor: pointer;
  border-color: var(--app-border-strong);
}

.form-switch .form-check-input {
  min-width: 2.65rem;
  height: 1.45rem;
}

.form-check-input:checked {
  background-color: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
}

.readonly-display,
.profile-url-plain {
  min-height: 40px;
  color: var(--app-text);
}

/* Badges and status */
.badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0;
}

.bg-primary-subtle {
  color: #1d4ed8 !important;
  background: #dbeafe !important;
}

.bg-info-subtle {
  color: #0369a1 !important;
  background: #e0f2fe !important;
}

.bg-success-subtle {
  color: #166534 !important;
  background: #dcfce7 !important;
}

.bg-warning-subtle {
  color: #92400e !important;
  background: #fef3c7 !important;
}

.bg-danger-subtle {
  color: #991b1b !important;
  background: #fee2e2 !important;
}

.bg-secondary-subtle {
  color: #475569 !important;
  background: #e2e8f0 !important;
}

.dark-mode .bg-primary-subtle,
.dark-mode .bg-info-subtle,
.dark-mode .bg-success-subtle,
.dark-mode .bg-warning-subtle,
.dark-mode .bg-danger-subtle,
.dark-mode .bg-secondary-subtle {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Page-specific polish */
.reports-header,
.operations-heading-row,
body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 {
  gap: 1rem;
}

.reports-kpi-grid {
  gap: 1rem;
}

.report-kpi {
  min-height: 118px;
  padding: 1rem;
}

.report-bar-track {
  height: 9px;
  background: var(--app-surface-muted);
}

.report-bar-track span {
  background: linear-gradient(90deg, var(--app-primary-strong), var(--app-accent));
}

.report-tabs {
  gap: 0.25rem;
  border-bottom-color: var(--app-border);
}

.report-tabs .nav-link {
  min-height: 40px;
  margin: 0;
  color: var(--app-muted-strong);
  border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
}

.report-tabs .nav-link.active {
  color: var(--app-primary-strong);
  border-color: var(--app-border) var(--app-border) var(--app-surface);
}

.settings-shell {
  gap: 1.25rem;
}

.settings-sidebar {
  top: calc(var(--app-topbar-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem;
}

.settings-nav-button {
  min-height: 42px;
  color: var(--app-muted-strong);
  border-radius: var(--app-radius-sm);
  cursor: pointer;
}

.settings-nav-button.active,
.settings-nav-button:hover {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}

.template-collapse-toggle {
  min-height: 40px;
  color: var(--app-text);
  border-radius: var(--app-radius-sm);
}

.template-collapse-toggle:hover {
  color: var(--app-primary-strong);
}

.template-send-preview {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.operations-title {
  font-size: 1.35rem;
  font-weight: 750;
}

.operations-retention {
  color: #075985;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.operations-filter-panel {
  max-width: none;
  padding: 1rem;
}

.operations-filter-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 0.8rem;
}

.operations-label {
  color: var(--app-muted-strong);
  font-weight: 700;
}

.operations-tab-switch {
  min-height: 38px;
  border-color: var(--app-border-strong);
  border-radius: var(--app-radius-sm);
}

.operations-tab-switch a {
  display: inline-flex;
  align-items: center;
  color: var(--app-muted-strong);
  border-color: var(--app-border);
  font-weight: 700;
}

.operations-tab-switch a.active {
  background: var(--app-primary-strong);
}

.operations-table {
  min-width: 940px;
  border-color: var(--app-border);
}

.operations-table tbody td,
.operations-table thead th {
  border-color: var(--app-border);
}

.operations-result-link {
  color: var(--app-primary-strong);
  border-radius: 4px;
}

.operations-state-item {
  background: var(--app-surface-muted);
  border-color: var(--app-border);
}

.operations-state-label,
.operations-detail-list dd {
  color: var(--app-text);
}

.operations-detail-list dt,
.operations-state-caption {
  color: var(--app-muted);
}

.auth-page {
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.12), transparent 38%),
    linear-gradient(160deg, #f8fafc 0%, #eef2ff 46%, #ecfeff 100%);
}

.auth-shell {
  grid-template-columns: minmax(0, 420px);
}

.auth-card {
  padding: 1.35rem;
}

.auth-brand-icon {
  background: var(--app-primary-strong);
}

.auth-brand h1,
.auth-section-title h2 {
  color: var(--app-text);
}

.auth-brand p,
.auth-section-title p {
  color: var(--app-muted);
}

/* Dark mode parity */
.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .user-dropdown,
.dark-mode .timezone-dropdown,
.dark-mode .template-panel,
.dark-mode .report-kpi,
.dark-mode .report-panel,
.dark-mode .settings-sidebar,
.dark-mode .operations-filter-panel,
.dark-mode .operations-table-wrap {
  color: var(--app-text);
  background: var(--app-surface);
  border-color: var(--app-border) !important;
}

.dark-mode .card-header,
.dark-mode .table-filter-bar,
.dark-mode .table-light,
.dark-mode .bg-white,
.dark-mode .table thead th,
.dark-mode .operations-table thead th {
  color: var(--app-muted-strong) !important;
  background: var(--app-surface-muted) !important;
}

.dark-mode .table,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .input-group-text {
  color: var(--app-text);
  background-color: var(--app-surface);
  border-color: var(--app-border-strong);
}

.dark-mode .form-control::placeholder {
  color: #7f8ea3;
}

.email-editor-shell[data-editor-theme="light"] .email-html-editor,
.dark-mode .email-editor-shell[data-editor-theme="light"] .email-html-editor {
  color: #111827;
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.email-editor-shell[data-editor-theme="dark"] .email-html-editor,
.dark-mode .email-editor-shell[data-editor-theme="dark"] .email-html-editor {
  color: #dbeafe;
  background-color: #0f172a;
  border-color: #334155;
}

.dark-mode .table-hover tbody tr:hover,
.dark-mode .report-list-item:hover {
  background: var(--app-surface-muted);
}

.dark-mode .app-sidebar {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.dark-mode .app-sidebar-brand,
.dark-mode .app-sidebar-brand:hover,
.dark-mode .app-sidebar-link,
.dark-mode .operations-title,
.dark-mode .operations-label,
.dark-mode .report-panel-header h2,
.dark-mode .report-kpi strong,
.dark-mode .report-list-item,
.dark-mode .supplier-note-text,
.dark-mode .readonly-display,
.dark-mode .profile-url-plain {
  color: var(--app-text);
}

.dark-mode .app-sidebar-link:not(.active) i {
  color: var(--app-muted);
}

.dark-mode .app-sidebar-link:hover {
  background: var(--app-surface-muted);
}

.dark-mode .app-sidebar-link.active {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}

.dark-mode .operations-retention {
  color: #bae6fd;
  background: rgba(14, 116, 144, 0.2);
  border-color: rgba(125, 211, 252, 0.28);
}

.dark-mode .auth-page {
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.16), transparent 36%),
    linear-gradient(160deg, #0d1117 0%, #111827 54%, #10212a 100%);
}

/* Responsive refinements */
@media (max-width: 1200px) {
  .reports-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operations-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  body,
  body.sidebar-collapsed {
    padding-left: 0;
  }

  .app-topbar,
  body.sidebar-collapsed .app-topbar {
    left: 0;
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-width);
  }

  body.sidebar-collapsed .app-sidebar-link {
    min-height: 40px;
  }

  .app-sidebar-toggle,
  .app-sidebar-toggle:hover {
    color: var(--app-muted-strong);
    background: var(--app-surface-muted);
  }

  .operations-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4,
  .reports-header,
  .operations-heading-row {
    align-items: flex-start !important;
    flex-direction: column;
  }

  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > .d-flex,
  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  .container-fluid,
  body > .container-fluid {
    padding-right: 1rem !important;
    padding-left: 1rem !important;
  }

  .h3,
  h1.h3 {
    font-size: 1.28rem;
  }

  .reports-kpi-grid {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .operations-filter-grid {
    grid-template-columns: 1fr;
  }

  .operations-actions,
  .operations-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .operations-actions .btn,
  .operations-pager .btn,
  .btn:not(.btn-sm),
  .form-control,
  .form-select {
    min-height: 44px;
  }

  .btn-group-sm > .btn,
  .btn-sm {
    min-height: 40px;
  }

  .navbar-timezone-control {
    max-width: calc(100vw - 112px);
  }

  .navbar-clock {
    max-width: 130px;
    overflow: hidden;
  }

  .user-dropdown,
  .timezone-dropdown {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 2026 UI refinement pass: operational calm, compact controls, clearer hierarchy */
:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-raised: #ffffff;
  --app-surface-muted: #eef3f8;
  --app-border: #d8e1ec;
  --app-border-strong: #b9c7d6;
  --app-text: #162033;
  --app-muted: #607083;
  --app-muted-strong: #334155;
  --app-primary: #2563eb;
  --app-primary-strong: #1e4fbf;
  --app-primary-soft: #dceafe;
  --app-accent: #0f766e;
  --app-accent-soft: #d7f7f2;
  --app-radius: 8px;
  --app-radius-sm: 6px;
  --app-shadow-sm: 0 1px 2px rgba(22, 32, 51, 0.05), 0 8px 24px rgba(56, 78, 107, 0.06);
  --app-shadow-md: 0 16px 44px rgba(56, 78, 107, 0.13);
  --app-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.dark-mode {
  --app-bg: #0d121a;
  --app-surface: #151c26;
  --app-surface-raised: #1b2430;
  --app-surface-muted: #101722;
  --app-border: #2d3a4b;
  --app-border-strong: #435367;
  --app-text: #f2f6fb;
  --app-muted: #aebccd;
  --app-muted-strong: #d2dbe7;
  --app-primary: #7db7ff;
  --app-primary-strong: #9bc8ff;
  --app-primary-soft: rgba(125, 183, 255, 0.15);
  --app-accent: #5eead4;
  --app-accent-soft: rgba(94, 234, 212, 0.13);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 0%, rgba(37, 99, 235, 0.08), transparent 28rem),
    linear-gradient(180deg, rgba(255,255,255,0.68), rgba(255,255,255,0));
}

.dark-mode body::before {
  background:
    radial-gradient(circle at 16% 0%, rgba(96, 165, 250, 0.12), transparent 28rem),
    linear-gradient(180deg, rgba(21, 28, 38, 0.9), rgba(13, 18, 26, 0));
}

.container-fluid,
body > .container-fluid {
  width: min(100%, 1480px);
  padding-right: clamp(1rem, 2vw, 1.75rem) !important;
  padding-left: clamp(1rem, 2vw, 1.75rem) !important;
}

body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4,
.reports-header,
.operations-heading-row {
  padding-top: 1.35rem !important;
  padding-bottom: 1.1rem !important;
  border-bottom: 1px solid rgba(185, 199, 214, 0.55);
  margin-bottom: 1.1rem;
}

h1,
.h3,
h1.h3,
.operations-title,
.report-panel-header h2 {
  color: var(--app-text);
  letter-spacing: 0;
  text-wrap: balance;
}

h1.h3,
.h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
}

p,
.text-muted,
.form-text {
  text-wrap: pretty;
}

.card,
.report-kpi,
.report-panel,
.settings-sidebar,
.operations-filter-panel,
.operations-table-wrap,
.template-panel,
.modal-content,
.auth-card {
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.card,
.report-kpi,
.report-panel,
.template-panel {
  overflow: clip;
}

.card-header,
.modal-header,
.report-panel-header,
.template-panel-header {
  min-height: 54px;
  padding: 0.9rem 1rem;
}

.card-body {
  padding: 1rem;
}

.stat-card .card-body {
  min-height: 112px;
}

.stat-label,
.report-kpi-label,
.operations-label,
.form-label,
.table th {
  letter-spacing: 0;
}

.stat-label,
.report-kpi-label,
.operations-label,
.form-label.extra-small,
.table th {
  text-transform: none;
}

.stat-value {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.05;
}

.stat-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.btn {
  min-width: 2.5rem;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
  box-shadow: 0 8px 20px rgba(30, 79, 191, 0.18);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
  background: #183f9b;
  border-color: #183f9b;
  box-shadow: 0 10px 22px rgba(30, 79, 191, 0.22);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-light {
  background: var(--app-surface);
}

.form-label {
  color: var(--app-muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.32rem;
}

.form-control,
.form-select,
.input-group-text {
  min-height: 38px;
  border-color: var(--app-border-strong);
  box-shadow: inset 0 1px 0 rgba(22, 32, 51, 0.02);
}

textarea.form-control {
  min-height: 7.5rem;
}

input[type="number"].form-control,
input[type="date"].form-control,
input[type="time"].form-control,
input[type="search"].form-control,
.table-filter-bar .form-control,
.table-filter-bar .form-select,
.operations-input,
.compact-select {
  min-height: 34px;
}

.table-filter-bar {
  padding: 0.85rem 1rem;
}

.table-filter-bar .row {
  row-gap: 0.65rem;
}

.table-filter-bar .col-md-auto {
  flex: 0 1 auto;
}

.table-filter-bar input[type="search"] {
  width: min(100%, 18rem);
}

.table-filter-bar .form-select {
  width: auto;
  min-width: 9rem;
}

.queue-page-header {
  gap: 1rem;
}

.queue-page-header > div:first-child {
  min-width: 0;
}

.queue-actionbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.queue-actionbar .btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
}

.queue-actionbar .btn-success {
  box-shadow: 0 10px 20px rgba(21, 128, 61, 0.16);
}

.queue-actions-menu {
  min-width: 13rem;
  padding: 0.45rem;
  border-color: var(--app-border);
  border-radius: var(--app-radius-sm);
  box-shadow: var(--app-shadow-md);
}

.queue-actions-menu .dropdown-item {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 600;
}

.queue-actions-menu .dropdown-item i {
  width: 1rem;
  text-align: center;
}

.export-action {
  gap: 0.42rem;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}

.export-action .export-file-icon {
  width: 1.12rem;
  min-width: 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-accent);
  font-size: 1.05rem;
  line-height: 1;
}

.export-action.btn-sm .export-file-icon,
.dropdown-item.export-action .export-file-icon {
  width: 1rem;
  min-width: 1rem;
  font-size: 0.98rem;
}

.dropdown-item.export-action {
  justify-content: flex-start;
}

.dark-mode .queue-actions-menu {
  background: var(--app-surface-raised);
  border-color: var(--app-border);
}

.filter-result-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--app-radius-sm);
}

.table-responsive {
  scrollbar-width: thin;
  scrollbar-color: var(--app-border-strong) transparent;
}

.table th {
  height: 40px;
  padding: 0.58rem 0.75rem;
  font-size: 0.74rem;
}

.table td {
  padding: 0.62rem 0.75rem;
}

.badge {
  border-radius: 6px;
  line-height: 1.15;
}

.app-sidebar,
.app-topbar {
  background: var(--app-surface);
}

.app-sidebar {
  border-right: 1px solid var(--app-border);
}

.app-topbar {
  border-bottom: 1px solid var(--app-border);
}

.app-sidebar-brand {
  min-height: var(--app-topbar-height);
  border-bottom-color: var(--app-border);
}

.app-sidebar-link {
  min-height: 38px;
}

.navbar-timezone-control {
  box-shadow: inset 0 0 0 1px var(--app-border);
}

.user-dropdown,
.timezone-dropdown {
  margin-top: 0.45rem;
}

.operations-filter-panel {
  padding: 0.85rem;
}

.operations-filter-grid {
  align-items: end;
}

.operations-date-range .operations-input {
  width: 8.5rem;
}

.date-range-filter {
  position: relative;
  width: max-content;
  max-width: 260px;
}

.operations-filter-date .date-range-filter {
  width: max-content;
  max-width: 260px;
}

.date-range-trigger {
  width: auto;
  max-width: 260px;
  min-height: 34px;
  display: grid;
  grid-template-columns: auto max-content auto;
  align-items: center;
  justify-content: start;
  gap: 0.36rem;
  padding: 0.32rem 0.46rem;
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.date-range-trigger:hover {
  border-color: var(--app-primary);
}

.date-range-trigger:focus-visible {
  border-color: var(--app-primary);
  box-shadow: var(--app-focus);
  outline: 0;
}

.date-range-trigger > i:first-child {
  color: var(--app-muted);
  font-size: 0.94rem;
}

.date-range-value {
  max-width: 10.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-chevron {
  color: var(--app-muted);
  font-size: 0.78rem;
  transition: transform 0.16s ease;
}

.date-range-filter.is-open .date-range-chevron {
  transform: rotate(180deg);
}

.date-range-menu {
  position: absolute;
  top: calc(100% + 0.32rem);
  left: 0;
  z-index: 1060;
  width: min(13.75rem, calc(100vw - 2rem));
  display: none;
  padding: 0.3rem;
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-md);
}

.date-range-filter.is-open .date-range-menu {
  width: min(13.75rem, calc(100vw - 2rem));
}

.date-range-filter.is-open .date-range-menu {
  display: block;
}

.date-range-filter.is-open.is-custom-open .date-range-menu {
  width: min(36rem, calc(100vw - 2rem));
  display: grid;
  grid-template-columns: minmax(11.5rem, 0.7fr) minmax(17rem, 1fr);
  gap: 0.85rem;
}

.date-range-presets {
  display: grid;
  gap: 0.12rem;
}

.date-range-preset {
  width: 100%;
  min-height: 29px;
  padding: 0.3rem 0.46rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--app-muted-strong);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 650;
  text-align: left;
}

.date-range-preset:hover,
.date-range-preset.active {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}

.date-range-custom-option {
  margin-top: 0.12rem;
  border-top: 1px solid var(--app-border);
  border-radius: 0 0 5px 5px;
}

.date-range-custom-option i {
  color: var(--app-muted);
  font-size: 0.72rem;
}

.date-range-custom {
  display: none;
  min-width: 0;
  padding: 0.4rem 0.58rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}

.date-range-filter.is-custom-open .date-range-custom {
  display: block;
}

.date-range-calendars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.date-range-calendar {
  min-width: 0;
  padding: 0.35rem;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}

.date-range-calendar-head {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 1.6rem;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.3rem;
  text-align: center;
}

.date-range-calendar-title {
  color: var(--app-muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.date-range-calendar-month {
  margin-top: 0.08rem;
  color: var(--app-text);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.1;
}

.date-range-calendar-nav {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-muted-strong);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 5px;
  font-size: 0.68rem;
}

.date-range-calendar-nav:hover {
  color: var(--app-primary-strong);
  border-color: rgba(37, 99, 235, 0.34);
}

.date-range-weekdays,
.date-range-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.14rem;
}

.date-range-weekdays {
  margin-bottom: 0.16rem;
  color: var(--app-muted);
  font-size: 0.62rem;
  font-weight: 750;
  text-align: center;
}

.date-range-day {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  color: var(--app-muted-strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.date-range-day:not(.empty):hover {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
}

.date-range-day.in-range {
  color: var(--app-primary-strong);
  background: rgba(37, 99, 235, 0.10);
}

.date-range-day.selected-start,
.date-range-day.selected-end {
  color: #fff;
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
}

.date-range-day.empty {
  pointer-events: none;
}

.date-range-custom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.42rem;
}

.date-range-custom-summary {
  min-width: 0;
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.date-range-apply {
  width: auto;
  min-height: 28px;
  padding: 0.24rem 0.62rem;
  margin-top: 0;
  font-size: 0.75rem;
}

.dark-mode .date-range-trigger {
  background: var(--app-surface);
  box-shadow: none;
}

.dark-mode .date-range-menu {
  background: var(--app-surface-raised);
  border-color: var(--app-border);
}

.dark-mode .date-range-calendar {
  background: var(--app-surface-muted);
}

.settings-shell {
  align-items: start;
}

.settings-nav-button {
  text-align: left;
}

.settings-timezone-field {
  max-width: 22rem;
}

.settings-timezone-field .form-select {
  min-height: 38px;
}

.settings-timezone-field .form-text {
  max-width: 30ch;
}

.settings-timezone-field .is-saving {
  background-image:
    linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.08), transparent),
    var(--bs-form-select-bg-img);
  background-size: 220% 100%, 16px 12px;
  animation: timezoneSaving 1.1s ease-in-out infinite;
}

.app-toast-region {
  position: fixed;
  top: calc(var(--app-topbar-height, 56px) + 0.85rem);
  right: 1rem;
  z-index: 1085;
  display: grid;
  gap: 0.55rem;
  width: min(21rem, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  padding: 0.8rem 0.95rem;
  color: var(--app-text);
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--app-primary-strong);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-md);
  opacity: 0;
  transform: translateY(-0.35rem);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-error {
  border-left-color: var(--app-danger);
}

.app-toast-title {
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
}

.app-toast-message {
  margin-top: 0.16rem;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.navbar-timezone-control {
  min-height: 34px;
  padding: 0.12rem 0.28rem 0.12rem 0.55rem;
  border: 1px solid rgba(185, 199, 214, 0.62);
  box-shadow: none;
}

.navbar-clock {
  font-size: 0.68rem;
  line-height: 1.18;
}

.navbar-clock-date {
  font-size: 0.58rem;
  font-weight: 650;
  line-height: 1.1;
}

.navbar-timezone-button {
  min-width: 30px;
  min-height: 30px;
  width: 30px;
  height: 30px;
}

.auth-page {
  min-height: 100dvh;
  padding: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(37, 99, 235, 0.14), transparent 24rem),
    radial-gradient(circle at 82% 20%, rgba(15, 118, 110, 0.10), transparent 22rem),
    linear-gradient(150deg, #f8fafc 0%, #eef4fb 52%, #e8f7f8 100%);
}

.auth-shell {
  min-height: 100dvh;
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 440px);
  place-content: center;
  justify-items: stretch;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
}

.auth-card {
  width: 100%;
  padding: clamp(1.35rem, 3vw, 2rem);
  color: var(--app-text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.86)),
    var(--app-surface);
  border: 1px solid rgba(185, 199, 214, 0.74) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 70px rgba(56, 78, 107, 0.18), 0 2px 8px rgba(22, 32, 51, 0.05) !important;
}

.auth-login-card {
  position: relative;
  overflow: hidden;
}

.auth-login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary-strong), var(--app-accent));
}

.auth-brand,
.auth-section-title {
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.45rem;
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--app-primary-strong);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(30, 79, 191, 0.24);
}

.auth-brand-icon i {
  font-size: 1.25rem;
}

.auth-brand h1,
.auth-section-title h2 {
  font-size: 1.28rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-brand p,
.auth-section-title p {
  margin-top: 0.24rem;
  color: var(--app-muted-strong);
  font-size: 0.86rem;
  font-weight: 650;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.auth-field {
  display: grid;
  gap: 0.34rem;
}

.auth-field .form-label {
  margin: 0;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > i {
  position: absolute;
  top: 50%;
  left: 0.82rem;
  z-index: 2;
  color: var(--app-muted);
  font-size: 0.95rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input-wrap .form-control {
  min-height: 44px;
  padding-left: 2.45rem;
  border-color: #b9c7d6;
  background: rgba(255,255,255,0.88);
}

.auth-input-wrap .form-control:focus {
  background: #fff;
}

.auth-submit {
  min-height: 46px;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  box-shadow: 0 14px 28px rgba(30, 79, 191, 0.22);
}

.auth-submit:hover {
  transform: translateY(-1px);
}

.auth-page .alert {
  border-radius: var(--app-radius-sm);
}

.dark-mode .auth-page {
  background:
    radial-gradient(circle at 18% 16%, rgba(96, 165, 250, 0.15), transparent 24rem),
    radial-gradient(circle at 82% 20%, rgba(45, 212, 191, 0.10), transparent 22rem),
    linear-gradient(150deg, #0d121a 0%, #111827 54%, #10212a 100%);
}

.dark-mode .auth-card {
  background:
    linear-gradient(180deg, rgba(21,28,38,0.95), rgba(21,28,38,0.88)),
    var(--app-surface);
}

.dark-mode .auth-input-wrap .form-control {
  background: rgba(13, 18, 26, 0.74);
}

@media (min-width: 992px) {
  .auth-shell:has(.auth-reset-card) {
    grid-template-columns: minmax(0, 440px) minmax(0, 440px);
  }
}

@media (max-width: 576px) {
  .auth-shell {
    padding: 1rem;
  }

  .auth-card {
    border-radius: 10px !important;
  }

  .auth-brand-icon {
    width: 44px;
    height: 44px;
  }
}

@keyframes timezoneSaving {
  0% { background-position: 180% 0, right 0.75rem center; }
  100% { background-position: -80% 0, right 0.75rem center; }
}

@media (min-width: 993px) {
  .app-topbar {
    padding-right: 1rem;
  }

  .table-filter-bar .row {
    flex-wrap: wrap;
  }
}

@media (max-width: 992px) {
  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4,
  .reports-header,
  .operations-heading-row {
    gap: 0.8rem;
  }

  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > .d-flex,
  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.6rem !important;
  }

  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > .d-flex .btn,
  body > .container-fluid > .d-flex.justify-content-between.align-items-center.py-4 > div:last-child .btn {
    width: 100%;
  }

  .table-filter-bar .col-md-auto,
  .table-filter-bar input[type="search"],
  .table-filter-bar .form-select {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .container-fluid,
  body > .container-fluid {
    padding-right: 0.85rem !important;
    padding-left: 0.85rem !important;
  }

  .card-header,
  .modal-header,
  .report-panel-header,
  .template-panel-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 0.5rem;
  }

  .card-body {
    padding: 0.85rem;
  }

  .row.g-3 {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.85rem;
  }

  .btn:not(.btn-sm),
  .form-control,
  .form-select {
    min-height: 42px;
  }

  .table th,
  .table td {
    padding: 0.58rem 0.65rem;
  }
}

/* Logs and reports tightening */
.operations-heading-row,
.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.operations-title {
  margin: 0;
}

.operations-tab-switch {
  overflow: hidden;
}

.operations-tab-switch a {
  min-height: 36px;
  padding: 0.42rem 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.operations-filter-panel {
  margin-bottom: 1rem;
}

.operations-filter-grid {
  grid-template-columns: repeat(5, minmax(9.5rem, 12rem)) auto;
  gap: 0.85rem 1rem;
}

.operations-filter-grid > div {
  min-width: 0;
}

.operations-filter-field {
  grid-column: auto;
  min-width: 0;
  max-width: 12rem;
}

.operations-filter-field .operations-input,
.operations-filter-field .operations-search-wrap {
  max-width: 12rem;
}

.operations-filter-date {
  grid-column: auto;
  padding-right: 0;
  max-width: 16rem;
}

.operations-filter-ip {
  grid-column: auto;
  padding-left: 0;
  max-width: 12rem;
}

.operations-label {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--app-muted-strong);
  font-size: 0.78rem;
}

.operations-search-wrap,
.operations-date-range {
  min-width: 0;
}

.operations-date-range {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.operations-date-range i {
  position: static !important;
  width: 1rem;
  color: var(--app-muted);
  line-height: 1;
}

.operations-date-range .operations-input {
  min-width: 0;
  width: 100%;
}

.operations-date-range .operations-input:first-of-type {
  padding-left: 0.5rem;
}

.operations-actions {
  grid-column: auto;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
  padding-top: 0;
}

.operations-actions .btn {
  min-width: 0;
}

.operations-table {
  table-layout: fixed;
  width: 100%;
}

.operations-table th,
.operations-table td,
.report-table th,
.report-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.operations-table th {
  white-space: nowrap;
}

.operations-table td {
  vertical-align: top;
}

.operations-table .operations-token,
.report-token {
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
}

.operations-code-cell {
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.operations-text,
.report-text-cell,
.report-error-cell {
  max-width: 24rem;
  line-height: 1.42;
}

.operations-result-link {
  max-width: 100%;
  text-align: left;
}

.operations-result-link span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.operations-detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.55rem 1rem;
}

.operations-detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operations-json {
  max-height: min(54vh, 34rem);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--app-radius-sm);
}

.operations-state-item {
  overflow-wrap: anywhere;
}

.reports-header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reports-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.report-kpi {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.report-kpi-label,
.report-kpi small {
  overflow-wrap: anywhere;
}

.report-kpi small,
.dashboard-helper-label,
.report-bar-label span,
.report-list-item small,
.supplier-row-status,
.filter-result-count {
  color: var(--app-muted-strong) !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.report-kpi small {
  margin-top: 0.05rem;
}

.report-bar-label span,
.report-status-badge,
.report-list-item small {
  text-transform: capitalize;
}

.report-kpi-date {
  font-size: clamp(1rem, 1.7vw, 1.35rem);
}

.report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.report-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.report-tabs .nav-link {
  white-space: nowrap;
}

.report-table {
  table-layout: auto;
  min-width: 680px;
}

.report-table th {
  white-space: nowrap;
}

.report-table td {
  vertical-align: top;
}

.report-status-badge {
  text-transform: capitalize;
}

.report-list-item {
  min-width: 0;
}

.report-list-item span,
.report-list-item small,
.report-bar-label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-empty,
.operations-table td.text-center.text-muted,
.report-table td.text-center.text-muted {
  color: var(--app-muted-strong) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.56), rgba(255,255,255,0)),
    var(--app-surface-muted);
  border-radius: var(--app-radius-sm);
  font-weight: 600;
}

.dark-mode .report-empty,
.dark-mode .operations-table td.text-center.text-muted,
.dark-mode .report-table td.text-center.text-muted {
  background: var(--app-surface-muted);
}

@media (max-width: 1200px) {
  .operations-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operations-filter-field,
  .operations-filter-date,
  .operations-filter-ip,
  .operations-filter-field .operations-input,
  .operations-filter-field .operations-search-wrap {
    max-width: none;
  }

  .operations-filter-field,
  .operations-filter-ip {
    grid-column: auto;
  }

  .operations-filter-date {
    grid-column: auto;
  }

  .operations-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 992px) {
  .operations-heading-row,
  .reports-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue-page-header {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .queue-actionbar {
    width: 100%;
    display: flex !important;
    justify-content: flex-start;
  }

  .reports-header-meta,
  .operations-tab-switch {
    width: 100%;
    justify-content: flex-start;
  }

  .operations-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-filter-field,
  .operations-filter-ip,
  .operations-filter-date,
  .operations-actions {
    grid-column: 1 / -1;
  }

  .operations-filter-date,
  .operations-filter-ip {
    padding-right: 0;
    padding-left: 0;
  }

  .operations-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .queue-actionbar {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .queue-actionbar .dropdown,
  .queue-actionbar .btn {
    width: 100%;
  }

  .operations-filter-grid {
    grid-template-columns: 1fr;
  }

  .operations-date-range {
    grid-template-columns: 1rem minmax(0, 1fr);
  }

  .date-range-filter,
  .operations-filter-date .date-range-filter {
    width: 100%;
    max-width: none;
  }

  .date-range-filter .date-range-trigger {
    width: 100%;
    max-width: none;
  }

  .date-range-trigger {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-content: stretch;
  }

  .date-range-value {
    max-width: none;
  }

  .date-range-menu {
    width: 100%;
  }

  .date-range-filter.is-open.is-custom-open .date-range-menu {
    width: 100%;
    display: block;
  }

  .date-range-custom {
    margin-top: 0.25rem;
  }

  .date-range-calendars {
    grid-template-columns: 1fr;
  }

  .date-range-calendar {
    padding: 0.42rem;
  }

  .date-range-custom-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .date-range-apply {
    width: 100%;
  }

  .operations-date-range span {
    display: none;
  }

  .operations-date-range .operations-input:last-child {
    grid-column: 2;
  }

  .operations-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .operations-detail-list {
    grid-template-columns: 1fr;
  }

  .report-table,
  .operations-table {
    min-width: 720px;
  }
}

/* Executive reports dashboard */
.reports-executive-page {
  --report-green: #15803d;
  --report-green-bg: #ecfdf3;
  --report-amber: #b45309;
  --report-amber-bg: #fffbeb;
  --report-red: #b91c1c;
  --report-red-bg: #fef2f2;
  --report-blue: #2563eb;
  --report-blue-bg: #eff6ff;
  --report-ink: #0f172a;
  max-width: 100%;
  overflow-x: hidden;
}

.reports-executive-header {
  gap: 1.5rem;
}

.reports-executive-header > div,
.report-health-main {
  min-width: 0;
}

.report-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0.34rem 0.65rem;
  color: var(--app-muted-strong);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-meta-pill.is-healthy {
  color: var(--report-green);
  background: var(--report-green-bg);
  border-color: #bbf7d0;
}

.report-meta-pill.is-warning {
  color: var(--report-amber);
  background: var(--report-amber-bg);
  border-color: #fde68a;
}

.report-action-feedback {
  margin-bottom: 1rem;
}

.report-health-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left-width: 4px;
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
}

.report-health-banner.is-healthy {
  border-left-color: var(--report-green);
}

.report-health-banner.is-warning {
  border-left-color: var(--report-amber);
}

.report-health-banner.is-critical {
  border-left-color: var(--report-red);
}

.report-health-state {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: var(--app-muted-strong);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-health-banner h2 {
  margin: 0;
  color: var(--report-ink);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.report-health-banner p {
  max-width: 58rem;
  margin: 0.35rem 0 0;
  color: var(--app-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-health-score {
  min-width: 112px;
  padding: 0.8rem;
  text-align: center;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}

.report-health-score strong {
  display: block;
  color: var(--report-ink);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1;
}

.report-health-score span {
  display: block;
  margin-top: 0.35rem;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.report-health-score-label {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.report-info-button {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--app-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1;
}

.report-info-button:hover,
.report-info-button:focus-visible {
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
  outline: none;
}

.reports-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.report-decision-card,
.report-insight-card,
.report-alert-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
}

.report-decision-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 1.15rem;
  border-top-width: 3px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.report-decision-card:hover {
  transform: translateY(-1px);
  border-color: var(--app-border-strong);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09);
}

.report-decision-card.is-healthy,
.report-insight-card.is-healthy {
  border-top-color: var(--report-green);
}

.report-decision-card.is-warning,
.report-insight-card.is-warning {
  border-top-color: var(--report-amber);
}

.report-decision-card.is-critical,
.report-insight-card.is-critical {
  border-top-color: var(--report-red);
}

.report-decision-card.is-info,
.report-insight-card.is-info {
  border-top-color: var(--report-blue);
}

.report-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-card-topline i {
  color: var(--app-muted);
  font-size: 1rem;
  opacity: 0.66;
}

.report-decision-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--report-ink);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.05;
}

.report-decision-card p,
.report-insight-card p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.report-decision-card small,
.report-insight-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.report-insight-card {
  min-height: 124px;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 1.1rem;
  border-top-width: 3px;
}

.report-insight-card strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--report-ink);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.05;
}

.report-alert-panel {
  overflow: hidden;
}

.report-alert-list {
  display: grid;
  gap: 0;
}

.report-alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  color: var(--report-ink);
  text-decoration: none;
  border-top: 1px solid var(--app-border);
}

.report-alert-item:hover {
  background: var(--app-surface-muted);
}

.report-alert-marker {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--report-blue);
}

.report-alert-item.is-critical .report-alert-marker {
  background: var(--report-red);
}

.report-alert-item.is-warning .report-alert-marker {
  background: var(--report-amber);
}

.report-alert-item strong,
.report-alert-item small {
  display: block;
  min-width: 0;
}

.report-alert-item strong {
  font-size: 0.84rem;
  font-weight: 650;
}

.report-alert-item small {
  margin-top: 0.2rem;
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.report-alert-item em {
  color: var(--app-primary);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 650;
  white-space: nowrap;
}

.report-severity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.report-severity-badge.is-critical {
  color: var(--report-red);
  background: var(--report-red-bg);
  border: 1px solid #fecaca;
}

.report-severity-badge.is-warning {
  color: var(--report-amber);
  background: var(--report-amber-bg);
  border: 1px solid #fde68a;
}

.report-severity-badge.is-normal {
  color: var(--report-green);
  background: var(--report-green-bg);
  border: 1px solid #bbf7d0;
}

.report-row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.report-row-actions .btn {
  min-height: 30px;
  white-space: nowrap;
}

.report-priority-table {
  min-width: 920px;
}

.reports-executive-page .report-panel {
  border-color: var(--app-border);
  box-shadow: var(--app-shadow-sm);
}

.reports-executive-page .report-panel-header {
  background: var(--app-surface);
}

.reports-executive-page .report-panel-header h2 {
  color: var(--report-ink);
}

@media (max-width: 1200px) {
  .reports-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .report-health-banner {
    grid-template-columns: 1fr;
  }

  .report-health-score {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .reports-primary-grid {
    grid-template-columns: 1fr;
  }

  .report-meta-pill,
  .reports-header-meta .btn {
    max-width: 100%;
    white-space: normal;
  }

  .report-decision-card,
  .report-insight-card,
  .report-health-banner {
    padding: 1rem;
  }

  .report-alert-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .report-alert-item em {
    grid-column: 2;
  }
}

.dark-mode .report-health-banner,
.dark-mode .report-decision-card,
.dark-mode .report-insight-card,
.dark-mode .report-alert-panel,
.dark-mode .report-meta-pill {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.dark-mode .report-health-banner h2,
.dark-mode .report-health-score strong,
.dark-mode .report-decision-card strong,
.dark-mode .report-insight-card strong,
.dark-mode .report-alert-item,
.dark-mode .reports-executive-page .report-panel-header h2 {
  color: var(--app-text);
}

/* Final chrome color override */
.app-sidebar,
.app-topbar,
.dark-mode .app-sidebar,
.dark-mode .app-topbar {
  background: #394b59;
}

.app-sidebar {
  border-right-color: rgba(255,255,255,0.14);
}

.app-topbar {
  border-bottom-color: rgba(255,255,255,0.14);
}

.app-sidebar-brand,
.app-sidebar-brand:hover,
.app-sidebar-link,
.app-sidebar-link:hover {
  color: rgba(255,255,255,0.86);
}

.app-sidebar-link i,
.app-sidebar-link:not(.active) i {
  color: rgba(255,255,255,0.78);
}

.app-sidebar-link:hover {
  background: rgba(255,255,255,0.1);
}

.app-sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.16);
  box-shadow: inset 3px 0 0 #fff;
}

.app-sidebar-link.active i {
  color: #fff;
}

.app-sidebar-toggle,
.navbar-timezone-button,
.navbar-user-button.btn-outline-light,
.navbar-alert-button.btn-outline-light {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.28);
}

.app-sidebar-toggle:hover,
.navbar-timezone-button:hover,
.navbar-user-button.btn-outline-light:hover,
.navbar-alert-button.btn-outline-light:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.navbar-clock {
  color: rgba(255,255,255,0.9);
}

.navbar-clock-date {
  color: rgba(255,255,255,0.68);
}

.navbar-timezone-control {
  background: #394b59;
  border-color: rgba(255,255,255,0.42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.navbar-timezone-control .navbar-clock,
.navbar-timezone-control .navbar-clock-date {
  color: #fff;
}

.navbar-user-button.btn-outline-light,
.navbar-alert-button.btn-outline-light {
  color: #374151;
  background: #e5e7eb;
  border-color: #cbd5e1;
}

.navbar-user-button.btn-outline-light:hover,
.navbar-alert-button.btn-outline-light:hover {
  color: #111827;
  background: #d1d5db;
  border-color: #9ca3af;
}

.dark-mode .followup-stat-box {
  background: #111827;
  border-color: #374151;
}

.dark-mode .followup-stat-value {
  color: #e5e7eb;
}

.dashboard-kpi-card .card-body {
  min-height: 132px;
  padding: 1.5rem;
}

.dashboard-kpi-card .dashboard-kpi-value {
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-kpi-card-email .dashboard-kpi-value {
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-kpi-card-email .dashboard-kpi-metrics {
  gap: 0.75rem;
}

.dashboard-kpi-card-email .dashboard-kpi-metric + .dashboard-kpi-metric {
  padding-left: 0.75rem;
}

@media (max-width: 575.98px) {
  .dashboard-kpi-card,
  .dashboard-kpi-card .card-body {
    min-height: 124px;
  }

  .dashboard-kpi-card .card-body {
    padding: 1rem;
  }

  .dashboard-kpi-card-email .dashboard-kpi-value {
    font-size: 1.05rem;
  }
}
