/* ============================================================================
   SWIGE ARES CORE - ESTILOS DE ALTO RENDIMIENTO (DARK EXECUTIVE THEME)
   ============================================================================ */

:root {
  --bg-dark: #090d16;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --border-color: #374151;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
}

.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: #0d121f;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.brand-logo {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.brand-meta h2 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

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

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge .avatar {
  width: 38px;
  height: 38px;
  background: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-badge .meta strong {
  display: block;
  font-size: 0.85rem;
}

.user-badge .meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
  padding: 2rem;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.topbar-title h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

.topbar-title .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
}

/* KPIS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.kpi-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-data .kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-data h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.kpi-data .kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* PANELS */
.content-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge-status {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* GEO MOCK BOX */
.geo-mock-box {
  height: 260px;
  background: #1e293b;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.geo-marker {
  position: absolute;
  background: rgba(17, 24, 39, 0.9);
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.geo-info-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.95);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

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

.action-btn .icon {
  font-size: 1.4rem;
}

.action-btn strong {
  display: block;
  font-size: 0.88rem;
}

.action-btn p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hash-cell {
  font-family: monospace;
  color: var(--primary);
  font-size: 0.75rem;
}

.btn-action-override {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-right: 0.3rem;
}

.btn-action-override.approve {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.btn-action-override.veto {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* FORMS */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input, .form-group select {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* NODES */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.node-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node-meta h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.node-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* VIEW SECTIONS */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* TOAST */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
