
/* HD Infocell Dashboard - versão SPA segura
   Não altera menu lateral, logo, rotas nem eventos do sistema. */

.hd-dashboard-panel,
.hd-dashboard-panel * { box-sizing: border-box; }

.hd-dashboard-panel {
  --hd-card: rgba(255,255,255,.95);
  --hd-border: rgba(15,23,42,.10);
  --hd-text: #0f172a;
  --hd-muted: #64748b;
  --hd-shadow: 0 14px 34px rgba(15,23,42,.08);
  position: relative;
  width: 100%;
  margin: 18px 0 26px;
  padding: 20px;
  border-radius: 24px;
  color: var(--hd-text);
  border: 1px solid var(--hd-border);
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.16), transparent 30%),
    linear-gradient(135deg, #f8fafc, #eef6ff);
  overflow: hidden;
  pointer-events: auto;
}

body.hd-theme-dark .hd-dashboard-panel {
  --hd-card: rgba(15,23,42,.88);
  --hd-border: rgba(148,163,184,.22);
  --hd-text: #f8fafc;
  --hd-muted: #cbd5e1;
  --hd-shadow: 0 18px 40px rgba(2,8,23,.30);
  background:
    radial-gradient(circle at top right, rgba(34,211,238,.16), transparent 34%),
    linear-gradient(135deg, #07111f, #0f172a);
}

.hd-safe-hero {
  position: relative;
  min-height: 180px;
  border-radius: 22px;
  padding: 28px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(8,18,36,.96) 0%, rgba(15,23,42,.78) 56%, rgba(14,165,233,.20) 100%),
    radial-gradient(circle at 72% 25%, rgba(34,211,238,.42), transparent 24%),
    linear-gradient(135deg, #061224, #0f172a);
  box-shadow: var(--hd-shadow);
}

.hd-safe-hero::after {
  content: "HD INFOCELL";
  position: absolute;
  right: 26px;
  top: 28px;
  font-size: clamp(34px, 7vw, 86px);
  font-weight: 950;
  letter-spacing: -4px;
  color: rgba(255,255,255,.075);
  transform: skew(-8deg);
  pointer-events: none;
}

.hd-safe-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(34,211,238,.14);
  border: 1px solid rgba(34,211,238,.30);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 16px;
}

.hd-safe-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: clamp(27px, 3.2vw, 42px);
  line-height: 1.1;
  font-weight: 950;
}

.hd-safe-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 720px;
  font-size: clamp(15px, 1.5vw, 19px);
  color: rgba(255,255,255,.84);
}

.hd-safe-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hd-safe-btn {
  display: inline-flex;
  align-items: center;
  border-radius: 13px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
}

.hd-safe-btn.primary {
  border: 0;
  background: linear-gradient(135deg, #0d9488, #2563eb);
}

.hd-safe-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.hd-safe-card {
  min-height: 84px;
  border-radius: 17px;
  padding: 14px;
  background: var(--hd-card);
  border: 1px solid var(--hd-border);
  box-shadow: var(--hd-shadow);
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--hd-text);
}

.hd-safe-card:hover { transform: translateY(-2px); }

.hd-safe-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(34,211,238,.12));
}

.hd-safe-title { display: block; font-size: 14px; font-weight: 950; }
.hd-safe-subtitle { display: block; font-size: 11px; color: var(--hd-muted); }

.hd-safe-widgets {
  display: grid;
  grid-template-columns: 1fr 1.12fr .92fr;
  gap: 14px;
}

.hd-safe-widget {
  min-height: 205px;
  border-radius: 19px;
  padding: 17px;
  background: var(--hd-card);
  border: 1px solid var(--hd-border);
  box-shadow: var(--hd-shadow);
  overflow: hidden;
}

.hd-safe-widget h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 950;
}

.hd-safe-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 10px;
  margin: 9px 0;
  background: rgba(15,23,42,.045);
}

body.hd-theme-dark .hd-safe-alert { background: rgba(255,255,255,.06); }

.hd-safe-dot {
  width: 34px; height: 34px; border-radius: 12px; color: white;
  font-weight: 900; display: grid; place-items: center; flex: 0 0 auto;
}
.hd-red { background: #ef4444; }
.hd-yellow { background: #f59e0b; }
.hd-green { background: #22c55e; }

.hd-safe-alert strong { display: block; font-size: 12.5px; }
.hd-safe-alert span { display: block; font-size: 11.5px; color: var(--hd-muted); }

.hd-safe-money { margin: 4px 0; font-size: clamp(28px, 3vw, 38px); font-weight: 950; }
.hd-safe-positive { color: #16a34a; font-size: 13px; font-weight: 850; }

.hd-safe-chart {
  margin-top: 18px;
  height: 105px;
  border-radius: 15px;
  background:
    linear-gradient(to top, rgba(37,99,235,.20), transparent),
    repeating-linear-gradient(to top, rgba(100,116,139,.13) 0 1px, transparent 1px 26px);
  position: relative;
}

.hd-safe-chart::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 25px; height: 55px;
  transform: skewX(-24deg);
  background: repeating-linear-gradient(110deg, #2563eb 0 12px, transparent 12px 34px, #06b6d4 34px 46px, transparent 46px 68px);
}

.hd-safe-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hd-border);
}
.hd-safe-row:last-child { border-bottom: 0; }
.hd-safe-label { font-size: 13px; font-weight: 800; }
.hd-safe-value { text-align: right; font-size: 17px; font-weight: 950; }
.hd-safe-mini { display: block; font-size: 11px; color: #16a34a; }

.hd-theme-toggle-safe {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15,23,42,.25);
}

body.hd-theme-dark .hd-theme-toggle-safe { background: #fff; color: #0f172a; }

@media (max-width: 1200px) {
  .hd-safe-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .hd-safe-widgets { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hd-dashboard-panel { padding: 14px; }
  .hd-safe-hero { padding: 22px; min-height: 170px; }
  .hd-safe-grid { grid-template-columns: 1fr; }
}
