/* ============================================================
   HOTSPOT ADMIN — UI moderna (dark glass + gradientes + microanim.)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-0:           #070912;
  --bg-1:           #0c0f1f;
  --bg-2:           #131830;
  --bg-3:           #1a2042;
  --bg-glass:       rgba(20, 26, 56, 0.55);
  --bg-glass-hover: rgba(28, 36, 76, 0.7);
  --border:         rgba(99, 102, 241, 0.18);
  --border-strong:  rgba(99, 102, 241, 0.35);
  --text:           #f5f7ff;
  --text-2:         #d3d9f2;
  --muted:          #a6afd4;

  --primary:    #6366f1;
  --primary-2:  #818cf8;
  --accent:     #22d3ee;
  --accent-2:   #06b6d4;
  --pink:       #ec4899;
  --green:      #10b981;
  --orange:     #f59e0b;
  --red:        #ef4444;

  --grad-primary:  linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-purple:   linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --grad-blue:     linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --grad-green:    linear-gradient(135deg, #10b981 0%, #22d3ee 100%);
  --grad-orange:   linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-cyan:     linear-gradient(135deg, #06b6d4 0%, #818cf8 100%);

  --shadow-sm:  0 2px 8px rgba(0,0,0,.25);
  --shadow:     0 12px 36px rgba(0,0,0,.35);
  --shadow-lg:  0 30px 60px rgba(0,0,0,.45);
  --glow:       0 0 30px rgba(99,102,241,.35);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  color: var(--text);
  background: var(--bg-0);
  letter-spacing: -0.01em;
}

/* fundo animado com blobs */
body::before, body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}
body::before {
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -200px; left: -200px;
}
body::after {
  background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
  bottom: -200px; right: -200px;
  animation-delay: -10s;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(60px,40px) scale(1.1); }
}

body.hs-app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }

a { color: var(--primary-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

code, pre { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ============================================================
   SIDEBAR
============================================================ */
.hs-sidebar {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  padding: 20px 14px;
  background: rgba(7, 9, 18, 0.7);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--border);
}
.hs-sidebar::-webkit-scrollbar { width: 4px; }
.hs-sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.hs-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.hs-brand-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--grad-primary);
  border-radius: 12px;
  font-size: 22px; color: #fff;
  box-shadow: var(--glow);
}
.hs-brand-name {
  font-weight: 700; font-size: 18px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hs-brand-host { font-size: 11px; color: var(--muted); margin-top: 1px; }

.hs-nav { display: flex; flex-direction: column; gap: 2px; }
.hs-nav-section {
  margin: 18px 0 6px; padding: 0 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.hs-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  color: var(--text-2);
  border-radius: 11px;
  font-size: 14px; font-weight: 500;
  transition: all .18s ease;
  position: relative;
}
.hs-nav a:hover {
  background: var(--bg-glass);
  color: var(--text);
  transform: translateX(2px);
}
.hs-nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,.25) 0%, rgba(34,211,238,.06) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.hs-nav a.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad-primary);
  box-shadow: 0 0 12px var(--primary);
}
.hs-nav a i { width: 18px; text-align: center; font-size: 16px; opacity: .9; }
.hs-nav a.active i { color: var(--accent); }

/* ============================================================
   MAIN
============================================================ */
.hs-main { display: flex; flex-direction: column; min-height: 100vh; }

.hs-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px;
  background: rgba(12, 15, 31, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.hs-topbar-title {
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #b4bce0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hs-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px; font-weight: 500;
  transition: all .18s;
}
.hs-user:hover { background: var(--bg-glass-hover); color: #fff; transform: translateY(-1px); }

.hs-content { padding: 28px 32px 90px; }

/* ============================================================
   GLASS CARDS
============================================================ */
.hs-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: all .25s ease;
}
.hs-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.hs-card.p-0 { padding: 0; overflow: hidden; }
.hs-card-h {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.hs-card-v { font-size: 30px; font-weight: 800; margin-top: 2px; line-height: 1.1; color: #fff; }
.hs-card h5 { font-weight: 700; color: #fff; }

/* Stat cards (KPIs) */
.hs-stat-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 24px;
}
.hs-stat {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center;
  position: relative; overflow: hidden;
}
.hs-stat::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  opacity: .08;
}
.hs-stat-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 28px; color: #fff;
}
.hs-stat--blue   .hs-stat-icon { background: var(--grad-blue); box-shadow: 0 0 24px rgba(59,130,246,.4); }
.hs-stat--blue::after   { background: var(--grad-blue); }
.hs-stat--purple .hs-stat-icon { background: var(--grad-purple); box-shadow: 0 0 24px rgba(139,92,246,.4); }
.hs-stat--purple::after { background: var(--grad-purple); }
.hs-stat--cyan   .hs-stat-icon { background: var(--grad-cyan); box-shadow: 0 0 24px rgba(6,182,212,.4); }
.hs-stat--cyan::after   { background: var(--grad-cyan); }
.hs-stat--green  .hs-stat-icon { background: var(--grad-green); box-shadow: 0 0 24px rgba(16,185,129,.4); }
.hs-stat--green::after  { background: var(--grad-green); }
.hs-stat--orange .hs-stat-icon { background: var(--grad-orange); box-shadow: 0 0 24px rgba(245,158,11,.4); }
.hs-stat--orange::after { background: var(--grad-orange); }

/* ============================================================
   FORMS
============================================================ */
.form-control, .form-select, .form-check-input {
  background: rgba(7, 9, 18, .6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  transition: all .15s;
}
.form-control:focus, .form-select:focus {
  background: rgba(7, 9, 18, .8);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
  outline: none;
}
.form-control::placeholder { color: var(--muted); }
.form-label { color: var(--text-2); font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.form-check-input {
  width: 18px; height: 18px;
  background: rgba(7,9,18,.6);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
}
.form-check-input:checked {
  background: var(--grad-primary);
  border-color: var(--primary);
}
.form-check-label { color: var(--text-2); font-size: 13px; cursor: pointer; }

textarea.form-control { min-height: 90px; }
.form-control-color { padding: 4px; min-width: 60px; height: 42px; }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  font-weight: 600; font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  border: 1px solid transparent;
  transition: all .18s ease;
  display: inline-flex; align-items: center; gap: 7px;
  letter-spacing: -0.01em;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-primary {
  background: var(--grad-primary);
  border: none; color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99,102,241,.55);
  filter: brightness(1.08);
  color: #fff;
}
.btn-outline-primary {
  color: var(--primary-2);
  border: 1px solid var(--border-strong);
  background: rgba(99,102,241,.08);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-outline-secondary {
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--bg-glass);
}
.btn-outline-secondary:hover { background: var(--bg-glass-hover); color: #fff; border-color: var(--border-strong); }
.btn-outline-danger {
  color: var(--red); border: 1px solid var(--red); background: rgba(239,68,68,.08);
}
.btn-outline-danger:hover { background: var(--red); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   TABLES
============================================================ */
.table { color: var(--text); margin: 0; font-size: 13.5px; }
.table > :not(caption) > * > * {
  background: transparent;
  border-color: rgba(99, 102, 241, 0.1);
  padding: 14px 18px;
  vertical-align: middle;
}
.table thead th {
  color: var(--muted);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong);
  background: rgba(7, 9, 18, 0.4);
}
.table-hover tbody tr {
  transition: all .15s;
  cursor: pointer;
}
.table-hover tbody tr:hover {
  background: linear-gradient(90deg, rgba(99,102,241,.08) 0%, rgba(34,211,238,.04) 100%) !important;
}
.hs-table-wrap { overflow-x: auto; }

/* Avatar */
.hs-avatar {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff; font-weight: 700; font-size: 13px;
  vertical-align: middle;
}

/* ============================================================
   BADGES
============================================================ */
.badge {
  font-weight: 600; font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 10px; border-radius: 6px;
}
.badge.bg-success   { background: rgba(16,185,129,.18) !important; color: #6ee7b7; border: 1px solid rgba(16,185,129,.35); }
.badge.bg-danger    { background: rgba(239,68,68,.18) !important;  color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }
.badge.bg-warning   { background: rgba(245,158,11,.18) !important; color: #fcd34d; border: 1px solid rgba(245,158,11,.35); }
.badge.bg-info      { background: rgba(34,211,238,.18) !important; color: #67e8f9; border: 1px solid rgba(34,211,238,.35); }
.badge.bg-primary   { background: rgba(99,102,241,.18) !important; color: #a5b4fc; border: 1px solid rgba(99,102,241,.35); }
.badge.bg-secondary { background: rgba(108,117,163,.18) !important; color: var(--text-2); border: 1px solid var(--border); }

/* ============================================================
   ALERTS
============================================================ */
.alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 16px; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.alert-success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.3);  color: #fca5a5; }
.alert-info    { background: rgba(34,211,238,.10); border-color: rgba(34,211,238,.3); color: #67e8f9; }

/* ============================================================
   DROPDOWN
============================================================ */
.dropdown-menu {
  background: rgba(12, 15, 31, .95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
}
.dropdown-item {
  color: var(--text-2);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--bg-glass-hover);
  color: #fff;
}
.dropdown-divider { border-color: var(--border); }

/* ============================================================
   LOGIN
============================================================ */
.hs-login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: var(--bg-0);
}
.hs-login::before, .hs-login::after { display: none; }
.hs-login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg), 0 0 100px rgba(99,102,241,.15);
  position: relative;
  animation: slideUp .5s cubic-bezier(.22,.9,.3,1.2);
}
.hs-login-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--grad-primary);
  z-index: -1;
  opacity: .4;
  filter: blur(20px);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hs-login-card h1 {
  font-size: 24px; font-weight: 700;
  margin: 8px 0 24px;
  background: linear-gradient(135deg, #fff 0%, #b4bce0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   PROVISION LOG (terminal)
============================================================ */
pre.hs-terminal {
  background: #04060e;
  color: #dde2f5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 400px; overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ============================================================
   UTILITIES / RESPONSIVE
============================================================ */
.hs-divider { height: 1px; background: var(--border); margin: 18px 0; }
.text-muted { color: var(--muted) !important; }
hr { border-color: var(--border); }

dl.row dt { color: var(--muted); font-weight: 600; font-size: 13px; }
dl.row dd { color: var(--text); font-size: 14px; }

::selection { background: var(--primary); color: #fff; }

/* scrollbar global */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.45); }

@media (max-width: 900px) {
  body.hs-app { grid-template-columns: 1fr; }
  .hs-sidebar {
    position: fixed; left: -290px; top: 0; bottom: 0; width: 280px;
    z-index: 100; transition: left .25s ease;
  }
  .hs-sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .hs-content { padding: 22px 20px 80px; }
  .hs-topbar { padding: 14px 20px; }
}

/* Animação fade-in para conteúdo */
.hs-content > * { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Botões de ação no header */
.hs-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Page header */
.hs-page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.hs-page-header h4 {
  font-size: 22px; font-weight: 700; margin: 0;
  background: linear-gradient(135deg, #fff 0%, #b4bce0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Cartão clicável para seleção de grupo no formulário de usuário */
.hs-group-pick {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 9, 18, .3);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.hs-group-pick:hover {
  border-color: var(--border-strong);
  background: rgba(99, 102, 241, .08);
}
.hs-group-pick.is-checked {
  border-color: var(--primary-2);
  background: rgba(99, 102, 241, .14);
  box-shadow: 0 0 0 1px var(--primary-2) inset, 0 4px 14px rgba(99, 102, 241, .25);
}
.hs-group-pick .form-check-input { cursor: pointer; }
.hs-group-pick .form-check-label { cursor: pointer; user-select: none; }
