:root {
  /* Minimal SaaS Milky White Theme */
  --bg-main: #f8fafc;
  --nav-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;

  --text-main: #334155;
  --text-muted: #64748b;
  --border-color: rgba(0, 0, 0, 0.05);

  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --primary-amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-text: #b45309;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;

  /* Tighter Soft UI Shadows */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-floating: 0 12px 24px rgba(0, 0, 0, 0.06);

  /* Sharper, tighter border radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --nav-bg: #1e293b;
  --sidebar-bg: #1e293b;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.05);

  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-text: #fcd34d;
  --success-bg: rgba(16, 185, 129, 0.1);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-floating: 0 16px 32px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   BASE STYLES & STRICT OVERFLOW PREVENTION
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
}

html,
body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ui-icon {
  width: 16px;
  height: 16px;
}

/* ==========================================
   LOGIN PAGE SPECIFIC
   ========================================== */
#login-wrapper {
  background-color: var(--bg-main);
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#login-wrapper .card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  padding: 40px 28px !important;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* ==========================================
   TOP NAVIGATION
   ========================================== */
.top-navbar {
  height: 72px; /* INCREASED HEADER HEIGHT */
  background-color: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
}
.nav-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-theme-btn:hover {
  background: var(--card-bg);
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.notification-center {
  position: relative;
}
.notification-button {
  position: relative;
}
.notification-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  color: #fff;
  background: #dc2626;
  border: 2px solid var(--nav-bg);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.notification-count[hidden],
.notification-panel[hidden] {
  display: none;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: hidden;
  color: var(--text-main);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
}
.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}
.notification-panel-header button {
  padding: 4px;
  color: var(--primary-blue);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.notification-list {
  max-height: 360px;
  overflow-y: auto;
}
.notification-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}
.notification-item.unread {
  background: rgba(59, 130, 246, 0.07);
}
.notification-item p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.notification-empty {
  padding: 18px 14px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}
.overview-notification-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2500;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  padding: 16px 18px;
  color: var(--text-main);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-blue);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  opacity: 0;
  transform: translate(-50%, calc(100% + 32px));
}
.overview-notification-toast.is-visible {
  animation: notificationToastIn 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.overview-notification-toast.is-hiding {
  animation: notificationToastOut 360ms ease-in forwards;
}
.overview-notification-toast-icon {
  flex: 0 0 auto;
  color: var(--primary-blue);
}
.overview-notification-toast-content {
  min-width: 0;
  flex: 1;
}
.overview-notification-toast-content strong {
  display: block;
  font-size: 13px;
}
.overview-notification-toast-content p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.overview-notification-toast-close {
  flex: 0 0 auto;
  padding: 2px 4px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
@keyframes notificationToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(100% + 32px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes notificationToastOut {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, calc(100% + 32px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .overview-notification-toast.is-visible,
  .overview-notification-toast.is-hiding {
    animation-duration: 1ms;
  }
}

.top-nav-links {
  display: flex;
  gap: 4px;
}
.top-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.top-link:hover {
  color: var(--text-main);
  background: var(--bg-main);
}
.top-link.active {
  color: var(--primary-blue);
  background: rgba(59, 130, 246, 0.08);
  font-weight: 600;
}

.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}
.avatar-circle:hover {
  transform: scale(1.05);
  background-color: rgba(59, 130, 246, 0.15);
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
[data-theme="dark"] .avatar-circle {
  background: #334155;
}

.user-meta {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.2;
}
.user-role {
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================
   LAYOUT & SIDEBAR
   ========================================== */
.app-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 12px;
  flex-shrink: 0;
}

.sidebar-menu {
  list-style: none;
}
.menu-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}
.menu-item:hover {
  background: var(--bg-main);
  color: var(--text-main);
}
.menu-item.active {
  background: #f0f9ff;
  color: var(--primary-blue);
  font-weight: 600;
}
[data-theme="dark"] .menu-item.active {
  background: rgba(59, 130, 246, 0.1);
}

.sidebar-footer-card {
  background: var(--bg-main);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 10px;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-main);
}
.status-dot.green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-bg);
}
.status-sub {
  color: var(--success);
  margin: 4px 0 2px 0;
  font-weight: 500;
}

/* Readonly Inputs Styling */
.table-input[readonly] {
  background: transparent !important;
  border-color: transparent !important;
  cursor: default !important;
  user-select: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ==========================================
   MAIN WORKSPACE & CARDS
   ========================================== */
.main-workspace {
  flex: 1;
  padding: 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.welcome-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.3px;
}
.welcome-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
}
.single-column-override {
  grid-template-columns: 1fr !important;
}

/* ==========================================
   SLIM PROFILE & ELIGIBILITY BANNER
   ========================================== */
.slim-profile-card {
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.slim-info-section {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.slim-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.slim-info-item small {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.slim-info-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slim-eligibility-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.slim-eligibility-section small {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.single-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.single-badge.full {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.single-badge.partial {
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.single-badge.missed {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================
   EVENLY SPACED SALARY & CALCULATE ROW
   ========================================== */
.salary-action-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 2px !important;
}

.salary-input,
#salary {
  flex: 1 1 50% !important;
  width: 50% !important;
  min-width: 0 !important;
  height: 32px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  box-sizing: border-box !important;
  background: var(--bg-main) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
}

.btn-calc-top,
#btn-calculate,
.btn-primary {
  flex: 1 1 50% !important;
  width: 50% !important;
  min-width: 0 !important;
  height: 32px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  background: var(--primary-blue) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}

.btn-primary:hover,
#btn-calculate:hover,
.btn-calc-top:hover {
  background: var(--primary-blue-hover) !important;
}

/* Dark Mode Button Overrides */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] #btn-calculate,
[data-theme="dark"] .btn-calc-top {
  background: #2563eb !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] #btn-calculate:hover,
[data-theme="dark"] .btn-calc-top:hover {
  background: #3b82f6 !important;
}

/* ==========================================
   HERO STACK: Payout & Next Band
   ========================================== */
.hero-top-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.card-sm-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.hero-payout-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-amber);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.hero-inner-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  gap: 8px;
  margin-bottom: 16px;
}
[data-theme="dark"] .hero-inner-box {
  background: rgba(255, 255, 255, 0.02);
}

.inner-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.inner-stat small {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.inner-stat strong {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-amber {
  color: var(--primary-amber) !important;
}

.hero-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.hero-footer strong {
  color: var(--text-main);
  font-weight: 600;
}

.band-transition-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.hero-prog-wrap {
  height: 6px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
[data-theme="dark"] .hero-prog-wrap {
  background: rgba(255, 255, 255, 0.04);
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary-amber);
  transition: width 0.8s ease;
  border-radius: 6px;
}
.right-align {
  display: flex;
  justify-content: flex-end;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.opportunity-inner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.inner-stat-box {
  background: rgba(0, 0, 0, 0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  min-width: 0;
}
[data-theme="dark"] .inner-stat-box {
  background: rgba(255, 255, 255, 0.015);
}
.inner-stat-box small {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.inner-stat-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   TABLES & METRICS
   ========================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}
.data-table th,
.data-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}
.data-table td {
  color: var(--text-main);
  font-weight: 500;
}

.table-input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: var(--bg-main);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.table-input:hover {
  background: #f1f5f9;
}
[data-theme="dark"] .table-input:hover {
  background: #334155;
}
.table-input:focus {
  background: var(--card-bg);
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.status-badge {
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}
.status-badge.met {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.15);
}
.status-badge.missed {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* METRICS TABLE ROW INTERACTION FIXES */
.metric-row {
  cursor: pointer;
  transition: background 0.2s ease;
}
.metric-row:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}
[data-theme="dark"] .metric-row:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

.expand-icon {
  display: inline-block;
  font-weight: 700;
  margin-right: 6px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.metric-row.expanded .expand-icon {
  transform: rotate(90deg);
  color: var(--primary-amber);
}

/* DETAILS ROW DISPLAY FIXES */
.details-row {
  display: none !important;
  background: rgba(0, 0, 0, 0.02) !important;
}
[data-theme="dark"] .details-row {
  background: rgba(255, 255, 255, 0.02) !important;
}
.details-row.show {
  display: table-row !important;
}

.metric-details-box {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text-main);
  display: flex;
  gap: 24px;
  border-left: 3px solid var(--primary-amber);
  margin: 4px 0;
}
.metric-details-box strong {
  color: var(--text-main);
  font-weight: 600;
}

.diff-val {
  font-weight: 600;
  font-size: 11px;
}
.diff-val.positive {
  color: var(--success);
}
.diff-val.negative {
  color: var(--danger);
}

/* ==========================================
   MONTH FILTER DROPDOWN
   ========================================== */
.month-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.month-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.month-select {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* ==========================================
   TOP-RIGHT SLIDING PROFILE DRAWER (STRICT UNDER AVATAR)
   ========================================== */
.profile-modal-overlay {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: transparent !important; /* Removes dark backdrop tint */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 99999 !important;
  justify-content: flex-end !important; /* Anchors content to top right */
  align-items: flex-start !important;
  padding-top: 72px !important; /* HEIGHT ADJUSTED TO MATCH NEW NAVBAR */
  padding-right: 16px !important; /* Aligns directly below avatar */
  box-sizing: border-box !important;
}

.profile-modal-overlay.active {
  display: flex !important;
}

.profile-modal-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-floating) !important;
  width: 290px !important;
  max-width: calc(100vw - 32px) !important;
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 !important;
  transform-origin: top right !important;
  animation: slideFromAvatar 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes slideFromAvatar {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.profile-modal-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close-btn:hover {
  color: var(--danger);
}

.profile-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.modal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-detail-item small {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.modal-detail-item strong {
  font-size: 11px;
  color: var(--text-main);
  font-weight: 600;
  word-break: break-word;
}

/* Styled Sign-Out Button Inside Drawer */
.drawer-logout-btn {
  margin-top: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-logout-btn:hover {
  background: var(--danger);
  color: #ffffff;
}

[data-theme="dark"] .drawer-logout-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .drawer-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.session-expired-dialog {
  margin: auto;
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  overflow: visible;
  color: var(--text-main);
  background: transparent;
  border: 0;
}
.session-expired-dialog::backdrop {
  background: rgba(10, 18, 32, 0.64);
  backdrop-filter: blur(5px);
}
.session-expired-card {
  padding: 30px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-amber);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  animation: sessionDialogEnter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.session-expired-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--amber-text);
  background: var(--amber-bg);
  border-radius: 12px;
}
.session-expired-icon svg {
  width: 25px;
  height: 25px;
}
.session-expired-eyebrow {
  margin: 0 0 6px;
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.session-expired-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}
.session-expired-message {
  margin: 10px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.session-expired-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--primary-blue);
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.session-expired-action:hover {
  background: var(--primary-blue-hover);
}
.session-expired-action:focus-visible {
  outline: 3px solid var(--primary-amber);
  outline-offset: 3px;
}
@keyframes sessionDialogEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .session-expired-card {
    animation: none;
  }
}

/* ==========================================
   CONSOLIDATED RESPONSIVE MEDIA QUERIES
   ========================================== */
@media (max-width: 1024px) {
  .hero-top-stack,
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .main-workspace {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .main-workspace {
    padding: 10px 12px !important;
  }
  .workspace-header {
    margin-bottom: 8px !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .month-filter-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .card,
  .slim-profile-card {
    margin-bottom: 8px !important;
    padding: 12px 14px !important;
    border-radius: var(--radius-md) !important;
  }
  .hero-top-stack,
  .dashboard-columns {
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  .top-navbar {
    padding: 0 16px;
    height: 64px !important;
    border-bottom: none !important;
  }
  .top-nav-links,
  .user-meta {
    display: none;
  }

  /* UPDATED MOBILE LAYOUT TO ACCOUNT FOR NEW 64px HEADER */
  .app-layout {
    flex-direction: column-reverse !important;
    height: calc(100vh - 64px) !important;
    overflow: hidden !important;
  }

  /* Mobile Sub-Header (Prevents overlapping main workspace) */
  .sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 4px 0 !important;
    flex-direction: row !important;
    position: relative !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: var(--nav-bg) !important;
    box-shadow: var(--shadow-sm);
  }

  .sidebar-menu {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    padding: 6px 16px !important;
    margin: 0 !important;
  }
  .menu-text,
  .sidebar-footer-card {
    display: none !important;
  }
  .menu-item {
    margin-bottom: 0 !important;
    padding: 8px 20px !important;
    border-radius: 12px !important;
  }
  .menu-item.active {
    background: rgba(59, 130, 246, 0.15) !important;
  }

  .hero-inner-box,
  .opportunity-inner-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 8px 6px !important;
    text-align: center;
  }
  .inner-stat small,
  .inner-stat-box small {
    font-size: 8px !important;
    letter-spacing: 0 !important;
  }
  .inner-stat strong,
  .inner-stat-box h4 {
    font-size: 11px !important;
  }

  .salary-action-wrap {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 6px !important;
  }
  .salary-input,
  #salary,
  .btn-calc-top,
  #btn-calculate {
    flex: 1 1 50% !important;
    width: 50% !important;
    margin: 0 !important;
  }

  .data-table th,
  .data-table td {
    padding: 8px 4px !important;
    font-size: 10px !important;
  }
  .table-input {
    width: 52px !important;
    padding: 5px 4px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 360px) {
  .hero-inner-box,
  .opportunity-inner-grid {
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }
}

/* ==========================================
   PERFORMANCE METRICS TABLE FIX
   ========================================== */
/* 1. Show concise abbreviated names cleanly like Screenshot 2 */
.name-full {
  display: none !important;
}
.name-abbr {
  display: inline !important;
}

/* 2. Table cell structure and padding */
.data-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.data-table th,
.data-table td {
  padding: 10px 12px !important;
  vertical-align: middle !important;
  white-space: normal !important; /* FIXED DESKTOP TAMPERING */
}

/* 3. Single-line Achieved input + % symbol */
.table-input-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.table-input-wrap input {
  width: 58px !important;
  height: 30px !important;
  padding: 4px 6px !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
}

/* 4. Single-line Status Badges (Prevents vertical text wrapping) */
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  padding: 4px 10px !important;
  border-radius: 14px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

/* ==========================================
   OPS MANAGER TABS & LIST
   ========================================== */
.ops-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 4px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ops-tab-btn:hover {
  color: var(--text-main);
}
.ops-tab-btn.active {
  color: var(--primary-blue);
  border-bottom: 2px solid var(--primary-blue);
}

.btn-view-staff {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--primary-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-view-staff:hover {
  background: var(--primary-blue);
  color: #fff;
}
[data-theme="dark"] .btn-view-staff {
  background: #334155;
}
[data-theme="dark"] .btn-view-staff:hover {
  background: var(--primary-blue);
}

/* =========================================================
   1. GLOBAL FONT SIZE INCREASES 
========================================================= */

/* Bump the base font size for the entire application */
body {
  font-size: 15px;
}

/* Increase specific text elements for better hierarchy */
h1 {
  font-size: 26px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
p,
.welcome-sub {
  font-size: 15px;
}

/* Sidebar and Navigation Text */
.menu-text {
  font-size: 15px;
}
.status-title {
  font-size: 15px;
}
.status-sub,
#last-updated-text {
  font-size: 13px;
}

/* Dashboard Cards & Inputs */
.slim-info-item small,
.inner-stat small,
.inner-stat-box small {
  font-size: 12px;
  letter-spacing: 0.5px;
}
.table-input,
select {
  font-size: 15px;
}
.btn-primary,
.btn-secondary,
.ops-tab-btn {
  font-size: 15px;
}

/* =========================================================
   2. STAFF DIRECTORY & TABLE ENHANCEMENTS
========================================================= */

/* Modernize the Table Container */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px; /* Increased table font */
}

/* Styled, prominent table headers */
.data-table th {
  background-color: var(--bg-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 16px;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Spacious Table Cells */
.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  vertical-align: middle;
}

/* Interactive Row Hover Effect (Zebra/Highlight) */
.data-table tbody tr {
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.06); /* Soft blue highlight */
}

[data-theme="dark"] .data-table tbody tr:hover {
  background-color: rgba(
    255,
    255,
    255,
    0.05
  ); /* Soft light highlight for dark mode */
}

/* Beautiful Action Buttons for the Directory */
.btn-view-staff {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-staff:hover {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

/* Search Box Polish */
#ops-search-input {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#ops-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

/* =========================================================
   3. PAGINATION CONTROLS & BOTTOM NAVIGATION
========================================================= */

/* Override inline styles for the container text */
.pagination-controls label,
.pagination-controls span {
  font-size: 14px !important;
  color: var(--text-color) !important;
  font-weight: 500 !important;
}

/* Styled Rows per page Dropdown */
#ops-page-size {
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 6px 12px !important;
  font-size: 14px !important;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

#ops-page-size:hover,
#ops-page-size:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Beautiful Prev & Next Buttons */
.pagination-controls .btn-secondary {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color) !important;
  padding: 6px 16px !important;
  font-size: 14px !important;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-controls .btn-secondary:hover {
  background-color: rgba(59, 130, 246, 0.05) !important;
  border-color: #3b82f6 !important;
  color: #3b82f6 !important;
}

.pagination-controls .btn-secondary:active {
  transform: translateY(1px);
}

/* =========================================================
   4. PWA INSTALL FAB (Bottom Left)
========================================================= */
.fab-install-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
  align-items: center;
  background-color: #10b981; /* Emerald green */
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.fab-install-btn:hover {
  background-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

/* ==========================================
   DASHBOARD SCROLL LOCK (STICKY HEADER & SIDEBAR)
   ========================================== */

/* 1. Stop the main browser window from scrolling */
body {
  overflow: hidden !important;
}

/* 2. Force the wrapper to take exactly 100% of the screen height */
#app-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 3. Keep the header at its exact height */
.top-navbar {
  flex-shrink: 0;
  z-index: 100;
}

/* 4. Allow the layout area to fill the remaining space */
.app-layout {
  flex-grow: 1;
  display: flex;
  overflow: hidden;
}

/* 5. Allow sidebar to scroll independently if menu gets long on small screens */
.sidebar {
  height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
}

/* 6. Make ONLY the main workspace scrollable */
.main-workspace {
  height: 100%;
  overflow-y: auto;
  flex-grow: 1;
  scroll-behavior: smooth;
}

/* ==========================================
   MOBILE LAYOUT FIX (RESTORE CONTENT & BOTTOM NAV)
   ========================================== */
@media (max-width: 768px) {
  /* 1. Stack main content on top and navigation bar at the bottom */
  .app-layout {
    flex-direction: column-reverse !important;
    height: calc(100vh - 64px) !important; /* Account for top navbar */
    overflow: hidden !important;
  }

  /* 2. Restrict mobile sidebar to a fixed bottom navigation height */
  .sidebar {
    height: 60px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }

  /* 3. Force main workspace to occupy all remaining screen space and scroll */
  .main-workspace {
    flex: 1 1 auto !important;
    height: calc(100% - 60px) !important;
    overflow-y: auto !important;
    padding-bottom: 32px !important;
  }
}

/* ==========================================
   HIDE SCROLLBARS & FULL-WIDTH WORKSPACE
   ========================================== */

/* 1. Expand workspace to full container width */
.main-workspace {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  box-sizing: border-box !important;
  /* Hide scrollbars for WebKit (Chrome, Safari) & Firefox while retaining scroll function */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* 2. Hide WebKit scrollbars globally across scrollable elements */
.main-workspace::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar,
#ops-ticket-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================
   ICON VISIBILITY & SIZE ENHANCEMENTS
   ========================================== */

/* Brand Header Logo Icon */
.nav-brand img {
  width: 30px !important;
  height: 30px !important;
}

/* Sidebar & Navigation Menu Icons */
.sidebar-menu .ui-icon {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 2.2px !important;
  flex-shrink: 0;
}

/* Support Contact Card & Button Icons */
.support-icon-wrap {
  width: 65px !important;
  height: 65px !important;
}

.support-icon-wrap svg {
  width: 38px !important;
  height: 38px !important;
  stroke-width: 2.2px !important;
}

#open-chat-btn svg {
  width: 22px !important;
  height: 22px !important;
}

/* Mobile Bottom Navigation Icons Specific Tuning */
@media (max-width: 768px) {
  .sidebar-menu {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sidebar-menu .menu-item {
    padding: 6px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
  }

  .sidebar-menu .ui-icon {
    width: 26px !important;
    height: 26px !important;
    stroke-width: 2.4px !important;
  }
}

/* BRAND HEADER LOGO ENHANCEMENT */
.nav-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.nav-brand img {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
}

.logo-text {
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* ==========================================
   MOBILE VIEW & NAVIGATION OPTIMIZATIONS
   ========================================== */
@media (max-width: 768px) {
  /* 1. Header Font & Padding Reduction */
  .top-navbar {
    padding: 8px 14px !important;
    height: 64px !important; /* UPDATED FOR TALLER NAVBAR */
  }

  .nav-brand {
    gap: 8px !important;
  }

  .nav-brand img {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
  }

  .logo-text {
    font-size: 14px !important; /* Reduced header font size */
    font-weight: 600 !important;
  }

  /* 2. Workspace Layout & Scroll Containment */
  #app-wrapper {
    height: 100vh !important;
    overflow: hidden !important;
  }

  .app-layout {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 64px) !important;
    position: relative !important;
  }

  .main-workspace {
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding-bottom: 85px !important; /* Prevents content from being hidden behind fixed menu */
  }

  /* 3. Fixed, Medium-Sized Bottom Menu (Always Visible) */
  .sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 62px !important; /* Medium touch-friendly height */
    background: var(--card-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    padding: 0 !important;
  }

  .sidebar-menu {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 4px !important;
  }

  .sidebar-menu .menu-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    height: 100% !important;
    border-radius: 6px !important;
  }

  .sidebar-menu .ui-icon {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 2px !important;
  }

  .sidebar-menu .menu-text {
    font-size: 11px !important;
    font-weight: 500 !important;
  }

  /* 4. Compact Floating Download Icon Button */
  #install-app-btn,
  .install-app-btn {
    position: fixed !important;
    bottom: 120px !important; /* Clears the pagination buttons */
    left: unset !important; /* CRITICAL: Completely erases the old left positioning */
    right: 16px !important; /* Forcefully pins it to the right */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 999 !important;
    font-size: 0 !important; /* Hides text */
  }

  #install-app-btn::before,
  .install-app-btn::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
/* ==========================================
   FIX 1: GLOBAL DESKTOP INSTALL BUTTON (FAB)
   ========================================== */
#install-app-btn {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background-color: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 12px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  width: auto !important;
  height: auto !important;
}

#install-app-btn:hover {
  background-color: #059669 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5) !important;
}

/* ==========================================
   FIX 2: MOBILE BOTTOM NAV & MOBILE FAB
   ========================================== */
@media (max-width: 768px) {
  /* Force Sidebar to the BOTTOM and REMOVE top anchoring */
  .sidebar {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 62px !important;
    background: var(--nav-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1) !important;
    z-index: 9999 !important;
    flex-direction: row !important;
    padding: 0 !important;
  }

  /* Convert Desktop Install Button to Mobile Circular Icon */
  #install-app-btn {
    bottom: 120px !important; /* 🚀 INCREASED from 80px to clear the pagination buttons! */
    left: auto !important;
    right: 16px !important; /* Keep it on the right side */
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }

  #install-app-btn .btn-label {
    display: none !important; /* Hides text on mobile */
  }

  #install-app-btn svg {
    margin: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: block !important;
  }

  /* Kill the CSS-injected duplicate icon */
  #install-app-btn::before,
  .install-app-btn::before {
    content: none !important;
    display: none !important;
  }
}
/* ==========================================
   FIX 1: GLOBAL DESKTOP INSTALL BUTTON (FAB)
   ========================================== */
#install-app-btn,
.fab-install-btn,
.install-app-btn {
  position: fixed !important;
  bottom: 40px !important; /* Moved up a little bit from the bottom edge */
  left: unset !important; /* CRITICAL: Erases the old left-side positioning */
  right: 32px !important; /* Locks it firmly to the right side */
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background-color: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 12px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  width: auto !important;
  height: auto !important;
}

#install-app-btn:hover,
.fab-install-btn:hover,
.install-app-btn:hover {
  background-color: #059669 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5) !important;
}
/* =========================================
   1. HIDE DOWNLOAD BUTTON INSIDE PWA
========================================= */
@media all and (display-mode: standalone) {
  /* 🚀 Added #install-app-btn so it actually hides in the PWA app! */
  #install-app-btn,
  .fab-install-btn,
  .install-app-btn,
  #btn-install-pwa {
    display: none !important;
  }
}

/* =========================================
   3. MOBILE: SEARCH BAR & SYNC BUTTON
========================================= */
@media (max-width: 768px) {
  .topbar,
  .workspace-header {
    flex-wrap: wrap !important;
    gap: 12px;
  }

  /* Refine the Search Input */
  #ops-search-input,
  input[type="text"][placeholder*="Search"] {
    width: 100% !important;
    padding: 12px 20px !important;
    border-radius: 24px !important; /* Smooth pills */
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    box-sizing: border-box;
  }

  /* 🚀 FIXED ID: Force the Sync Button to show up and match */
  #btn-force-sync {
    display: inline-flex !important;
    width: 100% !important;
    justify-content: center;
    padding: 12px 20px !important;
    border-radius: 24px !important;
    margin-top: 8px !important;
  }
}
/* Shared lighter typography and compact Chat profile drawer */
body {
  font-size: 14px;
  font-weight: 400;
}

h1 {
  font-size: 24px !important;
  font-weight: 500 !important;
}
h2 {
  font-size: 20px !important;
  font-weight: 500 !important;
}
h3 {
  font-size: 15px !important;
  font-weight: 500 !important;
}
h4,
h5,
h6 {
  font-weight: 500 !important;
}
p,
.welcome-sub {
  font-size: 14px !important;
  font-weight: 400;
}
strong,
b {
  font-weight: 500 !important;
}
button,
.btn-primary,
.btn-secondary,
.ops-tab-btn {
  font-weight: 500 !important;
}
small,
.user-role {
  font-size: 12px;
  font-weight: 400;
}
input,
select,
textarea {
  font-size: 14px !important;
  font-weight: 400;
}
.nav-brand,
.logo-text,
.user-name,
.menu-item,
.menu-text,
.status-indicator,
.status-title,
.top-link,
.kpi-title,
.kpi-value,
.data-table th,
.data-table td,
.status-badge,
.btn-view-staff {
  font-weight: 500 !important;
}
.logo-text {
  font-size: 16px !important;
}
.menu-text,
.top-link,
.data-table {
  font-size: 14px !important;
}
.user-name {
  font-size: 12px !important;
}
.user-role {
  font-size: 12px !important;
}

.profile-modal-card {
  width: 320px !important;
  max-width: calc(100vw - 24px) !important;
  padding: 12px !important;
  gap: 8px !important;
}

.chat-profile-avatar-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.chat-profile-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-muted);
}

.chat-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-profile-details {
  gap: 8px 12px;
  padding: 0 4px 4px;
}

.chat-profile-details small {
  font-size: 11px;
}
.chat-profile-details strong {
  font-size: 13px;
}
.chat-profile-email {
  grid-column: span 2;
}
.profile-modal-card .drawer-logout-btn {
  margin-top: 2px;
  font-size: 14px;
}

.session-expiry-dialog {
  position: fixed;
  z-index: 100000;
  top: 18px;
  right: 18px;
  width: min(390px, calc(100vw - 36px));
  padding: 20px;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-amber);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-floating);
  animation: session-expiry-enter 180ms ease-out;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--nav-bg);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.notification-count[hidden] {
  display: none;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10002;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 90px));
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-floating);
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
}

.notification-panel-header strong {
  font-size: 14px;
}

.notification-panel-header button {
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: var(--primary-blue);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.notification-list {
  display: grid;
}

.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.unread {
  background: color-mix(in srgb, var(--primary-blue) 7%, var(--card-bg));
}

.notification-item-title {
  font-size: 13px;
  font-weight: 500;
}

.notification-item-message,
.notification-item-time,
.notification-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.notification-empty {
  padding: 18px 14px;
  text-align: center;
}

.notification-toast-region {
  position: fixed;
  z-index: 10001;
  right: 12px;
  bottom: 22px;
  left: 12px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.notification-toast {
  width: min(520px, 100%);
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-blue);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-floating);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  animation: notification-toast-in 160ms ease-out;
}

.notification-toast-title {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 500;
}

.notification-toast-message {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

@keyframes notification-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.session-expiry-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--amber-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.session-expiry-dialog h2 {
  margin: 0 0 6px;
  font-size: 17px !important;
  font-weight: 500 !important;
}

.session-expiry-dialog p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px !important;
}

.session-expiry-action {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-blue);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.session-expiry-action:hover {
  background: var(--primary-blue-hover);
}

@keyframes session-expiry-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .session-expiry-dialog {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    padding: 16px;
  }
  .notification-toast-region {
    bottom: 76px;
  }
}

.overview-notification-toast {
  position: fixed;
  z-index: 10001;
  bottom: 24px;
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  padding: 16px 18px;
  transform: translate(-50%, calc(100% + 32px));
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-blue);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-floating);
  opacity: 0;
}

.overview-notification-toast.is-visible {
  animation: notificationToastIn 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.overview-notification-toast.is-hiding {
  animation: notificationToastOut 360ms ease-in forwards;
}

.overview-notification-toast-icon,
.overview-notification-toast-close {
  flex: 0 0 auto;
}

.overview-notification-toast-icon {
  color: var(--primary-blue);
}

.overview-notification-toast-content {
  min-width: 0;
  flex: 1;
}

.overview-notification-toast-content strong {
  display: block;
  font-size: 13px;
}

.overview-notification-toast-content p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.overview-notification-toast-close {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

@keyframes notificationToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(100% + 32px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes notificationToastOut {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, calc(100% + 32px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .overview-notification-toast.is-visible,
  .overview-notification-toast.is-hiding {
    animation-duration: 1ms;
  }
}

@media (max-width: 480px) {
  .overview-notification-toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}
