/* =========================
   CORPORATE TOP BAR
   ========================= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229,231,235,0.9);
}
.topbar-left{ display:flex; align-items:center; gap:12px; min-width: 220px; }
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-mark{
  width:38px;
  height:38px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#fff;
  background: linear-gradient(135deg, #0b5ed7, #0a2f6f);
  box-shadow: 0 8px 18px rgba(0,0,0,0.14);
  letter-spacing:0.5px;
}
.brand-title{ font-size:16px; font-weight:900; color:#111827; line-height:1.1; }

.brand-title .brand-garda{ color:#d32f2f; font-weight:900; letter-spacing:0.6px; }
.brand-title .brand-world{ color:#374151; font-weight:900; letter-spacing:0.6px; margin-left:2px; }

/* Dashboard KPI header - sticky & corporate */
#dashboardSection > h2{
  position: relative;
  top: auto;
  z-index: 1;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229,231,235,0.95);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 14px 0;
  box-shadow: 0 10px 26px rgba(15,23,42,0.10);
}

/* Charts & Analytics - corporate backgrounds for visibility */
#dashboardSection .chart-container{
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 12px;
  padding: 16px !important;
  box-shadow: 0 10px 26px rgba(15,23,42,0.10);
  background: #ffffff !important;
}
#dashboardSection .kpi-grid > .chart-container:nth-child(1){ background: #f8fafc !important; }
#dashboardSection .kpi-grid > .chart-container:nth-child(2){ background: #f1f5f9 !important; }
#dashboardSection .kpi-grid > .chart-container:nth-child(3){ background: #eef2ff !important; }

/* Fail to Patrol - buttons readability */
#failToPatrolSection .btn-primary{
  background: #0b3b8f;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(11,59,143,0.22);
}
#failToPatrolSection .btn-primary:hover{ background:#072d6a; }
.brand-subtitle{ font-size:12px; color:#6b7280; margin-top:2px; }

.topbar-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.user-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border:1px solid rgba(229,231,235,1);
  background:#fff;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.user-chip-label{ font-size:11px; color:#6b7280; font-weight:700; text-transform: uppercase; letter-spacing:0.4px; }
.user-chip-name{ font-size:13px; font-weight:800; color:#111827; }

.icon-btn{
  border:1px solid rgba(229,231,235,1);
  background:#fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.icon-btn:hover{ transform: translateY(-1px); }
.icon-btn.danger{ border-color: rgba(239,68,68,0.35); color:#b91c1c; }

.section-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.section-updated{
  font-size: 12px;
  color:#6b7280;
  font-weight:700;
}
.loading-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11,94,215,0.08);
  border: 1px solid rgba(11,94,215,0.18);
  color:#0b5ed7;
  font-weight:800;
  font-size: 12px;
}
.loading-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: currentColor;
  animation: pulse 1.2s infinite;
}

  :root{
    --accent:#0b5ed7;
    --danger:#dc3545;
    --muted:#6b7280;
    --glass: rgba(255,255,255,0.96);
    --dark-green:#064e3b; /* used for standby-good */
    --dark-green-2:#004d00;
  }
  html,body{height:100%; margin:0; font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;}
  body{ display:flex;
  min-height:100vh; background: linear-gradient(135deg, #f0f4f7, #e0e9f0); }
  
  /* Layout & Global Formatting */
  .app-container{ 
    display:flex;
  flex-direction:column; width:100%; max-width:1400px; margin:0 auto; padding:20px; 
    box-sizing:border-box;
    text-transform: uppercase; /* Enforce global Caps */
  }
  .main-content{ flex:1; padding-top:20px;
  }
  .tab-content{ padding:20px 0; }
  
  /* Tabs - FIXED STYLING */
  .nav-bar{ display:flex; background-color:var(--glass); backdrop-filter:blur(10px);
  box-shadow:0 2px 10px rgba(0,0,0,0.14); border-radius:10px; padding:10px 10px;
  position:sticky; top:0; z-index:1000; overflow-x:auto; overflow-y:hidden; gap:6px; }
.nav-bar::-webkit-scrollbar{ height:6px; }
.nav-bar::-webkit-scrollbar-thumb{ background: rgba(15,23,42,0.18); border-radius:999px; } 
  .nav-item{ padding:10px 12px; cursor:pointer; font-weight:700; 
  color: #334155; text-decoration:none; border-radius:8px;
  transition:background-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space:nowrap; display:flex; align-items:center; gap:8px;
  font-size: 9px; line-height: 1; }
.nav-item span{ white-space:nowrap; }
  .nav-item:hover{ background-color:rgba(0,0,0,0.05); }
  .nav-item.active{ background:#0b3b8f; color:#ffffff; box-shadow:0 6px 16px rgba(11,59,143,0.25); }
  
  /* Headers & Text Alignment */
  h1, h2, h3, h4 { text-align: left;
  }
  .user-info{ text-align: right; }
.user-info a{ appearance:none; -webkit-appearance:none; -moz-appearance:none; background:none; border:none; }
  .data-table th, .data-table td{ padding:12px 15px; text-align:left !important;
  }

/* ===================== CLAIMS TABLE VISIBILITY TWEAKS ===================== */
#claimsTable{
  width:100%;
  table-layout:fixed; /* required for predictable column widths */
}

/* Compact + readable */
#claimsTable th,
#claimsTable td{
  padding:2px 4px !important;
  font-size:8px !important;
  line-height:1.2;
  vertical-align:top;
}

/* Let both headers + cells wrap instead of cutting off */
#claimsTable th,
#claimsTable td{
  white-space:normal !important;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Reduce STAFF NO column width so NAME & MOBILE show clearly */
#claimsTable th:nth-child(1),
#claimsTable td:nth-child(1){
  width:45px !important;
  max-width:45px !important;
  white-space:nowrap !important; /* keep numbers on one line */
  padding-left:3px !important;
  padding-right:3px !important;
}

/* NAME column */
#claimsTable th:nth-child(2),
#claimsTable td:nth-child(2){
  width:150px !important;
  max-width:150px !important;
}

/* MOBILE column (in Claims sheet view this is usually the 5th column) */
#claimsTable th:nth-child(5),
#claimsTable td:nth-child(5){
  width:110px !important;
  max-width:110px !important;
  white-space:nowrap !important;
}

/* AFFECTED SALARY */
#claimsTable th:nth-child(3),
#claimsTable td:nth-child(3){
  width:110px !important;
  max-width:110px !important;
}

/* DESCRIBE / DESCRIPTION */
#claimsTable th:nth-child(4),
#claimsTable td:nth-child(4){
  width:130px !important;
  max-width:130px !important;
}

/* CLAIM OFFICER COMMENT (often 9th column in Claims sheet view) */
#claimsTable th:nth-child(9),
#claimsTable td:nth-child(9){
  width:140px !important;
  max-width:140px !important;
}

/* CLAIM OFFICER NAME (often 10th column in Claims sheet view) */
#claimsTable th:nth-child(10),
#claimsTable td:nth-child(10){
  width:110px !important;
  max-width:110px !important;
}

/* Keep dropdowns from stealing too much space */
#claimsTable select.input{
  font-size:8px !important;
  padding:1px 3px !important;
  height:20px !important;
  max-width:110px !important;
  width:110px !important;
}

/* Status pill in claims */
#claimsTable .status-pill{
  font-size:8px !important;
  padding:2px 6px !important;
  display:inline-block;
  max-width:100%;
  white-space:nowrap !important;
}

/* ======================================================================== */


  /* Cards - Enhanced for Appeal */
  .kpi-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:20px; margin-bottom:20px; }
  .kpi-card{ background:#fff; padding:20px; border-radius:12px;
  border:1px solid rgba(15,23,42,0.10);
  box-shadow:0 10px 26px rgba(15,23,42,0.10);
  transition:transform 0.18s ease, box-shadow 0.18s ease;
  cursor:default;
  border-left:5px solid var(--accent);
}
.kpi-card:hover{ transform: translateY(-2px); box-shadow:0 14px 34px rgba(15,23,42,0.14); }
  .kpi-card:hover{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,0.1); }
  .kpi-label{ font-size:0.9rem; color:var(--muted);
  margin-bottom:5px; text-align:left; }
  .kpi-value{ font-size:2.5rem; font-weight:700; color:var(--accent); line-height:1; text-align:left; }
  .kpi-value.standby-good{ color:var(--dark-green); }
  .kpi-value.standby-low{ color:#f0ad4e;
  }
  .kpi-value.standby-critical{ color:var(--danger); }
  .kpi-value.reserve{ color:var(--dark-green); }

  /* Forms and Inputs */
  .form-label{ text-align: left;
  }
  .form-control{ 
    width:calc(100% - 20px); padding:10px; border:1px solid #ccc; border-radius:6px; box-sizing:border-box; font-size:1rem; 
    background-color:#fff; 
    text-transform: uppercase;
  }
  /* Exception for password fields to keep them readable */
  #password, #rr_password {
    text-transform: none;
  }
  
  /* Modals */
  .modal{ display:none; position:fixed; z-index:1000; left:0; top:0; width:100%; height:100%; overflow:auto; background-color:rgba(0,0,0,0.5);
  }
  .modal-content{ background-color:#fefefe; margin:5% auto; padding:20px; border:1px solid #888; width:80%; max-width:600px; border-radius:8px; box-shadow:0 5px 15px rgba(0,0,0,0.3);
  }
  
  /* Misc */
  .hidden{ display:none !important;
  }
  .alert {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: none;
  }
  .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
  }
  .btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    font-weight: 600;
    transition: background-color 0.2s;
  }
  .btn-primary {
    background-color: var(--accent);
    color: white;
  }
  .btn-primary:hover {
    background-color: #004dae;
  }
  .btn-muted {
    background-color: #e9ecef;
    color: var(--muted);
  }
  .btn-muted:hover {
    background-color: #ced4da;
  }
  .btn-secondary {
    background-color: #0f766e;
    color: #ffffff;
  }
  .btn-secondary:hover {
    background-color: #0b5e55;
  }
  .btn-danger {
    background-color: var(--danger);
    color: white;
  }
  .btn-danger:hover {
    background-color: #bd2130;
  }
  .form-group {
    margin-bottom: 15px;
  }
  .form-inline {
    display: flex;
    gap: 15px;
  }

/* === PROFESSIONAL TABLE STYLING (ADDED) === */
.table-container {
  overflow: auto;
  max-height: 70vh;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
  font-weight: 700;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.data-table tbody tr:hover {
  background-color: #eef4ff;
}

.data-table td[contenteditable="true"] {
  background-color: #fffbe6;
  cursor: text;
}
/* ===== SUPERVISOR UPDATES COLUMN PRIORITY ===== */

#supervisorUpdatesTable {
  table-layout: auto !important;
}

#supervisorUpdatesTable th:nth-child(2),
#supervisorUpdatesTable td:nth-child(2),
#supervisorUpdatesTable th:nth-child(5),
#supervisorUpdatesTable td:nth-child(5) {
  white-space: normal !important;
  min-width: 160px;
  word-break: break-word;
}

#supervisorUpdatesTable th,
#supervisorUpdatesTable td {
  font-size: clamp(12px, 1.2vw, 14px);
}




/* ===== SUPERVISOR UPDATES (FRONTEND FIXES) ===== */
#supervisorUpdatesTable {
  width: 100%;
  border-collapse: collapse;
}

/* Freeze header */
#supervisorUpdatesTable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Body text size 8px (header excluded) */
#supervisorUpdatesTable tbody td {
  font-size: 8px !important;
  line-height: 1.25;
  white-space: normal !important;
  word-break: break-word;
  vertical-align: top;
}

/* Keep header readable */
#supervisorUpdatesTable thead th {
  font-size: 10px !important;
}

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  font-size: 8px;
  line-height: 1.2;
}
.status-verified { background: #0b5d1e; }      /* dark green */
.status-not-verified { background: #b00020; }  /* red */

/* Clerk dropdown */
.su-clerk-select {
  width: 100%;
  max-width: 140px;
  font-size: 8px;
  padding: 2px 4px;
}


/* === UI POLISH === */
.nav-item::before {
  content: attr(data-icon);
  opacity: 0.95;
  margin-right: 0;
  font-size: 12px;
  line-height: 1;
}
.nav-item.active::before { opacity: 1; filter: brightness(1.1); }


.tab-content {
  animation: fadeSlide 0.35s ease;
}

@keyframes fadeSlide {
  from { opacity:0; transform: translateY(6px); }
  to { opacity:1; transform: translateY(0); }
}

.btn {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

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


@media (max-width: 768px) {
  .data-table {
    font-size: 0.8rem;
  }
  .nav-bar {
    overflow-x: auto;
  }
}
@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.25); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse {
  animation: pulse 1.2s infinite;
}

/* ================================
   CORPORATE SUMMARY CARDS (FAIL TO PATROL)
   ================================ */

.corp-summary-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:12px;
  margin: 6px 0 14px 0;
}

.corp-summary-card{
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px 14px;
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
}

.corp-summary-card.warn{
  border-left:5px solid #f0ad4e;
}

.corp-summary-card.good{
  border-left:5px solid var(--dark-green);
}

.corp-summary-label{
  font-size:0.78rem;
  color: var(--muted);
  margin-bottom:6px;
  letter-spacing:0.2px;
}

.corp-summary-value{
  font-size:1.55rem;
  font-weight:800;
  color:#0b1f33;
}

.corp-summary-breakdown{
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px 14px;
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
  margin: 0 0 14px 0;
}

.corp-summary-breakdown-title{
  font-weight:800;
  margin-bottom:8px;
  color:#0b1f33;
  text-transform: uppercase;
  font-size:0.78rem;
  letter-spacing:0.4px;
}

.corp-summary-breakdown-list{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:8px 16px;
}

.corp-summary-breakdown-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px dashed #eef2f7;
  padding-bottom:6px;
}

.corp-summary-breakdown-item span{
  color:#111827;
}

.corp-summary-breakdown-item b{
  color:#0b1f33;
}

.corp-summary-breakdown-more{
  color: var(--muted);
  font-size:0.85rem;
}

/* ================================
   PRE-LOGIN VISUAL HARDENING
   ================================ */

/* Completely visually isolate app before login */
body.pre-login {
  overflow: hidden;
}

/* Blur + darken entire app until login */
body.pre-login #appContainer {
  filter: blur(14px);
  pointer-events: none;
  user-select: none;
}

/* Professional secure backdrop */
#loginModal {
  background:
    linear-gradient(120deg,
      #cfe7ff 0%,
      #e8f3ff 35%,
      #ffffff 60%,
      #dbeafe 100%
    );
}
#loginModal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.9), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(219,234,254,0.8), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(191,219,254,0.7), transparent 50%);
  pointer-events: none;
}

/* Lock login card dead-center */
#loginModal .modal-content {
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
}

/* Enterprise-grade header */
#loginModal h3 {
  text-align: center; text-transform:none;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

/* Tighten login form look */
#loginModal .form-control {
  height: 44px;
  font-size: 0.95rem;
}

/* Full-width primary button already good, enhance feel */
#loginModal .btn-primary {
  height: 46px;
  font-size: 1rem;
  letter-spacing: 0.4px;
}
/* ===== Leave Schedule Table ===== */
#leave-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#leave-table th {
  background: #1f4e78;
  color: white;
  padding: 8px;
  border: 1px solid #b7b7b7;
  text-align: center; text-transform:none;
  font-weight: bold;
}

#leave-table td {
  padding: 7px;
  border: 1px solid #d0d0d0;
  text-align: center; text-transform:none;
}

#leave-table tr:nth-child(even) {
  background-color: #f5f7fa;
}

#leave-table tr:hover {
  background-color: #eef3f9;
}
.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  color: white;
}

.badge.UPCOMING { background: #6c757d; }
.badge.ACTIVE { background: #28a745; }
.badge.COMPLETED { background: #dc3545; }
/* ================================
   MODERN LOGIN BACKGROUND
   ================================ */
#loginModal {
  background: radial-gradient(circle at top right, #7cc4ff 0%, #5aa9ff 30%, #1e6fd9 70%, #0b4aa8 100%);
  position: fixed;
  inset: 0;
}

/* abstract shapes */
#loginModal::before,
#loginModal::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.25;
}

#loginModal::before {
  width: 420px;
  height: 420px;
  background: #9dd6ff;
  top: 8%;
  right: 10%;
}

#loginModal::after {
  width: 520px;
  height: 520px;
  background: #1e88ff;
  bottom: -10%;
  left: -10%;
}

/* ================================
   LOGIN CARD
   ================================ */
#loginModal .modal-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #1e88e5, #1565c0);
  border-radius: 22px;
  padding: 28px 30px;
  max-width: 420px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
  color: #fff;
}

/* Header */
#loginModal h3 {
  text-align: left;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

#loginModal h3::before {
  content: "First time login? Change your password";
  display: block;
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ================================
   INPUTS
   ================================ */
#loginModal .form-control {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  height: 44px;
  font-size: 14px;
  color: #0f172a;
}

#loginModal .form-label {
  font-size: 13px;
  opacity: 0.9;
}

/* Eye icon */
#loginModal span[onclick] {
  color: #6b7280;
}

/* ================================
   BUTTON
   ================================ */
#loginModal .btn-primary {
  background: #0b3c91;
  border-radius: 12px;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 10px;
}

#loginModal .btn-primary:hover {
  background: #082f6a;
}
/* ================================
   DARK MODE LOGIN (AUTO)
   ================================ */
@media (prefers-color-scheme: dark) {
  #loginModal {
    background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 60%, #020617 100%);
  }

  #loginModal::before {
    background: #334155;
    opacity: 0.35;
  }

  #loginModal::after {
    background: #0b5ed7;
    opacity: 0.25;
  }

  #loginModal .modal-content {
    background: linear-gradient(180deg, #020617, #020617);
    box-shadow: 0 30px 80px rgba(0,0,0,0.75);
    color: #e5e7eb;
  }

  #loginModal .form-control {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #1f2937;
  }

  #loginModal .form-control::placeholder {
    color: #94a3b8;
  }

  #loginModal .btn-primary {
    background: #2563eb;
  }

  #loginModal .btn-primary:hover {
    background: #1d4ed8;
  }
}
/* ================================
   MOBILE LOGIN OPTIMIZATION
   ================================ */
@media (max-width: 640px) {

  #loginModal {
    padding: 16px;
  }

  #loginModal .modal-content {
    width: 100%;
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 18px;
  }

  #loginModal h3 {
    font-size: 22px;
  }

  #loginModal .form-control {
    height: 48px;
    font-size: 15px;
  }

  #loginModal .btn-primary {
    height: 48px;
    font-size: 16px;
  }
}


/* =====================================================
   LEAVE BALANCE – FIX NAME COLUMN WIDTH
   ===================================================== */
#leaveBalanceTable {
  table-layout: fixed;
  width: 100%;
}

#leaveBalanceTable th:nth-child(1),
#leaveBalanceTable td:nth-child(1) { width: 18%; }

#leaveBalanceTable th:nth-child(2),
#leaveBalanceTable td:nth-child(2) {
  width: 32%;
  white-space: normal;
  word-break: break-word;
}

#leaveBalanceTable th:nth-child(3),
#leaveBalanceTable td:nth-child(3) { width: 18%; }

#leaveBalanceTable th:nth-child(4),
#leaveBalanceTable td:nth-child(4) { width: 32%; }



/* =========================================================
   OPERATIONS DASHBOARD — Corporate layout + ordering styles
   (Overrides to remove sheet-like gridlines and add strong borders)
   ========================================================= */

/* Freeze Operations header bar while scrolling */
.ops-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}

/* Operations root wrapper (prevents parent grids affecting layout) */
.ops-root{ display:block; width:100%; }

/* Analysis (single highlighted card) */
.ops-grid-analysis{
  display:grid;
  grid-template-columns: minmax(280px, 560px);
  gap:16px;
  margin-top: 8px;
}
@media (max-width: 640px){
  .ops-grid-analysis{ grid-template-columns: 1fr; }
}

/* Separator line between sections */
.ops-divider-line{
  height: 2px;
  width: 100%;
  background: rgba(17,24,39,0.22);
  margin: 18px 0 18px 0;
}

/* Manpower Forecast highlight */
.ops-forecast-card{
  border: 3px solid #f59e0b !important;
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.18) !important;
  background: #3f3f46; /* dark slate like the sheet block */
  padding: 10px 12px 12px 12px;
  position: relative;
  overflow: hidden;
}
.ops-forecast-title{
  font-size: 28px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #d1d5db;
  text-align: center; text-transform:none;
  margin: 6px 0 10px 0;
  opacity: 0.95;
}

/* Forecast table (Analysis | Billable | Surplus) */
.ops-forecast-table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: transparent;
}
.ops-forecast-table thead th{
  padding: 6px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,0.10);
  color: #e5e7eb;
}
.ops-forecast-table thead th.ops-fc-col-billable,
.ops-forecast-table thead th.ops-fc-col-surplus{
  color: #f59e0b;
}
.ops-forecast-table tbody td{
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ops-fc-cell-label{
  background: rgba(148,163,184,0.32);
  color: #e5e7eb;
  font-style: italic;
  font-weight: 700;
}
.ops-fc-cell-num{
  background: #0b0b0b;
  color: #f9fafb;
  text-align: right;
  font-weight: 800;
}

/* Row highlights to mimic the sheet */
.ops-fc-row-loses .ops-fc-cell-surplus{
  background: #b91c1c;
  color: #fff;
}
.ops-fc-row-gains .ops-fc-cell-surplus{
  background: #16a34a;
  color: #fff;
}

.ops-fc-row-loses .ops-fc-cell-billable{
  background: #facc15;
  color: #111827;
}
.ops-fc-row-gains .ops-fc-cell-billable{
  background: #16a34a;
  color: #fff;
}
.ops-fc-row-short .ops-fc-cell-billable{
  background: #facc15;
  color: #111827;
}
.ops-fc-row-trainees .ops-fc-cell-billable{
  background: #facc15;
  color: #111827;
}
.ops-fc-row-forecast .ops-fc-cell-label,
.ops-fc-row-possible .ops-fc-cell-label{
  color: #34d399;
}
.ops-fc-row-forecast .ops-fc-cell-billable,
.ops-fc-row-possible .ops-fc-cell-billable{
  background: #dc2626;
  color: #fff;
}


/* Service lines row: 4 cards across (responsive) */
.ops-grid-services{
  display:grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap:16px;
}
@media (max-width: 1200px){
  .ops-grid-services{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-services{ grid-template-columns: 1fr; }
}

/* Remaining cards: 5 across (responsive) */
.ops-grid-others{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
}
@media (max-width: 1400px){
  .ops-grid-others{ grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px){
  .ops-grid-others{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-others{ grid-template-columns: 1fr; }
}

/* Thick separator line */
.ops-divider{
  height: 8px;
  background: rgba(31,41,55,0.25);
  margin: 16px 0 14px 0;
  border-radius: 999px;
}

/* Cards: plain, strong border */
.ops-card{
  border: 2px solid rgba(55,65,81,0.95) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08) !important;
  border-radius: 14px;
  overflow: hidden;

  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ops-card:hover{
  transform: translateY(-6px) rotate(-0.35deg);
  box-shadow: 0 18px 36px rgba(0,0,0,0.14);
}

.ops-card-title{
  border-bottom: none !important;
  background: linear-gradient(180deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02)) !important;
}

/* Table: remove ALL sheet-like lines + zebra */
.ops-table{
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.ops-table th,
.ops-table td{
  border: none !important;
}
.ops-table thead th{
  background: rgba(17,24,39,0.08) !important;
  color: #0f172a !important;
}
.ops-table tbody tr:nth-child(even) td,
.ops-table tbody tr:hover td{
  background: transparent !important;
}

/* Keep shortage/excess row fills subtle + corporate */
.ops-row-shortage td{
  background: rgba(34,197,94,0.14) !important;
}
.ops-row-excess td{
  background: rgba(239,68,68,0.12) !important;
}

/* FORCE negative numbers to be bold dark red text */
.ops-table td.ops-neg,
.ops-neg {
  background: transparent !important;
  color: #8B0000 !important;   /* deep professional red */
  font-weight: 900 !important;
  text-shadow: none !important;
}



/* Under-optimal ACTUAL: green cell + popping shiny red number */
.ops-under-optimal{
  background: linear-gradient(180deg, #dfffe9 0%, #b7f5cf 100%) !important;
  border-radius: 6px;
}
.ops-under-optimal .ops-pop-number{
  color: #b30000 !important;
  font-weight: 900 !important;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.75) 0%, rgba(255,74,74,0.22) 45%, rgba(179,0,0,0) 72%);
  text-shadow: 0 0 6px rgba(255,0,0,0.65), 0 0 14px rgba(255,0,0,0.30);
  animation: opsPulse 1.2s ease-in-out infinite;
}
@keyframes opsPulse{
  0%,100%{ transform: scale(1); filter: brightness(1); }
  50%{ transform: scale(1.08); filter: brightness(1.1); }
}
/* Slightly tighter numerics */
.ops-num{ font-variant-numeric: tabular-nums; }


.sys-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.sys-modal.hidden { display: none; }
.sys-card {
  background: #ffffff;
  width: 360px;
  padding: 28px;
  border-radius: 14px;
  text-align: center; text-transform:none;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  animation: popIn .25s ease-out;
}
.sys-icon {
  width: 56px; height: 56px; border-radius: 50%;
  margin: 0 auto 15px; font-size: 28px;
  display:flex; align-items:center; justify-content:center;
  color:white;
}
.sys-icon.success { background:#16a34a; }
.sys-icon.error { background:#dc2626; }
.sys-card h3 { margin:10px 0 8px; font-size:20px; color:#111827; }
.sys-card p { color:#4b5563; font-size:14px; margin-bottom:20px; }
.sys-card button {
  background:#1d4ed8; color:white; border:none;
  padding:10px 26px; border-radius:8px;
  font-weight:600; cursor:pointer;
}
.sys-card button:hover { background:#1e40af; }
@keyframes popIn {
  from { transform:scale(.9); opacity:0; }
  to { transform:scale(1); opacity:1; }
}

/* =====================================================
   LEAVE BALANCE – FIX NAME COLUMN WIDTH
   ===================================================== */
#leaveBalanceTable {
  table-layout: fixed;
  width: 100%;
}

#leaveBalanceTable th:nth-child(1),
#leaveBalanceTable td:nth-child(1) { width: 18%; }

#leaveBalanceTable th:nth-child(2),
#leaveBalanceTable td:nth-child(2) {
  width: 32%;
  white-space: normal;
  word-break: break-word;
}

#leaveBalanceTable th:nth-child(3),
#leaveBalanceTable td:nth-child(3) { width: 18%; }

#leaveBalanceTable th:nth-child(4),
#leaveBalanceTable td:nth-child(4) { width: 32%; }



/* =========================================================
   OPERATIONS DASHBOARD — Corporate layout + ordering styles
   (Overrides to remove sheet-like gridlines and add strong borders)
   ========================================================= */

/* Freeze Operations header bar while scrolling */
.ops-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}

/* Operations root wrapper (prevents parent grids affecting layout) */
.ops-root{ display:block; width:100%; }

/* Service lines row: 4 cards across (responsive) */
.ops-grid-services{
  display:grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap:16px;
}
@media (max-width: 1200px){
  .ops-grid-services{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-services{ grid-template-columns: 1fr; }
}

/* Remaining cards: 5 across (responsive) */
.ops-grid-others{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
}
@media (max-width: 1400px){
  .ops-grid-others{ grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px){
  .ops-grid-others{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-others{ grid-template-columns: 1fr; }
}

/* Thick separator line */
.ops-divider{
  height: 8px;
  background: rgba(31,41,55,0.25);
  margin: 16px 0 14px 0;
  border-radius: 999px;
}

/* Cards: plain, strong border */
.ops-card{
  border: 2px solid rgba(55,65,81,0.95) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08) !important;
  border-radius: 14px;
  overflow: hidden;

  transition: transform 160ms ease, box-shadow 160ms ease;
}
.ops-card-title{
  border-bottom: none !important;
  background: linear-gradient(180deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02)) !important;
}

/* Table: remove ALL sheet-like lines + zebra */
.ops-table{
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.ops-table th,
.ops-table td{
  border: none !important;
}
.ops-table thead th{
  background: rgba(17,24,39,0.08) !important;
  color: #0f172a !important;
}
.ops-table tbody tr:nth-child(even) td,
.ops-table tbody tr:hover td{
  background: transparent !important;
}

/* Keep shortage/excess row fills subtle + corporate */
.ops-row-shortage td{
  background: rgba(34,197,94,0.14) !important;
}
.ops-row-excess td{
  background: rgba(239,68,68,0.12) !important;
}

/* Shiny POP red for negative numbers */
.ops-neg{
  background: linear-gradient(180deg, #ff1f1f 0%, #b30000 100%) !important;
  color: #fff !important;
  font-weight: 900 !important;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 14px rgba(179,0,0,0.30);
}

/* Slightly tighter numerics */
.ops-num{ font-variant-numeric: tabular-nums; }


.filter-bar{margin:10px 0;display:flex}
.filter-bar input{padding:8px 10px;border-radius:6px;border:1px solid #ccc;min-width:260px}

/* =====================================================
   LEAVE BALANCE – FIX NAME COLUMN WIDTH
   ===================================================== */
#leaveBalanceTable {
  table-layout: fixed;
  width: 100%;
}

#leaveBalanceTable th:nth-child(1),
#leaveBalanceTable td:nth-child(1) { width: 18%; }

#leaveBalanceTable th:nth-child(2),
#leaveBalanceTable td:nth-child(2) {
  width: 32%;
  white-space: normal;
  word-break: break-word;
}

#leaveBalanceTable th:nth-child(3),
#leaveBalanceTable td:nth-child(3) { width: 18%; }

#leaveBalanceTable th:nth-child(4),
#leaveBalanceTable td:nth-child(4) { width: 32%; }



/* =========================================================
   OPERATIONS DASHBOARD — Corporate layout + ordering styles
   (Overrides to remove sheet-like gridlines and add strong borders)
   ========================================================= */

/* Freeze Operations header bar while scrolling */
.ops-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}

/* Operations root wrapper (prevents parent grids affecting layout) */
.ops-root{ display:block; width:100%; }

/* Service lines row: 4 cards across (responsive) */
.ops-grid-services{
  display:grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap:16px;
}
@media (max-width: 1200px){
  .ops-grid-services{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-services{ grid-template-columns: 1fr; }
}

/* Remaining cards: 5 across (responsive) */
.ops-grid-others{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
}
@media (max-width: 1400px){
  .ops-grid-others{ grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px){
  .ops-grid-others{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-others{ grid-template-columns: 1fr; }
}

/* Thick separator line */
.ops-divider{
  height: 8px;
  background: rgba(31,41,55,0.25);
  margin: 16px 0 14px 0;
  border-radius: 999px;
}

/* Cards: plain, strong border */
.ops-card{
  border: 2px solid rgba(55,65,81,0.95) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08) !important;
  border-radius: 14px;
  overflow: hidden;

  transition: transform 160ms ease, box-shadow 160ms ease;
}
.ops-card-title{
  border-bottom: none !important;
  background: linear-gradient(180deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02)) !important;
}

/* Table: remove ALL sheet-like lines + zebra */
.ops-table{
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.ops-table th,
.ops-table td{
  border: none !important;
}
.ops-table thead th{
  background: rgba(17,24,39,0.08) !important;
  color: #0f172a !important;
}
.ops-table tbody tr:nth-child(even) td,
.ops-table tbody tr:hover td{
  background: transparent !important;
}

/* Keep shortage/excess row fills subtle + corporate */
.ops-row-shortage td{
  background: rgba(34,197,94,0.14) !important;
}
.ops-row-excess td{
  background: rgba(239,68,68,0.12) !important;
}

/* Shiny POP red for negative numbers */
.ops-neg{
  background: linear-gradient(180deg, #ff1f1f 0%, #b30000 100%) !important;
  color: #fff !important;
  font-weight: 900 !important;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 14px rgba(179,0,0,0.30);
}

/* Slightly tighter numerics */
.ops-num{ font-variant-numeric: tabular-nums; }


.month-picker-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;z-index:9999}
.month-picker{background:#fff;border-radius:12px;padding:20px;width:90%;max-width:360px;text-align:center}
.month-picker-header{display:flex;justify-content:space-between;align-items:center;font-weight:600;margin-bottom:15px}
.month-picker-header button{border:none;background:#0b5ed7;color:#fff;border-radius:6px;padding:6px 10px;cursor:pointer}
.month-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.month-card{padding:10px;border-radius:8px;background:#f1f3f5;cursor:pointer;font-weight:500}
.month-card:hover{background:#0b5ed7;color:#fff}
.close-btn{margin-top:15px;background:#ccc;border:none;padding:8px 14px;border-radius:6px;cursor:pointer}
/* =====================================================
   FAIL TO PATROL – PROFESSIONAL TABLE VIEW
   ===================================================== */

/* ---- Table text sizing & layout ---- */
#failToPatrolTable {
  font-size: 9px;
  table-layout: fixed;
}

#failToPatrolTable th,
#failToPatrolTable td {
  white-space: nowrap;        /* ❌ No wrapping */
  overflow: hidden;
  text-overflow: ellipsis;    /* … if too long */
  padding: 6px 8px;
  vertical-align: middle;
}

/* ---- Header styling ---- */
#failToPatrolTable thead th {
  background: #0f766e;        /* Professional green */
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #065f46;
  text-align: center; text-transform:none;
}

/* ---- Body borders ---- */
#failToPatrolTable tbody td {
  border: 1px solid #e5e7eb;
}

/* ---- Hover effect ---- */
#failToPatrolTable tbody tr:hover {
  background: #f0fdfa;
}

/* =====================================================
   ACTION TAKEN – COLOR CODING (COLUMN I)
   ===================================================== */

#failToPatrolTable td:nth-child(9) {
  font-weight: 700;
  text-align: center; text-transform:none;
  border-radius: 6px;
}

/* VERBAL WARNING */
#failToPatrolTable td:nth-child(9):contains("VERBAL WARNING") {
  background: #e0f2fe;
  color: #0369a1;
}

/* CAUTIONARY */
#failToPatrolTable td:nth-child(9):contains("CAUTIONARY") {
  background: #fef9c3;
  color: #92400e;
}

/* 1ST WARNING */
#failToPatrolTable td:nth-child(9):contains("1ST WARNING") {
  background: #ffedd5;
  color: #9a3412;
}

/* 2ND WARNING */
#failToPatrolTable td:nth-child(9):contains("2ND WARNING") {
  background: #fee2e2;
  color: #991b1b;
}

/* FINAL WARNING */
#failToPatrolTable td:nth-child(9):contains("FINAL WARNING") {
  background: #fecaca;
  color: #7f1d1d;
}

/* SEPARATED */
#failToPatrolTable td:nth-child(9):contains("SEPARATED") {
  background: #111827;
  color: #ffffff;
}
/* =====================================================
   ACTION TAKEN – COLOR CLASSES (USED BY JS)
   ===================================================== */

.action-verbal {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
}

.action-caution {
  background: #fef9c3;
  color: #92400e;
  font-weight: 700;
}

.action-first {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 700;
}

.action-second {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.action-final {
  background: #fecaca;
  color: #7f1d1d;
  font-weight: 700;
}

.action-separated {
  background: #111827;
  color: #ffffff;
  font-weight: 700;
}
/* =====================================================
   PROFESSIONAL RESPONSIVE TABLE SYSTEM (ALL TABLES)
   - Fits text inside cells (no crossing borders)
   - Auto font scaling (desktop ↔ mobile)
   - Ellipsis + full text on hover (title attribute from JS)
   - Better spacing, borders, sticky headers, smooth scroll
   ===================================================== */

/* Scroll container (wrap your tables in .table-wrapper /.table-container where possible) */
.table-wrapper,
.table-container,
.table-responsive {
  max-height: 70vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Base table */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;  /* forces cells to respect width */
  font-size: clamp(9px, 0.85vw, 12px) !important;
}

/* Header */
table thead th {
  background-color: #0f766e !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-align: center !important;
  border: 1px solid #065f46 !important;
  position: sticky !important;
  top: 0;
  z-index: 5;
}

/* Cells: keep text INSIDE cell */
table th,
table td {
  padding: 6px 8px !important;
  border: 1px solid #d1d5db !important;
  vertical-align: middle !important;

  /* 🔑 stop overflow across borders */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;

  /* needed for ellipsis in fixed tables */
  max-width: 0;
  line-height: 1.3 !important;
  color: #111827 !important;
}

/* Row polish */
table tbody tr:nth-child(even) { background: #f8fafc; }
table tbody tr:hover { background-color: #ecfdf5 !important; }

/* Editing experience: expand on focus so user can see full value */
table td[contenteditable="true"]:focus {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  outline: 2px solid #0f766e;
  outline-offset: -2px;
  background: #ffffff;
}

/* Filters row */
.filter-row th {
  padding: 4px !important;
  background: #ecfdf5 !important;
}
.filter-row input {
  width: 100%;
  font-size: clamp(9px, 0.9vw, 12px);
  padding: 2px 4px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  outline: none;
}
.filter-row input:focus { border-color: #0f766e; }

/* Tablet */
@media (max-width: 1024px) {
  table { font-size: clamp(8px, 1.2vw, 10px) !important; }
  table th, table td { padding: 5px 6px !important; }
}

/* Mobile */
@media (max-width: 768px) {
  table { font-size: clamp(7px, 2.2vw, 9.5px) !important; }
  table th, table td { padding: 4px 5px !important; }
  /* allow horizontal scroll instead of breaking layout */
  .table-wrapper,
  .table-container,
  .table-responsive { overflow-x: auto; }
}
/* =====================================================
   LEAVE SCHEDULE – FORCE FIX (OLD STYLE OVERRIDE)
   ===================================================== */

#leaveScheduleTable,
#leaveScheduleTable th,
#leaveScheduleTable td {
  font-size: 9px !important;
  white-space: nowrap !important;
}

/* =====================================================
   CLAIMS / LEAVE BALANCE / SUPERVISOR UPDATES
   ===================================================== */

#claimsTable,
#leaveBalanceTable,
#recalledOffTable,
#supervisorUpdatesTable {
  font-size: 9px !important;
}

#claimsTable th,
#leaveBalanceTable th,
#supervisorUpdatesTable th {
  background-color: #0f766e !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}
/* =====================================================
   STICKY TABLE HEADERS (ALL TABLES)
   ===================================================== */

table thead th {
  position: sticky !important;
  top: 0;
  z-index: 5;
}

/* Ensure scroll container works */
.table-wrapper,
.table-container,
.table-responsive {
  max-height: 70vh;
  overflow: auto;
}
/* =====================================================
   TABLE COLUMN FILTERS (ALL TABLES)
   ===================================================== */

.filter-row th {
  padding: 4px !important;
  background: #ecfdf5 !important;
}

.filter-row input {
  width: 100%;
  font-size: 9px;
  padding: 2px 4px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  outline: none;
}

.filter-row input:focus {
  border-color: #0f766e;
}
/* =====================================================
   STICKY TOP NAVIGATION (FINAL & PRECISE)
   ===================================================== */

/* The white rounded tab container */
.tabs-container,
.nav-container,
.menu-wrapper,
.menu-scroll {
  position: sticky !important;
  top: 0;
  z-index: 9999;
  background: #ffffff;
}

/* Ensure tabs never collapse */
.tabs-container * {
  position: relative;
}

/* Prevent page content from going under the tabs */
body {
  scroll-padding-top: 80px;
}
/* =====================================================
   FIX TAB HIDING – MOVE SCROLL AWAY FROM TABS
   ===================================================== */

/* Kill scrolling on parent wrappers */
.tabs-container,
.menu-scroll,
.horizontal-scroll,
.nav-container {
  overflow: visible !important;
}

/* Allow scrolling ONLY on content */
.main-content,
.page-content,
.content-wrapper {
  overflow-y: auto !important;
  max-height: calc(100vh - 120px);
}

/* Lock tabs at top */
.tabs-container,
.nav-container {
  position: fixed !important;
  top: 60px; /* below GARDWORLD header */
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
}

/* Push content below fixed tabs */
.main-content,
.page-content,
.content-wrapper {
  margin-top: 80px !important;
}
/* ===============================
   TABLET SCREENS
   =============================== */
@media (max-width: 1024px) {
  table {
    font-size: 8px;
  }
}

/* ===============================
   MOBILE PHONES – AUTO FIT
   =============================== */
@media (max-width: 768px) {

  /* 🔹 Auto-scale text based on screen width */
  table {
    font-size: clamp(6.5px, 2.2vw, 8px) !important;
  }

  /* 🔹 Allow DATA to wrap (prevents overlap) */
  table td {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
  }

  /* 🔹 Headers stay single-line & readable */
  table thead th {
    white-space: nowrap !important;
    font-size: clamp(7px, 2.4vw, 8.5px) !important;
    text-align: center; text-transform:none;
  }

  /* 🔹 Compact padding for phones */
  table td,
  table th {
    padding: 4px 6px !important;
  }

  /* 🔹 Smooth horizontal scroll if needed */
  .table-container,
  .table-wrapper,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===============================
   EXTRA SMALL PHONES
   =============================== */
@media (max-width: 480px) {
  table {
    font-size: 6.5px !important;
  }
}
/* =====================================================
   RESPONSIVE TABLE TEXT FIT – FINAL (DESKTOP → MOBILE)
   ===================================================== */

/* ===============================
   DESKTOP & LAPTOP (DEFAULT)
   =============================== */
table {
  font-size: 9px;
  table-layout: fixed;
}

table th,
table td {
  white-space: nowrap;
  vertical-align: middle;
}
.app-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 280px;
  max-width: 90%;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

.app-notification.success {
  background: #e6f4ea;
  color: #0b8043;
  border-left: 6px solid #0b8043;
}

.app-notification.error {
  background: #fdecea;
  color: #c62828;
  border-left: 6px solid #c62828;
}

.app-notification.info {
  background: #e8f0fe;
  color: #1a73e8;
  border-left: 6px solid #1a73e8;
}

.hidden {
  display: none;
}

@keyframes pulseRed {
  0%   { box-shadow: 0 0 0 0 rgba(198,40,40,.6); }
  70%  { box-shadow: 0 0 0 12px rgba(198,40,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); }
}

@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(27,94,32,.6); }
  70%  { box-shadow: 0 0 0 12px rgba(27,94,32,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,94,32,0); }
}

.kpi-pulse-red {
  animation: pulseRed 2s infinite;
}

.kpi-pulse-green {
  animation: pulseGreen 2s infinite;
}
.approval-card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.kpi-alert-red {
  border-left: 5px solid #c62828;
  animation: pulseRed 1.5s infinite;
}

.kpi-alert-green {
  border-left: 5px solid #2e7d32;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 0 rgba(198,40,40,0.3); }
  50% { box-shadow: 0 0 10px rgba(198,40,40,0.6); }
  100% { box-shadow: 0 0 0 rgba(198,40,40,0.3); }
}

canvas {
  margin-top: 6px;
}
.kpi-info {
  margin-left: 6px;
  cursor: help;
  font-size: 12px;
  color: #6c757d;
  position: relative;
}

.kpi-info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

.kpi-info:hover::after {
  opacity: 1;
}
/* ==============================
   CLIENT UPDATES TABLE – COMPACT
   ============================== */

#clientUpdatesTable {
  font-size: 8px;
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed; /* 🔑 prevents overflow */
}

#clientUpdatesTable th,
#clientUpdatesTable td {
  padding: 4px 6px;
  border: 1px solid #d0d7de;
  vertical-align: top;
  white-space: normal;       /* allow wrapping */
  word-wrap: break-word;     /* legacy */
  overflow-wrap: break-word; /* modern */
  line-height: 1.25;
}

/* Header styling */
#clientUpdatesTable th {
  background-color: #0f766e;
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
}

/* Zebra striping */
#clientUpdatesTable tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Hover */
#clientUpdatesTable tbody tr:hover {
  background-color: #eef2ff;
}
.client-updates-scroll {
  max-height: 420px;   /* adjust as needed */
  overflow: auto;
}

#clientUpdatesTable thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}
#clientUpdatesTable th input.col-filter {
  width: 100%;
  margin-top: 3px;
  font-size: 8px;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
}
/* =========================
   KPI THROBBING ALERTS
========================= */

@keyframes pulseRed {
  0%   { box-shadow: 0 0 0 0 rgba(198,40,40,0.9); }
  70%  { box-shadow: 0 0 0 16px rgba(198,40,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); }
}

@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(27,94,32,0.9); }
  70%  { box-shadow: 0 0 0 16px rgba(27,94,32,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,94,32,0); }
}

.kpi-pulse-red {
  animation: pulseRed 1.4s infinite;
  border-left: 5px solid #c62828 !important;
}

.kpi-pulse-green {
  animation: pulseGreen 1.4s infinite;
  border-left: 5px solid #1b5e20 !important;
}
/* ===============================
   TABLE STABILITY
   =============================== */

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

.data-table th,
.data-table td {
  padding: 6px 8px;
  vertical-align: middle;

  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;

  overflow: hidden;
}
/* ===============================
   NAME & RELIEVER NAME AUTOFIT
   =============================== */

/* Staff Name */
.data-table td:nth-child(2),
.data-table th:nth-child(2),

/* Replacer Name */
.data-table td:nth-child(5),
.data-table th:nth-child(5) {

  /* Auto-scale font */
  font-size: clamp(10px, 1.1vw, 13px);

  line-height: 1.15;
  font-weight: 500;

  /* Ensure visibility */
  white-space: normal;
  word-break: break-word;
}
/* ===============================
   COLUMN WIDTH CONTROL
   =============================== */

/* Staff Name */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 140px;
}

/* Replacer Name */
.data-table th:nth-child(5),
.data-table td:nth-child(5) {
  width: 140px;
}
.data-table th:nth-child(6),
.data-table td:nth-child(6) {
  font-size: 11px;
  line-height: 1.25;
}
#supervisorUpdatesTable td {
  white-space: normal;
  word-break: break-word;
  max-width: 220px;
  line-height: 1.2;
}

/* Name + Replacer Name auto-shrink */
#supervisorUpdatesTable td:nth-child(2),
#supervisorUpdatesTable td:nth-child(5) {
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 600;
}



/* =========================
   KPI MULTI-VALUE CARD
   ========================= */
.kpi-multi{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-top:8px;
}
.kpi-mini{
  background: rgba(0,0,0,0.03);
  border-radius:10px;
  padding:8px;
  text-align:center;
}
.kpi-mini-label{
  font-size:11px;
  color:#6b7280;
  font-weight:600;
}
.kpi-mini-value{
  font-size:20px;
  font-weight:800;
  margin-top:2px;
}
@media (max-width: 520px){
  .kpi-multi{
    grid-template-columns: 1fr;
  }
}


/* =====================================================
   LEAVE BALANCE – FIX NAME COLUMN WIDTH
   ===================================================== */
#leaveBalanceTable {
  table-layout: fixed;
  width: 100%;
}

#leaveBalanceTable th:nth-child(1),
#leaveBalanceTable td:nth-child(1) { width: 18%; }

#leaveBalanceTable th:nth-child(2),
#leaveBalanceTable td:nth-child(2) {
  width: 32%;
  white-space: normal;
  word-break: break-word;
}

#leaveBalanceTable th:nth-child(3),
#leaveBalanceTable td:nth-child(3) { width: 18%; }

#leaveBalanceTable th:nth-child(4),
#leaveBalanceTable td:nth-child(4) { width: 32%; }

/* =========================================================
   TABLE VISIBILITY PATCH (ONLY TARGETED TABLES)
   Fixes: clipped right side, wrong column widths, hidden text
   Applies to: Client Updates, Fail To Patrol, MyReport Today, Leave Schedule
   ========================================================= */

/* Make the table containers scroll horizontally when needed (mobile / small screens) */
#clientUpdatesTable,
#failToPatrolTable,
#myReportTodayTable,
#leaveScheduleTable,
#leave-table {
  width: 100% !important;
}

/* Force their parent wrappers to allow horizontal scroll instead of hiding columns */
.table-container,
.table-wrapper,
.table-responsive,
.client-updates-scroll {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ---------- CLIENT UPDATES ---------- */
/* Let columns size better + allow wrapping for long text columns */
#clientUpdatesTable {
  table-layout: auto !important;          /* IMPORTANT */
  font-size: 12px !important;
}
#clientUpdatesTable th,
#clientUpdatesTable td {
  max-width: none !important;             /* cancels max-width:0 from global rules */
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;         /* wrap instead of ellipsis */
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
}
/* Make likely-short columns stay compact (adjust if needed) */
#clientUpdatesTable th:nth-child(2),
#clientUpdatesTable td:nth-child(2),
#clientUpdatesTable th:nth-child(5),
#clientUpdatesTable td:nth-child(5) {
  white-space: nowrap !important;
  width: 70px !important;
}

/* ---------- FAIL TO PATROL ---------- */
/* Keep layout clean but DO NOT hide text by ellipsis on desktop */
#failToPatrolTable {
  table-layout: auto !important;
  font-size: 12px !important;
}
#failToPatrolTable th,
#failToPatrolTable td {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
}
/* Keep very short columns compact */
#failToPatrolTable th:nth-child(1),
#failToPatrolTable td:nth-child(1),
#failToPatrolTable th:nth-child(2),
#failToPatrolTable td:nth-child(2) {
  white-space: nowrap !important;
  width: 60px !important;
}

/* ---------- MYREPORT TODAY ---------- */
/* This is the one in your screenshot: Staff No should be small, Name wider */
#myReportTodayTable {
  table-layout: auto !important;
  font-size: 13px !important;
}
#myReportTodayTable th,
#myReportTodayTable td {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
}
/* Make Staff No compact */
#myReportTodayTable th:nth-child(1),
#myReportTodayTable td:nth-child(1) {
  white-space: nowrap !important;
  width: 90px !important;
}
/* Give Name more room */
#myReportTodayTable th:nth-child(2),
#myReportTodayTable td:nth-child(2) {
  min-width: 220px !important;
}

/* ---------- LEAVE SCHEDULE ---------- */
/* You have both #leaveScheduleTable and #leave-table in your CSS; support both */
#leaveScheduleTable,
#leave-table {
  table-layout: auto !important;
  font-size: 12px !important;
}
#leaveScheduleTable th, #leaveScheduleTable td,
#leave-table th, #leave-table td {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
}

/* ---------- MOBILE: keep it readable and allow horizontal scroll ---------- */
@media (max-width: 768px) {
  #clientUpdatesTable,
  #failToPatrolTable,
  #myReportTodayTable,
  #leaveScheduleTable,
  #leave-table {
    font-size: 10px !important;
  }

  /* On phones, allow scroll rather than crushing columns */
  .table-container,
  .table-wrapper,
  .table-responsive,
  .client-updates-scroll {
    overflow-x: auto !important;
  }
}
/* ✅ Supervisor Updates: blue header only */
#supervisorUpdatesTable thead th{
  background:#0b5ed7 !important;
  color:#fff !important;
  font-weight:700;
  border-color:rgba(255,255,255,.2);
}




/* =========================
   OPERATIONS (Corporate Cards)
   ========================= */
.ops-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:16px;
  margin-top:14px;
}
.ops-card{
  background:#fff;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:14px;
  box-shadow:0 10px 26px rgba(0,0,0,0.06);
  overflow:hidden;

  transition: transform 160ms ease, box-shadow 160ms ease;
}
.ops-card-title{
  padding:12px 14px;
  font-weight:800;
  letter-spacing:.3px;
  text-transform:uppercase;
  background:linear-gradient(180deg, rgba(11,94,215,0.10), rgba(11,94,215,0.02));
  border-bottom:1px solid rgba(0,0,0,0.06);
}
.ops-card-orange .ops-card-title{
  background:linear-gradient(180deg, rgba(245,158,11,0.22), rgba(245,158,11,0.06));
}
.ops-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.ops-table th, .ops-table td{
  padding:7px 10px;
  border-bottom:1px solid rgba(0,0,0,0.06);
  white-space:normal;
}
.ops-table thead th{
  font-size:12px;
  color:#374151;
  text-transform:uppercase;
  letter-spacing:.3px;
  background:#f8fafc;
}
.ops-card-orange .ops-table thead th{
  background:rgba(245,158,11,0.10);
}
.ops-num{
  text-align:right;
  font-variant-numeric: tabular-nums;
}
.ops-row-total td{
  font-weight:800;
  font-style:italic;
}
.ops-row-shortage td:first-child{
  font-weight:800;
}
.ops-row-excess td:first-child{
  font-weight:800;
}
.ops-row-shortage td{
  background:rgba(34,197,94,0.18);
}
.ops-row-excess td{
  background:rgba(239,68,68,0.16);
}



/* =========================
   OPERATIONS - Enhancements (Sticky header, sections, no gridlines, negative highlight)
   ========================= */
.ops-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
}

.ops-section{
  margin-top: 14px;
}
.ops-section-title{
  font-weight: 800;
  letter-spacing: .35px;
  color: #0f172a;
  margin: 6px 2px 10px 2px;
  text-transform: uppercase;
  font-size: 12px;
  opacity: .85;
}
.ops-divider{
  height: 1px;
  background: rgba(2,6,23,0.10);
  margin: 18px 0 6px 0;
  border-radius: 999px;
}

/* Make Service Lines stand out */
.ops-grid-services .ops-card{
  border-color: rgba(245,158,11,0.22);
  box-shadow: 0 12px 30px rgba(245,158,11,0.08), 0 10px 26px rgba(0,0,0,0.06);

  transition: transform 160ms ease, box-shadow 160ms ease;
}

/* Remove gridline-like look */
.ops-table th, .ops-table td{
  border-bottom: none !important;
}
.ops-table tbody tr:nth-child(even) td{
  background: rgba(15,23,42,0.02);
}
.ops-table tbody tr:hover td{
  background: rgba(11,94,215,0.04);
}

/* Shiny red negative numbers */
.ops-neg{
  background: linear-gradient(180deg, #ff2d2d 0%, #c1121f 100%) !important;
  color: #fff !important;
  font-weight: 900 !important;
  border-radius: 7px;
  box-shadow:
    0 6px 14px rgba(193,18,31,0.25),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.15);
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

/* Keep shortage/excess subtle, but allow negative pop to win */
.ops-row-shortage td{
  background: rgba(34,197,94,0.14);
}
.ops-row-excess td{
  background: rgba(239,68,68,0.10);
}


/* =========================================================
   OPERATIONS DASHBOARD — Corporate layout + ordering styles
   (Overrides to remove sheet-like gridlines and add strong borders)
   ========================================================= */

/* Freeze Operations header bar while scrolling */
.ops-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}

/* Operations root wrapper (prevents parent grids affecting layout) */
.ops-root{ display:block; width:100%; }

/* Service lines row: 4 cards across (responsive) */
.ops-grid-services{
  display:grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap:16px;
}
@media (max-width: 1200px){
  .ops-grid-services{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-services{ grid-template-columns: 1fr; }
}

/* Remaining cards: 5 across (responsive) */
.ops-grid-others{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
}
@media (max-width: 1400px){
  .ops-grid-others{ grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}
@media (max-width: 900px){
  .ops-grid-others{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .ops-grid-others{ grid-template-columns: 1fr; }
}

/* Thick separator line */
.ops-divider{
  height: 8px;
  background: rgba(31,41,55,0.25);
  margin: 16px 0 14px 0;
  border-radius: 999px;
}

/* Cards: plain, strong border */
.ops-card{
  border: 2px solid rgba(55,65,81,0.95) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08) !important;
  border-radius: 14px;
  overflow: hidden;

  transition: transform 160ms ease, box-shadow 160ms ease;
}
.ops-card-title{
  border-bottom: none !important;
  background: linear-gradient(180deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02)) !important;
}

/* Table: remove ALL sheet-like lines + zebra */
.ops-table{
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.ops-table th,
.ops-table td{
  border: none !important;
}
.ops-table thead th{
  background: rgba(17,24,39,0.08) !important;
  color: #0f172a !important;
}
.ops-table tbody tr:nth-child(even) td,
.ops-table tbody tr:hover td{
  background: transparent !important;
}

/* Keep shortage/excess row fills subtle + corporate */
.ops-row-shortage td{
  background: rgba(34,197,94,0.14) !important;
}
.ops-row-excess td{
  background: rgba(239,68,68,0.12) !important;
}

/* Shiny POP red for negative numbers */
.ops-neg{
  background: linear-gradient(180deg, #ff1f1f 0%, #b30000 100%) !important;
  color: #fff !important;
  font-weight: 900 !important;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 14px rgba(179,0,0,0.30);
}

/* Slightly tighter numerics */
.ops-num{ font-variant-numeric: tabular-nums; }


/* ===== OPERATIONS LAYOUT OVERRIDES (Fix overlap + requested structure) ===== */
.ops-section{ display:block; width:100%; clear:both; }
.ops-grid-services{
  display:grid !important;
  grid-template-columns: repeat(4, minmax(240px, 1fr)) !important;
  gap:16px !important;
  align-items: stretch;
}
.ops-grid-others{
  display:grid !important;
  grid-template-columns: repeat(4, minmax(240px, 1fr)) !important; /* 4 per row */
  gap:16px !important;
  align-items: stretch;
}
@media (max-width: 1200px){
  .ops-grid-services, .ops-grid-others{ grid-template-columns: repeat(2, minmax(240px, 1fr)) !important; }
}
@media (max-width: 640px){
  .ops-grid-services, .ops-grid-others{ grid-template-columns: 1fr !important; }
}

/* Dark red thick separator under Service Lines */
.ops-divider-red{
  display:block;
  width:100%;

  height: 10px !important;
  background: linear-gradient(90deg, #7f1d1d 0%, #dc2626 45%, #7f1d1d 100%) !important;
  margin: 18px 0 18px 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 18px rgba(220,38,38,0.25) !important;
}

/* Strong dark grey borders on cards */
.ops-card{
  border: 3px solid #2f2f2f !important;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10) !important;

  transition: transform 160ms ease, box-shadow 160ms ease;
}

/* Remove any table-like lines completely */
.ops-table, .ops-table *{
  border: none !important;
}


/* Swing effect for numeric cells */
.ops-card-table td{
  transition: transform 140ms ease, background 140ms ease;
}
.ops-card-table td.ops-neg:hover,
.ops-card-table td.ops-num:hover{
  transform: translateY(-2px) rotate(-0.8deg);
}

/* make numeric cells feel clickable */
.ops-card-table td.ops-neg,
.ops-card-table td.ops-num{
  cursor: default;
}
/* =========================================
   EXECUTIVE SERVICE LINE STYLING
   ========================================= */

/* Premium grey gradient background */
.ops-grid-services .ops-card {
  background: linear-gradient(180deg, #f3f4f6 0%, #d1d5db 100%) !important;
  border: 3px solid #4b5563 !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

/* Header styling */
.ops-grid-services .ops-card-title {
  color: #7f1d1d !important;      /* deep executive red */
  font-weight: 900 !important;
  letter-spacing: 1px;
  position: relative;
}

/* Thin red underline accent */
.ops-grid-services .ops-card-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 40%;
  margin-top: 6px;
  background: #7f1d1d;
  border-radius: 2px;
}


/* ==============================
   RURAL PROJECTS TABLE – COMPACT (LIKE CLIENT UPDATES)
   Fix hidden/truncated columns by overriding global fixed-layout rules
   ============================== */
#ruralProjectsTable {
  table-layout: auto !important;
  width: 100%;
  font-size: 12px !important;
  border-collapse: collapse;
}
#ruralProjectsTable th,
#ruralProjectsTable td {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important; /* keep numbers neat; scroll horizontally if needed */
  padding: 4px 6px;
  border: 1px solid #d0d7de;
}

/* Ensure the Rural Projects table can scroll horizontally on small screens */
#ruralProjectsSection .table-container,
#ruralProjectsSection .table-wrap,
#ruralProjectsSection .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ================================
   OPERATIONS – EXPECTED IDLE RELIEVERS (SBNO) PANEL
   (Unified with Manpower Forecast)
   ================================ */

/* Put Forecast + Idle panel stacked (Idle stays BELOW Forecast) */
.ops-grid-analysis{
  display:block;
}

/* Make both ANALYSIS cards same width and unified */
.ops-forecast-card{
  width: 100%;
  max-width: 980px;
}
.ops-idle-card{
  width: 100%;
  max-width: 980px;
  margin-top: 14px;
  background:#ffffff;
  border:2px solid #111827;
  border-radius:10px;
  overflow:hidden;
}
/* Corporate red header (exact request: 8px bold white) */
.ops-idle-head{
  background:#b91c1c; /* corporate red */
  padding:8px 10px;
}
.ops-idle-title{
  color:#ffffff;
  font-weight:800;
  font-size:8px;
  letter-spacing:0.8px;
  line-height:1.2;
}

/* Body + table (no gridlines, readable) */
.ops-idle-body{
  padding:8px 10px 10px 10px;
}
.ops-idle-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:9px;
  table-layout:fixed;
}
.ops-idle-table th,
.ops-idle-table td{
  border:none !important; /* no gridlines */
  padding:4px 6px;
  text-align:left;
  vertical-align:top;
  font-weight:600;
  color:#111827;
  white-space:normal;       /* allow full names to show */
  overflow-wrap:break-word;
  word-break:normal;
}
.ops-idle-table thead th{
  font-weight:800;
  color:#111827;
  font-size:8px;
  padding-bottom:6px;
  white-space:normal;
}

/* Keep some columns compact */
.ops-idle-table th:nth-child(1),
.ops-idle-table td:nth-child(1),
.ops-idle-table th:nth-child(5),
.ops-idle-table td:nth-child(5){
  white-space:nowrap;
}

/* Give name / unit / manager more room */
.ops-idle-table th:nth-child(2),
.ops-idle-table td:nth-child(2){
  width: 240px;
}
.ops-idle-table th:nth-child(3),
.ops-idle-table td:nth-child(3){
  width: 160px;
}
.ops-idle-table th:nth-child(4),
.ops-idle-table td:nth-child(4){
  width: 160px;
}

.ops-idle-empty{
  padding:10px 6px !important;
  color:#6b7280 !important;
  font-weight:700 !important;
  text-align:center !important;
  white-space:normal !important;
}


/* BURNER MARQUEE */
.burner-wrap {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  max-width: 640px;
  padding-left: 18px; /* space for bulb */
}
.burner-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #ff1a1a;
  box-shadow: 0 0 6px rgba(255,0,0,.8), 0 0 14px rgba(255,0,0,.65);
  animation: burnerBulb 1.2s ease-in-out infinite;
}
.burner-text {
  display: inline-block;
  padding-left: 100%;
  color: #b00000;
  font-weight: 700;
  letter-spacing: .4px;
  text-shadow: 0 0 6px rgba(255,0,0,.75), 0 0 16px rgba(255,0,0,.55);
  animation: burnerMarquee 14s linear infinite;
}
@keyframes burnerMarquee {
  0%   { transform: translateX(0);    opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}
@keyframes burnerBulb {
  0%,100% { opacity: .45; filter: saturate(1); }
  50%     { opacity: 1;   filter: saturate(1.4); }
}


/* =========================================================
   APPROVALS – PROFESSIONAL QUEUE CARDS (OFF-STOP)
   ========================================================= */
.approval-toolbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.approval-toolbar .muted{ color:#6b7280; font-size:12px; }
.approval-queue{ display:flex; flex-direction:column; gap:12px; }

.approval-card{
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  overflow:hidden;
  transition: transform .2s ease, opacity .2s ease, filter .2s ease;
}
.approval-card:hover{ transform: translateY(-1px); }
.approval-card-done{ opacity:0; transform: translateY(-6px); filter: blur(1px); }

.approval-card-head{
  padding:14px 14px 10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid #f1f5f9;
  background: linear-gradient(180deg, rgba(15,118,110,0.08), rgba(255,255,255,0));
}
.approval-card-kicker{
  font-size:11px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#0f766e;
  font-weight:800;
}
.approval-card-main{
  font-size:18px;
  font-weight:900;
  margin-top:2px;
}

.approval-badges{ display:flex; align-items:center; gap:8px; }
.approval-badge{
  font-size:12px;
  font-weight:800;
  background:#0f766e;
  color:#fff;
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}

.approval-card-body{ padding:14px; }
.approval-details{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
.approval-details > div{
  background: rgba(0,0,0,0.03);
  border:1px solid rgba(0,0,0,0.04);
  border-radius:12px;
  padding:10px;
  font-size:12px;
}
.approval-reason{
  margin-top:12px;
  background:#fff;
  border:1px dashed #cbd5e1;
  border-radius:12px;
  padding:10px;
  font-size:13px;
}
.approval-actions{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}
.approval-actions .btn{
  flex:1 1 160px;
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
}
.approval-empty{
  padding:16px;
  text-align:center;
  border-radius:14px;
}

@media (max-width: 760px){
  .approval-details{ grid-template-columns: 1fr; }
  .approval-actions .btn{ flex:1 1 100%; }
}
/* =========================
   APPROVALS: FREEZE HEADER
   ========================= */
#approvalsSection > h2 {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0;
  padding: 14px 0 10px 0;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(239, 246, 255, 0.92) 70%, rgba(239, 246, 255, 0.0) 100%);
  backdrop-filter: blur(6px);
}

/* Give the cards a little spacing from the frozen title */
#approvalsContainer {
  margin-top: 10px;
}
#approvalsContainer {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 8px;
}
/* =========================================================
   MANPOWER FORECAST – VISIBILITY OVERRIDE (SAFE)
   - Removes the dark/black blocks so all numbers show clearly
   - DOES NOT affect approvals card styling or any other module
   ========================================================= */

.ops-forecast-card{
  background: #ffffff !important;   /* was dark slate */
}

.ops-forecast-title{
  color: #111827 !important;        /* was light gray */
  opacity: 1 !important;
}

.ops-forecast-table thead th{
  background: #0f766e !important;   /* professional green header */
  color: #ffffff !important;
  border-color: rgba(0,0,0,0.08) !important;
}

.ops-fc-cell-label{
  background: #e5e7eb !important;   /* light grey like sheet label cells */
  color: #111827 !important;
}

.ops-fc-cell-num{
  background: #ffffff !important;   /* remove black */
  color: #111827 !important;        /* readable numbers */
  border-color: rgba(0,0,0,0.08) !important;
}

/* Keep your existing highlight colors (reds/greens/yellows) working */
.ops-fc-row-loses .ops-fc-cell-surplus,
.ops-fc-row-gains .ops-fc-cell-surplus,
.ops-fc-row-loses .ops-fc-cell-billable,
.ops-fc-row-gains .ops-fc-cell-billable,
.ops-fc-row-short .ops-fc-cell-billable,
.ops-fc-row-trainees .ops-fc-cell-billable,
.ops-fc-row-forecast .ops-fc-cell-billable,
.ops-fc-row-possible .ops-fc-cell-billable{
  /* no change – your existing colors remain */
}


/* =====================================================
   WIATAG PATROL EXCEPTIONS (CORPORATE LOOK)
   - No gridlines
   - Sticky header already enabled globally
   - Subtle separators + clean background
   ===================================================== */

.corporate-table-wrapper{
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(17,24,39,0.06);
}

#wiatagGuardingFailedTable,
#wiatagSupervisorFailedTable{
  table-layout: fixed !important;
  font-size: 12px !important;
}

/* Remove gridlines and use subtle row separators */
#wiatagGuardingFailedTable th,
#wiatagGuardingFailedTable td,
#wiatagSupervisorFailedTable th,
#wiatagSupervisorFailedTable td{
  border: none !important;
  border-bottom: 1px solid #eef2f7 !important;
}

/* Cleaner header */
#wiatagGuardingFailedTable thead th,
#wiatagSupervisorFailedTable thead th{
  background: #0b3a53 !important; /* corporate navy */
  border-bottom: 1px solid #082b3e !important;
}

/* Action cell editing polish */
.corp-action-cell[contenteditable="true"]{
  cursor: text;
  background: #f8fafc;
  border-bottom: 1px solid #dbeafe !important;
}

.corp-action-cell.saving{
  opacity: 0.65;
}

.corp-action-cell.saved{
  outline: 2px solid #16a34a;
  outline-offset: -2px;
}

.corp-action-cell.save-failed{
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}


/* ===========================
   PROJECTS (Corporate polish)
   =========================== */

.projects-sticky{
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.86));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 10px 0;
}

.projects-sticky .title-stack{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.projects-sticky .header-actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-left:auto;
}

.projects-top{
  margin-top: 8px;
}

.project-form-wrap{
  margin-top: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.project-form-wrap .form-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 10px 0 14px 0;
}

.project-form-wrap .form-title{
  font-weight: 800;
  letter-spacing: .2px;
}

.projects-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}


/* Projects - Project Name */
.proj-card-title{
  font-size: 8px;        /* reduced to size 8 */
  font-weight: 700;      /* keep bold so it stays readable */
  line-height: 1.2;
  letter-spacing: 0.3px;
}
/* Projects - Updated text (relative time, small, never clipped) */
.proj-card-updated{
  display: block;             /* forces it to its own line */
  margin-left: auto;
  margin-top: 2px;
  font-size: 6px;             /* you requested size 6 */
  line-height: 1.1;
  opacity: 0.85;
  font-weight: 600;
  white-space: nowrap;        /* prevent wrapping */
  overflow: visible;          /* prevent cutting */
  text-overflow: unset;       /* prevent ... */
}

.proj-card-incharge{
  font-size: 6px;            /* reduced to size 6 */
  opacity: 0.85;
  font-weight: 600;          /* slightly lighter */
  padding: 2px 6px;          /* slightly tighter */
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj-card-edit{
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  display: none; /* toggled by role */
}
.proj-card-edit:hover{
  filter: brightness(1.08);
}
.proj-card-edit:active{
  transform: translateY(1px);
}

/* Last updated stamp keeps right alignment */
.proj-card-updated{
  margin-left: auto;
  white-space: nowrap;
}

@keyframes cardFlash{
  0%{ box-shadow: 0 0 0 0 rgba(24,169,87,0.28); }
  70%{ box-shadow: 0 0 0 10px rgba(24,169,87,0.0); }
  100%{ box-shadow: 0 0 0 0 rgba(24,169,87,0.0); }
}
.ops-card.flash{
  animation: cardFlash 0.9s ease-out 1;
}

/* Live dot on cards */
.live-dot{
  display:inline-block;
  width:9px;
  height:9px;
  border-radius:999px;
  margin-right:8px;
  background: #18a957;
  box-shadow: 0 0 0 0 rgba(24,169,87,0.55);
  animation: livePulse 0.55s infinite;
  vertical-align: middle;
}

@keyframes livePulse{
  0%{ transform:scale(0.9); box-shadow:0 0 0 0 rgba(24,169,87,0.55); opacity:0.95; }
  70%{ transform:scale(1.18); box-shadow:0 0 0 9px rgba(24,169,87,0.0); opacity:1; }
  100%{ transform:scale(0.9); box-shadow:0 0 0 0 rgba(24,169,87,0.0); opacity:0.9; }
}

/* Status styling */
.proj-status{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  background: rgba(0,0,0,0.04);
}

.proj-status.neg{
  background: rgba(214, 24, 24, 0.12);
  color: #b80e0e;
  animation: projNegPulse 0.45s infinite;
}

@keyframes projNegPulse{
  0%{ filter: brightness(1.0); }
  50%{ filter: brightness(1.15); }
  100%{ filter: brightness(1.0); }
}

.proj-status.pos{
  background: rgba(0,0,0,0.04);
  color: #b80e0e;
}

.proj-status.zero{
  background: rgba(24,169,87,0.10);
  color: #0d6b3a;
}

.proj-pm-badge{
  margin-top: 8px;
  display: none; /* toggled by role */
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  background: rgba(128, 70, 0, 0.10);
  border: 1px solid rgba(128, 70, 0, 0.22);
  color: #6b3a0d;
}
.proj-pm-badge::before{
  content: "PM";
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(128, 70, 0, 0.16);
  border: 1px solid rgba(128, 70, 0, 0.26);
  font-size: 11px;
  font-weight: 950;
}


/* ==========================
   PROJECT UPDATES (Cards)
   ========================== */
.projects-grid.viewer-all{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
  align-items: stretch;
}
@media (max-width: 1200px){
  .projects-grid.viewer-all{ grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px){
  .projects-grid.viewer-all{ grid-template-columns: 1fr; }
}

/* Status styling */
.proj-status{
  text-align:center;
  font-weight:900;
  font-variant-numeric: tabular-nums;
  padding:8px 10px;
  border-radius:10px;
}
.proj-status.neg{
  background: linear-gradient(180deg, #ff1f1f 0%, #b30000 100%) !important;
  color:#fff !important;
  animation: projBlink 0.65s ease-in-out infinite;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.20), 0 10px 20px rgba(179,0,0,0.25);
}
@keyframes projBlink{
  0%,100%{ transform: scale(1); filter: brightness(1); }
  50%{ transform: scale(1.03); filter: brightness(1.15); }
}
.proj-status.pos{
  color:#8B0000 !important;
  background: rgba(255,255,255,0.35);
}
.proj-status.zero{
  color:#14532d !important;
  background: rgba(20,83,45,0.08);
}



/* Projects: ensure + Project Update and Submit are always visible (Project Manager only toggles display in JS) */
#pu_openBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#2f2f2f !important;
  color:#fff !important;
  padding:10px 18px !important;
  border-radius:8px !important;
  border:none !important;
  font-weight:700 !important;
  cursor:pointer !important;
  box-shadow:0 3px 8px rgba(0,0,0,.25) !important;
  z-index:30 !important;
}
#pu_openBtn:hover{ background:#1f1f1f !important; }

#pu_submitBtn, #projectUpdatesForm button[type="submit"]{
  background:#2f2f2f !important;
  color:#fff !important;
  padding:10px 20px !important;
  border-radius:8px !important;
  border:none !important;
  font-weight:700 !important;
  cursor:pointer !important;
  box-shadow:0 3px 8px rgba(0,0,0,.25) !important;
}

.project-form-wrap .form-grid{
  grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
}
@media (max-width: 720px){
  .project-form-wrap .form-grid{
    grid-template-columns: 1fr !important;
  }
}

/* ===== Claims Status Styling ===== */
#claimsTable .status-pill{
  display:inline-block;
  padding:2px 6px;
  border-radius:6px;
  font-weight:700;
  color:#fff;
  line-height:1.2;
  white-space:nowrap;
}
#claimsTable .status-no-claim{ background:#b00020; }
#claimsTable .status-claim-paid{ background:#0b3d2e; }




/* ================================
   PENDING OFFS — KPI ARROWS + UNIT CARDS
   ================================ */
.po-delta{
  display:inline-block;
  font-weight:900;
  margin-right:6px;
  font-size: 14px;
  line-height: 1;
}
.po-up{ color: #dc3545; }    /* red up */
.po-down{ color: #16a34a; }  /* green down */
.po-flat{ color: #6b7280; }  /* gray */
.po-delta-line{
  margin-top: 4px;
  font-size: 12px;
}
.po-unit-card .kpi-value{
  font-size: 22px;
}




/* ===================== CONTROL ROOM ANALYTICS (NEW) ===================== */

.cr-huge-card{
  margin-top:14px;
  border:1px solid rgba(15,23,42,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 14px 34px rgba(15,23,42,0.10);
  padding: 14px;
}
.cr-huge-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  border-bottom: 1px solid rgba(229,231,235,0.9);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.cr-huge-title{ display:flex; align-items:center; gap:10px; }
.cr-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11,94,215,0.10);
  border:1px solid rgba(11,94,215,0.22);
  color:#0b5ed7;
  font-weight:900;
  font-size:11px;
  letter-spacing:0.6px;
}
.cr-h1{ font-size:14px; font-weight:900; color:#0f172a; letter-spacing:0.6px; }
.cr-sub{ font-size:12px; color:#6b7280; font-weight:700; text-transform:none; }

.cr-kpis{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.cr-kpi{
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background:#ffffff;
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}
.cr-kpi .k{ font-size:11px; color:#6b7280; font-weight:800; letter-spacing:0.4px; }
.cr-kpi .v{ font-size:18px; color:#0f172a; font-weight:900; margin-top:2px; }
.cr-kpi.danger{ border-left: 6px solid rgba(220,53,69,0.95); }
.cr-kpi.warn{ border-left: 6px solid rgba(255,159,10,0.95); }
.cr-kpi.good{ border-left: 6px solid rgba(16,185,129,0.95); }

.cr-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 980px){ .cr-grid{ grid-template-columns: 1fr; } }

.cr-panel{
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
  padding: 12px;
}
.cr-panel-title{
  font-size: 12px;
  font-weight: 900;
  color:#0f172a;
  margin-bottom: 8px;
  letter-spacing:0.5px;
}
.cr-list{ display:flex; flex-direction:column; gap:8px; }
.cr-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(229,231,235,0.95);
  background: #f8fafc;
}
.cr-item .l{ display:flex; flex-direction:column; gap:4px; }
.cr-item .t{ font-weight:900; color:#111827; font-size:11px; }
.cr-item .s{ color:#6b7280; font-weight:700; font-size:11px; text-transform:none; }
.cr-pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight:900;
  font-size: 10px;
  border: 1px solid rgba(15,23,42,0.10);
  background:#ffffff;
  color:#0f172a;
  white-space:nowrap;
}
.cr-pill.danger{ border-color: rgba(220,53,69,0.25); background: rgba(220,53,69,0.08); color:#b91c1c; }
.cr-pill.warn{ border-color: rgba(255,159,10,0.25); background: rgba(255,159,10,0.10); color:#92400e; }
.cr-pill.good{ border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.10); color:#065f46; }
.cr-pill.info{ border-color: rgba(11,94,215,0.25); background: rgba(11,94,215,0.08); color:#0b5ed7; }

.cr-feed-head{
  margin-top: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  border-top: 1px solid rgba(229,231,235,0.9);
  padding-top: 12px;
}
.cr-feed-meta{ color:#6b7280; font-weight:700; font-size: 12px; text-transform:none; }

.cr-feed{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}
@media (max-width: 980px){ .cr-feed{ grid-template-columns: 1fr; } }

.cr-card{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.12);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15,23,42,0.08);
  overflow:hidden;
}
.cr-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding: 12px;
  border-bottom: 1px solid rgba(229,231,235,0.9);
  background: linear-gradient(135deg, rgba(11,94,215,0.08), rgba(10,47,111,0.04));
}
.cr-card-title{
  font-weight: 900;
  font-size: 12px;
  color:#0f172a;
  letter-spacing:0.4px;
}
.cr-card-sub{
  margin-top:4px;
  font-size: 11px;
  color:#6b7280;
  font-weight:700;
  text-transform:none;
}
.cr-card-body{
  padding: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cr-field{
  border: 1px solid rgba(229,231,235,0.95);
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px;
}
.cr-field .k{ font-size:10px; color:#6b7280; font-weight:900; letter-spacing:0.5px; }
.cr-field .v{ font-size:11px; color:#0f172a; font-weight:800; margin-top:4px; text-transform:none; white-space:pre-wrap; }
.cr-card-foot{
  padding: 12px;
  border-top: 1px solid rgba(229,231,235,0.9);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.cr-new{ animation: crGlow 1.6s ease-in-out infinite; }
@keyframes crGlow{
  0%,100%{ box-shadow: 0 12px 26px rgba(15,23,42,0.08); }
  50%{ box-shadow: 0 14px 32px rgba(11,94,215,0.18); }
}





/* STAFF PROFILES MODULE */
.gw-profile-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:18px;}
.gw-profile-summary{display:flex;gap:10px;flex-wrap:wrap;}
.gw-mini-card{min-width:120px;padding:10px 14px;border-radius:14px;background:linear-gradient(135deg,#f8fbff,#eef4ff);border:1px solid #dbe5f5;}
.gw-mini-card .num{font-size:20px;font-weight:800;line-height:1.1;}
.gw-mini-card .lbl{font-size:12px;color:#60708d;margin-top:4px;}
.gw-profile-form-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:18px;}
.gw-photo-card,.gw-review-card{background:#f8fbff;border:1px solid #dbe5f5;border-radius:18px;padding:16px;margin-bottom:14px;}
.gw-photo-title{font-weight:800;margin-bottom:8px;color:#16345f;}
.gw-profile-photo-preview{width:100%;max-width:240px;aspect-ratio:3/4;object-fit:cover;border-radius:18px;border:1px solid #dbe5f5;margin-top:14px;box-shadow:0 10px 24px rgba(27,58,117,.10);}
.gw-status-pill{display:inline-flex;align-items:center;padding:7px 12px;border-radius:999px;background:#eef4ff;color:#284b87;font-weight:700;font-size:12px;}
.gw-status-pill.pending{background:#fff4db;color:#8a5a00;}
.gw-status-pill.approved{background:#e8f8ee;color:#0f6b36;}
.gw-status-pill.draft{background:#eef4ff;color:#284b87;}
.gw-action-stack{display:flex;gap:6px;flex-wrap:wrap;}
@media (max-width: 900px){.gw-profile-form-grid{grid-template-columns:1fr;}}

/* Staff Profiles rich message editor */
.gw-editor-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px;align-items:center;}
.gw-rich-editor{min-height:120px;border:1px solid #cfd8e7;border-radius:12px;padding:12px 14px;background:#fff;outline:none;white-space:pre-wrap;line-height:1.5;}
.gw-rich-editor:empty:before{content:attr(data-placeholder);color:#94a3b8;white-space:pre-line;}

.gw-training-options{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px;}
.gw-check-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid #dbe5f5;border-radius:999px;background:#fff;font-weight:600;color:#16345f;}
.gw-check-chip input{margin:0;}




/* ===== CONTROL ROOM SUB NAV ===== */
.cr-subnav{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin:12px 0 0 0;
  padding:12px 14px;
  border-radius:12px;
  background: rgba(255,255,255,0.96);
  border:1px solid rgba(229,231,235,0.95);
  box-shadow:0 10px 26px rgba(15,23,42,0.08);
}
.cr-subtab{
  border:1px solid rgba(229,231,235,1);
  background:#fff;
  color:#334155;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
}
.cr-subtab.active{
  background:#0b3b8f;
  color:#fff;
  box-shadow:0 8px 18px rgba(11,59,143,0.22);
}

/* ===== INCIDENT REPORT ===== */
.incident-toggle-bar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.incident-toggle-btn{
  border:1px solid rgba(229,231,235,1);
  background:#fff;
  color:#334155;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
  box-shadow:0 2px 10px rgba(0,0,0,0.06);
}
.incident-toggle-btn.active{
  background:#d32f2f;
  color:#fff;
  border-color:#d32f2f;
}
.incident-card{
  background:#fff;
  border-radius:16px;
  padding:16px;
  border:1px solid rgba(229,231,235,0.95);
  box-shadow:0 10px 26px rgba(15,23,42,0.08);
  margin-bottom:14px;
}
.incident-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap:12px;
}
@media (max-width: 720px){ .incident-grid{ grid-template-columns:1fr; } }
.incident-wide{ grid-column:1 / -1; }
#incidentReportSection .form-label,
#incidentReportSection h2,
#incidentReportSection h3,
#incidentReportSection .form-control,
#incidentReportSection textarea,
#incidentReportSection select,
#incidentTable td{ text-transform:none; }
#incidentTable th{
  background:#d32f2f;
  color:#fff;
  font-size:11px;
}

/* ===== CONTROL ROOM SEVERITY CARDS ===== */
.cr-card-danger{
  border-color: rgba(220,53,69,0.35);
  box-shadow: 0 14px 30px rgba(220,53,69,0.12);
}
.cr-card-danger .cr-card-head{
  background: linear-gradient(135deg, rgba(220,53,69,0.12), rgba(220,53,69,0.04));
}
.cr-card-warn{
  border-color: rgba(255,159,10,0.35);
  box-shadow: 0 14px 30px rgba(255,159,10,0.12);
}
.cr-card-warn .cr-card-head{
  background: linear-gradient(135deg, rgba(255,159,10,0.14), rgba(255,159,10,0.05));
}
.cr-card-info{
  border-color: rgba(107,114,128,0.25);
}
.cr-card-info .cr-card-head{
  background: linear-gradient(135deg, rgba(107,114,128,0.12), rgba(107,114,128,0.05));
}


/* Sticky section headers */
.cr-sticky-header,
.incident-sticky-header{
  position: sticky;
  top: 112px;
  z-index: 50;
}
.incident-toggle-bar{
  position: sticky;
  top: 192px;
  z-index: 49;
  background: linear-gradient(180deg, rgba(240,244,247,1) 0%, rgba(240,244,247,0.96) 100%);
  padding: 8px 0;
}

/* Wider recent incident report columns */
#incidentTable{
  table-layout: fixed;
  width: 100%;
}
#incidentTable th,
#incidentTable td{
  min-width: 190px;
  width: 190px;
  white-space: normal;
  word-break: break-word;
}

/* Rich system modal */
.sys-card-rich{
  width: min(760px, 92vw);
  max-height: 82vh;
  overflow: auto;
  border: 2px solid rgba(211,47,47,0.18);
  border-top: 6px solid #d32f2f;
}
.sys-card-rich .sys-icon.info{
  background:#0b3b8f;
}
.sys-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.sys-brand{
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-align: left;
}
.sys-brand-garda{ color:#d32f2f; font-weight:900; }
.sys-brand-world{ color:#374151; font-weight:900; }
.sys-brand-sub{ color:#111827; font-size:16px; font-weight:700; margin-left:6px; }
.sys-close-btn{
  background:#fff;
  border:1px solid rgba(229,231,235,1);
  border-radius:10px;
  width:38px; height:38px;
  font-size:24px; line-height:1;
  cursor:pointer;
}
#sysTitle{
  text-align:left;
  margin:6px 0 10px 0;
  text-transform:none;
}
#sysMessage{
  text-align:left;
  color:#374151;
  font-size:14px;
  line-height:1.6;
  text-transform:none;
}
.sys-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:14px;
}
.sys-actions button{
  background:#7a6200;
  border:2px solid #a48700;
  border-radius:999px;
  padding:12px 28px;
  font-weight:800;
}
.sys-actions{
  gap:12px;
}
.sys-actions .sys-btn-primary{
  background:linear-gradient(135deg,#0f766e,#115e59);
  border:1px solid rgba(15,118,110,.18);
  color:#fff;
  min-width:160px;
  box-shadow:0 10px 22px rgba(15,118,110,.22);
}
.sys-actions .sys-btn-primary:hover{
  background:linear-gradient(135deg,#115e59,#134e4a);
}
.sys-actions .sys-btn-secondary{
  background:#fff;
  color:#374151;
  border:1px solid rgba(209,213,219,1);
  min-width:120px;
  box-shadow:none;
}
.sys-actions .sys-btn-secondary:hover{
  background:#f9fafb;
}

/* Nicer control room modal content */
.sys-report-title{
  font-size:20px;
  font-weight:900;
  color:#111827;
}
.cr-modal-wrap{ text-transform:none; }
.cr-modal-pills{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.cr-modal-heading{
  font-size:22px;
  font-weight:900;
  color:#111827;
  margin:8px 0 4px 0;
}
.cr-modal-sub{
  color:#6b7280;
  font-weight:700;
  margin-bottom:14px;
}
.cr-modal-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap:12px;
}
@media (max-width: 720px){
  .cr-modal-grid{ grid-template-columns:1fr; }
}
.cr-modal-block{
  border:1px solid rgba(229,231,235,0.95);
  border-radius:12px;
  padding:12px;
  background:#fff;
  box-shadow:0 4px 12px rgba(15,23,42,0.06);
}
.cr-modal-block .k{
  font-size:12px;
  font-weight:900;
  color:#6b7280;
  text-transform:uppercase;
  margin-bottom:6px;
}
.cr-modal-block .v{
  font-size:14px;
  color:#111827;
  white-space:pre-wrap;
}
.cr-modal-foot{
  margin-top:14px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  font-size:14px;
  color:#111827;
}


/* Incident Report compact top spacing fix */
#incidentReportSection{
  padding-top: 0 !important;
  margin-top: -78px;
}
.incident-sticky-header{
  top: 96px;
}
.incident-toggle-bar{
  top: 162px;
}


/* Incident Report buttons visibility fix */
#incidentReportSection{
  margin-top: -24px !important;
  padding-top: 0 !important;
}
#incidentStickyHeader{
  position: sticky;
  top: 96px;
  z-index: 50;
  margin-bottom: 14px !important;
}
#incidentReportSection .incident-toggle-bar{
  display: flex !important;
  position: sticky;
  top: 178px;
  z-index: 51;
  margin-top: 0 !important;
  margin-bottom: 14px !important;
  padding: 10px 0 4px 0 !important;
  background: linear-gradient(180deg, rgba(240,244,247,1) 0%, rgba(240,244,247,0.98) 100%);
}
#incidentReportSection .incident-toggle-btn{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}


/* Control Room / Incident top spacing reduction */
.main-content{
  padding-top: 6px !important;
}
#controlRoomSection,
#incidentReportSection{
  padding-top: 0 !important;
  margin-top: -110px !important;
}
#controlRoomStickyHeader,
#incidentStickyHeader{
  margin-top: 0 !important;
}
#controlRoomSection .cr-sticky-header{
  top: 98px !important;
}
#incidentStickyHeader{
  top: 98px !important;
}
#incidentReportSection .incident-toggle-bar{
  top: 162px !important;
  margin-bottom: 10px !important;
}


/* Final header placement fix */
#controlRoomSection,
#incidentReportSection{
  margin-top: 0 !important;
  padding-top: 8px !important;
}

#controlRoomStickyHeader,
#incidentStickyHeader{
  position: relative !important;
  top: 0 !important;
  margin-top: 8px !important;
  margin-bottom: 10px !important;
}

#incidentReportSection .incident-toggle-bar{
  position: relative !important;
  top: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  padding-top: 0 !important;
  background: transparent !important;
}

.main-content{
  padding-top: 6px !important;
}


.cr-card-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.cr-pdf-btn{
  border:1px solid rgba(11,59,143,0.18);
  background:#fff;
  color:#0b3b8f;
  border-radius:999px;
  padding:6px 12px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.cr-pdf-btn:hover{
  transform:translateY(-1px);
}


.archived-btn{
  background:#374151 !important;
  color:#ffffff !important;
  border-color:#374151 !important;
}
.archived-btn:hover{
  background:#1f2937 !important;
  color:#ffffff !important;
}


/* Control Room sticky header final fix */
#controlRoomStickyHeader,
#controlRoomSection .section-toolbar.kpi-card{
  position: sticky !important;
  top: 118px !important;
  z-index: 80 !important;
  background: rgba(255,255,255,0.98) !important;
  box-shadow: 0 10px 20px rgba(15,23,42,0.10) !important;
}



/* ===== GW SIGNED PREVIEW ===== */
.gw-signed-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.gw-signed-title{
  font-size:18px;
  font-weight:900;
  color:#111827;
  text-transform:none;
}
.gw-signed-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.gw-signed-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap:14px;
}
.gw-signed-wide{
  grid-column:1 / -1;
}
.gw-signed-card{
  border:1px solid rgba(229,231,235,0.95);
  border-left:4px solid #d32f2f;
  border-radius:14px;
  background:linear-gradient(135deg,#ffffff 0%, #f8fafc 100%);
  box-shadow:0 10px 24px rgba(15,23,42,0.08);
  overflow:hidden;
}
.gw-signed-card-head{
  padding:12px 14px;
  background:#374151;
  color:#ffffff;
  font-size:13px;
  font-weight:900;
  letter-spacing:.2px;
  text-transform:none;
}
.gw-signed-pairs{
  padding:12px 14px;
  display:grid;
  gap:10px;
}
.gw-signed-pair{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:10px;
  align-items:flex-start;
  text-transform:none;
}
.gw-signed-pair .k{
  font-size:11px;
  font-weight:900;
  color:#6b7280;
  text-transform:uppercase;
}
.gw-signed-pair .v{
  font-size:13px;
  color:#111827;
  text-transform:none;
  word-break:break-word;
}
.gw-signed-message{
  padding:14px;
  min-height:120px;
  color:#111827;
  line-height:1.6;
  text-transform:none;
}
.gw-signed-message *{
  text-transform:none;
}
.gw-signed-signature-wrap{
  padding:14px;
  min-height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
}
#gwSignedSignatureImg{
  max-width:100%;
  max-height:120px;
  object-fit:contain;
}
.gw-signed-status-box{
  padding:14px;
  display:grid;
  gap:10px;
  text-transform:none;
}
/* ===== CONTROL ROOM HEADER/CARD: RETURN TO NORMAL SCROLL ===== */

#controlRoomStickyHeader,
#controlRoomSection .section-toolbar.kpi-card,
#controlRoomSection > .cr-huge-card,
#controlRoomSection > .section-toolbar{
  position: static !important;
  top: auto !important;
  transform: none !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}

#controlRoomSection{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.main-content{
  padding-top: 0 !important;
}



/* ===== Supervisor Updates / Clerk Performance ===== */
#supervisorUpdatesTable th,
#supervisorUpdatesTable td { min-width: 4cm !important; }
#supervisorUpdatesTable th:nth-child(8),
#supervisorUpdatesTable td:nth-child(8),
#supervisorUpdatesTable th:nth-child(9),
#supervisorUpdatesTable td:nth-child(9),
#supervisorUpdatesTable th:nth-child(10),
#supervisorUpdatesTable td:nth-child(10) { min-width: 2.6cm !important; }
.gw-toolbar-row{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.gw-perf-card{margin:14px 0 18px;border-radius:18px;padding:18px;background:linear-gradient(135deg,#8b0000 0%,#c1121f 55%,#f8f9fa 100%);color:#fff;box-shadow:0 14px 34px rgba(139,0,0,.18);}
.gw-perf-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:14px;}
.gw-perf-title{font-size:20px;font-weight:800;letter-spacing:.2px;}
.gw-perf-note{opacity:.92;font-size:12px;}
.gw-perf-top-grid{display:grid;grid-template-columns:repeat(3,minmax(140px,1fr));gap:12px;margin-bottom:12px;}
.gw-perf-stat{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.28);border-radius:16px;padding:14px;backdrop-filter:blur(4px);}
.gw-perf-stat .lbl{font-size:12px;opacity:.88;}
.gw-perf-stat .num{font-size:24px;font-weight:800;line-height:1.1;}
.gw-perf-progress-track,.gw-perf-mini-track{width:100%;background:rgba(255,255,255,.18);border-radius:999px;overflow:hidden;}
.gw-perf-progress-track{height:14px;margin:8px 0 14px;}
.gw-perf-progress-bar,.gw-perf-mini-bar{height:100%;background:linear-gradient(90deg,#ffe082,#fff);}
.gw-perf-subtitle{font-weight:700;margin:10px 0 8px;}
.gw-perf-row{display:grid;grid-template-columns:56px 1.2fr 1.5fr 1fr 72px;gap:10px;align-items:center;padding:10px 12px;margin-bottom:8px;border-radius:14px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.2);}
.gw-perf-rank{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#fff;color:#8b0000;font-weight:800;}
.gw-perf-name{font-weight:700;}
.gw-perf-meta{font-size:12px;opacity:.92;}
.gw-perf-pct{font-weight:800;text-align:right;}
.gw-perf-empty,.gw-perf-loading,.gw-empty-text{padding:14px;border-radius:12px;background:rgba(255,255,255,.14);}
.gw-signed-topbar,.gw-signed-grid{display:grid;gap:14px;}
.gw-signed-topbar{grid-template-columns:1fr auto;align-items:center;margin-bottom:14px;}
.gw-signed-grid{grid-template-columns:1fr 1fr;margin-bottom:14px;}
.gw-signed-card{background:#fff;border:1px solid #d9dee8;border-radius:16px;padding:16px;}
.gw-signed-card-title{font-weight:800;color:#8b0000;margin-bottom:10px;border-bottom:2px solid #f0f2f7;padding-bottom:6px;}
.gw-signed-pair{display:grid;grid-template-columns:160px 1fr;gap:10px;padding:6px 0;border-bottom:1px dashed #e5e7eb;}
.gw-signed-pair:last-child{border-bottom:none;}
.gw-signed-label{font-weight:700;color:#6b7280;}
.gw-signed-value{color:#111827;word-break:break-word;}
@media (max-width:900px){
  .gw-perf-top-grid,.gw-signed-grid,.gw-signed-topbar{grid-template-columns:1fr;}
  .gw-perf-row{grid-template-columns:44px 1fr;}
  .gw-perf-meta,.gw-perf-mini-track,.gw-perf-pct{grid-column:2;}
}




/* =====================================================
   FINANCE — PROFIT & LOSS DASHBOARD
   ===================================================== */
.finance-shell{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.finance-hero{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(220px,0.8fr);
  gap:18px;
  padding:22px;
  border-radius:18px;
  background:linear-gradient(135deg,#ffffff 0%,#f8fafc 48%,#ffe9e9 100%);
  border:1px solid rgba(11,59,143,0.08);
  box-shadow:0 14px 34px rgba(15,23,42,0.08);
  align-items:center;
}
.finance-kicker{
  display:inline-block;
  background:#a30000;
  color:#fff;
  font-size:11px;
  font-weight:800;
  letter-spacing:0.08em;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
}
.finance-hero h2{
  margin:0 0 8px 0;
  color:#0f172a;
}
.finance-hero p{
  margin:0;
  color:#475569;
  line-height:1.6;
}
.finance-hero-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.finance-hero-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:180px;
  background:radial-gradient(circle at center, rgba(163,0,0,0.08), rgba(11,59,143,0.03));
  border-radius:16px;
}
.finance-hero-brand img{
  max-width:220px;
  width:100%;
  object-fit:contain;
  filter:drop-shadow(0 8px 18px rgba(163,0,0,0.18));
}
.finance-upload-status{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#eef2ff;
  color:#1e3a8a;
  font-size:12px;
  font-weight:600;
}
.finance-upload-status.success{ background:#ecfdf5; color:#166534; }
.finance-upload-status.error{ background:#fef2f2; color:#b91c1c; }
.finance-upload-status.info{ background:#eff6ff; color:#1d4ed8; }

.finance-kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
}
.finance-kpi-card{
  background:#fff;
  border-radius:16px;
  padding:18px;
  border:1px solid rgba(148,163,184,0.18);
  box-shadow:0 12px 28px rgba(15,23,42,0.06);
}
.finance-kpi-label{
  font-size:11px;
  letter-spacing:0.08em;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
}
.finance-kpi-value{
  margin-top:10px;
  font-size:24px;
  font-weight:900;
  color:#0f172a;
}
.finance-kpi-value.positive{ color:#166534; }
.finance-kpi-value.negative{ color:#b91c1c; }
.finance-kpi-sub{
  margin-top:8px;
  color:#64748b;
  font-size:12px;
}

.finance-grid-2{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:16px;
}
.finance-panel{
  background:#fff;
  border-radius:16px;
  padding:18px;
  border:1px solid rgba(148,163,184,0.18);
  box-shadow:0 12px 28px rgba(15,23,42,0.06);
}
.finance-panel-title{
  font-weight:800;
  color:#0f172a;
  margin-bottom:14px;
  font-size:15px;
}
.finance-insights-list{
  display:grid;
  gap:12px;
}
.finance-insight-card{
  padding:14px;
  border-radius:14px;
  border-left:5px solid #94a3b8;
  background:#f8fafc;
}
.finance-insight-card.positive{ border-left-color:#16a34a; background:#f0fdf4; }
.finance-insight-card.negative{ border-left-color:#dc2626; background:#fef2f2; }
.finance-insight-card.warning{ border-left-color:#f59e0b; background:#fff7ed; }
.finance-insight-card.neutral{ border-left-color:#3b82f6; background:#eff6ff; }
.finance-insight-title{
  font-weight:800;
  margin-bottom:6px;
  color:#0f172a;
}
.finance-insight-text{
  color:#475569;
  line-height:1.55;
  font-size:13px;
}
.finance-mapping-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
}
.finance-map-item{
  border:1px solid rgba(148,163,184,0.22);
  border-radius:12px;
  padding:12px;
  background:linear-gradient(180deg,#ffffff,#f8fafc);
}
.finance-map-item span{
  display:block;
  font-size:11px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:0.06em;
  margin-bottom:6px;
}
.finance-map-item strong{
  display:block;
  color:#0f172a;
  line-height:1.45;
  font-size:13px;
}
.finance-table-wrap{
  overflow:auto;
  max-height:420px;
}
.finance-preview-table{
  width:100%;
  border-collapse:collapse;
  font-size:10px !important;
}
.finance-preview-table th{
  position:sticky;
  top:0;
  background:#a30000 !important;
  color:#fff !important;
  z-index:3;
}
.finance-preview-table th,
.finance-preview-table td{
  padding:8px 10px !important;
  border:1px solid #e2e8f0;
  white-space:nowrap;
}
.finance-preview-table tbody tr:nth-child(even){
  background:#f8fafc;
}
.finance-empty-state{
  padding:14px;
  border-radius:12px;
  background:#f8fafc;
  color:#64748b;
  font-size:13px;
}
@media (max-width: 900px){
  .finance-hero{ grid-template-columns:1fr; }
}


/* =========================
   ACTIVE STAFF (HR)
   ========================= */
.hr-action-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

#activeStaffTableContainer{
  border:1px solid rgba(15,23,42,0.10);
  border-radius:12px;
  background:#ffffff;
  box-shadow:0 10px 26px rgba(15,23,42,0.10);
  overflow:auto;
}

#activeStaffTable tr.active-staff-highlight td{
  background:#d1fae5 !important;
  transition: background 0.4s ease;
}


.table-tools-inline{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.table-tools-inline input{
  flex:1 1 260px;
  min-width:220px;
}




#systemAdminIntroCard .sa-quick-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
#systemAdminIntroCard .sa-quick-btn{ min-width:190px; min-height:44px; font-weight:700; }
/* ===== SYSTEM ADMIN PERMISSIONS ===== */
#systemAdminSection{ width:100%; }
#systemAdminSection .header-group{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#systemAdminSection .gw-toolbar-row{ display:flex; gap:8px; flex-wrap:wrap; }
#systemAdminIntroCard, #systemAdminUploadPanel, #systemAdminPermissionsPanel{ margin-top:12px; }
.sa-card-shell{ margin-top:12px; overflow:hidden; }
.sa-panel-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.sa-panel-title{ font-size:18px; font-weight:900; color:#111827; }
.sa-panel-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.sa-search-input{ min-width:280px; }
.sa-upload-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-bottom:12px; }
.sa-table-wrap{ width:100%; overflow:auto; max-height:520px; }
#saPermissionsTable{ min-width:1500px; border-collapse:separate; border-spacing:0; }
#saPermissionsTable thead th{ position:sticky; top:0; z-index:3; background:#0f766e; color:#fff; }
#saPermissionsTable td, #saPermissionsTable th{ white-space:nowrap; }
#saPermissionsTable td:first-child, #saPermissionsTable th:first-child,
#saPermissionsTable td:nth-child(2), #saPermissionsTable th:nth-child(2),
#saPermissionsTable td:nth-child(3), #saPermissionsTable th:nth-child(3),
#saPermissionsTable td:nth-child(4), #saPermissionsTable th:nth-child(4){ position:sticky; background:#fff; z-index:2; }
#saPermissionsTable td:first-child, #saPermissionsTable th:first-child{ left:0; }
#saPermissionsTable td:nth-child(2), #saPermissionsTable th:nth-child(2){ left:110px; }
#saPermissionsTable td:nth-child(3), #saPermissionsTable th:nth-child(3){ left:260px; }
#saPermissionsTable td:nth-child(4), #saPermissionsTable th:nth-child(4){ left:440px; }
#saPermissionsTable thead th:first-child, #saPermissionsTable thead th:nth-child(2), #saPermissionsTable thead th:nth-child(3), #saPermissionsTable thead th:nth-child(4){ z-index:4; }
.sa-permission-pager{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; flex-wrap:wrap; }
@media (max-width:900px){ .sa-search-input{ min-width:100%; width:100%; } }



/* ===== Supervisor Updates exact sheet-width sync ===== */
#supervisorUpdatesTable {
  table-layout: fixed !important;
  width: max-content !important;
  min-width: 100% !important;
}

#supervisorUpdatesTable th,
#supervisorUpdatesTable td {
  min-width: unset !important;
  max-width: none !important;
  width: auto !important;
}

#supervisorUpdatesTable thead th {
  white-space: nowrap !important;
}

#supervisorUpdatesTable tbody td {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

#supervisorUpdatesTable col {
  width: auto;
}


/* =========================
   RESOURCE SCHEDULE
   ========================= */
.rs-shell{ display:flex; flex-direction:column; gap:16px; }
.rs-hero{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:18px 20px; border-radius:18px; background:linear-gradient(135deg,#f8fbff,#eef4ff);
  border:1px solid rgba(11,59,143,0.08); box-shadow:0 12px 30px rgba(15,23,42,0.08);
}
.rs-hero-actions{ display:flex; align-items:center; gap:10px; }
.rs-feedback{ min-height:20px; font-weight:700; font-size:12px; }
.rs-feedback.success{ color:#065f46; }
.rs-feedback.error{ color:#b91c1c; }

.rs-summary-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.rs-mini-card{ background:#fff; border:1px solid rgba(15,23,42,0.08); border-radius:16px; padding:16px; box-shadow:0 10px 26px rgba(15,23,42,0.06); }
.rs-mini-card .num{ font-size:26px; font-weight:900; color:#0b3b8f; line-height:1; }
.rs-mini-card .lbl{ margin-top:6px; font-size:12px; color:#64748b; font-weight:700; }

.rs-download-strip{ display:grid; grid-template-columns:minmax(220px,320px) minmax(320px,1fr); gap:14px; }
.rs-download-block{ background:#fff; border:1px solid rgba(15,23,42,0.08); border-radius:16px; padding:14px 16px; box-shadow:0 10px 26px rgba(15,23,42,0.05); }
.rs-download-block-wide{ min-width:0; }
.rs-control-label{ display:block; margin-bottom:8px; font-size:12px; font-weight:800; color:#475569; }
.rs-download-row{ display:flex; align-items:center; gap:10px; }
.rs-download-row select{ min-width:0; flex:1 1 auto; }

.rs-layout{ display:grid; grid-template-columns:minmax(280px,340px) minmax(0,1fr); gap:16px; align-items:start; }
.rs-panel{ background:#fff; border:1px solid rgba(15,23,42,0.08); border-radius:18px; padding:16px; box-shadow:0 16px 34px rgba(15,23,42,0.06); }
.rs-panel-wide{ min-width:0; }
.rs-panel-head{ margin-bottom:12px; }
.rs-panel-title{ font-size:14px; font-weight:900; color:#0f172a; letter-spacing:0.3px; }
.rs-panel-sub{ font-size:12px; color:#64748b; margin-top:4px; font-weight:600; }

.rs-roster-grid{ display:flex; flex-direction:column; gap:12px; max-height:calc(100vh - 330px); overflow:auto; padding-right:4px; }
.rs-roster-card{ width:100%; text-align:left; background:#fff; border:1px solid rgba(15,23,42,0.08); border-radius:16px; padding:14px; box-shadow:0 8px 20px rgba(15,23,42,0.05); transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.rs-roster-card:hover{ transform:translateY(-1px); box-shadow:0 12px 22px rgba(15,23,42,0.10); }
.rs-roster-card.active{ border-color:#0b5ed7; background:#eef5ff; box-shadow:0 14px 26px rgba(11,94,215,0.15); }
.rs-roster-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.rs-roster-title{ font-size:14px; font-weight:900; color:#0f172a; }
.rs-roster-sub{ font-size:11px; color:#64748b; font-weight:700; margin-top:4px; }
.rs-roster-meta, .rs-roster-foot{ margin-top:10px; display:flex; flex-wrap:wrap; gap:8px 12px; color:#64748b; font-size:11px; font-weight:700; }
.rs-badge{ display:inline-flex; align-items:center; justify-content:center; padding:6px 10px; border-radius:999px; background:#eff6ff; color:#0b5ed7; font-size:11px; font-weight:900; }
.rs-badge.alt{ background:#e8f0ff; color:#0b3b8f; }

.rs-detail-card{ min-height:320px; }
.rs-detail-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.rs-detail-title{ font-size:18px; font-weight:900; color:#0f172a; }
.rs-detail-sub{ margin-top:4px; font-size:12px; color:#64748b; font-weight:700; }
.rs-detail-actions{ display:flex; flex-wrap:wrap; gap:8px; }
.rs-detail-toolbar{ margin-bottom:12px; display:flex; justify-content:flex-start; }

.rs-roster-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.rs-delete-btn{ padding:6px 10px; font-size:11px; }
.rs-detail-toolbar{ gap:10px; align-items:center; flex-wrap:wrap; }
.rs-section-card{ margin-bottom:16px; border:1px solid rgba(15,23,42,0.06); border-radius:16px; padding:12px; background:#f8fbff; }
.rs-section-title{ font-size:12px; font-weight:900; color:#0f172a; margin-bottom:8px; letter-spacing:0.3px; }
.rs-table tbody tr{ cursor:move; }
.rs-row-dragging td{ opacity:0.45; }
.rs-row-drop-target td{ outline:2px solid #0b5ed7; outline-offset:-2px; }
.rs-token{ font-weight:900; text-align:center !important; }
.rs-token-off{ background:#000 !important; color:#fff !important; }
.rs-token-day{ background:#d9ead3 !important; color:#215e21 !important; }
.rs-token-night{ background:#f4cccc !important; color:#7f0000 !important; }
.rs-token-rd{ background:#fff2cc !important; color:#7f6000 !important; }
.rs-token-rn{ background:#d9ead3 !important; color:#274e13 !important; }
.rs-token-idle{ background:#c00000 !important; color:#fff !important; }

.rs-search{ max-width:460px; }
.rs-table-wrap{ position:relative; max-height:calc(100vh - 320px); overflow:auto; border:1px solid rgba(15,23,42,0.08); border-radius:16px; }
.rs-table{ min-width:100%; width:max-content; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.rs-table-sized th,.rs-table-sized td{ white-space:normal; word-break:break-word; }
.rs-table thead th{ position:sticky; top:0; z-index:3; background:#e10600; color:#fff; font-weight:900; font-size:12px; letter-spacing:.2px; white-space:nowrap; padding:12px 14px; border-right:1px solid rgba(255,255,255,0.12); border-bottom:1px solid rgba(15,23,42,0.08); }
.rs-table thead th:last-child{ border-right:none; }
.rs-table tbody td{ background:#fff; padding:10px 12px; border-right:1px solid #eef2f7; border-bottom:1px solid #eef2f7; font-size:12px; color:#0f172a; }
.rs-table tbody tr:nth-child(even) td{ background:#fcfdff; }
.rs-table tbody td:last-child{ border-right:none; }
.rs-col-resizer{ position:absolute; top:0; right:-2px; width:8px; height:100%; cursor:col-resize; user-select:none; z-index:6; }
.rs-col-resizer::after{ content:''; position:absolute; top:18%; right:3px; width:2px; height:64%; border-radius:999px; background:rgba(255,255,255,0.55); }
.rs-empty{ padding:24px; border:1px dashed rgba(148,163,184,0.45); border-radius:16px; text-align:center; color:#64748b; font-weight:700; background:#fbfdff; }

@media (max-width: 1180px){
  .rs-download-strip{ grid-template-columns:1fr; }
}

@media (max-width: 980px){
  .rs-layout{ grid-template-columns:1fr; }
  .rs-hero{ flex-direction:column; }
  .rs-download-row{ flex-direction:column; align-items:stretch; }
}
/* ===== GLOBAL FRONTEND TABLE COLUMN RESIZE ===== */
.data-table.g-col-resizable-table{
  min-width:100%;
  width:max-content;
  table-layout:fixed !important;
}
.data-table.g-col-resizable-table th,
.data-table.g-col-resizable-table td{
  position:relative;
}
.g-col-resizer{
  position:absolute;
  top:0;
  right:-2px;
  width:8px;
  height:100%;
  cursor:col-resize;
  user-select:none;
  z-index:5;
}
.g-col-resizer::after{
  content:'';
  position:absolute;
  top:18%;
  right:3px;
  width:2px;
  height:64%;
  border-radius:999px;
  background:rgba(15,23,42,0.22);
}
.data-table thead th:hover .g-col-resizer::after{
  background:rgba(225,6,0,0.55);
}




/* Generic frontend table column resize */
.data-table th{ position:relative; }
.frontend-col-resizer{ position:absolute; top:0; right:-2px; width:8px; height:100%; cursor:col-resize; user-select:none; z-index:6; }
.frontend-col-resizer::after{ content:""; position:absolute; top:18%; right:3px; width:2px; height:64%; border-radius:999px; background:rgba(255,255,255,0.58); }
.frontend-col-resizer:hover::after, .data-table th:hover .frontend-col-resizer::after{ background:rgba(220,38,38,0.9); }
.table-container, .rs-table-wrap{ overflow:auto; }
#clientUpdatesTable th .col-filter{ display:none !important; }

