:root {
  /* Match CSM theme body background and panels */
  --ssp-bg: #eff3f9;
  --ssp-panel: #ffffff;
  --ssp-panel2: #f8f9fb;
  
  /* Match CSM core colors */
  --green1: green;
  --green2: green;
  --green3: #2ecc71;
  --green4: #2ed47e;
  --green5: #eafbf2;
  /* --green3: green;
  --green4: green;
  --green5: green; */
  
  --gold1: #8B6914;
  --gold2: #C49A2A;
  --gold3: #E8C35A;
  --gold4: #F5E09A;
  --gold5: #FDF8E8;
  
  --navy1: #1A2744;
  --navy2: #2D4070;
  --navy3: #4A6199;
  --navy4: #8FA8CC;
  --navy5: #E8EEF7;
  
  --text1: #1C2018;
  --text2: #4A5244;
  --text3: #8A9486;
  
  --border: #eff3f9;
  --border2: #e7e2e2;
  
  --red: #C0392B;
  --amber: #D4890A;
  --emerald: #1E8449;
}

/* Custom dashboard components style */

/* ---- SHARED INTERACTIVE CARD LINK ---- */
.dash-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dash-card-link .dash-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.dash-card-link:hover .dash-card {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.13);
}

.dash-card-link:active .dash-card {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* ---- BASE CARD ---- */
.dash-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 4px 5px 15px 0px #cecbcb;
  height: 100%;
  margin-bottom: 0;
}

/* ---- ICON BOX ---- */
.dash-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-icon-box .material-symbols-outlined {
  font-size: 20px;
}

/* ---- TYPOGRAPHY ---- */
.dash-label {
  font-size: 12px;
  color: #050505ff;
  font-weight: 500;
  margin-bottom: 4px;
}

.dash-value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: #1a1a2e;
  margin: 0;
}

.dash-unit {
  font-size: 11px;
  color: #000000;
  font-weight: 600;
  margin-left: 4px;
}

.dash-sublabel {
  font-size: 11px;
  color: #000000;
  font-weight: 600;
  margin-top: 3px;
  margin-bottom: 0;
}

/* PROCESS FLOW */
.process-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.process-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ssp-panel2);
  border: 1px solid var(--border);
}
.process-step .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.process-step .step-num.done { background: var(--green2); color: #fff; }
.process-step .step-num.active { background: var(--gold2); color: #fff; }
.process-step .step-num.pending { background: var(--border2); color: var(--text3); }

.step-label {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
}
.step-bar-wrap {
  width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
}
.step-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--green2);
}
.step-pct {
  font-size: 10px;
  color: var(--text3);
  width: 32px;
  text-align: right;
}
.arrow-down {
  text-align: center;
  color: var(--green3);
  font-size: 14px;
  line-height: 1;
}

/* DISEASE PANEL */
.disease-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.disease-row:last-child {
  border-bottom: none;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: #27AE60; }
.status-dot.amber { background: #F39C12; }
.status-dot.red { background: #E74C3C; }

.disease-name {
  flex: 1;
  font-size: 12px;
  color: var(--text1);
}
.disease-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-green { background: #EAFAF1; color: #1E8449; }
.badge-amber { background: #FEF9E7; color: #B7770D; }
.badge-red { background: #FDEDEC; color: #C0392B; }

/* INVENTORY */
.inv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.inv-item:last-child {
  border-bottom: none;
}
.inv-name {
  font-size: 12px;
  color: var(--text1);
}
.inv-bar-wrap {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 10px;
}
.inv-bar {
  height: 100%;
  border-radius: 2px;
}
.inv-bar.ok { background: var(--green2); }
.inv-bar.warn { background: var(--amber); }
.inv-bar.low { background: var(--red); }
.inv-qty {
  font-size: 11px;
  color: var(--text3);
}

/* EQUIPMENT */
.equip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ssp-panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.equip-icon {
  font-size: 20px;
  color: var(--navy3);
}
.equip-name {
  font-size: 12px;
  font-weight: 500;
}
.equip-status {
  font-size: 10px;
  margin-top: 1px;
}
.equip-status.ok { color: var(--emerald); }
.equip-status.warn { color: var(--amber); }

.equip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ALLOCATION TABLE */
.alloc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.alloc-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.alloc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.alloc-table tr:last-child td {
  border-bottom: none;
}
.alloc-table tr:hover td {
  background: var(--ssp-panel2);
}

.progress-sm {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
}
.progress-sm-inner {
  height: 100%;
  border-radius: 2px;
  background: var(--navy2);
}

/* AI PANEL */
.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ai-badge {
  background: linear-gradient(135deg, var(--green5), var(--gold5));
  border: 1px solid var(--gold3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold1);
  letter-spacing: .5px;
}
.ai-rec {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ai-rec:last-child {
  border-bottom: none;
}
.ai-rec-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ai-rec-text {
  font-size: 12px;
  color: var(--text1);
  line-height: 1.5;
}
.ai-rec-text strong {
  color: var(--text1);
  font-weight: 600;
}
.ai-rec-time {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

/* FOOTER BAR */
.footer-bar {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.footer-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
}
.footer-stat i {
  font-size: 13px;
  color: var(--green2);
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27AE60;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* MAP placeholder */
.map-placeholder {
  background: var(--ssp-panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text3);
}
.map-placeholder i {
  font-size: 40px;
  color: var(--green4);
}

/* TABS */
.tab-row {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  background: var(--ssp-panel2);
  border-radius: 8px;
  padding: 3px;
}
.tab-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text3);
  border: none;
  background: transparent;
  transition: all .15s;
}
.tab-btn.active {
  background: #ffffff;
  color: var(--text1);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
