/* ==========================================================================
   BCN3 Picker Performance Tracker - Styles
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #f5f6f8;
  min-width: 1024px;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 600;
  color: #1a1a1a;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: #232f3e;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

/* ---------- FC Selector Dropdown ---------- */
.fc-selector {
  position: relative;
}

.lang-selector {
  margin-left: 4px;
}

.lang-select {
  padding: 4px 8px;
  font-size: 16px;
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.lang-select option {
  background-color: #232f3e;
  color: #fff;
  font-size: 16px;
}

.fc-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: #ff9900;
  color: #232f3e;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.fc-selector-btn:hover {
  background-color: #e68a00;
}

.fc-selector-arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.fc-selector[aria-expanded="true"] .fc-selector-arrow {
  transform: rotate(180deg);
}

.fc-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  overflow: hidden;
}

.fc-dropdown[hidden] {
  display: none;
}

.fc-search-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  outline: none;
  color: #1a1a1a;
  box-sizing: border-box;
}

.fc-search-input::placeholder {
  color: #999;
}

.fc-search-input:focus {
  background-color: #f9fbff;
}

.fc-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
}

.fc-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background-color 0.1s;
}

.fc-dropdown-item:hover {
  background-color: #f0f4ff;
}

.fc-dropdown-item.selected {
  background-color: #e3f2fd;
  color: #0073bb;
  font-weight: 600;
}

.fc-dropdown-item.hidden {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bridge-status {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}

.bridge-status--connected {
  color: #a5d6a7;
}

.bridge-status--disconnected {
  color: #ef9a9a;
}

.bridge-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
}

.bridge-active {
  background-color: rgba(46, 125, 50, 0.2);
  color: #a5d6a7;
}

.bridge-inactive {
  background-color: rgba(211, 47, 47, 0.2);
  color: #ef9a9a;
}

/* site-badge removed - replaced by .fc-selector */

/* ---------- Controls Bar ---------- */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
  position: relative;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

/* ---------- Form Elements ---------- */
input[type="date"],
input[type="number"],
select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #0073bb;
  box-shadow: 0 0 0 2px rgba(0, 115, 187, 0.15);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

button {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #0073bb;
  color: #ffffff;
  transition: background-color 0.15s ease;
}

button:hover {
  background-color: #005a94;
}

button:active {
  background-color: #004a7a;
}

button:focus-visible {
  outline: 2px solid #0073bb;
  outline-offset: 2px;
}

/* ---------- Custom Timeframe Panel ---------- */
.custom-timeframe-panel {
  margin: 0 24px;
  padding: 12px 20px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.custom-timeframe-panel[hidden] {
  display: none;
}

.custom-timeframe-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.interval-checkbox {
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.interval-checkbox:hover {
  background-color: #f0f4ff;
}

.interval-checkbox input {
  margin-right: 3px;
}

.custom-timeframe-actions {
  display: flex;
  gap: 8px;
}

.custom-timeframe-actions button {
  padding: 4px 10px;
  font-size: 11px;
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.custom-timeframe-actions button:hover {
  background-color: #e0e0e0;
}

/* ---------- Shift Plan Section ---------- */
.shift-plan-section {
  margin: 16px 24px 8px;
  padding: 16px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.shift-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-link-btn {
  background: none;
  border: 1px solid #ccc;
  color: #0073bb;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1;
  text-decoration: none;
}

.source-link-btn:hover {
  background-color: #e3f2fd;
  border-color: #0073bb;
}

.shift-plan-header h2 {
  font-size: 15px;
  margin: 0;
  color: #333;
}

.shift-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.plan-card {
  text-align: center;
  min-width: 0;
  position: relative;
  padding: 26px 14px 12px;
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

/* IB/OB flow panels hold two columns (Volume + TPH), so they're wider. */
.plan-card-flow {
  grid-column: span 2;
}

.plan-flow-cols {
  display: flex;
  gap: 16px;
}

.plan-flow-col {
  flex: 1;
  min-width: 0;
  position: relative;
}

.plan-flow-col + .plan-flow-col {
  border-left: 1px solid #e8e8e8;
  padding-left: 16px;
}

.plan-col-title {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Actual/Plan stack on the left, deviation indicator on the right (aligned
   near the top so it lines up with the Actual value, clear of the Plan-row
   buttons like the ALPS refresh/save). */
.plan-col-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.plan-col-main {
  flex: 1;
  min-width: 0;
}

.plan-deviation {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  min-width: 56px;
  margin-top: 18px;
}

.plan-deviation-arrow {
  font-size: 18px;
}

.plan-deviation-pct {
  font-size: 20px;
  font-weight: 800;
}

.plan-deviation.bridge-red { color: #c62828; }
.plan-deviation.bridge-green { color: #2e7d32; }
.plan-deviation.bridge-yellow { color: #ef9a00; }

/* Two-column flow panels (IB/OB/XLIP) are tight — shrink the Actual/Plan
   numbers and tighten spacing so the deviation badge never collides with them. */
.plan-card-flow .plan-card-actual {
  font-size: 26px;
}

.plan-card-flow input.plan-card-plan,
.plan-card-flow input.plan-card-plan[type="number"] {
  font-size: 26px !important;
  width: 64px;
}

.plan-card-flow .plan-card-row {
  gap: 8px;
}

.plan-card-flow .plan-card-label {
  width: 42px;
}

.plan-card-flow .plan-deviation {
  min-width: 48px;
}

.plan-card-flow .plan-deviation-arrow { font-size: 15px; }
.plan-card-flow .plan-deviation-pct { font-size: 16px; }

body.dark-mode .plan-flow-col + .plan-flow-col {
  border-left-color: #3a3f48;
}

body.dark-mode .plan-col-title {
  color: #999;
}

body.dark-mode .plan-deviation.bridge-red { color: #ef9a9a; }
body.dark-mode .plan-deviation.bridge-green { color: #81c784; }
body.dark-mode .plan-deviation.bridge-yellow { color: #ffcc66; }

.plan-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.plan-card-actual {
  font-size: 40px;
  font-weight: 700;
  color: #1a1a1a;
}

.plan-card-divider {
  /* Subtle full-width rule within the panel padding — separates Actual from
     Plan without the heavy bar look. */
  width: 100%;
  height: 1px;
  background-color: #e0e0e0;
  margin: 10px 0;
}

input.plan-card-plan,
input.plan-card-plan[type="number"] {
  width: 100px;
  font-size: 40px !important;
  font-weight: 700 !important;
  text-align: left;
  border: none !important;
  border-bottom: 2px dashed rgba(100,160,220,0.5) !important;
  border-radius: 0 !important;
  color: #1a1a1a !important;
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0;
  font-family: inherit;
  line-height: 1.1;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
  outline: none !important;
  box-shadow: none !important;
}

input.plan-card-plan:focus {
  outline: none !important;
  border-bottom-color: #0073bb !important;
}

input.plan-card-plan::placeholder {
  color: #666;
  font-size: 16px !important;
  font-weight: 400 !important;
}

.plan-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.plan-btn-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-card-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.plan-card-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  width: 55px;
  flex-shrink: 0;
  text-align: right;
}

.plan-calc-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 5px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  color: #4da6ff;
}

.plan-calc-btn:hover {
  opacity: 1;
}

.plan-save-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 5px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.plan-save-btn:hover {
  opacity: 1;
}

.plan-save-btn.saved {
  opacity: 1;
  color: #2e7d32;
}

.plan-calc-btn.calculating {
  animation: spin 0.8s linear infinite;
}

/* Remove number input spinners */
input.plan-card-plan::-webkit-inner-spin-button,
input.plan-card-plan::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.plan-card-plan[type="number"] {
  -moz-appearance: textfield !important;
}
.plan-card-plan[type="number"] {
  -moz-appearance: textfield;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.plan-card-sla {
  position: relative;
}

.plan-card-sla-stacked {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sla-stack-item {
  position: relative;
  text-align: center;
}

.sla-stack-divider {
  border-top: 1px solid #e0e0e0;
  margin: 2px 0;
}

.sla-value-small {
  font-size: 22px !important;
}

.plan-card-source {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 12px;
  padding: 2px 4px;
  z-index: 1;
}

.plan-card-subtitle {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.alps-status {
  font-size: 12px;
  font-weight: 400;
  color: #888;
}

.plan-card-alps {
  position: relative;
}

.plan-card-xlip {
  position: relative;
}

body.dark-mode .plan-card-xlip {
  border-left-color: #3a3f48;
}

.alps-refresh-inline {
  padding: 1px 4px;
  font-size: 11px;
  margin-left: 4px;
  vertical-align: middle;
}

.alps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 6px;
}

.alps-table th {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  text-align: center;
}

.alps-table td {
  padding: 5px 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.alps-row-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #666 !important;
  text-align: left !important;
}

.alps-total-row td {
  border-top: 1px solid #ddd;
  font-weight: 700;
}

body.dark-mode .alps-table th {
  color: #aaa;
}

body.dark-mode .alps-table td {
  color: #e0e0e0;
}

body.dark-mode .alps-row-label {
  color: #999 !important;
}

body.dark-mode .alps-total-row td {
  border-top-color: #3a3f48;
}

body.dark-mode .plan-card-alps {
  border-left-color: #3a3f48;
}

#alps-capacity-section .plan-card {
  min-width: 100px;
}

.rate-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: #0073bb;
  background-color: #e3f2fd;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

body.dark-mode .rate-badge {
  color: #4da6e8;
  background-color: #0d2137;
}

.info-tooltip {
  font-size: 14px;
  color: #0073bb;
  cursor: help;
  position: relative;
  display: inline-block;
  margin-left: 4px;
}

.info-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #232f3e;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
  z-index: 100;
}

.info-tooltip:hover::after {
  opacity: 1;
}

.header-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-label {
  font-size: 11px;
  color: #ccc;
}

/* ---------- CORA Risk Section ---------- */
.cora-section {
  margin: 20px 24px 10px;
  padding: 16px 20px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.cora-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cora-controls {
  display: flex;
  gap: 8px;
}

.rodeo-center-controls {
  display: flex;
  gap: 8px;
}

.cora-header h2 {
  font-size: 15px;
  margin: 0;
  color: #333;
}

.cora-updated-label {
  font-size: 11px;
  color: #888;
  margin-left: 8px;
  white-space: nowrap;
}

.cora-updated-label.cora-stale {
  color: #c62828;
  font-weight: 600;
}

body.dark-mode .cora-updated-label {
  color: #999;
}

body.dark-mode .cora-updated-label.cora-stale {
  color: #ef9a9a;
}

.cora-expand-btn {
  padding: 4px 12px;
  font-size: 12px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
}

.cora-expand-btn:hover {
  background-color: #e0e0e0;
}

.day-range-select {
  display: none; /* removed — replaced by custom dropdown */
}

.date-picker-dropdown {
  position: relative;
}

.date-picker-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 200;
  min-width: 120px;
}

.date-picker-panel[hidden] {
  display: none;
}

.date-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-picker-item {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  border: 1px solid #e0e0e0;
  color: #333;
  background-color: #f8f9fa;
  transition: background-color 0.1s, border-color 0.1s;
  user-select: none;
}

.date-picker-item:hover {
  background-color: #e3f2fd;
  border-color: #90caf9;
}

.date-picker-item.selected {
  background-color: #0073bb;
  color: #ffffff;
  border-color: #0073bb;
}

body.dark-mode .date-picker-panel {
  background-color: #1e2228;
  border-color: #3a3f48;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .date-picker-item {
  background-color: #2a2f38;
  border-color: #3a3f48;
  color: #ccc;
}

body.dark-mode .date-picker-item:hover {
  background-color: #354050;
  border-color: #4da6e8;
}

body.dark-mode .date-picker-item.selected {
  background-color: #0073bb;
  color: #ffffff;
  border-color: #0073bb;
}

.date-picker-dropdown .day-range-select {
  display: none;
}

body.dark-mode .day-range-select option {
  background-color: #2a2f38;
  color: #ccc;
}

.rodeo-manifest-on {
  background-color: #e8f5e9 !important;
  color: #2e7d32 !important;
  border-color: #a5d6a7 !important;
}

.cora-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cora-table th,
.cora-table td {
  padding: 5px 8px;
  text-align: center;
  border: 1px solid #e8e8e8;
  white-space: nowrap;
}

.cora-table th {
  background-color: #f5f6f8;
  font-weight: 600;
  font-size: 11px;
  color: #444;
}

.cora-cpt-cell {
  font-weight: 600;
  text-align: left !important;
}

.cora-table-wrapper {
  overflow-x: auto;
}

.cora-risk-bar {
  margin-bottom: -1px;
}

.cora-risk-bar .cora-table {
  border-bottom: 2px solid #0073bb;
}

.cora-risk-bar th {
  font-size: 14px;
  padding: 6px 8px;
}

.cora-summary-row td {
  font-weight: 600;
}

.cora-detail-row td {
  font-size: 11px;
  color: #666;
}

.cora-rodeo-separator td {
  height: 4px;
  padding: 0;
  background-color: #0073bb;
  border: none;
}

body.dark-mode .cora-rodeo-separator td {
  background-color: #4da6e8;
}

body.dark-mode .cora-detail-row td {
  color: #999;
}

.cora-metric-label {
  font-weight: 600;
  text-align: left !important;
  white-space: nowrap;
  background-color: #f9fafb;
}

.cora-cpt-name {
  font-size: 10px;
  font-weight: 700;
  color: #0073bb;
}

/* Rodeo table */
.rodeo-pp-row {
  font-weight: 600;
}

.rodeo-expandable {
  cursor: pointer;
}

.rodeo-expandable:hover {
  background-color: #f0f4ff !important;
}

.rodeo-wp-row {
  font-size: 11px;
  color: #555;
}

.rodeo-wp-label {
  padding-left: 20px !important;
  text-align: left !important;
  font-weight: normal;
  color: #666;
}

.rodeo-sub-wp-label {
  padding-left: 36px !important;
  text-align: left !important;
  font-weight: normal;
  font-size: 10px;
  color: #888;
}

.rodeo-total-row {
  border-top: 2px solid #ccc;
  background-color: #f9fafb;
}

.rodeo-total-cell {
  font-weight: 700;
  background-color: #f0f4ff;
}

.rodeo-warning {
  color: #e65100;
  font-size: 12px;
  margin-top: 8px;
}

.cora-risk-yellow {
  background-color: #fff9c4;
  color: #f57f17;
  font-weight: 600;
}

.cora-risk-orange {
  background-color: #ffe0b2;
  color: #e65100;
  font-weight: 600;
}

.cora-risk-red {
  background-color: #ffcdd2;
  color: #c62828;
  font-weight: 600;
}

/* ---------- Chart Sections ---------- */
.chart-section {
  margin: 20px 24px;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

/* ---------- Mini Charts Grid ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
  margin: 20px 24px;
}

.mini-chart-card {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.mini-chart-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.mini-chart-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.mini-chart-title {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-chart-container {
  position: relative;
  height: 180px;
  width: 100%;
  flex: 1;
  max-height: 180px;
  overflow-y: auto;
}

.mini-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.mini-chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.02) 10px,
    rgba(0,0,0,0.02) 20px
  );
  border: 2px dashed #ddd;
  border-radius: 6px;
}

.placeholder-text {
  font-size: 13px;
  font-weight: 500;
  color: #999;
  font-style: italic;
}

body.dark-mode .mini-chart-placeholder {
  border-color: #3a3f48;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.02) 10px,
    rgba(255,255,255,0.02) 20px
  );
}

body.dark-mode .placeholder-text {
  color: #666;
}

/* ---------- Dwell Mini Summary ---------- */
.dwell-mini-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
}

.dwell-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dwell-count span {
  font-size: clamp(32px, 4vw, 80px);
  font-weight: 700;
}

.dwell-count small {
  font-size: clamp(12px, 1.2vw, 24px);
  color: #888;
}

.dwell-green span { color: #2e7d32; }
.dwell-yellow span { color: #f57f17; }
.dwell-red span { color: #c62828; }

.associate-slow span { color: #1565c0; }
.associate-avg span { color: #2e7d32; }
.associate-fast span { color: #d32f2f; }

body.dark-mode .dwell-green span { color: #66bb6a; }
body.dark-mode .dwell-yellow span { color: #ffa726; }
body.dark-mode .dwell-red span { color: #ef5350; }

body.dark-mode .associate-slow span { color: #42a5f5; }
body.dark-mode .associate-avg span { color: #66bb6a; }
body.dark-mode .associate-fast span { color: #ef5350; }

/* ---------- Eligibility Mini Summary ---------- */
.eligibility-mini-summary {
  overflow-y: auto;
  padding: 6px 20px;
  height: 100%;
  display: flex;
  align-items: center;
}

.eligibility-mini-table {
  width: 100%;
  border-collapse: collapse;
}

.eligibility-mini-table tr + tr {
  border-top: 1px solid #eee;
}

.eligibility-mini-table td {
  padding: 5px 8px;
}

.eligibility-mini-table .elig-name {
  text-align: left;
  color: #555;
  font-size: 18px;
}

.eligibility-mini-table .elig-count {
  text-align: right;
  font-weight: 700;
  font-size: 24px;
}

.eligibility-mini-table .elig-name {
  white-space: nowrap;
  vertical-align: top;
  width: 1%;
}

.eligibility-mini-table .elig-count-badge {
  font-size: 0.9em;
  color: #ff9900;
  font-weight: 700;
}

.eligibility-mini-table .elig-logins {
  text-align: right;
  color: #232f3e;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

body.dark-mode .eligibility-mini-table tr + tr {
  border-top-color: #3a3f48;
}

body.dark-mode .eligibility-mini-table .elig-name {
  color: #aaa;
}

body.dark-mode .eligibility-mini-table .elig-logins {
  color: #d6d9de;
}

body.dark-mode .eligibility-mini-table .elig-count-badge {
  color: #ffb84d;
}

/* ---------- Eligibility Modal Table ---------- */
.eligibility-modal-table-wrap {
  max-height: 60vh;
  overflow-y: auto;
}

.eligibility-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.eligibility-modal-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
}

.eligibility-modal-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
}

.eligibility-modal-table tr.elig-inactive {
  opacity: 0.45;
}

body.dark-mode .eligibility-modal-table th {
  background: #252a32;
  color: #ccc;
  border-bottom-color: #444;
}

body.dark-mode .eligibility-modal-table td {
  border-bottom-color: #333;
}

/* ---------- Skynet Late Departures ---------- */
.skynet-mini-summary {
  overflow-y: auto;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.skynet-mini-row {
  display: flex;
  gap: 0;
  height: 100%;
}

.skynet-mini-row .skynet-mini-section {
  flex: 1;
  text-align: center;
  padding: 0 10px;
}

.skynet-mini-row .skynet-mini-section + .skynet-mini-section {
  border-left: 2px solid #444;
}

.skynet-mini-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.skynet-mini-ok {
  font-size: 14px;
  color: #2e7d32;
  padding: 4px 0;
}

.skynet-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.skynet-mini-table th {
  font-size: 10px;
  color: #888;
  text-align: left;
  padding: 2px 4px;
  border-bottom: 1px solid #eee;
}

.skynet-mini-table td {
  padding: 2px 4px;
  font-size: 11px;
}

.skynet-modal-section {
  margin-bottom: 20px;
}

.skynet-modal-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #555;
}

.skynet-no-data {
  font-size: 16px;
  color: #2e7d32;
  padding: 10px 0;
}

.skynet-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.skynet-modal-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.skynet-modal-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
}

.skynet-modal-table tr.skynet-late {
  color: #c62828;
}

td.skynet-late {
  color: #c62828 !important;
  font-weight: 700;
}

body.dark-mode .skynet-mini-ok { color: #66bb6a; }
body.dark-mode .skynet-mini-table th { border-bottom-color: #3a3f48; color: #777; }
body.dark-mode .skynet-modal-section h3 { color: #ccc; }
body.dark-mode .skynet-no-data { color: #66bb6a; }
body.dark-mode .skynet-modal-table th { background: #252a32; color: #ccc; border-bottom-color: #444; }
body.dark-mode .skynet-modal-table td { border-bottom-color: #333; }
body.dark-mode .skynet-modal-table tr.skynet-late { color: #ef5350; }
body.dark-mode td.skynet-late { color: #ef5350 !important; }

/* ---------- TCAP Mini Summary ---------- */
.tcap-mini-summary {
  padding: 6px 10px;
  overflow-y: auto;
}

.tcap-mini-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.tcap-mini-header-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.tcap-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tcap-mini-stat .tcap-pct {
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 700;
  color: #f57c00;
}

.tcap-mini-stat .tcap-trucks {
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 700;
  color: #1565c0;
}

.tcap-mini-stat small {
  font-size: 10px;
  color: #888;
}

.tcap-mini-ok {
  text-align: center;
  font-size: 13px;
  color: #2e7d32;
  padding: 4px 0;
}

.tcap-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.tcap-mini-table th {
  font-size: 9px;
  color: #888;
  text-align: left;
  padding: 2px 4px;
  border-bottom: 1px solid #eee;
}

.tcap-mini-table td {
  padding: 2px 4px;
}

/* ---------- TCAP Modal ---------- */
.tcap-modal-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tcap-modal-stat {
  font-size: 14px;
}

.tcap-no-data {
  font-size: 16px;
  color: #2e7d32;
  padding: 10px 0;
}

.tcap-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tcap-modal-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.tcap-modal-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
}

body.dark-mode .tcap-mini-ok { color: #66bb6a; }
body.dark-mode .tcap-mini-table th { border-bottom-color: #3a3f48; color: #777; }
body.dark-mode .tcap-no-data { color: #66bb6a; }
body.dark-mode .tcap-modal-table th { background: #252a32; color: #ccc; border-bottom-color: #444; }
body.dark-mode .tcap-modal-table td { border-bottom-color: #333; }

.tcap-breach-row { color: #c62828; }
.tcap-breach-pct { color: #c62828 !important; font-weight: 700; }
.tcap-trucks-alert { color: #c62828 !important; }

body.dark-mode .tcap-breach-row { color: #ef5350; }
body.dark-mode .tcap-breach-pct { color: #ef5350 !important; }
body.dark-mode .tcap-trucks-alert { color: #ef5350 !important; }

/* Idle Time mini — smaller text */
.idle-time-mini .dwell-count span {
  font-size: 32px;
}
.idle-time-mini .dwell-count small {
  font-size: 14px;
}

/* Pick Performance + Idle Time merged mini panel */
.pick-perf-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 0;
  margin-top: -10px;
}

.pick-perf-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.pick-perf-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pick-perf-count span {
  font-size: 62px;
  font-weight: 700;
}

.pick-perf-count small {
  font-size: 15px;
  color: #888;
}

.pick-perf-divider {
  width: 80%;
  height: 1px;
  background: #e0e0e0;
  margin: 2px 0;
}

body.dark-mode .pick-perf-divider {
  background: #3a3f48;
}

.pick-perf-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.pick-perf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pick-perf-stat span {
  font-size: 26px;
  font-weight: 600;
  color: #1a1a1a;
}

.pick-perf-stat small {
  font-size: 10px;
  color: #888;
}

body.dark-mode .pick-perf-stat span {
  color: #e0e0e0;
}

/* ---------- Dwell Modal Table ---------- */
.dwell-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dwell-filter-btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f0f0f0;
  color: #333;
}

.dwell-filter-btn.active {
  border-color: #0073bb;
  background: #e3f2fd;
  color: #0073bb;
  font-weight: 600;
}

.dwell-filter-btn.filter-green.active { border-color: #2e7d32; background: #e8f5e9; color: #2e7d32; }
.dwell-filter-btn.filter-yellow.active { border-color: #f57f17; background: #fff8e1; color: #f57f17; }
.dwell-filter-btn.filter-red.active { border-color: #c62828; background: #ffebee; color: #c62828; }

.dwell-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dwell-table th {
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: #444;
  background: #f8f9fa;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.dwell-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
}

.dwell-table .dwell-cell-green { color: #2e7d32; font-weight: 600; }
.dwell-table .dwell-cell-yellow { color: #f57f17; font-weight: 600; }
.dwell-table .dwell-cell-red { color: #c62828; font-weight: 700; }

.dwell-table .dwell-title-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dwell-table a {
  color: #0073bb;
  text-decoration: none;
}
.dwell-table a:hover { text-decoration: underline; }

.dwell-modal-container {
  max-height: 400px;
  overflow-y: auto;
}

body.dark-mode .dwell-filter-btn { background: #2a2f38; border-color: #3a3f48; color: #ccc; }
body.dark-mode .dwell-filter-btn.active { background: #0d2137; border-color: #4da6e8; color: #4da6e8; }
body.dark-mode .dwell-table th { background: #252a32; color: #ccc; border-bottom-color: #3a3f48; }
body.dark-mode .dwell-table td { border-bottom-color: #2a2f38; color: #ddd; }
body.dark-mode .dwell-table a { color: #4da6e8; }

/* Idle Time columns in merged table */
.idle-col-header {
  background-color: #e8f5e9 !important;
  color: #2e7d32 !important;
}

.idle-col {
  background-color: #f1f8f2;
}

body.dark-mode .idle-col-header {
  background-color: #1b3324 !important;
  color: #66bb6a !important;
}

body.dark-mode .idle-col {
  background-color: #1a2e22;
}

body.dark-mode .mini-chart-card {
  background-color: #1e2228;
  border-color: #2a2f38;
}

body.dark-mode .mini-chart-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mini-chart-title {
  color: #ccc;
}

/* ---------- Chart Modal ---------- */
.chart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 960;
}

.chart-modal-overlay[hidden] {
  display: none;
}

.chart-modal {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 24px;
  width: 90vw;
  max-width: 1100px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.chart-modal-close {
  background: none;
  border: 1px solid #ccc;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  padding: 2px 10px;
  border-radius: 4px;
  line-height: 1;
}

.chart-modal-close:hover {
  background-color: #f0f0f0;
  color: #333;
}

.chart-modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chart-modal-body {
  position: relative;
  height: 400px;
  width: 100%;
}

.chart-modal-body canvas {
  width: 100% !important;
  height: 100% !important;
}

body.dark-mode .chart-modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

body.dark-mode .chart-modal {
  background-color: #1e2228;
  border: 1px solid #2a2f38;
}

body.dark-mode .chart-modal-header h2 {
  color: #e0e0e0;
}

body.dark-mode .chart-modal-close {
  border-color: #3a3f48;
  color: #aaa;
}

body.dark-mode .chart-modal-close:hover {
  background-color: #2a2f38;
  color: #fff;
}

.chart-section h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #333;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chart-controls label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.chart-controls select {
  min-width: 160px;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

.total-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.total-chart-header h2 {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.target-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.target-inputs label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
}

.target-field {
  width: 80px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.split-field {
  width: 65px;
}

.apply-target-btn {
  padding: 5px 12px;
  font-size: 12px;
  background-color: #0073bb;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.apply-target-btn:hover {
  background-color: #005a94;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Table Section ---------- */
.table-section {
  margin: 20px 24px;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.table-section-half {
  width: calc(50% - 30px);
  display: inline-block;
  vertical-align: top;
}

.table-section-half .section-title-row {
  margin-bottom: 12px;
}

.table-section-half .section-title-row h2 {
  margin: 0;
}

.table-section h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #333;
}

#associate-table-container {
  overflow-x: auto;
}

.associate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.associate-table thead {
  background-color: #f8f9fa;
}

.associate-table th,
.associate-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

.associate-table th {
  font-weight: 600;
  color: #444;
  white-space: nowrap;
  border-bottom: 2px solid #ddd;
}

.associate-table tbody tr:hover {
  background-color: #f5f8fc;
}

.expandable-row {
  cursor: pointer;
}

.expandable-row:hover {
  background-color: #eef3fa !important;
}

.expand-icon {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  color: #666;
  transition: transform 0.15s;
}

.breakdown-row {
  background-color: #f9fafb !important;
  font-size: 12px;
  color: #555;
}

.breakdown-row td {
  padding: 4px 12px !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.breakdown-indent {
  color: #999;
  padding-left: 20px !important;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-header:hover {
  background-color: #eef3fa;
  color: #0073bb;
}

/* ---------- Threshold Status Indicators ---------- */
.status-cell {
  font-weight: 600;
  border-radius: 3px;
}

.status-above {
  color: #d32f2f;
  background-color: #ffebee;
}

.status-below {
  color: #1565c0;
  background-color: #e3f2fd;
}

.status-at {
  color: #2e7d32;
  background-color: #e8f5e9;
}

/* Table row status styling */
tr.status-above {
  border-left: 3px solid #d32f2f;
}

tr.status-below {
  border-left: 3px solid #1565c0;
}

tr.status-at {
  border-left: 3px solid #2e7d32;
}

/* ---------- Go to Source Button ---------- */
.go-to-source-btn {
  padding: 4px 10px;
  font-size: 12px;
  background-color: #f0f0f0;
  color: #0073bb;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}

.go-to-source-btn:hover {
  background-color: #e3f2fd;
  border-color: #0073bb;
}

/* ---------- Configuration Panel ---------- */
.config-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  z-index: 950;
}

.config-panel.open {
  display: block;
}

.config-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 940;
}

.config-overlay.open {
  display: block;
}

.config-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.config-panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.version-badge {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  background-color: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.config-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.config-close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.config-panel h2 {
  font-size: 15px;
  margin-bottom: 16px;
  color: #333;
}

.config-panel fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  margin: 0 0 16px;
}

.config-panel legend {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  padding: 0 8px;
}

.config-toggle-btn {
  margin-left: auto;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 4px;
  color: #333;
  font-weight: 500;
}

.config-toggle-btn:hover {
  background-color: #e0e0e0;
  border-color: #999;
}

.feedback-btn {
  display: inline-block;
  padding: 5px 12px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.feedback-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.refresh-btn {
  background: none;
  border: 1px solid #2e7d32;
  color: #2e7d32;
  font-size: 18px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1;
  font-weight: bold;
}

.refresh-btn:hover {
  background-color: #e8f5e9;
}

.refresh-btn:active {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

.last-refresh-text {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
}

.threshold-inputs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.threshold-inputs .control-group {
  flex: 1;
  min-width: 180px;
}

.threshold-inputs input[type="number"] {
  width: 100px;
}

#save-thresholds-btn {
  margin-top: 8px;
  background-color: #2e7d32;
}

#save-thresholds-btn:hover {
  background-color: #1b5e20;
}

.reset-btn {
  margin-top: 8px;
  margin-left: 8px;
  background-color: #757575;
}

.reset-btn:hover {
  background-color: #616161;
}

.pp-threshold-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #eee;
}

.pp-threshold-header {
  background-color: transparent;
  border: none;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

.pp-threshold-col-label {
  font-size: 11px;
  color: #555;
  text-align: center;
}

.pp-threshold-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.pp-threshold-row input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.shift-markers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.shift-marker-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shift-marker-col strong {
  font-size: 13px;
  color: #333;
  margin-bottom: 4px;
}

.shift-marker-col label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #555;
}

.shift-marker-col input[type="time"] {
  width: 100px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ---------- Auth Error Overlay ---------- */
.auth-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-error-overlay[hidden] {
  display: none;
}

.auth-error-content {
  background-color: #ffffff;
  padding: 32px 40px;
  border-radius: 8px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-error-content h2 {
  font-size: 18px;
  color: #d32f2f;
  margin-bottom: 12px;
}

.auth-error-content p {
  font-size: 14px;
  color: #555;
  margin: 8px 0;
}

.auth-error-content code {
  background-color: #f5f5f5;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  color: #d32f2f;
}

.auth-error-content button {
  margin-top: 20px;
  padding: 10px 28px;
  font-size: 14px;
  background-color: #0073bb;
}

/* ---------- Loading Indicator ---------- */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 14px;
  color: #555;
}

.loading-indicator[hidden] {
  display: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #0073bb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: 60px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  padding: 12px 16px;
  background-color: #323232;
  color: #ffffff;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
  word-wrap: break-word;
}

.toast.toast-error {
  background-color: #d32f2f;
}

.toast.toast-warning {
  background-color: #f57c00;
}

.toast.toast-success {
  background-color: #2e7d32;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Messages ---------- */
.no-data-message {
  text-align: center;
  padding: 24px;
  color: #777;
  font-size: 14px;
  font-style: italic;
}

.error-message {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 8px;
}

/* ---------- Utility ---------- */
[hidden] {
  display: none !important;
}

/* ---------- Dark Mode Toggle ---------- */
.dark-mode-toggle {
  display: flex;
  align-items: center;
}

.dark-mode-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

/* ---------- Dark Mode Theme ---------- */
body.dark-mode {
  background-color: #1a1d23;
  color: #e0e0e0;
}

body.dark-mode .app-header {
  background-color: #16191f;
  border-bottom: 1px solid #2a2f38;
}

body.dark-mode .controls-bar {
  background-color: #1e2228;
  border-bottom: 1px solid #2a2f38;
}

body.dark-mode .last-refresh-text {
  color: #999;
}

body.dark-mode .header-label {
  color: #999;
}

body.dark-mode .shift-plan-section,
body.dark-mode .cora-section,
body.dark-mode .chart-section,
body.dark-mode .table-section {
  background-color: #1e2228;
  border-color: #2a2f38;
}

body.dark-mode .plan-card {
  background-color: #232830;
  border-color: #3a3f48;
}

body.dark-mode h2,
body.dark-mode h3 {
  color: #e0e0e0;
}

body.dark-mode .plan-card-actual {
  color: #ffffff;
}

body.dark-mode .plan-card-title {
  color: #aaa;
}

body.dark-mode .plan-card-divider {
  background-color: #3a3f48;
}

body.dark-mode input.plan-card-plan {
  color: #ffffff !important;
  border-bottom-color: #555 !important;
}

body.dark-mode .plan-calc-btn {
  color: #ccc;
}

body.dark-mode .plan-card-label {
  color: #777;
}

body.dark-mode .plan-card-sla {
  border-left-color: #3a3f48;
}

body.dark-mode .sla-stack-divider {
  border-top-color: #3a3f48;
}

body.dark-mode .cora-table th {
  background-color: #252a32;
  color: #ccc;
}

body.dark-mode .cora-table td {
  border-color: #2a2f38;
  color: #ddd;
}

body.dark-mode .cora-metric-label {
  background-color: #252a32;
  color: #ccc;
}

body.dark-mode .cora-expand-btn {
  background-color: #2a2f38;
  border-color: #3a3f48;
  color: #ccc;
}

body.dark-mode .cora-expand-btn:hover {
  background-color: #3a3f48;
}

body.dark-mode input[type="date"],
body.dark-mode input[type="number"],
body.dark-mode input[type="time"],
body.dark-mode select {
  background-color: #2a2f38;
  border-color: #3a3f48;
  color: #e0e0e0;
}

body.dark-mode .control-group label {
  color: #aaa;
}

body.dark-mode .associate-table thead {
  background-color: #252a32;
}

body.dark-mode .associate-table th {
  color: #ccc;
  border-bottom-color: #3a3f48;
}

body.dark-mode .associate-table td {
  border-bottom-color: #2a2f38;
  color: #ddd;
}

body.dark-mode .associate-table tbody tr:hover {
  background-color: #252a32;
}

body.dark-mode .table-section {
  background-color: #1e2228;
  border-color: #2a2f38;
}

body.dark-mode .table-section h2 {
  color: #e0e0e0;
}

body.dark-mode .status-above {
  color: #ef9a9a;
  background-color: #3b1010;
}

body.dark-mode .status-below {
  color: #90caf9;
  background-color: #0d2137;
}

body.dark-mode .status-at {
  color: #a5d6a7;
  background-color: #1b3a1b;
}

body.dark-mode tr.status-above {
  border-left-color: #ef9a9a;
}

body.dark-mode tr.status-below {
  border-left-color: #90caf9;
}

body.dark-mode tr.status-at {
  border-left-color: #a5d6a7;
}

body.dark-mode .expandable-row:hover {
  background-color: #2a3040 !important;
}

body.dark-mode .breakdown-row td {
  border-bottom-color: #2a2f38 !important;
  color: #aaa;
}

body.dark-mode .sortable-header:hover {
  background-color: #2a3040;
  color: #4da6e8;
}

body.dark-mode .config-panel {
  background-color: #1e2228;
  border-color: #2a2f38;
}

body.dark-mode .config-panel fieldset {
  border-color: #2a2f38;
}

body.dark-mode .config-panel legend {
  color: #ccc;
}

body.dark-mode .config-panel-header h2 {
  color: #e0e0e0;
}

body.dark-mode .config-close-btn {
  color: #aaa;
}

body.dark-mode .config-close-btn:hover {
  background-color: #2a2f38;
  color: #fff;
}

body.dark-mode .pp-threshold-row {
  background-color: #252a32;
  border-color: #2a2f38;
}

body.dark-mode .pp-threshold-label {
  color: #ccc;
}

body.dark-mode .config-toggle-btn {
  background-color: #2a2f38;
  border-color: #3a3f48;
  color: #ccc;
}

body.dark-mode .config-toggle-btn:hover {
  background-color: #3a3f48;
}

body.dark-mode .refresh-btn {
  border-color: #4caf50;
  color: #4caf50;
}

body.dark-mode .refresh-btn:hover {
  background-color: rgba(76, 175, 80, 0.1);
}

body.dark-mode .source-link-btn {
  border-color: #3a3f48;
  color: #4da6e8;
}

body.dark-mode .source-link-btn:hover {
  background-color: #252a32;
}

body.dark-mode .target-inputs label {
  color: #aaa;
}

body.dark-mode .target-field {
  background-color: #2a2f38;
  border-color: #3a3f48;
  color: #e0e0e0;
}

body.dark-mode .chart-controls label {
  color: #aaa;
}

body.dark-mode .dark-mode-toggle label {
  color: #ccc;
}

body.dark-mode .rodeo-total-row {
  background-color: #252a32;
}

body.dark-mode .rodeo-total-cell {
  background-color: #1a2433;
}

body.dark-mode .rodeo-manifest-on {
  background-color: #1b3a1b !important;
  color: #a5d6a7 !important;
  border-color: #2e7d32 !important;
}

body.dark-mode .cora-risk-yellow {
  background-color: #3d3400;
  color: #ffd54f;
}

body.dark-mode .cora-risk-orange {
  background-color: #3e2000;
  color: #ffb74d;
}

body.dark-mode .cora-risk-red {
  background-color: #3b1010;
  color: #ef9a9a;
}

body.dark-mode .breakdown-row {
  background-color: #252a32 !important;
}
