/* ═══════════════════════════════════════════════
   STILO HUB — Design System
   ═══════════════════════════════════════════════ */

:root {
  --bg-base: #0a0b14;
  --bg-surface: #111223;
  --bg-card: #161829;
  --bg-hover: #1c1e33;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);

  --text-primary: #f0f1fa;
  --text-secondary: #9395b0;
  --text-muted: #5a5c78;

  --accent: #6366f1;
  --accent-hover: #4f52e0;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-2: #8b5cf6;

  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.12);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.12);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);

  --sidebar-w: 240px;
  --sidebar-collapsed: 68px;
  --topbar-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);

  --font: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCREENS ─── */
.screen {
  display: none;
}

.screen.active {
  display: flex;
}

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════ */
#screen-login {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    var(--bg-base);
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
}

.orb1 {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.15);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.orb2 {
  width: 300px;
  height: 300px;
  background: rgba(139, 92, 246, 0.12);
  bottom: -50px;
  right: -50px;
  animation-delay: 3s;
}

.orb3 {
  width: 200px;
  height: 200px;
  background: rgba(6, 182, 212, 0.08);
  top: 50%;
  left: 50%;
  animation-delay: 5s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.login-card {
  position: relative;
  background: rgba(17, 18, 35, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon.sm {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f0f1fa, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.login-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.field-wrap input {
  width: 100%;
  padding: 11px 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.field-wrap input::placeholder {
  color: var(--text-muted);
}

.field-wrap input:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.toggle-pass {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.toggle-pass:hover {
  color: var(--text-secondary);
}

.login-error {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  animation: shake 0.3s ease;
}

.login-error.hidden {
  display: none;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.agent-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── STATUS DOTS ─── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-online {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.dot-offline {
  background: var(--red);
}

.dot-warning {
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
}

.dot-checking {
  background: var(--orange);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* ═══════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════ */
#screen-dashboard {
  min-height: 100vh;
  flex-direction: row;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, #f0f1fa, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-section-label {
  opacity: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  margin-bottom: 2px;
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-item span:not(.badge-agent) {
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-item span:not(.badge-agent) {
  opacity: 0;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-agent {
  font-size: 10px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--transition);
}

.badge-online {
  color: var(--green);
}

.badge-offline {
  color: var(--red);
}

.badge-warning {
  color: var(--orange);
  animation: pulse 1.5s infinite;
}

.badge-checking {
  color: var(--orange);
  animation: pulse 1.5s infinite;
}

.sidebar-user {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s;
}

.sidebar.collapsed .user-info {
  opacity: 0;
}

.user-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.user-role {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-logout:hover {
  background: var(--red-bg);
  color: var(--red);
}

.sidebar.collapsed .btn-logout {
  margin: 0 auto;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed~.main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: rgba(17, 18, 35, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: none;
  transition: all var(--transition);
}

.topbar-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-breadcrumb {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.agent-pill.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
  color: var(--orange);
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ─── CONTENT SECTIONS ─── */
.content-section {
  display: none;
  padding: 28px 28px 60px;
  flex-direction: column;
  gap: 0;
}

.content-section.active {
  display: flex;
  flex-direction: column;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.section-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 42px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.section-subtitle svg {
  color: var(--accent);
}

/* ─── AGENT BANNER ─── */
.agent-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  margin-bottom: 28px;
  animation: slideDown 0.3s ease;
}

.agent-banner.hidden {
  display: none;
}

.agent-banner-icon {
  color: var(--orange);
  flex-shrink: 0;
}

.agent-banner-text {
  flex: 1;
}

.agent-banner-text strong {
  display: block;
  font-size: 0.875rem;
  color: var(--orange);
  margin-bottom: 2px;
}

.agent-banner-text span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-download-agent {
  padding: 8px 16px;
  background: var(--orange);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-download-agent:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green {
  background: var(--green-bg);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.stat-icon.purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.stat-icon.orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── UTILITY CARDS ─── */
.util-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.util-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.util-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.15);
}

.util-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.util-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.util-icon.green {
  background: var(--green-bg);
  color: var(--green);
}

.util-icon.blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.util-icon.cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.util-icon.purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.util-icon.orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.util-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.util-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
}

.util-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.util-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* ─── TOOL LAYOUT ─── */
.tool-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.tool-layout.single {
  grid-template-columns: 360px 1fr;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-panel.full {
  grid-column: 1;
}

.tool-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-info-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-info-icon.green {
  background: var(--green-bg);
  color: var(--green);
}

.tool-info-icon.blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.tool-info-icon.cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.tool-info-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.tool-info-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tool-config {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.config-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.config-row:last-child {
  border-bottom: none;
}

.config-row label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 100px;
  font-weight: 500;
}

.config-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
}

.config-value code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #a5b4fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tool Steps */
.tool-steps {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.step:last-child {
  border-bottom: none;
}

.step.done {
  background: rgba(16, 185, 129, 0.05);
}

.step.running {
  background: rgba(99, 102, 241, 0.05);
  animation: stepPulse 1.5s ease-in-out infinite;
}

.step.error {
  background: rgba(239, 68, 68, 0.05);
}

@keyframes stepPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.step.done .step-num {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.step.running .step-num {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: #a5b4fc;
}

.step.error .step-num {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

.step-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.step.done .step-text {
  color: var(--text-primary);
}

.step-status {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.step.done .step-status::before {
  content: '✓';
  color: var(--green);
}

.step.running .step-status::before {
  content: '...';
  color: var(--accent);
}

.step.error .step-status::before {
  content: '✕';
  color: var(--red);
}

/* Execute Button */
.btn-execute {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
}

.btn-execute:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-execute:active {
  transform: translateY(0);
}

.btn-execute.cyan-btn {
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  box-shadow: none;
}

.btn-execute.cyan-btn:hover {
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.25);
}

.btn-execute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-secondary.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn-execute {
  flex: 1;
}

/* Warning Box */
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #fcd34d;
  line-height: 1.4;
}

.warning-box svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Progress Bar */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* Unlock Visual */
.unlock-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lock-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.5s ease;
}

.lock-icon.unlocked {
  background: var(--green-bg);
  color: var(--green);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

.lock-icon.locked {
  background: var(--orange-bg);
  color: var(--orange);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.3);
}

.unlock-visual p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.unlock-visual strong {
  color: var(--text-primary);
}

/* ─── LOG PANEL ─── */
.tool-log-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 500px;
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-clear-log {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font);
  transition: all var(--transition);
}

.btn-clear-log:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.log-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.log-output::-webkit-scrollbar {
  width: 4px;
}

.log-output::-webkit-scrollbar-track {
  background: transparent;
}

.log-output::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.log-empty {
  color: var(--text-muted);
  font-style: italic;
}

.log-line {
  display: block;
}

.log-time {
  color: var(--text-muted);
}

.log-ok {
  color: var(--green);
}

.log-err {
  color: var(--red);
}

.log-info {
  color: var(--blue);
}

.log-warn {
  color: var(--orange);
}

/* ─── AGENT SECTION ─── */
.agent-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.agent-status-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.agent-status-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.agent-status-icon.online {
  background: var(--green-bg);
  color: var(--green);
}

.agent-status-icon.offline {
  background: var(--red-bg);
  color: var(--red);
}

.agent-status-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.agent-status-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.agent-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.agent-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.agent-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.detail-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-value.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a5b4fc;
}

.agent-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.install-guide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.install-guide h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.guide-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.guide-step strong {
  color: var(--text-primary);
}

.guide-step code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a5b4fc;
}

/* ─── LOADING DOT ─── */
.loading-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.loading-dot::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 1px;
  animation: loadSlide 1s ease-in-out infinite;
}

@keyframes loadSlide {
  0% {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }

  100% {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: right;
  }
}

/* ─── TOAST ─── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 360px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  border-left: 3px solid var(--green);
}

.toast-error {
  border-left: 3px solid var(--red);
}

.toast-info {
  border-left: 3px solid var(--blue);
}

.toast-warning {
  border-left: 3px solid var(--orange);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-error .toast-icon {
  color: var(--red);
}

.toast-info .toast-icon {
  color: var(--blue);
}

.toast-warning .toast-icon {
  color: var(--orange);
}

/* ─── SANEAMENTO & IMPORTACAO TABS ─── */
.saneamento-tabs,
.importacao-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.saneamento-tabs .tab-btn,
.importacao-tabs .tab-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  padding: 8px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  border-radius: 6px !important;
  transition: all var(--transition) !important;
}

.saneamento-tabs .tab-btn:hover,
.importacao-tabs .tab-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.saneamento-tabs .tab-btn.active,
.importacao-tabs .tab-btn.active {
  background: rgba(99, 102, 241, 0.12) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  color: #a5b4fc !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15) !important;
}

/* Checklist formatting improvements */
.checklist .check-label {
  transition: all var(--transition);
  padding: 6px 8px;
  border-radius: 6px;
}

.checklist .check-label:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary) !important;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-log-panel {
    height: 300px;
  }
}

@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    transition: left 0.25s ease, width 0.25s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .topbar-menu-btn {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-section {
    padding: 20px 16px 40px;
  }
}

/* ─── CONTROLE DE USUÁRIOS & MODAL STYLES ─── */
.badge-role {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  text-transform: uppercase;
}

.badge-role-admin {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-role-moderador {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-role-operador {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot-active {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 6px var(--green);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot-inactive {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--red);
  box-shadow: 0 0 6px var(--red);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.btn-action-user {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 5px 9px;
  font-size: 0.8rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action-user:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-action-user.danger:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-action-user:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

/* Modals with premium glassmorphism */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 20, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: rgba(22, 24, 41, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f0f1fa, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px;
  border-radius: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.93) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Card and Menu Locked State */
.card-locked {
  opacity: 0.65;
  filter: saturate(0.6);
  cursor: not-allowed !important;
}

.card-locked:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--border) !important;
}

.nav-locked span {
  color: var(--text-muted) !important;
}

/* User Profile Trigger Hover States */
.user-profile-trigger {
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.user-profile-trigger:hover {
  background: var(--bg-hover);
}