@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
  --primary-color: #1d3557;
  --primary-light: #457b9d;
  --primary-dark: #0d1b2a;
  --accent-color: #ffd700;
  --accent-hover: #ffed4e;
  --success-color: #2e7d32;
  --danger-color: #d32f2f;
  --warning-color: #ff9800;
  --info-color: #2196f3;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-light: #f5f7fa;
  --bg-white: #ffffff;
  --text-dark: #1d3557;
  --text-light: #6c757d;
  --border-color: #e1e6ef;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PROFESSIONAL NOTIFICATION SYSTEM ===== */
.notification-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 12px;
  padding: 24px 32px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: all;
  animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--info-color);
}

.notification.success {
  border-left-color: var(--success-color);
}

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

.notification.warning {
  border-left-color: var(--warning-color);
}

.notification.info {
  border-left-color: var(--info-color);
}

.notification-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.notification.success .notification-icon {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success-color);
}

.notification.error .notification-icon {
  background: rgba(211, 47, 47, 0.1);
  color: var(--danger-color);
}

.notification.warning .notification-icon {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning-color);
}

.notification.info .notification-icon {
  background: rgba(33, 150, 243, 0.1);
  color: var(--info-color);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.notification-message {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

.notification-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes notificationSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

.notification.removing {
  animation: notificationSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
  background: var(--bg-light);
  margin: 0; 
  padding: 0; 
  min-height: 100vh; 
  overflow-y: auto; 
  scroll-behavior: smooth;
  color: var(--text-dark);
  line-height: 1.6;
}

body.login-active { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  min-height: 100vh;
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 50%, #ffd700 100%);
  position: relative;
  overflow: hidden;
}

/* Animated background for login */
body.login-active::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: linear-gradient(45deg, 
    rgba(29, 53, 87, 0.2) 0%, 
    rgba(69, 123, 157, 0.2) 33%,
    rgba(255, 215, 0, 0.2) 66%,
    rgba(29, 53, 87, 0.2) 100%);
  animation: gradientShift 20s ease infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-50px, -50px) rotate(180deg); }
}

html { scroll-behavior: smooth; }
/* ===== DASHBOARD LAYOUT ===== */
.wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 25px;
  box-sizing: border-box;
}

.dashboard { 
  background: var(--bg-white);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  border: 1px solid rgba(29, 53, 87, 0.08);
}

.dashboard:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

header { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f3f7;
}

header img { 
  height: 52px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
  transition: transform 0.3s ease;
}

header img:hover {
  transform: scale(1.05) rotate(2deg);
}

header h1 { 
  margin: 0; 
  color: var(--primary-color);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.row { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; align-items: end; }
/* ===== FORM INPUTS ===== */
select, input { 
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid #e1e6ef;
  font-size: 14px;
  background: #f8f9fa;
  color: var(--text-dark);
  text-align: center;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.1);
  transform: translateY(-1px);
}

select#companySelect, select#yearSelect, select#rfSelect,
select#reportAgencySelect, select#reportYearSelect, select#reportRFSelect { 
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: #fff;
  font-weight: 700;
  border: 2px solid var(--primary-dark);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.2);
  cursor: pointer;
}

/* Fix dropdown option colors */
select#companySelect option,
select#yearSelect option,
select#rfSelect option,
select#reportAgencySelect option,
select#reportYearSelect option,
select#reportRFSelect option {
  background: #fffbea;
  color: #1d3557;
  font-weight: 600;
  padding: 8px;
}

select#companySelect option:hover,
select#yearSelect option:hover,
select#rfSelect option:hover,
select#reportAgencySelect option:hover,
select#reportYearSelect option:hover,
select#reportRFSelect option:hover {
  background: #ffd700;
  color: #1d3557;
}

select#companySelect:hover, select#yearSelect:hover, select#rfSelect:hover,
select#reportAgencySelect:hover, select#reportYearSelect:hover, select#reportRFSelect:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(29, 53, 87, 0.3);
}
/* ===== TABLE STYLES ===== */
table { 
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td { 
  border: 1px solid #e1e6ef;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

/* Allocation Dashboard Table Layout Fix - Scoped to .subtable only */
.subtable {
  table-layout: fixed;
  min-width: 1200px; /* Ensure minimum width for all columns to display */
}

.subtable th,
.subtable td {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Column widths for 5-column allocation tables (Software & Service) */
.subtable th:nth-child(1),
.subtable td:nth-child(1) {
  width: 20%;
  min-width: 180px;
}

/* Fix dropdown/select fields in DESCRIPTION column to stay within bounds */
.subtable td:nth-child(1) select,
.subtable td:nth-child(1) input[type="text"] {
  max-width: 100%;
  box-sizing: border-box;
}

.subtable th:nth-child(2),
.subtable td:nth-child(2) {
  width: 8%;
  min-width: 70px;
  text-align: center;
}

/* Fix input fields in QUANTITY column to stay within bounds */
.subtable td:nth-child(2) input {
  max-width: 100%;
  box-sizing: border-box;
}

.subtable th:nth-child(3),
.subtable td:nth-child(3) {
  width: 10%;
  min-width: 90px;
  text-align: right;
}

.subtable th:nth-child(4),
.subtable td:nth-child(4) {
  width: 12%;
  min-width: 100px;
  text-align: right;
}

.subtable th:nth-child(5),
.subtable td:nth-child(5) {
  width: 50%;
  min-width: 350px;
}

/* Fix input fields in NOTES column to stay within bounds */
.subtable td:nth-child(5) input[type="text"],
.subtable td:nth-child(5) button {
  max-width: 100%;
  box-sizing: border-box;
}

/* Cloud Total Table ONLY - 8 columns (Cloud Provider, Budget, RF1-4 Actual, Variance, Notes) */
/* Override default subtable rules for cloudTable specifically */
#cloudTable {
  table-layout: fixed;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}

/* Reset subtable column widths for cloudTable */
#cloudTable th,
#cloudTable td {
  width: auto;
  min-width: 0;
  padding: 8px 4px;
  vertical-align: middle;
}

/* Cloud Total specific column widths */
#cloudTable th:nth-child(1),
#cloudTable td:nth-child(1) {
  width: 18% !important;
  min-width: 140px !important;
}

#cloudTable th:nth-child(2),
#cloudTable td:nth-child(2) {
  width: 11% !important;
  min-width: 90px !important;
  text-align: center !important;
}

#cloudTable th:nth-child(3),
#cloudTable th:nth-child(4),
#cloudTable th:nth-child(5),
#cloudTable th:nth-child(6),
#cloudTable td:nth-child(3),
#cloudTable td:nth-child(4),
#cloudTable td:nth-child(5),
#cloudTable td:nth-child(6) {
  width: 10% !important;
  min-width: 75px !important;
  text-align: right !important;
}

#cloudTable th:nth-child(3),
#cloudTable th:nth-child(4),
#cloudTable th:nth-child(5),
#cloudTable th:nth-child(6) {
  text-align: center !important;
}

#cloudTable th:nth-child(7),
#cloudTable td:nth-child(7) {
  width: 11% !important;
  min-width: 80px !important;
  text-align: right !important;
}

#cloudTable th:nth-child(8),
#cloudTable td:nth-child(8) {
  width: 20% !important;
  min-width: 150px !important;
}

#cloudTable td:nth-child(2) input,
#cloudTable td:nth-child(8) input {
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure parent td doesn't constrain cloudTable */
#cloudDetails > td {
  padding: 8px !important;
  overflow-x: visible !important;
}

/* Cloud monthly input fields - over budget styling */
input.cloud-month-input {
  box-sizing: border-box;
  text-align: right;
  transition: all 0.2s ease;
}

/* Red highlight for over-budget actuals - contained within input box */
input.cloud-month-input.over-budget {
  background-color: #d32f2f !important;
  color: #ffffff !important;
  font-weight: bold !important;
  border: 2px solid #b71c1c !important;
  box-shadow: none !important;
}

th { 
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

th .toggle {
  float: right;
  margin-left: 0;
  margin-top: -2px;
}

tr {
  transition: var(--transition);
}

tr:nth-child(even) { 
  background: #f8f9fa;
}

tr:hover {
  background: #e3f2fd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
td[contenteditable="true"]{ background:#fffbea; min-height:20px; outline:none; border:1px solid transparent; }
td[contenteditable="true"]:focus{ background:#fff8cc; border:1px solid #ffd700; }

/* Allocation Dashboard - Enable horizontal scroll for nested subtables */
tr.hidden td[colspan="2"] {
  overflow-x: auto;
  display: block;
}

.subtable th { background:#457b9d; color:#fff; }
.toggle { 
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  font-weight: 600;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  display: inline-block;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
  border: 1px solid #1565c0;
  vertical-align: top;
  line-height: 1.2;
}

.allocation-id-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: top;
  font-family: monospace;
  letter-spacing: 0.02em;
}
.allocation-id-badge:empty { display: none; }

/* Admin-only editable Allocation ID field — same visual language as the
   read-only badge above, just interactive. index.html's inline <style>
   block (loaded AFTER this file) has ".dashboard input[type=\"text\"]" at
   higher specificity than a plain class selector here — same fight
   .ats-lock-select had with ".dashboard select" — so these use !important
   rather than trying to out-rank that selector. */
input.allocation-id-input {
  display: inline-block !important;
  width: 64px !important;
  margin-left: 6px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  background: #f1f5f9 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  vertical-align: top;
  font-family: monospace !important;
  letter-spacing: 0.02em;
  text-align: center !important;
  box-shadow: none !important;
  transform: none !important;
}
input.allocation-id-input:hover { border-color: #cbd5e1 !important; }
input.allocation-id-input:focus {
  outline: none !important;
  border-color: #1d3557 !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(29,53,87,0.12) !important;
}

.toggle:hover {
  background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(33, 150, 243, 0.4);
}
.controls { display:flex; gap:8px; justify-content:center; margin-top:12px; flex-wrap:wrap; }
/* ===== BUTTON STYLES ===== */
button { 
  cursor: pointer;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

button:hover::after {
  width: 200px;
  height: 200px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
}

button.secondary { 
  background: #6c757d;
  box-shadow: 0 2px 6px rgba(108, 117, 125, 0.2);
}

button.secondary:hover {
  background: #5a6268;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

button.success { 
  background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

button.success:hover {
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.4);
}

button.danger { 
  background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

button.danger:hover {
  box-shadow: 0 4px 16px rgba(211, 47, 47, 0.4);
}

button.warning { 
  background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
  color: #000;
}

button.warning:hover {
  box-shadow: 0 4px 16px rgba(255, 152, 0, 0.4);
}

button.info { 
  background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

button.info:hover {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
}

button:disabled { 
  background: #dee2e6;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

button:disabled:hover {
  transform: none;
  box-shadow: none;
}
#saveMsg, #rateCardMsg { display:none; color:green; font-weight:700; margin-top:6px; text-align:center; }
#timestamp { margin-top:6px; font-size:13px; color:#666; text-align:center; }
.small { font-size:13px; color:#444; }
.numberonly { ime-mode:disabled; }
.textonly { ime-mode:disabled; }
/* Fix for contenteditable fields */
[contenteditable="true"] {
  background: linear-gradient(135deg, #fffbea 0%, #fff8e1 100%);
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #ffd700;
  min-height: 20px;
  outline: none;
  font-weight: 600;
  color: #1d3557;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

[contenteditable="true"]:focus {
  background: linear-gradient(135deg, #fff8cc 0%, #ffeb3b 100%);
  border-color: #ffc107;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3), 0 0 0 4px rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

[contenteditable="true"]:hover {
  border-color: #ffc107;
  box-shadow: 0 3px 12px rgba(255, 215, 0, 0.2);
}
/* Rate Card Section */
.ratecard { 
  margin-top: 24px;
  padding: 28px;
  border-radius: 12px;
  border: 2px solid #e1e6ef;
  background: linear-gradient(135deg, #fbfdff 0%, #f0f7ff 100%);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.ratecard:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.ratecard h3 { 
  margin: 0 0 20px 0;
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  position: relative;
}

.ratecard h3::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 80px;
  height: 3px;
  background: var(--accent-color);
}
.ratecard table { width:100%; }
.ratecard th { background:#2a6f86; }
.ratecard input { width:100px; padding:4px; font-size:14px !important; }
.hidden { display:none; }

/* Adjust Book comment — shown next to a line item's total only when that
   line item actually has an active book adjustment (see renderAdjustBookNotes
   in app.js); editable in place rather than only inside the Adjust Book modal. */
.adjust-book-note-input { margin-left:10px; width:360px; max-width:50%; padding:5px 9px; font-size:13px; border:1px solid #cbd5e1; border-radius:5px; color:#475569; vertical-align:middle; }
.adjust-book-note-input:focus { outline:none; border-color:#1F4E79; box-shadow:0 0 0 2px rgba(31,78,121,0.15); }
.adjust-book-note-input:disabled { background:#f1f5f9; color:#94a3b8; cursor:not-allowed; }

/* ===== RATE CARD PANEL (SIDEBAR LAYOUT) ===== */
.ratecard-panel {
  display: flex;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 700px;
  margin-top: 20px;
}

.ratecard-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1d3557 0%, #2a506f 100%);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 16px 0 0 16px;
}

.ratecard-sidebar-title {
  padding: 0 24px 20px 24px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  margin-bottom: 12px;
}

.ratecard-menu-item {
  padding: 14px 24px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 15px;
  border-left: 4px solid transparent;
  user-select: none;
}

.ratecard-menu-item:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: rgba(255,255,255,0.5);
  transform: translateX(2px);
}

.ratecard-menu-item.active {
  background: rgba(255,255,255,0.2);
  color: white;
  border-left-color: var(--accent-color);
  font-weight: 600;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.ratecard-menu-item span:first-child {
  font-size: 20px;
}

.ratecard-content {
  flex: 1;
  padding: 30px;
  background: #ffffff;
  overflow-y: auto;
}

/* Rate card table styling */
#rateCardTable {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#rateCardTable thead th {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  color: white;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#rateCardTable tbody tr {
  border-bottom: 1px solid #e1e6ef;
  transition: background-color 0.2s ease;
}

#rateCardTable tbody tr:hover {
  background-color: #f8f9fa;
}

#rateCardTable tbody td {
  padding: 14px 16px;
  color: #1d3557;
}

/* Legacy ratecard styles - kept for backward compatibility */
.report-section { margin-top:24px; padding:16px; border:1px solid #e1e6ef; border-radius:8px; background:#fafbfc; }
.report-table { font-size:13px; }
.report-table th { background:#555; }
/* overflow:visible at THIS specificity is required for the Leadership
   Report's sortable sticky header (app.js renderLeadershipReportTable) to
   actually stick to the page's own scroll. The generic "table {
   overflow:hidden }" rule above AND index.html's inline ".dashboard
   .tab-content table { overflow:hidden }" both make every <table> a
   non-scrolling overflow container by default, which silently becomes
   position:sticky's inert containing block for any sticky thead th inside
   it — same root cause already documented for .ctu-table below. An ID
   selector beats both outright regardless of their class counts. */
#leadershipReportTableContainer table { overflow: visible; }
.total-row { font-weight:bold; background:#e3f2fd !important; }
.grand-total-row { font-weight:bold; background:#1d3557 !important; color:white; }
.editable-rate { border:1px dashed #ccc; padding:2px 4px; border-radius:3px; font-size:14px !important; }
.view-only-rate { border:none; background:transparent; padding:2px 4px; font-size:14px !important; color:#333; }

/* Airtable Allocations table — mirrors the D-CORE IT [AL YYYY] "ALLOCATIONS" sheet colors exactly */
.airtable-sheet-table { border-collapse:separate; border-spacing:0; font-family:Arial, "Arial Narrow", sans-serif; font-size:10px; white-space:nowrap; }
/* box-sizing:border-box on BOTH th and td — a later rule sets border-box on
   thead th only (for header-height purposes), and td stayed content-box by
   default; that mismatch meant the same declared nth-child width rendered
   ~14px narrower on th than on td, so the header-only table (all th) and
   body-only table (all td) no longer agreed on column widths once they
   became separate <table> elements. */
.airtable-sheet-table th, .airtable-sheet-table td { border:1px solid #c9d3e0; line-height:1.3; box-sizing:border-box; }
/* padding:2px 6px !important at THIS specificity is required — index.html's
   inline ".dashboard .tab-content table td { padding:10px 14px !important }"
   rule otherwise wins (same recurring issue fixed for .ctu-table above): the
   extra ~16px of padding per cell was enough to push table-layout:fixed's
   column math past the table's own declared width, inflating the frozen
   table by ~150px and breaking its alignment with the header-only table
   sitting next to it. */
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th,
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table td { padding:2px 6px !important; }
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table thead th { padding:1px 6px !important; line-height:1.1 !important; }
.airtable-sheet-table thead th { color:#fff; font-weight:600; font-size:9px; text-align:left; vertical-align:bottom; white-space:normal; }
.ats-col-id     { background:#1F3864; }
.ats-col-desc   { background:#1F3864; }
.ats-col-client { background:#1F3864; }
.ats-col-meta   { background:#7a7a7a; }
.ats-col-month  { background:#4a6178; text-align:right; }
.ats-col-qtotal { background:#4a7182; text-align:right; }
.airtable-sheet-table tbody td.ats-data-meta  { background:#EAF2FC; }
.airtable-sheet-table tbody td.ats-data-month { background:#EAF2FC; text-align:right; color:#3a3a3a; }
.airtable-sheet-table tbody td.ats-data-qtotal{ background:#DCE8B8; text-align:right; font-weight:600; color:#3a3a3a; }
.airtable-sheet-table tbody tr.ats-appended-row td.ats-data-meta,
.airtable-sheet-table tbody tr.ats-appended-row td.ats-data-month { background:#FFF7DC; }
.airtable-sheet-table tbody tr:hover td:not(.ats-data-qtotal) { filter:brightness(0.97); }
.ats-status-dot { font-size:13px; cursor:help; }

/* Month lock status bar — mirrors the source workbook's CLOSED/OPEN row.
   User-editable per-month OPEN/CLOSED dropdown (saved via
   /api/airtable/month-status). Selector specificity must match/beat the
   general thead-th padding rule above (both use !important) or that rule
   wins and this padding is ignored. */
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table thead tr.ats-lock-row th { padding:2px 2px !important; line-height:1.1 !important; }
.ats-lock-row th { font-size:9px; letter-spacing:.03em; text-align:center; vertical-align:middle; }
/* index.html's ".dashboard .tab-content table th" rule (background/color,
   both !important) has higher specificity than a plain 2-class selector and
   silently wins — same fight already documented above for padding. Matching
   that rule's proven higher-specificity pattern here too. */
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th.ats-col-lock.ats-lock-closed { background:#c0392b !important; color:#fff !important; }
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th.ats-col-lock.ats-lock-open   { background:#1e8449 !important; color:#fff !important; }
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th.ats-col-lock.ats-lock-blank  { background:transparent !important; border:none !important; }
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th.ats-col-lock-spacer          { background:transparent !important; border:none !important; }
.ats-sheet-wrap table.airtable-sheet-table.airtable-sheet-table th.ats-col-lock-qtotal          { background:#2f5f8a !important; color:#fff !important; text-align:right !important; }
/* The OPEN/CLOSED <select> itself blends into its th's colored background
   (set by .ats-lock-closed/.ats-lock-open above) rather than looking like a
   separate control. */
/* .dashboard select (index.html) sets border/background/color at the same
   (class, type) specificity — "select.ats-lock-select" ties that specificity
   and wins on source order (this stylesheet loads after index.html's inline
   <style> block) instead of losing to it as a bare ".ats-lock-select" would. */
select.ats-lock-select {
  background:transparent !important; color:#fff; border:none !important; font:inherit; font-weight:700;
  text-align:center; text-align-last:center; width:100%; cursor:pointer; appearance:none;
  -webkit-appearance:none; -moz-appearance:none; box-shadow:none !important; padding:2px !important;
}
select.ats-lock-select:focus { outline:1px solid rgba(255,255,255,0.7); box-shadow:none !important; background:transparent !important; }
.ats-lock-select option { color:#000; }

/* Locked columns: .ats-frozen-wrap is the ONE real vertical scroll container
   (holds only the frozen table). .ats-scroll-x is an independent sibling —
   NOT nested inside .ats-frozen-wrap — height-capped with overflow-y:hidden
   so its horizontal scrollbar sits at the bottom of the visible viewport
   rather than the bottom of the full ~4000px content (which made it
   unreachable without first scrolling all the way down). Its vertical
   position is pushed in via scrollTop synced from .ats-frozen-wrap's real
   scroll (see loadAirtablePreview in app.js). Keeping it OUTSIDE the
   scrolling container is required: nesting it inside would double-shift its
   content (once from the real scroll moving the div, once from the synced
   scrollTop).

   The header row is pinned above the scrolling body in its own fixed bar
   (.ats-head-row), same technique as Cloud TrueUp — position:sticky on the
   <th> elements doesn't work here (see the comment in loadAirtablePreview,
   app.js), so a separate always-visible header bar is used instead.
   .ats-scroll-x-head's scrollLeft is kept in sync with the body's via a
   listener in loadAirtablePreview. */
.ats-sheet-wrap { border:1px solid #c9d3e0; border-radius:4px; overflow:hidden; }
.ats-head-row { display:flex; }
.ats-scroll-x-head { overflow:hidden; flex:1; }
.ats-scroll-x-head table { width:max-content; }
.ats-dual-scroll { display:flex; border-top:1px solid #c9d3e0; }
.ats-frozen-wrap { flex-shrink:0; max-height:640px; overflow-y:auto; border-right:2px solid #94a3b8; }
/* Widths sized to the ~90th percentile length of the actual dataset (not
   the single longest outlier — sizing for one 55-character Client name
   blew the frozen area out to 940px, leaving almost no room for the
   scrollable month columns next to it and making the whole sheet feel
   cramped/misaligned). The rare row longer than this still gets a title
   tooltip with the full text instead of being cut off silently. */
.ats-frozen-table { table-layout:fixed; width:540px; }
.ats-frozen-table th:nth-child(1), .ats-frozen-table td:nth-child(1) { width:80px;  min-width:80px;  max-width:80px;  overflow:hidden; text-overflow:ellipsis; }
.ats-frozen-table th:nth-child(2), .ats-frozen-table td:nth-child(2) { width:240px; min-width:240px; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ats-frozen-table th:nth-child(3), .ats-frozen-table td:nth-child(3) { width:220px; min-width:220px; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ats-frozen-table tbody td:nth-child(2), .ats-frozen-table tbody td:nth-child(3) { white-space:nowrap; }
.ats-scroll-x { overflow-x:auto; overflow-y:hidden; flex:1; max-height:638px; }
.ats-scroll-x table { width:max-content; }
/* Both tables' header rows need matching height so tbody rows on either
   side don't drift out of alignment. All header text here is forced
   single-line (nowrap + ellipsis, see .ats-frozen-table rules above), so
   there's no wrapping to accommodate — a small fixed height is enough. */
.ats-head-row thead tr:not(.ats-lock-row) th { height:22px; box-sizing:border-box; vertical-align:bottom; }
.ats-head-row thead tr.ats-lock-row th { height:auto; box-sizing:border-box; }

/* Sheet-style summary header bar — mirrors the ALLOCATIONS sheet's top rows */
.ats-sheet-header { display:flex; align-items:stretch; gap:0; font-family:Arial, "Arial Narrow", sans-serif; margin-bottom:12px; border:1px solid #c9d3e0; overflow:hidden; border-radius:4px; }
.ats-header-left { background:#f5a623; color:#1a1a1a; padding:8px 14px; min-width:130px; display:flex; flex-direction:column; justify-content:center; }
.ats-header-title { font-weight:700; font-size:13px; }
.ats-header-period { font-size:10px; margin-top:2px; color:#3a3a3a; }
.ats-header-counters { display:flex; background:#fff; }
.ats-counter { padding:6px 14px; text-align:center; border-right:1px solid #e2e8f0; display:flex; flex-direction:column; justify-content:center; }
.ats-counter-value { font-size:16px; font-weight:700; color:#1a1a1a; }
.ats-counter-label { font-size:8px; color:#8a8a8a; letter-spacing:.5px; }
.ats-header-legend { flex:1; background:#2b3a4a; color:#fff; font-size:9px; display:flex; align-items:center; gap:10px; padding:6px 12px; flex-wrap:wrap; }
.ats-header-right { display:flex; align-items:center; }
.ats-rf-badge { background:#1f3864; color:#fff; font-size:11px; font-weight:600; padding:8px 14px; height:100%; display:flex; align-items:center; }
.ats-total-badge { background:#2e7d32; color:#fff; font-size:14px; font-weight:700; padding:8px 16px; height:100%; display:flex; align-items:center; }

/* ===== Cloud TrueUp — replica of "2026 Cloud Spend True-Up and Allocation
   Updates.xlsx" (colors/layout pulled directly from the source workbook) ===== */
.ctu-title-band { background:#D6E3F8; color:#1F4E79; font-weight:700; font-size:15px; padding:12px 16px; border:1px solid #c9d3e0; border-bottom:none; border-radius:8px 8px 0 0; font-family:'Inter', sans-serif; letter-spacing:-0.01em; }
.ctu-subtitle-band { font-size:11.5px; color:#64748b; padding:6px 16px; border:1px solid #c9d3e0; border-top:none; border-bottom:none; font-family:'Inter', sans-serif; }

/* No max-height/overflow here anymore — see the .ctu-frozen-wrap comment
   below for why this used to be its own internal scroll region and isn't
   one any more. */
.ctu-table-wrap { border:1px solid #c9d3e0; border-radius:0 0 8px 8px; box-shadow:0 1px 3px rgba(15,23,42,0.04); }
.ctu-table { border-collapse:separate; border-spacing:0; table-layout:fixed; font-family:'Inter', -apple-system, sans-serif; font-size:12.5px; width:max-content; min-width:100%; }
/* overflow:visible at THIS specificity is required — both the generic
   "table { overflow:hidden }" rule in this file AND index.html's inline
   ".dashboard .tab-content table { overflow:hidden }" (specificity 0,2,1,
   beats a plain ".ctu-table" class alone) make every <table> element a
   non-scrolling overflow container by default, which silently becomes
   position:sticky's inert containing block for any sticky thead th inside
   it (same root cause documented above for .ctu-sheet-wrap) — breaking
   Microsoft EA Renewal's plain single-table sticky header before it ever
   worked. This selector deliberately reaches (0,3,0) to clear that bar. */
.ctu-sheet-wrap .ctu-table.ctu-table { overflow:visible; }
.ctu-table th, .ctu-table td { border-right:1px solid #e6ebf2; border-bottom:1px solid #e6ebf2; overflow:hidden; line-height:0; }
/* padding:0 !important at THIS specificity is required — index.html's inline
   ".dashboard .tab-content table td { padding:10px 14px !important }" rule
   has specificity (0,2,2) and loads after this file, so both a plain
   ".ctu-table td" AND an !important-only override still lose the cascade
   (specificity is compared before source order even within the !important
   tier). This selector deliberately reaches (0,3,2) to clear that bar.
   Scoped to .ctu-sheet-wrap (not just .ctu-table-wrap) so it also covers the
   separate fixed header-bar tables, which live outside .ctu-table-wrap. */
.ctu-sheet-wrap table.ctu-table.ctu-table th,
.ctu-sheet-wrap table.ctu-table.ctu-table td { padding:0 !important; }
.ctu-table thead th { text-align:center; vertical-align:middle; white-space:normal; font-size:11px; font-weight:600; letter-spacing:0.01em; padding:9px 8px; line-height:1.35; box-shadow:0 1px 0 rgba(0,0,0,0.05); }
.ctu-table .ctu-group-nav { background:#1F4E79; color:#fff; }
.ctu-table .ctu-group-summary { background:#2E75B6; color:#fff; }
.ctu-table .ctu-summary-h { background:#2E75B6; color:#fff; }
.ctu-table thead tr:first-child th.ctu-group-nav[colspan] { background:#1F4E79; }
.ctu-table thead tr:nth-child(2) th:not(.ctu-summary-h) { background:#28527D; }

.ctu-table tbody tr { height:38px; }
.ctu-table tbody tr:hover td { background-color:#f4f7fb; }
.ctu-table tbody tr:hover td.ctu-projected { background-color:#e6ecfb; }
.ctu-table tbody td.ctu-agency { font-weight:600; text-align:left; color:#0f172a; }
.ctu-table tbody td.ctu-num { text-align:right; font-variant-numeric:tabular-nums; vertical-align:middle; padding:8px 12px; line-height:1.4; }
/* Auto-calculated (projected) months — a distinct blue/lavender tint plus
   italic text so they read as "the system computed this", separate from
   real user-entered figures and from the green "summary" formula columns. */
.ctu-table tbody td.ctu-num.ctu-projected { background:#EEF2FC; }
.ctu-table tbody td.ctu-num.ctu-projected input.ctu-input { color:#4C5FAA; font-style:italic; }
.ctu-table tbody td.ctu-summary { font-weight:600; background:#f8fafc; }
/* True-Up Owed: positive = agency used MORE than its allocation (owed to
   Stagwell) = light red; negative = used LESS than allocated = green. */
.ctu-table tbody td.ctu-num.ctu-trueup-over { background:#FCEAEA; }
.ctu-table tbody td.ctu-num.ctu-trueup-over input.ctu-input { color:#B42318; font-weight:700; }
.ctu-table tbody td.ctu-num.ctu-trueup-under { background:#E6F6EC; }
.ctu-table tbody td.ctu-num.ctu-trueup-under input.ctu-input { color:#0F7A3D; font-weight:700; }
.ctu-table tbody td.ctu-comment { color:#64748b; text-align:left; }
.ctu-table tbody tr.ctu-zebra td:not(.ctu-summary):not(.ctu-comment):not(:hover) { background:#FAFBFD; }

/* Insert/delete-row controls — hidden until the row is hovered so the sheet
   doesn't look cluttered with icons when just reading figures. */
.ctu-table.ctu-table tbody td.ctu-row-actions { text-align:center; padding:0; vertical-align:middle; }
.ctu-row-btn { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; padding:0; box-sizing:border-box; margin:0 1px; border:none; border-radius:4px; background:#e2e8f0; color:#475569; font-size:13px; line-height:1; cursor:pointer; opacity:0; transition:opacity 0.1s; vertical-align:middle; box-shadow:none; }
.ctu-table tbody tr:hover .ctu-row-btn { opacity:1; }
.ctu-row-btn:hover { background:#1F4E79; color:#fff; }
.ctu-row-btn-del:hover { background:#dc2626; color:#fff; }

/* Editable cell inputs — every figure is a live input, styled to read as
   a normal cell at rest and only reveal itself as "editable" on hover/focus
   so a fully-editable grid doesn't look like a messy form. */
/* Selectors here are deliberately over-specific (repeating .ctu-table) to
   beat index.html's inline ".dashboard input[type=...]" rule, which has the
   same specificity and loads after this file, so it would otherwise win the
   cascade tie and silently reimpose the generic 8px/12px input padding. */
/* Fixed px height (not %) on every editable box — a native <select>'s
   intrinsic height differs slightly from <input> across browsers even with
   box-sizing:border-box, which otherwise makes the frozen Agency table's
   rows a fraction of a pixel taller than the scrolling table's rows and
   drifts them out of alignment by the bottom of a long list. */
/* display:block (not the default inline-block) matters here — an
   inline-level replaced element like <select> sits inside the td's
   inline-formatting context and picks up "half-leading" from the td's
   inherited line-height, inflating the row a few px taller than a plain
   <input>-only row and drifting the frozen/scroll tables apart. */
.ctu-table.ctu-table .ctu-input { display:block; width:100%; height:36px; border:1px solid transparent; background:transparent; font:inherit; font-size:12.5px; font-variant-numeric:tabular-nums; text-align:right; padding:0 6px; box-sizing:border-box; color:inherit; box-shadow:none; border-radius:0; }
.ctu-table.ctu-table .ctu-input.ctu-input-text { text-align:left; font-weight:inherit; }
.ctu-table.ctu-table .ctu-input:hover { border-color:#c3d3e8; background:#fff; }
.ctu-table.ctu-table .ctu-input:focus { border-color:#1F4E79; background:#fff; outline:none; box-shadow:inset 0 0 0 1px #1F4E79; position:relative; z-index:1; }
.ctu-table.ctu-table .ctu-input.ctu-input-dirty { background:#FFFAE0; }
.ctu-table.ctu-table .ctu-input.ctu-input-dirty:focus { background:#fff; }
.ctu-table.ctu-table .ctu-input::placeholder { color:#cbd5e1; }
.ctu-table.ctu-table td.ctu-agency .ctu-input,
.ctu-table.ctu-table td.ctu-comment .ctu-input { padding:0 12px; }
/* Specificity here (.ctu-table.ctu-table + select + 2 classes) must beat the
   generic ".ctu-table.ctu-table .ctu-input { text-align:right }" rule above,
   or the tie is broken by source order and the dropdown ends up right-aligned. */
.ctu-table.ctu-table select.ctu-input.ctu-input-select { cursor:pointer; text-align:left; -webkit-appearance:none; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:22px !important; }
.ctu-table.ctu-table select.ctu-input.ctu-input-select option[value=""] { color:#94a3b8; }

/* Locked Agency/Service columns via two side-by-side tables. There is now
   only ONE vertical scrollbar for this whole widget — the page's own —
   since .ctu-head-row is sticky (below) and both .ctu-frozen-wrap and
   .ctu-scroll-x are plain, uncapped, normal-flow elements that simply grow
   to their full content height and scroll along with the page in natural
   lockstep (no JS scrollTop syncing needed for the vertical axis at all).
   An earlier version capped both at a fixed height with their own internal
   scrollbar, which — once the sticky header fix (below) made the page's
   own scroll usable too — produced two competing vertical scrollbars for
   the same content. */
.ctu-dual-scroll { display:flex; overflow-x:hidden; }
.ctu-frozen-wrap { flex-shrink:0; border-right:2px solid #94a3b8; }
/* min-width:100% from the shared .ctu-table rule (needed so the scrolling
   table never shrinks below its container) would otherwise force this table
   to stretch too — min-width wins over width when larger, per spec. */
.ctu-frozen-table.ctu-frozen-table { min-width:0; width:230px; }
/* overflow-x:hidden (not auto) — this table has no scrollbar of its own.
   Horizontal scrolling instead happens via .ctu-scroll-x-head's scrollbar
   (below), which lives inside the sticky header so it's always reachable
   regardless of vertical scroll position; this element's scrollLeft is
   just pushed in from that via a listener in renderCloudTrueUp() (app.js). */
.ctu-scroll-x { overflow-x:hidden; flex:1; }
.ctu-scroll-x table { width:max-content; }

/* Header bar pinned above the scrolling body. Uses a separate always-visible
   bar (not position:sticky on the <th>s themselves) — see the comment in
   renderCloudTrueUpTotal (app.js) for why: sticky <th>s fail because an
   overflow-x:auto ancestor hijacks the containing block for anything
   INSIDE it. .ctu-head-row itself sits OUTSIDE that nested scroll context
   though (a sibling of .ctu-table-wrap, not a descendant of .ctu-scroll-x),
   so position:sticky works fine here — this keeps the header (and its
   horizontal scrollbar) pinned to the viewport regardless of how far the
   page has scrolled. */
/* overflow:hidden removed deliberately from .ctu-sheet-wrap — any ancestor
   with non-visible overflow becomes position:sticky's containing block,
   even if that ancestor itself never scrolls. Since this div never scrolls
   (the page does), leaving overflow:hidden here made .ctu-head-row's sticky
   position compute against a frame that never moves, so it never actually
   stuck to the viewport — it just moved in lockstep with this wrapper. The
   very minor cosmetic cost is the inner table's top corners no longer get
   clipped to match this wrapper's rounded border. */
.ctu-sheet-wrap { border:1px solid #c9d3e0; border-radius:8px; }
.ctu-sheet-wrap .ctu-table-wrap { border:none; border-radius:0; border-top:1px solid #c9d3e0; }
.ctu-head-row { display:flex; position:sticky; top:0; z-index:20; background:#fff; }
/* border-right must match .ctu-frozen-wrap's exactly (same width+color) or
   this ends up 2px narrower than the body's frozen column, shifting every
   header cell in .ctu-scroll-x-head out of alignment with its matching
   data column below. */
.ctu-head-frozen-wrap { flex-shrink:0; border-right:2px solid #94a3b8; }
.ctu-scroll-x-head { overflow-x:auto; overflow-y:hidden; flex:1; }
.ctu-scroll-x-head table { width:max-content; }
.ctu-head-row thead th, .ctu-dual-scroll thead th { height:60px; box-sizing:border-box; }

/* Version badge + history panel + modals (mirrors the allocation-versions
   UI pattern elsewhere in the dashboard, with ctu-prefixed ids/classes so
   the two version-control systems never collide on the same page). */
.ctu-version-badge { display:flex; align-items:center; gap:8px; background:#eef3fa; border:1px solid #c9d3e0; border-radius:20px; padding:4px 6px 4px 12px; font-size:12px; }
.ctu-version-badge #ctuVersionLabel { font-weight:700; color:#1F4E79; }
.ctu-version-badge #ctuVersionMeta { color:#64748b; }
.ctu-history-btn { background:#1F4E79; color:#fff; border:none; border-radius:16px; padding:5px 12px; font-size:12px; cursor:pointer; }
.ctu-history-btn:hover { background:#163a5c; }
.ctu-autosave-indicator { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:#059669; font-weight:600; background:#ecfdf5; border:1px solid #a7f3d0; border-radius:14px; padding:5px 12px; animation:ctuFadeIn 0.2s ease; }
@keyframes ctuFadeIn { from { opacity:0; transform:translateY(-2px); } to { opacity:1; transform:translateY(0); } }

.ctu-subtab-btn { background:none; border:none; border-bottom:2px solid transparent; padding:10px 4px; margin-bottom:-1px; font-size:14px; font-weight:600; color:#64748b; cursor:pointer; }
.ctu-subtab-btn:hover { color:#1F4E79; }
.ctu-subtab-btn.active { color:#1F4E79; border-bottom-color:#1F4E79; }

/* Year selectors on the Cloud Reconciliation sub-tabs — same navy-chevron
   look as the Leadership Report's .lr-select. */
#cloudTrueUp-tab #cloudTrueUpYear,
#cloudTrueUp-tab #ctuAnalysisYear,
#cloudTrueUp-tab #merakiYearSelect {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  height: 36px; min-width: 104px; margin: 0; padding: 0 40px 0 14px;
  font: 600 14px/1 'Inter', system-ui, sans-serif; color: #0f172a;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F4E79' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
                    linear-gradient(#eef4fb, #eef4fb);
  background-repeat: no-repeat, no-repeat;
  background-position: right 12px center, right 0 top 0;
  background-size: 12px 12px, 34px 100%;
  border: 1px solid #cbd5e1; border-radius: 9px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
#cloudTrueUp-tab #cloudTrueUpYear:hover,
#cloudTrueUp-tab #ctuAnalysisYear:hover,
#cloudTrueUp-tab #merakiYearSelect:hover { border-color: #1F4E79; }
#cloudTrueUp-tab #cloudTrueUpYear:focus,
#cloudTrueUp-tab #ctuAnalysisYear:focus,
#cloudTrueUp-tab #merakiYearSelect:focus {
  outline: none; border-color: #1F4E79; box-shadow: 0 0 0 3px rgba(31,78,121,.18);
}

.ctu-dollar-wrap { position:relative; display:block; width:100%; }
.ctu-dollar-prefix { position:absolute; left:6px; top:50%; transform:translateY(-50%); color:#666; font-size:inherit; pointer-events:none; }

/* Small note badge for a month cell that has a comment attached — click to
   view/edit it. Absolutely positioned in the cell's top-right corner
   (inside .ctu-dollar-wrap, which is position:relative) instead of taking
   up its own block of space below the input, so a cell with a note is
   exactly the same height as one without and every row stays aligned. */
/* Inset (not a negative offset) — the <td> itself is overflow:hidden, so
   anything positioned outside its box would be silently clipped/invisible. */
.ctu-cell-note-btn { position:absolute; top:1px; right:1px; width:13px; height:13px; line-height:13px; padding:0; border:none; border-radius:50%; background:#fff7ed; box-shadow:0 1px 2px rgba(0,0,0,0.25); cursor:pointer; font-size:8px; color:#b45309; z-index:2; }
.ctu-cell-note-btn:hover { background:#ffedd5; }

.ctu-kpi-row { display:flex; gap:14px; flex-wrap:wrap; }
.ctu-kpi-card { flex:1 1 200px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:14px 16px; }
.ctu-kpi-label { font-size:12px; color:#64748b; font-weight:600; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:6px; }
.ctu-kpi-value { font-size:22px; font-weight:700; }

.ctu-analysis-search { width:100%; max-width:360px; padding:9px 12px; border:1px solid #cbd5e1; border-radius:6px; font-size:14px; }
.ctu-analysis-search:focus { outline:none; border-color:#1F4E79; box-shadow:0 0 0 2px rgba(31,78,121,0.15); }

.ctu-analysis-chart-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:start; }
@media (max-width: 900px) { .ctu-analysis-chart-grid { grid-template-columns:1fr; } }

.ctu-analysis-table-card { border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; box-shadow:0 1px 3px rgba(15,37,64,0.06); background:#fff; }
.ctu-analysis-table-scroll { overflow-x:auto; overflow-y:auto; max-height:520px; }
.ctu-analysis-table { width:100%; border-collapse:collapse; font-size:13px; }
.ctu-analysis-th { position:sticky; top:0; z-index:1; background:#f1f5f9; color:#1F4E79; font-weight:700; font-size:11.5px; text-transform:uppercase; letter-spacing:0.03em; padding:11px 14px; border-bottom:2px solid #dbe3ec; cursor:pointer; user-select:none; white-space:nowrap; transition:background 0.15s ease; }
.ctu-analysis-th:hover { background:#e6edf5; }
.ctu-analysis-th-active { background:#e2eaf3; color:#0f2540; }
.ctu-analysis-sort-arrow { display:inline-block; margin-left:4px; font-size:9px; color:#1F4E79; }
.ctu-analysis-td { padding:9px 14px; border-bottom:1px solid #edf1f5; white-space:nowrap; font-size:13px; color:#334155; }
.ctu-analysis-table tbody tr { transition:background 0.12s ease; }
.ctu-analysis-table tbody tr:hover { background:#f5f8fc; }
.ctu-analysis-row-alt { background:#fafbfc; }
.ctu-analysis-row-alt:hover { background:#f5f8fc; }
.ctu-analysis-row-selected, .ctu-analysis-row-selected:hover { background:#e3f0ff; }
.ctu-analysis-row-selected td:first-child { box-shadow:inset 3px 0 0 #1F4E79; }
.ctu-analysis-table-footer { padding:8px 14px; font-size:11.5px; color:#94a3b8; background:#f8fafc; border-top:1px solid #edf1f5; }

.ctu-provider-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:11.5px; font-weight:700; letter-spacing:0.02em; }
.ctu-trueup-badge { display:inline-block; padding:3px 10px; border-radius:6px; font-weight:700; font-variant-numeric:tabular-nums; }

.ctu-version-panel { position:fixed; top:0; right:-440px; width:420px; height:100%; background:#fff; box-shadow:-4px 0 20px rgba(0,0,0,0.15); z-index:1001; transition:right 0.25s ease; display:flex; flex-direction:column; }
.ctu-version-panel.open { right:0; }
.ctu-version-panel-header { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid #e2e8f0; }
.ctu-version-panel-title { font-weight:700; font-size:15px; color:#1F4E79; }
.ctu-version-panel-subtitle { font-size:11px; color:#94a3b8; }
.ctu-panel-close { background:none; border:none; font-size:22px; cursor:pointer; color:#64748b; line-height:1; }
.ctu-version-panel-body { flex:1; overflow-y:auto; padding:14px 20px; }
.ctu-panel-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.3); z-index:1000; }
.ctu-panel-overlay.open { display:block; }

.ctu-version-card { border:1px solid #e2e8f0; border-radius:8px; padding:12px 14px; margin-bottom:10px; }
.ctu-version-card.current { border-color:#1F4E79; background:#f5f8fc; }
.ctu-version-card-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.ctu-version-card-label { font-weight:700; color:#1F4E79; }
.ctu-version-card-current-pill { font-size:10px; background:#1F4E79; color:#fff; padding:2px 8px; border-radius:10px; }
.ctu-version-card-meta { font-size:11px; color:#94a3b8; margin-bottom:6px; }
.ctu-version-card-summary { font-size:12px; color:#334155; margin-bottom:8px; }
.ctu-version-card-actions button { font-size:11px; padding:4px 10px; margin-right:6px; }

.ctu-version-diff { margin-top:10px; padding-top:10px; border-top:1px dashed #e2e8f0; font-size:12px; color:#334155; }
.ctu-diff-line { padding:3px 0; line-height:1.5; }
.ctu-diff-tag { display:inline-block; font-size:10px; font-weight:700; padding:1px 7px; border-radius:8px; margin-right:4px; }
.ctu-diff-tag-add { background:#f0fdf4; color:#16a34a; }
.ctu-diff-tag-remove { background:#fef2f2; color:#dc2626; }

.ctu-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:1100; align-items:center; justify-content:center; }
.ctu-modal-overlay.open { display:flex; }
.ctu-modal { background:#fff; border-radius:10px; padding:20px 24px; width:420px; max-width:90vw; box-shadow:0 10px 40px rgba(0,0,0,0.2); }
.ctu-modal h4 { margin:0 0 6px; color:#1F4E79; }

/* ===== C&C tab: sub-tab shell + Microsoft EA Renewal tracker =====
   Enterprise-style grid: neutral white rows, change type carried by a thin
   left accent bar + status pill (instead of full-row Excel fills), sticky
   header, KPI strip, search + segmented filter. Everything is scoped under
   .cnc-shell so the global button/select/input rules can't leak in. The
   Excel export keeps the workbook's original ADD/REMOVE/UNCHANGE fills. */
.cnc-shell { --msea-navy:#0f2540; --msea-blue:#1F4E79; --msea-border:#e3e8ef; --msea-muted:#64748b; --msea-add:#1d4ed8; --msea-add-bg:#eaf1ff; --msea-remove:#b42318; --msea-remove-bg:#fdecec; --msea-unchange:#0f7a3d; --msea-unchange-bg:#e7f6ed; font-family:'Inter', -apple-system, sans-serif; }

.report-section.cnc-shell { background:#fff; padding:20px 24px 24px; border-color:var(--msea-border); }
.cnc-subtab-bar { display:flex; gap:28px; border-bottom:1px solid var(--msea-border); margin:-4px 0 22px; }
.cnc-shell button.cnc-subtab-btn { background:none; border:none; border-bottom:2px solid transparent; border-radius:0; box-shadow:none; padding:12px 2px; margin:0 0 -1px; font-size:14px; font-weight:600; color:var(--msea-muted); cursor:pointer; transform:none; }
.cnc-shell button.cnc-subtab-btn:hover { color:var(--msea-blue); background:none; transform:none; box-shadow:none; }
.cnc-shell button.cnc-subtab-btn.active { color:var(--msea-blue); border-bottom-color:var(--msea-blue); }

.cnc-placeholder { border:1px dashed #cbd5e1; border-radius:10px; padding:56px 24px; text-align:center; background:#fafbfc; }
.cnc-placeholder-title { font-size:16px; font-weight:600; color:var(--msea-navy); }
.cnc-placeholder-text { font-size:13px; color:var(--msea-muted); margin-top:6px; }

.msea-header { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap; margin-bottom:18px; }
.msea-eyebrow { font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; color:var(--msea-blue); }
.cnc-shell h3.msea-heading { margin:4px 0 4px; font-size:22px; font-weight:700; color:var(--msea-navy); letter-spacing:-0.015em; }
.msea-subheading { margin:0; font-size:13px; color:var(--msea-muted); max-width:640px; }
.msea-header-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.msea-field-label { font-size:12px; color:var(--msea-muted); font-weight:500; }
.cnc-shell select.msea-year-select { height:34px; padding:0 30px 0 12px; border:1px solid #cbd5e1; border-radius:8px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 11px center; -webkit-appearance:none; appearance:none; font-size:13px; font-weight:600; color:var(--msea-navy); cursor:pointer; box-shadow:none; width:auto; min-width:0; margin:0; }
.msea-version { display:flex; align-items:center; gap:8px; height:34px; padding:0 4px 0 12px; border:1px solid var(--msea-border); border-radius:8px; background:#fff; font-size:12px; }
.msea-version-label { font-weight:700; color:var(--msea-blue); }
.msea-version-meta { color:var(--msea-muted); }

.msea-kpis { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:12px; margin-bottom:16px; }
.msea-kpi { background:#fff; border:1px solid var(--msea-border); border-radius:10px; padding:14px 16px; position:relative; overflow:hidden; }
.msea-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:#cbd5e1; }
.msea-kpi-add::before { background:var(--msea-add); }
.msea-kpi-remove::before { background:var(--msea-remove); }
.msea-kpi-ok::before { background:var(--msea-unchange); }
.msea-kpi-warn::before { background:#d97706; }
.msea-kpi-label { font-size:11px; font-weight:600; letter-spacing:0.04em; text-transform:uppercase; color:var(--msea-muted); }
.msea-kpi-value { font-size:24px; font-weight:700; color:var(--msea-navy); margin-top:6px; font-variant-numeric:tabular-nums; letter-spacing:-0.02em; }
.msea-kpi-add .msea-kpi-value { color:var(--msea-add); }
.msea-kpi-remove .msea-kpi-value { color:var(--msea-remove); }
.msea-kpi-warn .msea-kpi-value { color:#b45309; }
.msea-kpi-sub { font-size:12px; color:#94a3b8; margin-top:2px; }

.msea-card { background:#fff; border:1px solid var(--msea-border); border-radius:10px; box-shadow:0 1px 2px rgba(15,23,42,0.04); overflow:hidden; }
.msea-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 14px; border-bottom:1px solid var(--msea-border); background:#fbfcfd; }
.msea-search { display:flex; align-items:center; gap:8px; height:34px; padding:0 12px; width:320px; max-width:100%; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#94a3b8; }
.msea-search:focus-within { border-color:var(--msea-blue); box-shadow:0 0 0 3px rgba(31,78,121,0.12); }
.cnc-shell .msea-search input { flex:1; border:none; outline:none; box-shadow:none; background:transparent; padding:0; margin:0; height:100%; font-size:13px; color:var(--msea-navy); width:auto; min-width:0; }
.msea-seg { display:inline-flex; padding:3px; border-radius:8px; background:#eef2f6; gap:2px; }
.cnc-shell button.msea-seg-btn { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 12px; border:none; border-radius:6px; background:transparent; box-shadow:none; font-size:12.5px; font-weight:600; color:#475569; cursor:pointer; margin:0; transform:none; }
.cnc-shell button.msea-seg-btn:hover { color:var(--msea-navy); background:rgba(255,255,255,0.6); transform:none; box-shadow:none; }
.cnc-shell button.msea-seg-btn.active { background:#fff; color:var(--msea-navy); box-shadow:0 1px 2px rgba(15,23,42,0.12); }
.msea-seg-dot { width:7px; height:7px; border-radius:50%; background:#94a3b8; }
.msea-seg-all .msea-seg-dot { display:none; }
.msea-seg-add .msea-seg-dot { background:var(--msea-add); }
.msea-seg-remove .msea-seg-dot { background:var(--msea-remove); }
.msea-seg-unchange .msea-seg-dot { background:var(--msea-unchange); }
.msea-seg-count { font-size:11px; font-weight:600; color:var(--msea-muted); background:#e2e8f0; border-radius:10px; padding:1px 7px; }
.msea-seg-btn.active .msea-seg-count { background:#eef2f6; }

.msea-table-wrap { max-height:620px; overflow:auto; }
.cnc-shell .msea-table { table-layout:fixed; width:100%; min-width:960px; font-size:13px; }
.cnc-shell .msea-table th, .cnc-shell .msea-table td { border-left:none; border-right:none; border-bottom:1px solid #eef1f5; }
.cnc-shell .msea-table thead th { position:sticky; top:0; z-index:5; background:#f6f8fa; color:var(--msea-muted); font-size:11px; font-weight:600; letter-spacing:0.05em; text-transform:uppercase; text-align:left; padding:11px 12px; border-bottom:1px solid var(--msea-border); box-shadow:none; }
.cnc-shell .msea-table thead th.msea-th-num { text-align:right; padding-right:18px; }
.cnc-shell .msea-table thead th.msea-sortable { cursor:pointer; user-select:none; }
.cnc-shell .msea-table thead th.msea-sortable:hover, .cnc-shell .msea-table thead th.msea-sorted { color:var(--msea-blue); }
.msea-sort-icon { font-size:10px; margin-left:4px; opacity:0.7; }
.cnc-shell .msea-table tbody tr { height:44px; }
.cnc-shell .msea-table tbody td { vertical-align:middle; background:#fff; padding:0 4px; line-height:normal; }
.cnc-shell .msea-table tbody tr:hover td { background:#f7f9fc; }
/* Change-type accent: a 3px bar on the leading cell. */
.cnc-shell .msea-table tbody td.msea-actions { text-align:center; box-shadow:inset 3px 0 0 #cbd5e1; }
.cnc-shell .msea-table tbody tr.msea-row-add td.msea-actions { box-shadow:inset 3px 0 0 var(--msea-add); }
.cnc-shell .msea-table tbody tr.msea-row-remove td.msea-actions { box-shadow:inset 3px 0 0 var(--msea-remove); }
.cnc-shell .msea-table tbody tr.msea-row-unchange td.msea-actions { box-shadow:inset 3px 0 0 var(--msea-unchange); }
.cnc-shell .msea-table tbody tr:hover .ctu-row-btn { opacity:1; }
.cnc-shell .msea-table .ctu-input { height:34px; border-radius:6px; font-size:13px; padding:0 10px; }
.cnc-shell .msea-table td.msea-agency .ctu-input { font-weight:600; color:var(--msea-navy); }
.cnc-shell .msea-table td.msea-license .ctu-input { color:#334155; }
.cnc-shell .msea-table td.msea-unmatched select.ctu-input { color:#b45309; background-color:#fffaf0; }
/* Change type rendered as a status pill. */
.cnc-shell .msea-table td.msea-type select.ctu-input.ctu-input-select { display:inline-block; width:auto; min-width:118px; height:26px; border-radius:13px; font-size:11.5px; font-weight:700; letter-spacing:0.04em; padding:0 26px 0 12px !important; background-position:right 10px center; border:1px solid transparent; }
.cnc-shell .msea-table select.msea-changetype-add { color:var(--msea-add); background-color:var(--msea-add-bg); border-color:#c7d7fb; }
.cnc-shell .msea-table select.msea-changetype-remove { color:var(--msea-remove); background-color:var(--msea-remove-bg); border-color:#f6c9c6; }
.cnc-shell .msea-table select.msea-changetype-unchange { color:var(--msea-unchange); background-color:var(--msea-unchange-bg); border-color:#bfe5cc; }
.cnc-shell .msea-table td.msea-type { padding-left:10px; }
.cnc-shell .msea-table td.msea-qty .ctu-input { text-align:right; font-variant-numeric:tabular-nums; padding-right:14px; }
.cnc-shell .msea-table td.msea-qty-add .ctu-input { color:var(--msea-add); font-weight:600; }
.cnc-shell .msea-table td.msea-qty-remove .ctu-input { color:var(--msea-remove); font-weight:600; }
.cnc-shell .msea-table td.msea-qty-unchange .ctu-input { color:#94a3b8; }
.cnc-shell .msea-table td.msea-qty-final .ctu-input { font-weight:700; color:var(--msea-navy); }
.cnc-shell .msea-table td.msea-no-results { text-align:center; color:#94a3b8; padding:40px 0; font-size:13px; }

.msea-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 16px; border-top:1px solid var(--msea-border); background:#fbfcfd; font-size:12px; color:var(--msea-muted); }
.msea-legend { display:inline-flex; gap:16px; }
.msea-legend-item { display:inline-flex; align-items:center; gap:6px; }
.msea-legend-item::before { content:""; width:3px; height:12px; border-radius:2px; }
.msea-legend-add::before { background:var(--msea-add); }
.msea-legend-remove::before { background:var(--msea-remove); }
.msea-legend-unchange::before { background:var(--msea-unchange); }

.msea-empty { border:1px dashed #cbd5e1; border-radius:10px; padding:40px; text-align:center; color:#94a3b8; font-size:13px; }

.msea-actionbar { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:16px; }
.msea-actionbar-left, .msea-actionbar-right { display:flex; gap:8px; flex-wrap:wrap; }
.cnc-shell button.msea-btn { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; box-shadow:none; transform:none; margin:0; transition:background 0.12s, border-color 0.12s; }
.cnc-shell button.msea-btn-sm { height:26px; padding:0 10px; font-size:12px; border-radius:6px; }
.cnc-shell button.msea-btn-ghost { background:#fff; color:#334155; border:1px solid #cbd5e1; }
.cnc-shell button.msea-btn-ghost:hover { background:#f6f8fa; border-color:#94a3b8; color:var(--msea-navy); transform:none; box-shadow:none; }
.cnc-shell button.msea-btn-primary { background:var(--msea-blue); color:#fff; border:1px solid var(--msea-blue); }
.cnc-shell button.msea-btn-primary:hover { background:#163a5c; border-color:#163a5c; transform:none; box-shadow:none; }
.cnc-shell button.msea-btn:disabled { opacity:0.6; cursor:default; }

@media (max-width: 1280px) { .msea-kpis { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .msea-kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* ═══════════════════════════════════════════════════════════════════════════
   C&C → Content Supply Chain cost allocation grid
   Scoped under .cnc-shell for the same reason the EA tracker is: the global
   button/input/select rules in this file are aggressive and would otherwise
   overwrite the grid's own sizing. Shares the --msea-* tokens so the two
   sub-tabs read as one product rather than two.
   ═══════════════════════════════════════════════════════════════════════════ */

.cnc-shell .csc-banner { border-radius:8px; padding:10px 14px; font-size:12.5px; margin-bottom:14px; }
.cnc-shell .csc-banner-warn { background:#fff8eb; border:1px solid #fde3b0; color:#92400e; }

/* Charge-model bar: the formula and its bands sit directly above the grid so
   the rule producing every number is visible, not buried in a help page. */
.cnc-shell .csc-modelbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; background:linear-gradient(180deg,#fbfcfe,#f4f7fa); border:1px solid var(--msea-border); border-radius:10px; padding:10px 14px; margin-bottom:14px; }
.cnc-shell .csc-modelbar-left { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.cnc-shell .csc-modelbar-label { font-size:11px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--msea-muted); }
.cnc-shell .csc-modelbar-formula { font-size:12.5px; font-weight:600; color:var(--msea-navy); background:#fff; border:1px solid var(--msea-border); border-radius:6px; padding:4px 10px; font-variant-numeric:tabular-nums; }
.cnc-shell .csc-band-chips { display:inline-flex; gap:8px; flex-wrap:wrap; }
.cnc-shell button.csc-band-chip { display:inline-flex; flex-direction:column; align-items:flex-start; gap:1px; background:#fff; border:1px solid var(--msea-border); border-radius:8px; padding:5px 11px; cursor:pointer; box-shadow:none; transform:none; margin:0; min-width:0; text-align:left; transition:border-color 0.12s, background 0.12s; }
.cnc-shell button.csc-band-chip:hover { border-color:#94a3b8; background:#fbfcfe; transform:none; box-shadow:none; }
.cnc-shell button.csc-band-chip.active { border-color:var(--msea-blue); background:#eef4fb; box-shadow:inset 0 0 0 1px var(--msea-blue); }
.cnc-shell .csc-band-chip-rate { font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
.cnc-shell .csc-band-chip-meta { font-size:10.5px; color:var(--msea-muted); font-weight:500; }
.cnc-shell .csc-band-chip-t1 .csc-band-chip-rate { color:#0f7a3d; }
.cnc-shell .csc-band-chip-t2 .csc-band-chip-rate { color:#b45309; }
.cnc-shell .csc-band-chip-t3 .csc-band-chip-rate { color:#b42318; }

.cnc-shell .csc-toolbar { align-items:center; }
.cnc-shell .csc-toolbar-right { display:inline-flex; align-items:center; gap:8px; margin-left:auto; }
.cnc-shell button.msea-btn.csc-btn-on { background:#eef4fb; border-color:var(--msea-blue); color:var(--msea-blue); }

.cnc-shell .csc-table-wrap { overflow:auto; max-height:min(74vh, 820px); min-height:300px; border-bottom:1px solid var(--msea-border); }
.cnc-shell .csc-table { table-layout:fixed; width:100%; min-width:1400px; font-size:13px; }
/* overflow:visible at THIS specificity is required for the sticky header and
   the sticky totals footer below to work at all. Both the generic
   "table { overflow:hidden }" rule in this file and index.html's inline
   ".dashboard .tab-content table { overflow:hidden }" (specificity 0,2,1)
   make every <table> a non-scrolling overflow container, which then becomes
   position:sticky's inert containing block — the thead has nothing to stick
   to and simply scrolls away. Same root cause already documented above for
   .ctu-sheet-wrap and #leadershipReportTableContainer; that existing fix is
   scoped to .ctu-sheet-wrap, which this table is not inside. Doubling the
   class reaches (0,3,0) to clear the inline rule's bar.
   margin/radius/shadow are zeroed in the same rule because the generic
   "table" rule adds margin-top:16px, a 10px radius and a shadow — the margin
   opened a 17px gap above the pinned header, and the radius only clipped
   anything while overflow was hidden, so leaving it would let the sticky
   header bleed past the rounded corners. The .msea-card and .csc-table-wrap
   around it already supply the frame. */
.cnc-shell .csc-table.csc-table { overflow:visible; margin:0; border-radius:0; box-shadow:none; }
.cnc-shell .csc-table th, .cnc-shell .csc-table td { border-left:none; border-right:none; border-bottom:1px solid #eef1f5; }
.cnc-shell .csc-table thead th { position:sticky; top:0; z-index:6; background:#f6f8fa; color:var(--msea-muted); font-size:10.5px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; text-align:left; padding:10px 12px; border-bottom:1px solid var(--msea-border); box-shadow:none; white-space:normal; }
.cnc-shell .csc-table thead th.msea-th-num { text-align:right; }
.cnc-shell .csc-table thead th.csc-th-band { text-align:center; }
.cnc-shell .csc-table thead th.csc-th-cat { line-height:1.25; }
.cnc-shell .csc-table .csc-th-mix { display:block; font-size:10px; font-weight:600; color:#94a3b8; text-transform:none; letter-spacing:0; }

.cnc-shell .csc-table tbody tr { height:46px; }
.cnc-shell .csc-table tbody td { vertical-align:middle; background:#fff; padding:0 8px; line-height:1.35; }
.cnc-shell .csc-table tbody tr.csc-row:hover td { background:#f7f9fc; }
.cnc-shell .csc-table td.ctu-num { text-align:right; font-variant-numeric:tabular-nums; }

/* Rows that are not being charged stay legible but visibly inert, so a $0 is
   obviously "excluded" rather than "someone forgot to type a number". */
.cnc-shell .csc-table tbody tr.csc-row-muted td { background:#fcfcfd; }
.cnc-shell .csc-table tbody tr.csc-row-muted .csc-entity-name,
.cnc-shell .csc-table tbody tr.csc-row-muted .csc-brand,
.cnc-shell .csc-table tbody tr.csc-row-muted .csc-rowtotal,
.cnc-shell .csc-table tbody tr.csc-row-muted .csc-modelcost { color:#94a3b8; }
.cnc-shell .csc-table tbody tr.csc-row-muted:hover td { background:#f5f6f8; }
.cnc-shell .csc-table tbody tr.csc-row-overridden td.csc-actions { box-shadow:inset 3px 0 0 #d97706; }
.cnc-shell .csc-table tbody tr.csc-row-attention td.csc-actions { box-shadow:inset 3px 0 0 #dc2626; }

.cnc-shell .csc-table td.csc-actions { text-align:center; padding:0; }
.cnc-shell .csc-scope { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.cnc-shell .csc-scope input { width:14px; height:14px; margin:0; cursor:pointer; accent-color:var(--msea-blue); box-shadow:none; }

.cnc-shell .csc-entity { padding:4px 10px; }
.cnc-shell .csc-entity-name { font-weight:600; color:var(--msea-navy); font-size:12.5px; line-height:1.3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cnc-shell .csc-entity-code { font-size:10.5px; color:#94a3b8; font-family:'SFMono-Regular', Consolas, monospace; letter-spacing:-0.01em; }
.cnc-shell .csc-brand { color:#475569; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Agency: the join onto the portal's central agency list. An unmapped row
   that still carries cost is shown dashed and italic, because a chargeable
   entity with no agency is the one state that blocks the cost going anywhere;
   an out-of-scope row is merely muted, since it never needed mapping. */
.cnc-shell .csc-table td.csc-agency { padding:0 6px; }
.cnc-shell .csc-table td.csc-agency select.ctu-input.ctu-input-select {
  display:block; width:100%; height:30px; border:1px solid #dbe2ea; border-radius:6px;
  font-size:11.5px; font-weight:500; text-align:left; color:#334155; background-color:#fff;
  padding:0 20px 0 9px !important; background-position:right 7px center;
  cursor:pointer; text-overflow:ellipsis;
}
.cnc-shell .csc-table td.csc-agency select.ctu-input.ctu-input-select:hover { border-color:#94a3b8; }
.cnc-shell .csc-table td.csc-agency.csc-agency-empty select.ctu-input.ctu-input-select { border-style:dashed; border-color:#e0b872; background-color:#fffdf7; color:#b45309; font-style:italic; }
.cnc-shell .csc-table td.csc-agency.csc-agency-na select.ctu-input.ctu-input-select { color:#c3ccd6; border-color:#eef1f5; font-style:italic; }
.cnc-shell .csc-table td.csc-agency.csc-agency-unmatched select.ctu-input.ctu-input-select { background-color:#fffaf0; color:#b45309; border-color:#f3d6a8; }
.cnc-shell .csc-table td.csc-agency select option { color:#0f2540; font-style:normal; }

/* Pipeline stage is an editable dropdown that still READS as the status badge
   it replaced — the colour is the thing people scan the column for, so it
   survives becoming a control. Deliberately NOT reusing the old .csc-stage-*
   pill classes: those set `background` shorthand, which would wipe out the
   chevron background-image the select needs. */
.cnc-shell .csc-table td.csc-stage { padding:0 6px; }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select {
  display:block; width:100%; height:28px; border:1px solid transparent; border-radius:14px;
  font-size:10.5px; font-weight:600; letter-spacing:0.01em; text-align:left;
  padding:0 20px 0 10px !important; background-position:right 7px center;
  background-color:#f1f5f9; color:#475569; cursor:pointer;
  text-overflow:ellipsis; transition:border-color 0.12s;
}
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select:hover { border-color:rgba(15,37,64,0.18); }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select:disabled { cursor:not-allowed; opacity:0.7; }
/* These carry the FULL base selector plus the modifier class. The base rule
   above is itself 5 classes deep, so a shorter `.csc-table select.csc-stagesel-x`
   loses to it on specificity and the pill silently renders grey for every
   stage — which is exactly what happened the first time. */
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.csc-stagesel-launched { background-color:#e7f6ed; color:#0f7a3d; }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.csc-stagesel-current-mid-process { background-color:#eaf1ff; color:#1d4ed8; }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.csc-stagesel-exec-brief-scheduled-completed { background-color:#fef3e2; color:#b45309; }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.csc-stagesel-discovery-working-items { background-color:#f3e8ff; color:#7e22ce; }
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.csc-stagesel-unmatched { background-color:#fffaf0; color:#b45309; border-color:#f3d6a8; font-style:italic; }
/* Unsaved edit: a border, not the usual yellow fill — the fill would destroy
   the stage colour, which is the one thing this column is scanned for. */
.cnc-shell .csc-table td.csc-stage select.ctu-input.ctu-input-select.ctu-input-dirty { border-color:#d97706; }
/* The options themselves render in the OS dropdown, where the pill colours
   would be unreadable — reset them to plain dark text. */
.cnc-shell .csc-table td.csc-stage select option { background:#fff; color:#0f2540; font-style:normal; font-weight:500; }

.cnc-shell .csc-stage-pill { display:inline-block; max-width:100%; padding:3px 9px; border-radius:11px; font-size:10.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:#f1f5f9; color:#475569; }
.cnc-shell .csc-stage-launched { background:#e7f6ed; color:#0f7a3d; }
.cnc-shell .csc-stage-current-mid-process { background:#eaf1ff; color:#1d4ed8; }
.cnc-shell .csc-stage-exec-brief-scheduled-completed { background:#fef3e2; color:#b45309; }
.cnc-shell .csc-stage-discovery-working-items { background:#f3e8ff; color:#7e22ce; }

.cnc-shell .csc-bandcell { text-align:center; }
.cnc-shell .csc-band { display:inline-block; min-width:42px; padding:3px 8px; border-radius:11px; font-size:11px; font-weight:700; font-variant-numeric:tabular-nums; background:#f1f5f9; color:#94a3b8; }
.cnc-shell .csc-band-t1 { background:#e7f6ed; color:#0f7a3d; }
.cnc-shell .csc-band-t2 { background:#fef3e2; color:#b45309; }
.cnc-shell .csc-band-t3 { background:#fdecec; color:#b42318; }

.cnc-shell .csc-table .ctu-input.csc-money { height:32px; border-radius:6px; font-size:12.5px; padding:0 9px; text-align:right; font-variant-numeric:tabular-nums; }
.cnc-shell .csc-table .ctu-input.csc-money::placeholder { color:#b6c0cd; font-style:italic; }
.cnc-shell .csc-table .ctu-input.csc-money:disabled { background:#f8fafc; color:#94a3b8; cursor:not-allowed; }
.cnc-shell .csc-table td.csc-netrev .ctu-input { font-weight:600; color:var(--msea-navy); }
.cnc-shell .csc-table td.csc-modelcost { color:#64748b; }
/* An overridden category reads as hand-entered at a glance — this is the one
   place the grid stops agreeing with the model, so it is marked, not hidden. */
.cnc-shell .csc-table td.csc-cell-overridden { background:#fffaf0; }
.cnc-shell .csc-table .ctu-input.csc-overridden { color:#9a3412; font-weight:700; }
.cnc-shell .csc-table td.csc-rowtotal { font-weight:700; color:var(--msea-navy); padding-right:12px; }
.cnc-shell .csc-table td.csc-rowvariance { font-size:11.5px; font-weight:600; }
.cnc-shell .csc-var-zero { color:#cbd5e1; }
.cnc-shell .csc-var-up { color:#b42318; }
.cnc-shell .csc-var-down { color:#0f7a3d; }

.cnc-shell .csc-table td.csc-rowtools { text-align:center; padding:0; white-space:nowrap; }
.cnc-shell .csc-table .csc-note-btn, .cnc-shell .csc-table .csc-reset-btn { opacity:0; }
.cnc-shell .csc-table tbody tr:hover .csc-note-btn, .cnc-shell .csc-table tbody tr:hover .csc-reset-btn { opacity:1; }
.cnc-shell .csc-table .csc-note-btn.csc-has-note { opacity:1; background:#fff4e5; color:#b45309; }

.cnc-shell .csc-table tr.csc-group-row { cursor:pointer; }
.cnc-shell .csc-table tr.csc-group-row td { background:#f4f7fb; font-weight:700; color:var(--msea-navy); border-bottom:1px solid #dbe4ee; border-top:1px solid #dbe4ee; height:36px; font-size:12px; }
.cnc-shell .csc-table tr.csc-group-row:hover td { background:#eaf0f7; }
.cnc-shell .csc-table td.csc-group-caret { text-align:center; color:var(--msea-muted); }
.cnc-shell .csc-group-count { font-weight:500; color:var(--msea-muted); font-size:11px; margin-left:6px; }
.cnc-shell .csc-table td.csc-group-num { font-variant-numeric:tabular-nums; color:#475569; font-weight:600; }
.cnc-shell .csc-table td.csc-group-total { color:var(--msea-navy); }

/* Totals pinned to the bottom of the scroll area: on a 148-row sheet the
   total is the number being checked, and scrolling to find it is friction. */
/* line-height and white-space are NOT optional here. The generic
   ".ctu-table th, .ctu-table td" rule sets line-height:0 for every cell; the
   tbody rule above overrides it, but the footer never did, so the totals
   rendered as overlapping line boxes with no height — "0.363%" came out as a
   smudge. nowrap stops a short value splitting across two of those boxes. */
.cnc-shell .csc-table tfoot td { position:sticky; bottom:0; z-index:5; background:#eef3f9; border-top:2px solid var(--msea-blue); font-weight:700; color:var(--msea-navy); height:44px; font-variant-numeric:tabular-nums; line-height:1.35; white-space:nowrap; vertical-align:middle; }
.cnc-shell .csc-table tfoot td.csc-total-label { font-size:11px; letter-spacing:0.04em; text-transform:uppercase; color:var(--msea-muted); }
/* index.html's inline ".dashboard .tab-content table td { padding:10px 14px
   !important }" (0,2,2) applies to these cells too, leaving only 52px of a
   80px column for the rate. !important at (0,3,2) is what clears it — the
   same bar the .ctu-sheet-wrap padding override documents further up. */
.cnc-shell .csc-table tfoot td.csc-total-rate { text-align:center; font-size:11.5px; color:var(--msea-blue); padding-left:3px !important; padding-right:3px !important; }
.cnc-shell .csc-table tfoot td.csc-total-cost { font-size:14px; padding-right:12px; }
.cnc-shell .csc-table td.csc-no-results { text-align:center; color:#94a3b8; padding:48px 0; font-size:13px; }

.cnc-shell .csc-footer { font-size:11.5px; }
.cnc-shell .csc-hint { color:#94a3b8; }

/* Auto-match review. Confidence is shown per row because the three levels
   mean genuinely different things: "exact" is a name match, "good" is a
   judgement the reviewer should actually look at before approving. */
.csc-am-modal { width:720px; max-width:94vw; }
.csc-am-body { max-height:52vh; overflow-y:auto; margin:14px 0 4px; border:1px solid #e2e8f0; border-radius:8px; padding:6px 4px; background:#fcfdfe; }
.csc-am-section-title { font-size:11px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color:#1F4E79; padding:10px 10px 6px; }
.csc-am-section-muted { color:#94a3b8; border-top:1px solid #eef1f5; margin-top:6px; }
.csc-am-row { display:flex; align-items:center; gap:10px; padding:6px 10px; border-radius:6px; font-size:12.5px; cursor:pointer; }
.csc-am-row:hover { background:#f1f5fb; }
.csc-am-row input { margin:0; width:14px; height:14px; accent-color:#1F4E79; box-shadow:none; flex:none; }
.csc-am-brand { font-weight:700; color:#0f2540; width:150px; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.csc-am-arrow { color:#94a3b8; flex:none; }
.csc-am-agency { color:#334155; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.csc-am-conf { flex:none; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:2px 7px; border-radius:10px; }
.csc-am-conf-exact { background:#e7f6ed; color:#0f7a3d; }
.csc-am-conf-high { background:#eaf1ff; color:#1d4ed8; }
.csc-am-conf-good { background:#fef3e2; color:#b45309; }
.csc-am-count { flex:none; min-width:28px; text-align:right; color:#94a3b8; font-variant-numeric:tabular-nums; font-size:11.5px; }
.csc-am-row-skipped { cursor:default; color:#94a3b8; padding-left:34px; }
.csc-am-row-skipped:hover { background:transparent; }
.csc-am-row-skipped .csc-am-brand { color:#64748b; font-weight:600; }
.csc-am-reason { flex:1; font-size:11.5px; color:#a0abb8; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.csc-am-empty { color:#64748b; font-size:13px; padding:20px; text-align:center; }

.csc-mix-modal { width:520px; }
.csc-mix-fields { display:flex; flex-direction:column; gap:8px; margin:14px 0; }
.csc-mix-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.csc-mix-label { font-size:12.5px; color:#334155; font-weight:500; }
.csc-mix-input { display:inline-flex; align-items:center; gap:6px; }
.csc-mix-input input { width:82px; padding:6px 8px; border:1px solid #cbd5e1; border-radius:6px; text-align:right; font-variant-numeric:tabular-nums; margin:0; box-shadow:none; }
.csc-mix-input span { font-size:12px; color:#94a3b8; }
.csc-mix-preview { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:10px 12px; font-size:12px; }
.csc-mix-preview-row { display:flex; justify-content:space-between; gap:12px; padding:3px 0; color:#475569; font-variant-numeric:tabular-nums; }
.csc-mix-preview-total { border-top:1px solid #e2e8f0; margin-top:4px; padding-top:6px; color:#0f2540; font-weight:700; }
.csc-mix-warn { margin-top:8px; color:#b45309; font-size:11.5px; }

@media (max-width: 1280px) { .cnc-shell .csc-kpis { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cnc-shell .csc-toolbar-right { margin-left:0; width:100%; }
  .cnc-shell .csc-modelbar { align-items:flex-start; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .wrap {
    padding: 15px;
  }
  
  .dashboard {
    padding: 20px;
  }
  
  header h1 {
    font-size: 20px;
  }
  
  .login-container {
    padding: 30px 25px;
    max-width: 90%;
  }
  
  .tab-button {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .admin-panel {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    border-radius: 16px 16px 0 0;
  }
  
  .admin-content {
    border-radius: 0 0 16px 16px;
  }
  
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

/* ===== LOADING ANIMATION ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* ===== ERROR & SUCCESS MESSAGES ===== */
.error { 
  color: var(--danger-color);
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  padding: 14px 18px;
  border-radius: 10px;
  margin: 12px 0;
  border-left: 4px solid var(--danger-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
}

.success-message { 
  color: var(--success-color);
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  padding: 14px 18px;
  border-radius: 10px;
  margin: 12px 0;
  border-left: 4px solid var(--success-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#saveMsg, #rateCardMsg { 
  display: none;
  color: var(--success-color);
  font-weight: 700;
  margin-top: 10px;
  text-align: center;
  padding: 10px;
  background: #e8f5e8;
  border-radius: 8px;
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
/* ===== SUMMARY CARDS ===== */
.summary-cards { 
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.summary-card { 
  flex: 1;
  min-width: 120px;
  padding: 12px 8px;
  border-radius: 10px;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #e1e6ef;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bg-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.summary-card:hover::before {
  transform: scaleX(1);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: var(--primary-light);
}

.summary-value { 
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.summary-label { 
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.approval-section { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid #ff9800; }
.status-badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e8; color: #2e7d32; }
.status-sent { background: #e3f2fd; color: #1565c0; }
/* ===== LOGIN PAGE STYLES ===== */
.login-container { 
  background: rgba(255, 255, 255, 0.98);
  padding: 50px 45px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.3);
  max-width: 420px;
  width: 90%;
  margin: 0 auto;
  position: relative;
  z-index: 1000;
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.6s ease-out;
}

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

.login-container header {
  text-align: center;
  margin-bottom: 35px;
}

.login-container header img {
  height: 60px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

.login-container header img:hover {
  transform: scale(1.05);
}

.login-form { 
  display: flex; 
  flex-direction: column; 
  gap: 20px;
}

.login-form h3 {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 700;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-form input { 
  padding: 14px 18px;
  border: 2px solid #e1e6ef;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  background: #f8f9fa;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.1);
  transform: translateY(-2px);
}

.login-form input::placeholder {
  color: #adb5bd;
}

.login-form button { 
  padding: 14px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  background: var(--bg-gradient);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.login-form button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.login-form button:hover::before {
  width: 300px;
  height: 300px;
}

.login-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-form button:active {
  transform: translateY(0);
}

#loginError {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}
.user-info { 
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--success-color);
  box-shadow: var(--shadow-sm);
  border: 1px solid #a5d6a7;
}
/* Category styles */
.category-header { background: #f0f7ff !important; cursor: pointer; }
.category-header:hover { background: #e3f2fd !important; }
.sub-item { background: #fafafa; }
.sub-item td:first-child { padding-left: 30px; font-style: italic; }
.category-total { background: #e8f5e8 !important; font-weight: bold; }
/* Dropdown styles */
.license-dropdown { width: 100%; padding: 6px; border: 1px solid #ccd; border-radius: 4px; font-size: 13px; }
.license-option { padding: 8px; }
.add-license-row { background: #f0f8ff !important; }
.add-license-btn { padding: 4px 8px; font-size: 12px; margin-left: 8px; }
/* Rate card group styles - FIXED */
.ratecard-group-header { 
  background: #e3f2fd !important; 
  cursor: pointer; 
  font-weight: bold; 
}
.ratecard-group-header:hover { 
  background: #bbdefb !important; 
}
.ratecard-sub-item { 
  background: #fafafa; 
}
.ratecard-sub-item td:first-child { 
  padding-left: 30px; 
}
/* Report type selector */
.report-type-selector { background: #e3f2fd; padding: 10px; border-radius: 6px; margin-bottom: 15px; }
.report-type-buttons { display: flex; gap: 10px; }
.report-type-btn { flex: 1; font-size: 14px; }
.report-type-btn.active { background: #1565c0; }
/* Leadership report styles */
.company-group { background: #f0f7ff; margin-bottom: 10px; border-radius: 4px; }
.company-group-header { background: #bbdefb !important; cursor: pointer; font-weight: bold; }
.trend-indicator { font-size: 12px; margin-left: 5px; }
.trend-up { color: #2e7d32; }
.trend-down { color: #d32f2f; }
.trend-neutral { color: #666; }
/* Font size adjustments */
.quantity-input, .rate-input, .cost-input { font-size: 14px !important; }
.rate-value, .yearly-cost { font-size: 14px !important; }
/* Okta refresh button */
.okta-refresh-btn { margin-left: 8px; padding: 4px 8px; font-size: 12px; }
/* Navigation controls */
.nav-controls { background: #f8f9fa; padding: 12px; border-radius: 6px; margin-bottom: 15px; border-left: 4px solid #1d3557; display: flex; justify-content: space-between; align-items: center; }
/* Sticky navigation for Rate Card tab */
.sticky-nav-controls { position: sticky; top: 0; z-index: 100; background: #f8f9fa; padding: 12px; border-radius: 6px; margin-bottom: 15px; border-left: 4px solid #1d3557; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
/* ===== ADMIN PANEL STYLES ===== */
.admin-panel { 
  background: var(--bg-white);
  padding: 0;
  border-radius: 16px;
  margin-top: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  min-height: 600px;
  overflow: hidden;
  border: 1px solid rgba(29, 53, 87, 0.1);
}

.admin-sidebar { 
  width: 240px;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 16px 0 0 16px;
  padding: 24px 0;
  position: relative;
}

.admin-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
  opacity: 0.5;
}

.admin-sidebar-title { 
  color: var(--accent-color);
  font-size: 22px;
  font-weight: 800;
  padding: 0 24px 24px 24px;
  border-bottom: 3px solid var(--accent-color);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.admin-menu-item { 
  padding: 14px 24px;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.admin-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transition: width 0.3s ease;
}

.admin-menu-item:hover::before {
  width: 100%;
}

.admin-menu-item:hover { 
  border-left-color: var(--accent-color);
  padding-left: 28px;
}

.admin-menu-item.active { 
  background: rgba(255, 215, 0, 0.15);
  border-left-color: var(--accent-color);
  font-weight: 800;
  box-shadow: inset 0 0 20px rgba(255,215,0,0.1);
}

.admin-content { 
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: #f8f9fa;
  border-radius: 0 16px 16px 0;
}
.admin-section { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #e1e6ef; display: none; }
.admin-section.active { display: block; }
.admin-section:last-child { border-bottom: none; }
.admin-section h3 { margin-top: 0; color: #1d3557; border-bottom: 2px solid #1d3557; padding-bottom: 10px; font-size: 18px; }
.user-list { width: 100%; border-collapse: collapse; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.user-list th, .user-list td { padding: 12px 15px; border: 1px solid #e1e6ef; text-align: left; }
.user-list th { background: #1d3557; color: white; font-weight: 600; }
.user-list tr:nth-child(even) { background: #f9f9f9; }
.user-list tr:hover { background: #f0f7ff; }
.user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #e1e6ef; }
.user-form .full-width { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 8px; font-weight: 600; color: #1d3557; font-family: 'Inter', sans-serif; }
.tab-bar-row {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f3f7;
}
.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: transparent;
}
.tab-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
/* ===== TAB STYLES ===== */
.tab-button {
  padding: 10px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  margin-right: 2px;
  font-weight: 600;
  transition: var(--transition);
  color: var(--text-light);
  border: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  position: relative;
  overflow: hidden;
}

.tab-button::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bg-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-button:hover::before {
  transform: scaleX(1);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.2);
}

.tab-button.active::before {
  transform: scaleX(1);
  background: var(--accent-color);
}

.tab-button:hover:not(.active) {
  background: #eef4fb;
  color: var(--primary-color);
}
.tab-content { padding: 25px 0 0 0; background: #fff; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== NESTED SUB-TAB STYLES (e.g. Leadership Report: Overview / RF Comparison / Key Insights) ===== */
.subtab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 18px 0 20px 0;
  border-bottom: 2px solid #eef1f5;
}
.subtab-button {
  padding: 9px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-light, #64748b);
  transition: var(--transition, all 0.2s ease);
  margin-bottom: -2px;
}
.subtab-button:hover:not(.active) {
  color: var(--primary-color, #1d3557);
  background: #f6f9fc;
}
.subtab-button.active {
  color: var(--primary-color, #1d3557);
  border-bottom-color: var(--accent-color, #1d3557);
}
.subtab-pane { display: none; }
.subtab-pane.active { display: block; }

/* ===== Key Insights KPI cards (clickable, drill down to detail) ===== */
.ki-kpi-card {
  cursor: pointer;
  transition: var(--transition, all 0.2s ease);
}
.ki-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1 !important;
}
.ki-kpi-card-active {
  border-color: var(--primary-color, #1d3557) !important;
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.15);
}
.fa-period-btn {
  padding: 5px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  transition: var(--transition, all 0.2s ease);
}
.fa-period-btn:hover:not(.active) {
  background: #e2e8f0;
}
.fa-period-btn.active {
  background: var(--primary-color, #1d3557);
  border-color: var(--primary-color, #1d3557);
  color: white;
}

/* ===== RF Comparison table — enterprise-grade sticky/sortable grid =====
   Selectors below are deliberately over-specific (3 classes + 2 elements)
   because index.html's ".dashboard .tab-content table th/td" rule forces
   its own background/padding/font-size with !important — a plain
   ".rf-compare-table th" rule would lose that fight even with !important
   of its own, since it ties on specificity and loses on source order. */
.rf-compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rf-compare-search {
  padding: 7px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  min-width: 220px;
  font-family: 'Inter', sans-serif;
}
.rf-compare-count {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}
.rf-compare-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.rf-compare-scroll table.rf-compare-table {
  /* Sticky cells inside a table with border-collapse:separate silently
     fail to composite in some Chromium builds (the sticky offset computes
     correctly but the cell never visually pins) — collapse is the combo
     that's actually reliable for position:sticky on th/td. */
  border-collapse: collapse !important;
  width: 100%;
  overflow: visible !important;
  border: none !important;
  border-radius: 0 !important;
}
.rf-compare-scroll table.rf-compare-table th.rf-th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  background: #1d3557 !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: none !important;
  letter-spacing: 0.02em;
  text-align: right !important;
  padding: 10px 16px !important;
  border-bottom: 2px solid #142744 !important;
  white-space: nowrap;
}
.rf-compare-scroll table.rf-compare-table th.rf-th-sortable {
  cursor: pointer;
  user-select: none;
}
.rf-compare-scroll table.rf-compare-table th.rf-th-sortable:hover {
  background: #28527d !important;
}
.rf-compare-sort-arrow {
  margin-left: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.rf-compare-scroll table.rf-compare-table th.rf-th-sortable:hover .rf-compare-sort-arrow {
  color: rgba(255, 255, 255, 0.75);
}
.rf-compare-sort-arrow-active {
  font-size: 10px;
  color: #7fb3e8 !important;
}
.rf-compare-scroll table.rf-compare-table th.rf-th-var {
  background: #2f6da8 !important;
  color: #fff !important;
}
.rf-compare-scroll table.rf-compare-table th.rf-th-sticky {
  left: 0 !important;
  text-align: left !important;
  z-index: 3 !important;
}
.rf-compare-scroll table.rf-compare-table td.rf-td {
  padding: 9px 16px !important;
  font-size: 13px !important;
  border-bottom: 1px solid #eef1f5 !important;
  white-space: nowrap;
  color: #1e293b;
}
.rf-compare-scroll table.rf-compare-table td.rf-td-var {
  background: #f5f9fd;
}
.rf-compare-scroll table.rf-compare-table td.rf-td-sticky {
  position: sticky !important;
  left: 0 !important;
  z-index: 1 !important;
  background: #fff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
  text-align: left !important;
}
.rf-compare-scroll table.rf-compare-table tr.rf-tr-alt td.rf-td {
  background: #fafbfc;
}
.rf-compare-scroll table.rf-compare-table tr:hover td.rf-td {
  background: #eef5fc !important;
}
/* Layout improvements */
.controls-row { display: flex; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; align-items: center; }
.control-group { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 120px; align-items: center; }
.control-group label { margin-bottom: 8px; font-weight: 600; color: #1d3557; font-family: 'Inter', sans-serif; }
.spacer { flex: 1; }
.action-buttons { display: flex; gap: 10px; align-items: center; }
/* Multi-select styles */
.multi-select { height: 120px; }
.company-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* Animation for global rate card alert */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.company-tag { background: #e3f2fd; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
/* Global Rate Card Modal Styles */
.global-rate-input {
  width: 100px !important;
  padding: 4px !important;
  border: 1px dashed #ff9800 !important;
  border-radius: 3px !important;
  font-size: 14px !important;
}

/* ===== LOCK/UNLOCK FEATURE STYLES ===== */
.lock-button {
  background: #ff9800;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  margin-right: 10px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lock-button.unlocked {
  background: #4caf50;
}

.lock-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.lock-button:active {
  transform: translateY(0);
}

/* ── Dashboard action toolbar (Locked / Save / Carry Forward / Adjust Book) ─
   ID-scoped so this never bleeds into .lock-button/.info/button used
   elsewhere in the app. Save uses the same navy→steel gradient as the
   app's own header/modal chrome (#1d3557 → #457b9d) instead of an
   unrelated generic slate, so it reads as this product's primary action,
   not a default Bootstrap-ish button. */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#lockButton,
#saveButton,
#carryForwardButton,
#adjustBookButton,
#completeWorkbookButton {
  height: 38px;
  padding: 0 16px;
  margin: 0 !important;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.1s ease;
  transform: none;
}
.btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Status indicator, not an "action" — a genuine status-dot chip (the same
   pattern as an "online/offline" indicator), not a colored button pretending
   to be a status. The dot itself carries the state; text is secondary. */
#lockButton {
  background: #fff;
  color: #7c2d12;
  border: 1px solid #fde4cb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
#lockButton .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  flex-shrink: 0;
}
#lockButton:hover {
  border-color: #fbbf87;
  background: #fffaf3;
}
#lockButton.unlocked {
  color: #14532d;
  border-color: #d3f0dd;
}
#lockButton.unlocked .status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
#lockButton.unlocked:hover {
  border-color: #a9e6bd;
  background: #f6fdf9;
}

/* Primary action — brand gradient, soft cool-toned shadow (not the old
   saturated blue-glow), a real lift on hover, a real press on click. */
#saveButton {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.15), 0 2px 8px rgba(29, 53, 87, 0.18);
}
#saveButton:hover {
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.18), 0 4px 14px rgba(29, 53, 87, 0.28);
  transform: translateY(-1px);
}
#saveButton:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.15);
}

/* Secondary actions — quiet ghost buttons, distinguished from each other by
   icon only. Hover fills with a faint brand-navy tint, not gray. */
#carryForwardButton,
#adjustBookButton {
  background: #fff;
  color: #1d3557;
  border: 1px solid #dbe4ee;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
#carryForwardButton:hover,
#adjustBookButton:hover {
  background: #f3f7fb;
  border-color: #aecbe3;
}
#carryForwardButton:active,
#adjustBookButton:active {
  background: #eaf1f8;
}

/* Complete — a deliberate, final-feeling confirm action (distinct from the
   quiet ghost buttons above): solid green fill when actionable, same
   dimensions as the rest of the toolbar so it never looks bolted on. */
#completeWorkbookButton {
  background: linear-gradient(135deg, #15803d 0%, #22a35a 100%);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.15), 0 2px 8px rgba(21, 128, 61, 0.18);
}
#completeWorkbookButton:hover {
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.18), 0 4px 14px rgba(21, 128, 61, 0.28);
  transform: translateY(-1px);
}
#completeWorkbookButton:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.15);
}
#completeWorkbookButton:disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
  box-shadow: none;
  transform: none;
  opacity: 1;
}

/* ── Adjust Book modal ─────────────────────────────────────────────── */
.ab-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ab-card {
  background: #fff;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 4px 16px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  position: relative;
  font-family: 'Inter', sans-serif;
}
.ab-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 1;
}
.ab-close:hover { background: rgba(255, 255, 255, 0.3); }
.ab-close svg { width: 15px; height: 15px; }

.ab-header {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  color: #fff;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ab-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ab-header-icon svg { width: 21px; height: 21px; }
.ab-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.ab-header p#adjustBookAgencyLabel { margin: 3px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.8); }

.ab-body {
  padding: 22px 26px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ab-field label {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ab-optional {
  text-transform: none;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0;
  font-size: 11.5px;
}
.ab-field select,
.ab-field input[type="text"],
.ab-field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.ab-field select:focus,
.ab-field input:focus {
  outline: none;
  border-color: #457b9d;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.15);
}

.ab-segmented {
  display: flex;
  gap: 8px;
}
.ab-segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ab-seg-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: #64748b;
  transition: all 0.15s;
}
.ab-seg-option svg { width: 15px; height: 15px; }
#ab-dir-add:checked + .ab-seg-add {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}
#ab-dir-subtract:checked + .ab-seg-subtract {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.ab-amount-wrap {
  position: relative;
}
.ab-amount-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-weight: 600;
  font-size: 15px;
  pointer-events: none;
}
.ab-amount-wrap input {
  padding-left: 26px !important;
  font-size: 17px !important;
  font-weight: 600;
}

.ab-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}
.ab-error {
  color: #b91c1c;
  font-size: 12.5px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px 12px;
}

.ab-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px;
  background: #f8fafc;
  border-top: 1px solid #eef1f5;
  margin-top: 14px;
}
.ab-btn-ghost,
.ab-btn-primary {
  height: 38px;
  padding: 0 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.ab-btn-ghost svg, .ab-btn-primary svg { width: 15px; height: 15px; }
.ab-btn-ghost {
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}
.ab-btn-ghost:hover { background: #f1f5f9; }
.ab-btn-primary {
  background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.15), 0 2px 8px rgba(29, 53, 87, 0.18);
}
.ab-btn-primary:hover {
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.18), 0 4px 14px rgba(29, 53, 87, 0.28);
  transform: translateY(-1px);
}
.ab-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── RF category breakdown modal (drill-down from a Var cell) ───────── */
.rfbd-card {
  max-width: 560px;
}
#rfBreakdownSubtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.8);
}
.rfbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.rfbd-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  padding: 0 8px 10px;
  border-bottom: 1.5px solid #e2e8f0;
}
.rfbd-table th.rfbd-num, .rfbd-table td.rfbd-num {
  text-align: right;
}
.rfbd-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
}
.rfbd-table td.rfbd-cat {
  font-weight: 600;
  color: #334155;
}
.rfbd-total-row td {
  border-top: 1.5px solid #cbd5e1;
  border-bottom: none;
  padding-top: 12px;
  font-weight: 700;
  color: #1e293b;
}

.lock-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lock-modal-content {
  background: white;
  padding: 30px 40px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 350px;
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ── Dispute revisions on the Dashboard ──────────────────────────────────
   A figure a department agreed to change on a dispute. The row still shows
   its own quantity and rate — those are what the rate card says — so the
   amount has to carry the fact that it is no longer their product: red when
   the revision raised it, green when it lowered it. */
.yearly-cost.dispute-revised { font-weight: 700 !important; }
.yearly-cost.dispute-revised.is-up { color: #b42318 !important; }
.yearly-cost.dispute-revised.is-down { color: #027a48 !important; }
.dispute-revised-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  color: #5b4b00;
  background: #fef7e0;
  border: 1px solid #f2d888;
  cursor: help;
  vertical-align: middle;
}

/* ===== Cloud TrueUp Overview — usability layer (toolbar, KPIs, filters,
   legend, row hover across the split tables, agency grouping). Purely
   presentational: nothing here changes a figure. ===== */
.ctu-ov-toolbar { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; font-family:'Inter', sans-serif; }
.ctu-ov-kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:10px; }
.ctu-ov-kpi { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:10px 14px; min-width:0; }
.ctu-ov-kpi-label { font-size:11px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:0.03em; }
.ctu-ov-kpi-value { font-size:18px; font-weight:700; color:#0f172a; font-variant-numeric:tabular-nums; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ctu-ov-kpi-sub { font-size:11.5px; color:#64748b; margin-top:2px; }
.ctu-ov-kpi.is-over .ctu-ov-kpi-value { color:#c62828; }
.ctu-ov-kpi.is-under .ctu-ov-kpi-value { color:#2e7d32; }
.ctu-ov-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ctu-ov-chips { display:inline-flex; gap:4px; background:#f1f5f9; border-radius:18px; padding:3px; }
.ctu-ov-chip { border:none; background:transparent; color:#475569; font-size:12px; font-weight:600; padding:5px 12px; border-radius:15px; cursor:pointer; box-shadow:none; }
.ctu-ov-chip:hover { background:#e2e8f0; color:#1F4E79; }
.ctu-ov-chip.active { background:#1F4E79; color:#fff; }
.ctu-ov-jump { padding:5px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:12px; color:#334155; background:#fff; cursor:pointer; }
.ctu-ov-btn { border:1px solid #cbd5e1; background:#fff; color:#1F4E79; font-size:12px; font-weight:600; padding:5px 12px; border-radius:6px; cursor:pointer; box-shadow:none; }
.ctu-ov-btn:hover { background:#eef3fa; }
.ctu-ov-count { font-size:12px; color:#64748b; margin-left:auto; }
.ctu-ov-legend { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; font-size:11.5px; color:#475569; }
.ctu-ov-legend > span { display:inline-flex; align-items:center; gap:6px; }
.ctu-ov-sw { display:inline-block; width:12px; height:12px; border-radius:3px; border:1px solid transparent; }
.ctu-ov-keys { color:#94a3b8; }
.ctu-ov-keys kbd { font-family:inherit; font-size:10.5px; background:#f1f5f9; border:1px solid #e2e8f0; border-bottom-width:2px; border-radius:4px; padding:0 4px; color:#475569; }
/* One hovered row lights up in both halves of the split grid. */
.ctu-table tbody tr.ctu-row-hover td { background-color:#eef3fa; }
/* A thin rule where a new agency's rows begin, so its services read as one group. */
.ctu-table tbody tr.ctu-group-start td { box-shadow:inset 0 1px 0 #b6c2d2; }
/* Number inputs: no spinner arrows — ↑/↓ move between rows instead of nudging the value. */
.ctu-table input.ctu-input-month::-webkit-outer-spin-button,
.ctu-table input.ctu-input-month::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.ctu-table input.ctu-input-month { -moz-appearance:textfield; appearance:textfield; }
.ctu-ov-empty { padding:18px; text-align:center; color:#64748b; font-size:13px; border-top:1px solid #e6ebf2; }

/* Budget column pinned alongside the frozen Agency/Service pane.
   Budget lives in the SCROLLING table (it's the first column there), not in
   the frozen one, so keeping it readable while the user scrolls out to DEC
   and the summary columns means position:sticky rather than moving it into
   .ctu-frozen-table — moving it would also have meant a second colgroup,
   a second set of totals cells and two more places for the frozen/scroll
   row heights to drift apart.
   Sticky is safe HERE (unlike the sticky-thead attempt documented above)
   precisely because the axis is horizontal: the nearest scrollport for
   these cells IS .ctu-scroll-x / .ctu-scroll-x-head, which is exactly the
   box we want them to stick to. .ctu-scroll-x is overflow-x:hidden and has
   its scrollLeft pushed in from the header bar by JS — still a scroll
   container, so sticky tracks it just as it would a user-dragged one.
   A box-shadow draws the divider instead of border-right: with
   table-layout:fixed a thicker border would widen the column by a pixel,
   and the header bar and body are two separate tables that must stay
   column-for-column aligned. */
.ctu-sheet-wrap .ctu-table th.ctu-sticky-budget,
.ctu-sheet-wrap .ctu-table td.ctu-sticky-budget {
  position: sticky;
  left: 0;
  z-index: 3;
  box-shadow: 1px 0 0 #94a3b8;
}
.ctu-sheet-wrap .ctu-table thead th.ctu-sticky-budget {
  z-index: 4;
  box-shadow: 1px 0 0 #94a3b8, 0 1px 0 rgba(0, 0, 0, 0.05);
}
/* The hover tint on a row is painted by the cell's own background, so a
   transparent sticky cell would let the month columns slide visibly under
   it. Both of these already carry an opaque inline background today; these
   rules are the fallback if that inline style is ever dropped. */
.ctu-sheet-wrap .ctu-table tbody td.ctu-sticky-budget { background: #f5f5f5; }
.ctu-sheet-wrap .ctu-table tbody tr:hover td.ctu-sticky-budget { background-color: #eef1f5; }
