/* SCM Dashboard styles — purple theme */
.scm-dash-wrap { padding: 0 24px; }
.scm-shell {
  max-width: 1240px; margin: 30px auto 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #04071a; text-align: left;
  box-shadow: 0 60px 140px -30px rgba(176,107,255,0.45), 0 0 0 1px rgba(255,255,255,0.04);
}
.scm-shell .titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; background: #1b1f33;
  border-bottom: 1px solid transparent;
  border-image: var(--fade-edge) 1;
}
.scm-shell .traffic { display: flex; gap: 7px; }
.scm-shell .traffic span { width: 12px; height: 12px; border-radius: 50%; }
.scm-shell .traffic .r { background: #ff5f57; }
.scm-shell .traffic .y { background: #febc2e; }
.scm-shell .traffic .g { background: #28c840; }
.scm-shell .url-pill {
  flex: 1; text-align: center; font-size: 11px; color: #9aa3bd;
  background: #2a2f47; padding: 4px 14px; border-radius: 6px;
  max-width: 360px; margin: 0 auto;
}
.scm-shell .chrome-tools { display: flex; gap: 8px; color: #6b7593; font-size: 11px; }
.scm-shell .chrome-tools.right { margin-left: auto; }

.scm-dash {
  display: grid; grid-template-columns: 220px 1fr;
  background: #04071a;
  font-family: 'Inter', sans-serif; font-size: 11px; color: #c9d3ee;
}

/* ----- SIDEBAR ----- */
.scm-dash .side {
  background: #060a1f;
  border-right: 1px solid transparent;
  border-image: var(--fade-v) 1;
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
}
.scm-dash .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.scm-dash .side .brand .brand-lockup { flex: 1; max-width: 148px; width: 100%; height: auto; display: block; }
.scm-dash .side .brand svg { width: 28px; height: 24px; }
.scm-dash .side .brand .b1 { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; color: #fff; line-height: 1; }
.scm-dash .side .brand .b2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 11px; color: var(--accent-purple); margin-top: 2px; line-height: 1; }
.scm-dash .side .brand .b3 { font-size: 8px; color: #6b7593; margin-top: 2px; letter-spacing: 0.04em; }
.scm-dash .side .brand .pro {
  margin-left: auto; font-size: 8px;
  background: rgba(255,181,71,0.12); color: #ffb547;
  border: 1px solid rgba(255,181,71,0.4);
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.08em;
}

.scm-dash .side .sect {
  margin: 12px 8px 6px; font-size: 9px; color: #2adfc0;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.scm-dash .side .nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: 6px;
  color: #8893b3; font-size: 11px;
  border: 1px solid transparent;
}
.scm-dash .side .nav-item .ic { width: 11px; text-align: center; opacity: 0.7; }
.scm-dash .side .nav-item.active {
  background: linear-gradient(90deg, rgba(40,200,160,0.18) 0%, rgba(40,200,160,0.04) 100%);
  color: #2adfc0; border-color: rgba(40,200,160,0.30);
}

.scm-dash .side .xpoint {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid transparent;
  border-image: var(--fade-edge) 1;
}
.scm-dash .side .xpoint-lbl {
  font-size: 9px; color: #2adfc0; letter-spacing: 0.18em;
  margin: 4px 8px 8px; text-transform: uppercase;
}
.scm-dash .side .xpoint-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
}
.scm-dash .side .xpoint-user .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 12px; color: #fff;
}
.scm-dash .side .xpoint-user .who .n { color: #fff; font-size: 11px; line-height: 1.2; }
.scm-dash .side .xpoint-user .who .r { color: #6b7593; font-size: 9px; }

/* ----- MAIN ----- */
.scm-dash .main { padding: 16px 20px; min-width: 0; }
.scm-dash .head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.scm-dash .head-row h1 {
  margin: 0; font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 18px; letter-spacing: 0.10em;
  color: #fff; text-transform: uppercase;
}
.scm-dash .head-row .sub {
  font-size: 10px; color: #6b7593; margin-top: 2px;
}
.scm-dash .head-row .ts {
  font-size: 10px; color: #8893b3;
  display: flex; align-items: center; gap: 6px;
}
.scm-dash .head-row .ts .ico { color: var(--accent-purple); }

/* Charts row (3 cols) */
.scm-dash .charts3 {
  display: grid; grid-template-columns: 1fr 1.05fr 1.2fr; gap: 14px;
  margin-bottom: 14px;
}
.scm-dash .panel {
  background: rgba(8,12,30,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px 18px;
}
.scm-dash .panel .pt {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 11px; letter-spacing: 0.18em;
  color: #2adfc0; text-transform: uppercase;
  margin-bottom: 14px;
}

/* gauge */
.scm-gauge { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; }
.scm-gauge svg { width: 100%; height: 100%; overflow: visible; }
.scm-gauge .needle-num {
  position: absolute;
  left: 0; right: 0; bottom: 6px; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 42px; color: #ff8c4d; line-height: 1;
}
.scm-gauge .needle-num .max {
  display: block; font-size: 11px; color: #6b7593;
  font-weight: 500; letter-spacing: 0.1em; margin-top: 2px;
}
.scm-gauge-legend {
  display: flex; align-items: center; gap: 12px;
  font-size: 10px; color: #8893b3;
  margin-top: 8px;
}
.scm-gauge-legend .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff8c4d; display: inline-block; margin-right: 5px; }

/* treemap distribution */
.scm-tree {
  display: grid; grid-template-columns: 1fr 1.1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  height: 170px;
}
.scm-tree .tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 6px; color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  position: relative;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 6px);
}
.scm-tree .tile .lbl {
  font-weight: 700; font-size: 22px; letter-spacing: 0.06em; line-height: 1;
}
.scm-tree .tile .num {
  font-size: 26px; font-weight: 700; line-height: 1; margin-top: 4px;
}
.scm-tree .tile .pct { font-size: 10px; opacity: 0.85; margin-top: 4px; letter-spacing: 0.06em; }
.scm-tree .alto {
  grid-row: 1 / span 2;
  background: linear-gradient(180deg, #f08a4a 0%, #d96a30 100%);
}
.scm-tree .medio { background: linear-gradient(180deg, #d6a93a 0%, #b78a25 100%); }
.scm-tree .bajo { background: linear-gradient(180deg, #5dc55a 0%, #3aa238 100%); }

/* evolution chart */
.scm-evo { position: relative; height: 170px; }
.scm-evo svg { width: 100%; height: 100%; overflow: visible; }

/* KPI row */
.scm-kpis-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 14px;
}
.scm-kpi {
  background: rgba(8,12,30,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.scm-kpi .left .lab {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500; font-size: 10px; letter-spacing: 0.18em;
  color: #6b7593; text-transform: uppercase;
  margin-bottom: 8px;
}
.scm-kpi .left .val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 32px; line-height: 1;
}
.scm-kpi.total .val { color: #2adfc0; }
.scm-kpi.crit .val { color: #ff5f5f; }
.scm-kpi.high .val { color: #ff8c4d; }
.scm-kpi.lowmed .val { color: #28c840; }
.scm-kpi .badge {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.scm-kpi.total .badge { background: rgba(42,223,192,0.12); color: #2adfc0; border: 1px solid rgba(42,223,192,0.3); }
.scm-kpi.crit .badge { background: rgba(255,95,95,0.12); color: #ff5f5f; border: 1px solid rgba(255,95,95,0.3); }
.scm-kpi.high .badge { background: rgba(255,140,77,0.12); color: #ff8c4d; border: 1px solid rgba(255,140,77,0.3); }
.scm-kpi.lowmed .badge { background: rgba(40,200,64,0.12); color: #28c840; border: 1px solid rgba(40,200,64,0.3); }

/* Bottom 3 metrics */
.scm-metrics3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.scm-metric {
  background: rgba(8,12,30,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.scm-metric .ic {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.scm-metric.cred .ic { background: rgba(255,95,95,0.12); color: #ff5f5f; border: 1px solid rgba(255,95,95,0.3); }
.scm-metric.doc .ic { background: rgba(176,107,255,0.12); color: #b06bff; border: 1px solid rgba(176,107,255,0.3); }
.scm-metric.serv .ic { background: rgba(255,181,71,0.12); color: #ffb547; border: 1px solid rgba(255,181,71,0.3); }
.scm-metric .info .lab {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500; font-size: 10px; letter-spacing: 0.16em;
  color: #6b7593; text-transform: uppercase;
}
.scm-metric .info .val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 26px; color: #fff;
  line-height: 1.1;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Stack dashboard sidebar/main below tablet */
@media (max-width: 1024px) {
  .scm-dash-wrap { padding: 0 16px; }
  .scm-dash { grid-template-columns: 1fr; }
  .scm-dash .side {
    border-right: none;
    border-bottom: 1px solid transparent;
    border-image: var(--fade-edge) 1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    gap: 6px;
  }
  .scm-dash .side .brand { padding: 4px 8px; flex: 0 0 100%; }
  .scm-dash .side .brand .b3 { white-space: nowrap; }
  .scm-dash .side .sect { display: none; }
  .scm-dash .side .nav-item {
    padding: 6px 10px;
    font-size: 10px;
  }
  .scm-dash .side .xpoint { display: none; }
  .scm-dash .charts3 { grid-template-columns: 1fr; gap: 12px; }
  .scm-gauge { height: 200px; }
  .scm-evo { height: 200px; }
  .scm-kpis-row { grid-template-columns: repeat(2, 1fr); }
  .scm-metrics3 { grid-template-columns: 1fr; }
  .scm-dash .head-row {
    flex-direction: column; align-items: flex-start; gap: 6px;
  }
  .scm-dash .head-row .ts { margin-left: 0; }
}

@media (max-width: 640px) {
  .scm-shell { margin-top: 22px; border-radius: 10px; }
  .scm-shell .url-pill { display: none; }
  .scm-dash .main { padding: 12px 14px; }
  .scm-dash .head-row h1 { font-size: 16px; letter-spacing: 0.08em; }
  .scm-kpis-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scm-kpi .left .val { font-size: 26px; }
  .scm-tree .tile .lbl { font-size: 16px; }
  .scm-tree .tile .num { font-size: 20px; }
  .scm-dash .panel { padding: 12px; }
}

@media (max-width: 480px) {
  .scm-shell .chrome-tools { display: none; }
  .scm-kpis-row { grid-template-columns: 1fr; }
}
