/* =========================================================
   DASHBOARD VISUAL UPGRADE (Grafana/ShadCN-ish)
   - No layout changes; keeps your current card sizes
   - Adds donut, sparklines, shimmer, thin status strip, subtle 3D hover
   ========================================================= */

.ms-kpi-3d{
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.ms-kpi-3d::before{
  content:"";
  position:absolute;
  inset:-40% -40% auto -40%;
  height: 180px;
  background: radial-gradient(circle at 30% 40%, rgba(0,153,255,0.22), transparent 60%);
  opacity: 0.85;
  pointer-events:none;
}

.ms-kpi-3d::after{
  content:"";
  position:absolute;
  inset:auto -35% -55% -35%;
  height: 240px;
  background: radial-gradient(circle at 60% 40%, rgba(214,178,74,0.14), transparent 65%);
  opacity: 0.9;
  pointer-events:none;
}

.ms-kpi-3d:hover{
  transform: translateY(-2px) scale(1.006);
  box-shadow: 0 26px 64px rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.22) !important;
}

/* Thin status strip */
.ms-strip{
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  border-radius: 16px;
}

.ms-strip-item{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width: 140px;
}

.ms-strip-label{
  font-size:0.78rem;
  color: rgba(234,242,255,0.66);
}
body[data-theme="light"] .ms-strip-label{ color: rgba(15,23,42,0.62); }

.ms-strip-value{
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* Live dot */
.ms-dot{
  width:10px;height:10px;border-radius:999px; display:inline-block;
}
.ms-dot-live{
  background: rgba(0,153,255,0.95);
  box-shadow: 0 0 0 0 rgba(0,153,255,0.38);
  animation: msDotPulse 1.8s ease-in-out infinite;
}
@keyframes msDotPulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(0,153,255,0.00); }
  50%{ box-shadow: 0 0 0 10px rgba(0,153,255,0.12); }
}
@media (prefers-reduced-motion: reduce){
  .ms-dot-live{ animation:none !important; }
}

/* Progress bar */
.ms-bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  overflow:hidden;
}
body[data-theme="light"] .ms-bar{
  background: rgba(15,23,42,0.06);
  border-color: rgba(15,23,42,0.12);
}

.ms-bar-fill{
  display:block;
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,153,255,0.95), rgba(214,178,74,0.82));
  box-shadow: 0 0 16px rgba(0,153,255,0.18);
  transition: width 420ms ease;
}

/* Sparkline boxes */
.ms-spark{
  height: 34px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 10px;
  overflow:hidden;
}
body[data-theme="light"] .ms-spark{
  background: rgba(255,255,255,0.65);
  border-color: rgba(15,23,42,0.12);
}
.ms-spark svg{ width:100%; height:100%; }
.ms-spark path{ color: rgba(0,153,255,0.92); }

/* KPI icons */
.ms-kpi-icon{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display:inline-grid;
  place-items:center;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
  color: rgba(0,153,255,0.92);
}
body[data-theme="light"] .ms-kpi-icon{
  background: rgba(255,255,255,0.78);
  border-color: rgba(15,23,42,0.12);
}
.ms-kpi-icon svg{ width: 22px; height: 22px; }

/* Mini ring for System Load */
.ms-mini-ring{
  width: 56px; height: 56px;
  display:grid; place-items:center;
  position: relative;
  opacity: 0.95;
}
.ms-mini-ring svg{ width: 56px; height: 56px; transform: rotate(-90deg); }
.ms-mini-ring .ms-ring-track{ stroke: rgba(255,255,255,0.14); }
body[data-theme="light"] .ms-mini-ring .ms-ring-track{ stroke: rgba(15,23,42,0.14); }
.ms-mini-ring .ms-ring-prog{
  stroke: rgba(0,153,255,0.95);
  stroke-linecap: round;
  stroke-dasharray: 175.9; /* 2πr where r=28 => 175.9 */
  stroke-dashoffset: calc(175.9 - (175.9 * var(--msRing, 0)));
}

/* Disk donut */
.ms-donut{
  width: 74px; height: 74px;
  position: relative;
  display:grid;
  place-items:center;
  border-radius: 999px;
}
.ms-donut svg{ width: 74px; height: 74px; transform: rotate(-90deg); }
.ms-donut-track{
  stroke: rgba(255,255,255,0.14);
}
body[data-theme="light"] .ms-donut-track{
  stroke: rgba(15,23,42,0.14);
}
.ms-donut-prog{
  stroke-linecap: round;
  stroke-dasharray: 163.36; /* 2πr where r=26 */
  stroke-dashoffset: 163.36;
  filter: drop-shadow(0 0 10px rgba(0,153,255,0.18));
  transition: stroke-dashoffset 420ms ease;
}
.ms-donut-center{
  position:absolute;
  font-weight: 900;
  color: rgba(234,242,255,0.90);
}
body[data-theme="light"] .ms-donut-center{ color: rgba(15,23,42,0.88); }

/* Shimmer (subtle) */
.ms-shimmer{
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.18),
    rgba(255,255,255,0.06)
  );
  background-size: 200% 100%;
  animation: msShimmer 2.8s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,0.10);
}
@keyframes msShimmer{
  0%{ background-position: 0% 0%; }
  100%{ background-position: 200% 0%; }
}
@media (prefers-reduced-motion: reduce){
  .ms-shimmer{ animation:none !important; }
}

/* Activity panel */
.ms-activity{
  margin-top: 10px;
}
.ms-activity-empty{
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.18);
  color: rgba(234,242,255,0.72);
}
body[data-theme="light"] .ms-activity-empty{
  border-color: rgba(15,23,42,0.22);
  color: rgba(15,23,42,0.72);
}
.ms-activity-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.ms-activity-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
}
body[data-theme="light"] .ms-activity-item{
  background: rgba(255,255,255,0.75);
  border-color: rgba(15,23,42,0.12);
}
.ms-activity-tag{
  display:inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,153,255,0.12);
  color: rgba(234,242,255,0.88);
  font-weight: 800;
  font-size: 0.78rem;
}
body[data-theme="light"] .ms-activity-tag{
  color: rgba(15,23,42,0.86);
  border-color: rgba(15,23,42,0.16);
}
.ms-activity-text{
  flex: 1 1 auto;
  color: rgba(234,242,255,0.86);
}
body[data-theme="light"] .ms-activity-text{ color: rgba(15,23,42,0.86); }
.ms-activity-ts{
  color: rgba(234,242,255,0.62);
  font-size: 0.88rem;
}
body[data-theme="light"] .ms-activity-ts{ color: rgba(15,23,42,0.62); }

/* Charts */
.ms-chartbox{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
  padding: 12px;
}
body[data-theme="light"] .ms-chartbox{
  border-color: rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.72);
}
.ms-chart-title{
  font-weight: 900;
  margin-bottom: 10px;
}
.ms-chart{
  height: 84px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.10);
  overflow:hidden;
  padding: 8px;
}
body[data-theme="light"] .ms-chart{
  border-color: rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.70);
}
.ms-chart svg{ width:100%; height:100%; }
.ms-chart path{ color: rgba(0,153,255,0.92); }

/* Small refresh button */
.ms-refresh{
  border-radius: 999px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
/* Ensure the mini ring consumes the CSS var set by JS */
#msLoadRing { --msRing: 0; }

/* =========================
   DASHBOARD VISUAL WIDGETS
   (Grafana-ish polish, no deps)
   ========================= */

.ms-kpi-3d{
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.ms-kpi-3d::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(400px 160px at 20% 0%, rgba(0,153,255,0.22), transparent 60%),
    radial-gradient(360px 160px at 90% 10%, rgba(214,178,74,0.16), transparent 60%);
  pointer-events:none;
  opacity: 0.9;
}
.ms-kpi-3d:hover{
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}

/* Status strip */
.ms-strip{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
}
.ms-strip-item{
  min-width: 140px;
}
.ms-strip-label{
  font-size: 0.78rem;
  color: rgba(234,242,255,0.65);
}
.ms-strip-value{
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* Small "live" dot */
.ms-dot{
  width:10px; height:10px; border-radius:50%;
  display:inline-block;
}
.ms-dot-live{
  background: rgba(0,153,255,0.95);
  box-shadow: 0 0 0 rgba(0,153,255,0.0);
  animation: msDotPulse 1.8s ease-in-out infinite;
}
@keyframes msDotPulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(0,153,255,0.0); transform: scale(1); }
  50%{ box-shadow: 0 0 0 10px rgba(0,153,255,0.10); transform: scale(1.05); }
}

/* Progress bar */
.ms-bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  overflow:hidden;
}
.ms-bar-fill{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(0,153,255,0.95), rgba(214,178,74,0.85));
  border-radius: 999px;
  transition: width 260ms ease;
}

/* Sparkline container */
.ms-spark{
  height: 34px;
  border-radius: 14px;
  background: rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 10px;
}
.ms-spark svg{
  width:100%;
  height:100%;
}
.ms-spark path{
  color: rgba(0,153,255,0.95);
}

/* Donut */
.ms-donut{
  position: relative;
  width: 72px;
  height: 72px;
  display:grid;
  place-items:center;
}
.ms-donut svg{
  width:72px;
  height:72px;
  transform: rotate(-90deg);
}
.ms-donut-track{
  stroke: rgba(255,255,255,0.14);
}
.ms-donut-prog{
  stroke-linecap: round;
  stroke-dasharray: 163.36; /* 2πr where r=26 */
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 260ms ease;
}
.ms-donut-center{
  position:absolute;
  font-weight: 900;
  font-size: 0.95rem;
  color: rgba(234,242,255,0.92);
}

/* Mini ring */
.ms-mini-ring{
  width: 54px;
  height: 54px;
  display:grid;
  place-items:center;
  opacity: 0.95;
}
.ms-mini-ring svg{
  width:54px;height:54px;
  transform: rotate(-90deg);
}
.ms-mini-ring .ms-ring-track{
  stroke: rgba(255,255,255,0.14);
}
.ms-mini-ring .ms-ring-prog{
  stroke: rgba(0,153,255,0.95);
  stroke-linecap: round;
  stroke-dasharray: 175.93; /* 2πr where r=28 */
  stroke-dashoffset: calc(175.93 - (175.93 * var(--msRing, 0)));
  transition: stroke-dashoffset 200ms linear;
}
#msLoadRing{ --msRing: 0; }

/* Shimmer divider */
.ms-shimmer{
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06),
    rgba(0,153,255,0.18),
    rgba(255,255,255,0.06)
  );
  background-size: 240% 100%;
  animation: msShimmer 2.6s ease-in-out infinite;
}
@keyframes msShimmer{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 240% 50%; }
}

/* Activity list */
.ms-activity-empty{
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.18);
  color: rgba(234,242,255,0.72);
}
.ms-activity-list{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.ms-activity-item{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
}
.ms-activity-tag{
  font-size: 0.78rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.10);
}
.ms-activity-text{
  flex: 1;
  color: rgba(234,242,255,0.86);
}
.ms-activity-ts{
  font-size: 0.82rem;
  color: rgba(234,242,255,0.58);
}

/* Charts box */
.ms-chartbox{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  padding: 12px;
}
.ms-chart-title{
  font-weight: 900;
  margin-bottom: 8px;
}
.ms-chart{
  height: 64px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 10px;
}
.ms-chart svg{ width:100%; height:100%; }
.ms-chart path{ color: rgba(0,153,255,0.95); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .ms-kpi-3d:hover{ transform:none; }
  .ms-dot-live{ animation:none !important; }
  .ms-shimmer{ animation:none !important; }
}
/* =========================
   Dashboard "pop" layer
   ========================= */

.ms-kpi-3d{
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.ms-kpi-3d::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(500px 180px at 18% 12%, rgba(0,153,255,0.18), transparent 60%),
    radial-gradient(420px 160px at 90% 10%, rgba(214,178,74,0.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  opacity: 0.85;
  pointer-events:none;
}

.ms-kpi-3d::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.08) 28%, transparent 55%);
  transform: translateX(-140%);
  opacity: 0.35;
  pointer-events:none;
}

.ms-kpi-3d:hover{
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(0,0,0,0.30);
}
.ms-kpi-3d:hover::after{
  transform: translateX(140%);
  transition: transform 780ms ease;
}

@media (prefers-reduced-motion: reduce){
  .ms-kpi-3d:hover{ transform:none; }
  .ms-kpi-3d::after{ display:none; }
}

/* Status strip */
.ms-strip{
  border-radius: 16px;
}
.ms-strip-item{
  min-width: 160px;
}
.ms-strip-label{
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.ms-strip-value{
  font-weight: 900;
  color: var(--text-main);
}

/* tiny live dot */
.ms-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.ms-dot-live{
  background: rgba(0,153,255,0.85);
  box-shadow: 0 0 0 0 rgba(0,153,255,0.45);
  animation: msDotPulse 1.8s ease-in-out infinite;
}
@keyframes msDotPulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(0,153,255,0.45); }
  50%{ box-shadow: 0 0 0 8px rgba(0,153,255,0.0); }
}

/* Bars */
.ms-bar{
  width:100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  overflow:hidden;
}
.ms-bar-fill{
  display:block;
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,153,255,0.95), rgba(214,178,74,0.85));
  box-shadow: 0 10px 22px rgba(0,153,255,0.14);
  transition: width 420ms ease;
}

/* Icons */
.ms-kpi-icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
}
.ms-kpi-icon svg{
  width: 22px;
  height: 22px;
  opacity: 0.92;
}

/* Donut */
.ms-donut{
  width: 76px;
  height: 76px;
  position: relative;
  display:grid;
  place-items:center;
}
.ms-donut svg{
  width: 76px;
  height: 76px;
  transform: rotate(-90deg);
}
.ms-donut-track{
  stroke: rgba(255,255,255,0.14);
}
.ms-donut-prog{
  stroke-linecap: round;
  transition: stroke-dashoffset 520ms ease;
  filter: drop-shadow(0 0 10px rgba(0,153,255,0.18));
}
.ms-donut-center{
  position:absolute;
  font-weight: 950;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Mini ring */
.ms-mini-ring{
  width: 66px;
  height: 66px;
  display:grid;
  place-items:center;
}
.ms-mini-ring svg{
  width: 66px;
  height: 66px;
  transform: rotate(-90deg);
}
.ms-ring-track{
  stroke: rgba(255,255,255,0.14);
}
.ms-ring-prog{
  stroke: rgba(0,153,255,0.92);
  stroke-linecap: round;
  transition: stroke-dashoffset 520ms ease;
  filter: drop-shadow(0 0 10px rgba(0,153,255,0.18));
}

/* Sparklines */
.ms-spark{
  height: 38px;
  border-radius: 14px;
  background: rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 10px;
}
.ms-spark svg{
  width: 100%;
  height: 100%;
  color: rgba(0,153,255,0.92);
}

/* Shimmer placeholder */
.ms-shimmer{
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: msShimmer 1.8s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,0.10);
}
@keyframes msShimmer{
  0%{ background-position: 0% 0; }
  100%{ background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce){
  .ms-shimmer{ animation:none; }
  .ms-dot-live{ animation:none; }
}

/* Activity list */
.ms-activity{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  padding: 10px;
  min-height: 140px;
}
.ms-activity-empty{
  padding: 14px;
  color: var(--text-muted);
}
.ms-activity-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
}
.ms-activity-item + .ms-activity-item{
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ms-activity-tag{
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
  color: rgba(234,242,255,0.82);
  min-width: 84px;
  text-align:center;
}
.ms-activity-text{
  flex: 1;
  color: var(--text-main);
  opacity: 0.92;
}
.ms-activity-ts{
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Charts box */
.ms-chartbox{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  padding: 12px;
}
.ms-chart-title{
  font-weight: 900;
  margin-bottom: 8px;
}
.ms-chart{
  height: 74px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 10px;
}
.ms-chart svg{
  width: 100%;
  height: 100%;
  color: rgba(0,153,255,0.92);
}

/* =========================================================
   RECENT ACTIVITY - mobile overflow fix (datetime off-screen)
   ========================================================= */

/* The activity item is typically a left block (label/text) + right block (datetime). */
.ms-activity .ms-activity-item,
.ms-activity .ms-activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Critical: allow the left side to shrink instead of forcing overflow */
.ms-activity .ms-activity-item > :first-child,
.ms-activity .ms-activity-row > :first-child {
  min-width: 0;
}

/* The datetime: keep tidy on desktop, but never overflow container */
.ms-activity .ms-activity-time,
.ms-activity .ms-activity-date,
.ms-activity .ms-activity-right,
.ms-activity .ms-mono {
  max-width: 100%;
}

/* Mobile: stack date under the text and allow wrapping */
@media (max-width: 576px) {
  .ms-activity .ms-activity-item,
  .ms-activity .ms-activity-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Make datetime wrap nicely instead of pushing off-screen */
  .ms-activity .ms-activity-time,
  .ms-activity .ms-activity-date,
  .ms-activity .ms-activity-right,
  .ms-activity .ms-mono {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    width: 100%;
    font-size: 0.92rem;
    opacity: 0.9;
  }
}
/* =========================================================
   [MS FIX] Hide placeholder “Note:” helper copy on cards
   ========================================================= */
.ms-note,
.ms-card-note,
.note,
.card-note {
  display: none !important;
}

/* ============================
   MS Heartbeat Traffic Lights
   ============================ */

.ms-tl { display:inline-flex; gap:8px; align-items:center; }

.ms-tl-dot{
  width:12px; height:12px; border-radius:50%;
  border:1px solid rgba(255,255,255,0.22);
  opacity:.38;
  background: rgba(255,255,255,0.08);
  box-shadow:none;
}

/* ON states */
.ms-tl-dot.is-on{
  opacity:1;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.06),
    0 0 14px rgba(255,255,255,0.18);
}

.ms-tl-dot.is-green{ background: rgba(46, 204, 113, 0.95); box-shadow: 0 0 18px rgba(46,204,113,0.45); }
.ms-tl-dot.is-yellow{ background: rgba(241, 196, 15, 0.95); box-shadow: 0 0 18px rgba(241,196,15,0.45); }
.ms-tl-dot.is-red{ background: rgba(231, 76, 60, 0.95); box-shadow: 0 0 18px rgba(231,76,60,0.45); }

/* subtle shining/pulse */
@keyframes msPulseGlow {
  0%   { filter: brightness(1); transform: scale(1); }
  50%  { filter: brightness(1.25); transform: scale(1.06); }
  100% { filter: brightness(1); transform: scale(1); }
}

.ms-tl-dot.is-on{
  animation: msPulseGlow 1.25s ease-in-out infinite;
}
/* =========================================================
   HEARTBEAT UX FIXES
   - Ping button: green flash on success, red flash on failure
   - Status dots: only active state pulses (green/yellow/red)
   - Down-for: monospace, stable width
   ========================================================= */

@keyframes msFlashOk {
  0%   { box-shadow: 0 0 0 rgba(46, 204, 113, 0); background-color: rgba(46,204,113,0.12); }
  40%  { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0.20); background-color: rgba(46,204,113,0.22); }
  100% { box-shadow: 0 0 0 rgba(46, 204, 113, 0); background-color: transparent; }
}

@keyframes msFlashBad {
  0%   { box-shadow: 0 0 0 rgba(231, 76, 60, 0); background-color: rgba(231,76,60,0.12); }
  40%  { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.20); background-color: rgba(231,76,60,0.22); }
  100% { box-shadow: 0 0 0 rgba(231, 76, 60, 0); background-color: transparent; }
}

.ms-ping-flash-ok {
  animation: msFlashOk 650ms ease-out 1;
  border-color: rgba(46,204,113,0.65) !important;
}

.ms-ping-flash-bad {
  animation: msFlashBad 650ms ease-out 1;
  border-color: rgba(231,76,60,0.65) !important;
}

@keyframes msDotPulse {
  0%   { transform: scale(1); opacity: 0.55; box-shadow: 0 0 0 0 rgba(255,255,255,0.0); }
  50%  { transform: scale(1.08); opacity: 1.00; box-shadow: 0 0 0 8px rgba(255,255,255,0.08); }
  100% { transform: scale(1); opacity: 0.55; box-shadow: 0 0 0 0 rgba(255,255,255,0.0); }
}

.ms-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  opacity: 0.35;           /* inactive */
}

.ms-dot.is-active {
  opacity: 1;
  animation: msDotPulse 1.2s ease-in-out infinite;
}

/* if you already have these colors, keep them; otherwise define them */
.ms-dot.green  { background: rgba(46,204,113,0.95); }
.ms-dot.yellow { background: rgba(241,196,15,0.95); }
.ms-dot.red    { background: rgba(231,76,60,0.95); }

.ms-hb-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}
/* =========================================================
   [MS] RESTORED HEARTBEAT UI
   - Card ping animation + glow
   - Traffic light (green/amber/red) with "on" state
   ========================================================= */

.ms-hb-card{
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

/* Ping "breathing" while request is happening */
.ms-hb-card.ms-hb-pinging{
  animation: msHbPingPulse .55s ease-in-out infinite;
}

@keyframes msHbPingPulse{
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

/* Glow states */
.ms-hb-card.ms-hb-glow-green{
  box-shadow: 0 0 0 2px rgba(34,197,94,.65), 0 10px 28px rgba(34,197,94,.18);
}

.ms-hb-card.ms-hb-glow-red{
  box-shadow: 0 0 0 2px rgba(239,68,68,.65), 0 10px 28px rgba(239,68,68,.18);
}

/* Traffic light container */
.ms-tl{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.ms-tl-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  opacity: .22;
  box-shadow: none;
  transform: scale(.98);
  transition: opacity .18s ease, box-shadow .18s ease, transform .18s ease;
}

/* Base colors (off state) */
.ms-tl-dot[data-light="green"]{ background: rgba(34,197,94,1); }
.ms-tl-dot[data-light="amber"]{ background: rgba(245,158,11,1); }
.ms-tl-dot[data-light="red"]  { background: rgba(239,68,68,1); }

/* ON state */
.ms-tl-dot.is-on{
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(255,255,255,.10), 0 0 14px rgba(255,255,255,.12);
}

/* Stronger glow by color when ON */
.ms-tl-dot.is-on[data-light="green"]{ box-shadow: 0 0 0 2px rgba(34,197,94,.22), 0 0 16px rgba(34,197,94,.45); }
.ms-tl-dot.is-on[data-light="amber"]{ box-shadow: 0 0 0 2px rgba(245,158,11,.22), 0 0 16px rgba(245,158,11,.45); }
.ms-tl-dot.is-on[data-light="red"]  { box-shadow: 0 0 0 2px rgba(239,68,68,.22), 0 0 16px rgba(239,68,68,.45); }

/* =========================================================
   MATRIX RAIN BUTTON (Manage Servers)
   - Hover reveals animated green "code rain"
   - No layout changes
   ========================================================= */

.ms-btn-matrix{
  position: relative;
  overflow: hidden;
  isolation: isolate; /* keep overlay contained */
}

.ms-btn-matrix .ms-btn-label{
  position: relative;
  z-index: 2;
}

/* Dark overlay + glow */
.ms-btn-matrix::before{
  content:"";
  position:absolute;
  inset:-2px;
  z-index: 0;
  opacity: 0;
  transition: opacity .18s ease;
  background: radial-gradient(circle at 30% 30%, rgba(0,255,120,.25), transparent 60%);
  filter: blur(0.2px);
}

/* Code rain layer */
.ms-btn-matrix::after{
  content:"";
  position:absolute;
  inset:-140% 0 -140% 0; /* tall so it can scroll */
  z-index: 1;
  opacity: 0;
  transition: opacity .18s ease;

  /* “falling” lines: multiple thin gradients stacked */
  background-image:
    linear-gradient(to bottom,
      rgba(0,0,0,0) 0%,
      rgba(0,255,120,.06) 10%,
      rgba(0,255,120,.18) 25%,
      rgba(0,255,120,.05) 50%,
      rgba(0,0,0,0) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(0,255,120,.0) 0px,
      rgba(0,255,120,.0) 10px,
      rgba(0,255,120,.12) 11px,
      rgba(0,255,120,.0) 13px
    );

  background-size: 100% 120px, 100% 100%;
  animation: ms-matrix-rain 1.2s linear infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Hover / Focus */
.ms-btn-matrix:hover::before,
.ms-btn-matrix:focus-visible::before{
  opacity: 1;
}
.ms-btn-matrix:hover::after,
.ms-btn-matrix:focus-visible::after{
  opacity: 1;
}

/* Slight “hacker glow” */
.ms-btn-matrix:hover,
.ms-btn-matrix:focus-visible{
  box-shadow:
    0 0 0 1px rgba(0,255,120,.35),
    0 0 18px rgba(0,255,120,.22);
}

@keyframes ms-matrix-rain{
  0%   { transform: translateY(-18%); }
  100% { transform: translateY(18%); }
}

/* =========================================================
   [MS] SVG DASH BUTTON (Stanko-style) — CSS only
   - Requires matching HTML markup (button + svg + rects)
   - We will wire this onto "Manage Servers" in dashboard/index.php
   ========================================================= */

.ms-btn-dash{
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-block;

  /* keeps button dimension consistent with your existing button */
  min-width: 200px;
  height: 44px;

  transform: translateZ(0);
  transition: transform 220ms ease, filter 220ms ease;
}

.ms-btn-dash:hover,
.ms-btn-dash:focus-visible{
  transform: scale(1.03);
  filter: brightness(1.05);
}

.ms-btn-dash:focus-visible{
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0,153,255,0.22);
  border-radius: 999px;
}

/* content sits above SVG */
.ms-btn-dash .ms-btn-dash__content{
  position: relative;
  z-index: 2;

  height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  color: var(--text-main);
  font-weight: 800;
  line-height: 1;

  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

/* SVG overlay */
.ms-btn-dash .ms-btn-dash__svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  z-index: 1;
  pointer-events: none;
}

.ms-btn-dash .ms-btn-dash__line{
  fill: none;
  stroke-linecap: round;
}

/* These numbers are tuned for a pill-ish rounded rect.
   We keep it stable across widths by using "pathLength=1000" in SVG markup. */
@keyframes msDashOuter{
  0%   { stroke-dashoffset: 0;    stroke-dasharray: 500 500; }
  50%  {                       stroke-dasharray: 333 667; }
  100% { stroke-dashoffset: 1000; stroke-dasharray: 500 500; }
}

@keyframes msDashInner{
  0%   { stroke-dashoffset: 0;     stroke-dasharray: 500 500; }
  50%  {                        stroke-dasharray: 333 667; }
  100% { stroke-dashoffset: -1000; stroke-dasharray: 500 500; }
}

/* default running animation */
.ms-btn-dash .ms-btn-dash__outer{
  stroke: rgba(214,178,74,0.95);
  stroke-width: 3.5;
  animation: msDashOuter 6s linear infinite;
}

.ms-btn-dash .ms-btn-dash__inner{
  stroke: rgba(0,153,255,0.90);
  stroke-width: 2.0;
  animation: msDashInner 5s linear infinite;
}

/* hover: pause animation and glow slightly */
.ms-btn-dash:hover .ms-btn-dash__outer,
.ms-btn-dash:hover .ms-btn-dash__inner,
.ms-btn-dash:focus-visible .ms-btn-dash__outer,
.ms-btn-dash:focus-visible .ms-btn-dash__inner{
  animation-play-state: paused;
  filter: drop-shadow(0 0 10px rgba(0,153,255,0.18));
}

@media (prefers-reduced-motion: reduce){
  .ms-btn-dash,
  .ms-btn-dash *{
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   [MS] Disable Matrix rain visuals if class still exists
   (prevents conflicting visuals if markup still has ms-btn-matrix)
   ========================================================= */
.ms-btn-matrix::before,
.ms-btn-matrix::after{
  display: none !important;
}


/* =========================================================
   HOLOGRAM HOVER (Dashboard Cards Only)
   - Applies to ms-kpi-3d + kpi-card + ms-strip
   - No markup changes, no layout changes
   - Uses ::before shimmer overlay + glow on hover
   ========================================================= */

/* Ensure pseudo-element layering works reliably */
.ms-kpi-3d,
.kpi-card,
.ms-strip{
  position: relative;
  overflow: hidden;   /* required for shimmer mask */
  isolation: isolate; /* keeps overlay contained */
}

/* Holographic overlay */
.ms-kpi-3d::before,
.kpi-card::before,
.ms-strip::before{
  content:"";
  position:absolute;
  top:-60%;
  left:-60%;
  width:220%;
  height:220%;
  pointer-events:none;
  z-index: 0;

  /* Hologram shimmer gradient */
  background: linear-gradient(
    0deg,
    transparent,
    transparent 35%,
    rgba(0,255,255,0.22),
    rgba(214,178,74,0.14),
    transparent 72%
  );

  transform: rotate(-45deg);
  opacity: 0;
  transition: opacity 220ms ease, transform 520ms ease;
}

/* Keep card content above the overlay */
.ms-kpi-3d > *,
.kpi-card > *,
.ms-strip > *{
  position: relative;
  z-index: 1;
}

/* Hover effect */
.ms-kpi-3d:hover,
.kpi-card:hover,
.ms-strip:hover{
  transform: scale(1.02); /* modest, keeps your "feel" */
  box-shadow:
    0 0 0 1px rgba(0,255,255,0.22),
    0 0 22px rgba(0,255,255,0.18),
    0 24px 60px rgba(0,0,0,0.28);
}

/* Animate shimmer sweep on hover */
.ms-kpi-3d:hover::before,
.kpi-card:hover::before,
.ms-strip:hover::before{
  opacity: 1;
  transform: rotate(-45deg) translateY(120%);
}

/* Light theme tuning (avoid “neon glare”) */
body[data-theme="light"] .ms-kpi-3d:hover,
body[data-theme="light"] .kpi-card:hover,
body[data-theme="light"] .ms-strip:hover{
  box-shadow:
    0 0 0 1px rgba(0,153,255,0.18),
    0 0 18px rgba(0,153,255,0.12),
    0 18px 42px rgba(15,23,42,0.12);
}

body[data-theme="light"] .ms-kpi-3d::before,
body[data-theme="light"] .kpi-card::before,
body[data-theme="light"] .ms-strip::before{
  background: linear-gradient(
    0deg,
    transparent,
    transparent 35%,
    rgba(0,153,255,0.14),
    rgba(214,178,74,0.10),
    transparent 72%
  );
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .ms-kpi-3d,
  .kpi-card,
  .ms-strip{
    transition: none !important;
  }
  .ms-kpi-3d::before,
  .kpi-card::before,
  .ms-strip::before{
    transition: none !important;
  }
  .ms-kpi-3d:hover,
  .kpi-card:hover,
  .ms-strip:hover{
    transform: none !important;
  }
}


/* =========================================================
   [MS SYSTEM TENANT REGISTRY v1.1]
   FILE: /var/www/monitorsystem/public/assets/css/dashboard.css
   PURPOSE:
     - Add responsive system-host tenant registry table handling
     - Prevent long host/database/created values from overflowing
     - Keep existing look and feel intact
   ========================================================= */

.ms-system-tenants-card{
  overflow: hidden;
}

.ms-system-tenants-table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

.ms-system-tenants-table{
  width: 100%;
  min-width: 980px;
  margin-bottom: 0 !important;
  table-layout: fixed;
}

.ms-system-tenants-table > thead > tr > th,
.ms-system-tenants-table > tbody > tr > td{
  vertical-align: top;
  padding: 14px 12px;
}

.ms-system-tenants-col-id{ width: 72px; }
.ms-system-tenants-col-name{ width: 190px; }
.ms-system-tenants-col-slug{ width: 140px; }
.ms-system-tenants-col-domain{ width: 360px; }
.ms-system-tenants-col-status{ width: 110px; }
.ms-system-tenants-col-db{ width: 300px; }
.ms-system-tenants-col-created{ width: 170px; }

.ms-tenant-cell-wrap{
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.ms-tenant-wrap-anywhere{
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1199.98px){
  .ms-system-tenants-table{
    min-width: 920px;
  }

  .ms-system-tenants-col-domain{ width: 320px; }
  .ms-system-tenants-col-db{ width: 260px; }
}

@media (max-width: 767.98px){
  .ms-system-tenants-table{
    min-width: 780px;
  }

  .ms-system-tenants-table > thead > tr > th,
  .ms-system-tenants-table > tbody > tr > td{
    padding: 12px 10px;
    font-size: 0.95rem;
  }
}

@media (max-width: 575.98px){
  .ms-system-tenants-table{
    min-width: 720px;
  }

  .ms-system-tenants-col-name{ width: 170px; }
  .ms-system-tenants-col-domain{ width: 280px; }
  .ms-system-tenants-col-db{ width: 240px; }
  .ms-system-tenants-col-created{ width: 150px; }
}
