/* ═════════════════════════════════════════════════════════════════ */
/* ORBITCYB COMMAND CENTER — ESTILOS PRINCIPALES v1.0              */
/* ═════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────── */
/* VARIABLES Y TOKENS                                               */
/* ──────────────────────────────────────────────────────────────── */

:root {
  /* COLORES PRINCIPALES */
  --orbit: #22c55e;
  --orbit-h: #16a34a;
  --orbit-a: #15803d;
  --pulse: #22c55e;
  --nova: #ef4444;
  --solar: #f59e0b;
  --midnight: #111111;
  --charcoal: #171717;
  --slate: #1f1f1f;
  --storm: #2a2a2a;

  /* FONDOS */
  --bg: #0a0a0a;
  --panel: #111111;
  --rim: #1f1f1f;
  --hover: #161616;

  /* TEXTOS */
  --txt: #f5f5f5;
  --txtS: #e5e5e5;
  --txtM: #a3a3a3;
  --txtD: #525252;

  /* ESPACIADO */
  --s: 4px;
  --sm: 8px;
  --md: 12px;
  --lg: 16px;
  --xl: 24px;
  --xxl: 32px;

  /* BORDES */
  --r: 6px;
  --rL: 12px;
  --border: #262626;

  /* FUENTES */
  --fd: 'Syne', sans-serif;
  --fs: 'DM Sans', sans-serif;
  --fm: 'JetBrains Mono', monospace;

  /* SOMBRAS */
  --sh1: 0 1px 3px rgba(0, 0, 0, 0.5);
  --sh2: 0 4px 6px rgba(0, 0, 0, 0.3);
  --sh3: 0 10px 15px rgba(0, 0, 0, 0.4);

  /* Z-INDEX */
  --zBase: 1;
  --zDropdown: 100;
  --zModal: 1000;
  --zToast: 2000;
}

/* ──────────────────────────────────────────────────────────────── */
/* RESET Y BASE                                                     */
/* ──────────────────────────────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--fs);
  background-color: var(--bg);
  color: var(--txt);
  line-height: 1.5;
}

body {
  overflow: hidden;
}

input, textarea, select, button {
  font-family: inherit;
}

/* ──────────────────────────────────────────────────────────────── */
/* APP LAYOUT                                                       */
/* ──────────────────────────────────────────────────────────────── */

.app {
  display: none;
  flex-direction: row;
  height: 100vh;
  width: 100%;
  background-color: var(--bg);
  position: relative;
}

/* ──────────────────────────────────────────────────────────────── */
/* SIDEBAR                                                          */
/* ──────────────────────────────────────────────────────────────── */

.sidebar {
  width: 260px;
  background-color: var(--panel);
  border-right: 1px solid var(--rim);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--lg);
  gap: var(--md);
  color: var(--txt);
  flex-shrink: 0;
}

.sb-logo {
  margin-bottom: var(--md);
  padding-bottom: var(--md);
  border-bottom: 1px solid var(--rim);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: var(--md);
  margin-bottom: var(--sm);
}

.logo-orb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orbit);
  font-size: 16px;
}

.logo-text {
  font-family: var(--fd);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--txt);
}

.logo-ver {
  font-family: var(--fm);
  font-size: 9px;
  color: var(--txtM);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sb-status {
  display: flex;
  align-items: center;
  gap: var(--sm);
  font-size: 10px;
  color: var(--txtM);
  letter-spacing: 0.5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--pulse);
  animation: pulse-animation 2s ease-in-out infinite;
}

@keyframes pulse-animation {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.sb-section {
  margin-bottom: var(--lg);
}

.sb-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--txtD);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--sm);
  padding-left: var(--sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sm);
  padding: var(--sm) var(--md);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.nav-item:hover {
  background-color: var(--hover);
  border-color: var(--rim);
}

.nav-item.active {
  background-color: rgba(34, 197, 94, 0.08);
  border-color: transparent;
  border-left: 2px solid var(--orbit);
  color: var(--orbit);
}

.nav-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 12px;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--nova);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.nav-badge.ok {
  background-color: var(--pulse);
}

.sb-projects {
  margin-top: auto;
  margin-bottom: var(--lg);
}

#sbProjectsList {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
}

.sb-proj-item {
  padding: var(--sm) var(--md);
  border-radius: var(--r);
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sb-proj-item:hover {
  background-color: var(--hover);
  border-color: var(--rim);
}

.sb-user {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: var(--md);
  background-color: #0d0d0d;
  border-radius: var(--rL);
  border: 1px solid var(--rim);
  margin-top: auto;
}

.sb-user-row {
  display: flex;
  align-items: center;
  gap: var(--md);
}

.user-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--orbit);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
}

.user-role {
  font-size: 10px;
  color: var(--txtM);
}

/* ──────────────────────────────────────────────────────────────── */
/* MAIN LAYOUT                                                      */
/* ──────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg);
}

/* ──────────────────────────────────────────────────────────────── */
/* TOPBAR                                                           */
/* ──────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  height: 70px;
  padding: 0 var(--xl);
  border-bottom: 1px solid var(--rim);
  background-color: var(--panel);
  gap: var(--xl);
  flex-shrink: 0;
}

.tb-title {
  font-family: var(--fd);
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
}

.tb-sub {
  font-family: var(--fm);
  font-size: 9px;
  color: var(--txtM);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tb-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--md);
  justify-content: flex-end;
}

.file-label {
  position: relative;
  cursor: pointer;
}

.file-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background-color: var(--hover);
  border: 1px solid var(--rim);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.notif-btn:hover {
  background-color: var(--rim);
  border-color: var(--orbit);
}

.notif-pip {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--nova);
  display: none;
  animation: pulse-animation 2s ease-in-out infinite;
}

.notif-pip.show {
  display: block;
}

/* ──────────────────────────────────────────────────────────────── */
/* CONTENT AREA                                                     */
/* ──────────────────────────────────────────────────────────────── */

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg);
  position: relative;
}

.view {
  display: none;
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: var(--xl);
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
  position: relative;
  inset: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ──────────────────────────────────────────────────────────────── */
/* UPLOAD ZONE (ONBOARDING) - MEJORADO                              */
/* ──────────────────────────────────────────────────────────────── */

.upload-zone {
  text-align: center;
  padding: 30px var(--xl);
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.03);
  border-radius: var(--rL);
  margin-bottom: var(--xl);
  border: 1px solid var(--rim);
  animation: slideInDown 0.6s ease-out;
}

.onboard-logo {
  font-family: var(--fd);
  font-size: 32px;
  font-weight: 800;
  color: var(--txt);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.onboard-sub {
  font-size: 12px;
  color: var(--txtM);
  margin-bottom: var(--lg);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.drop-zone {
  border: 2px dashed var(--rim);
  border-radius: var(--rL);
  padding: 24px;
  background-color: rgba(34, 197, 94, 0.04);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  margin-bottom: var(--lg);
  max-width: 600px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  background-color: rgba(34, 197, 94, 0.08);
  border-color: var(--orbit);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-icon {
  font-size: 40px;
  display: block;
  margin-bottom: var(--md);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.dz-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 4px;
}

.dz-hint {
  font-size: 12px;
  color: var(--txtM);
  margin-bottom: var(--md);
}

.dz-hint strong {
  color: var(--orbit);
  font-weight: 600;
}

.dz-spec {
  font-size: 10px;
  color: var(--txtD);
  font-family: var(--fm);
  letter-spacing: 0.5px;
}

.drop-note {
  font-family: var(--fm);
  font-size: 9px;
  color: var(--txtM);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────────── */
/* ANIMACIONES AVANZADAS                                            */
/* ──────────────────────────────────────────────────────────────── */

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 0px rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ──────────────────────────────────────────────────────────────── */
/* PANELS Y CONTAINERS                                              */
/* ──────────────────────────────────────────────────────────────── */

.panel {
  background-color: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeInUp 0.5s ease-out;
}

.panel:hover {
  border-color: #2a2a2a;
}

.panel-header {
  padding: var(--lg) var(--xl);
  border-bottom: 1px solid var(--rim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: transparent;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.alert-title {
  color: var(--nova);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--pulse);
  animation: pulse-animation 2s ease-in-out infinite;
}

.panel-body {
  padding: var(--lg) var(--xl);
}

.panel-filter {
  padding: var(--md) var(--xl);
  background-color: transparent;
}

.flex-1 {
  flex: 1;
}

/* ──────────────────────────────────────────────────────────────── */
/* GRID LAYOUTS                                                     */
/* ──────────────────────────────────────────────────────────────── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--xl);
  margin-bottom: var(--xxl);
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--rim);
  border-left: 3px solid var(--orbit);
  border-radius: var(--r);
  padding: var(--lg) var(--xl);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  animation: scaleIn 0.4s ease-out;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card:hover {
  background-color: #141414;
  border-left-color: var(--orbit-h);
}

/* KPI Icon */
.kpi-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--fd);
  font-size: 32px;
  font-weight: 800;
  color: var(--txt);
  line-height: 1.1;
}

/* KPI Progress Bar */
.kpi-progress {
  width: 100%;
  height: 3px;
  background: var(--rim);
  border-radius: 2px;
  margin: var(--sm) 0 4px;
  overflow: hidden;
}

.kpi-progress > div {
  height: 100%;
  background: var(--orbit);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.kpi-label {
  font-size: 11px;
  color: var(--txtM);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* KPI Description */
.kpi-desc {
  font-size: 11px;
  color: var(--txtD);
  line-height: 1.4;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg);
  margin-bottom: var(--xl);
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lg);
  margin-bottom: var(--xl);
}

.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--lg);
  margin-bottom: var(--xl);
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--xl);
  text-align: center;
  transition: background-color 0.15s ease;
}

.stat-card:hover {
  background: #141414;
}

.stat-icon {
  font-size: 32px;
  display: block;
  margin-bottom: var(--md);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--orbit);
  margin-bottom: var(--sm);
}

.stat-label {
  font-size: 12px;
  color: var(--txtM);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--md) var(--lg);
  background: var(--bg-alt);
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid var(--orbit);
}

.stat-mini .stat-label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.stat-mini .stat-value {
  margin: 0;
  font-size: 18px;
}

.role-item {
  padding: var(--lg);
  background: var(--bg-alt);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  margin-bottom: var(--md);
  transition: all 0.3s ease;
}

.role-item:hover {
  background: var(--orbital);
  border-color: var(--pulse);
}

.role-name {
  font-weight: 600;
  color: var(--txt);
  margin-bottom: var(--sm);
  font-size: 14px;
}

.role-desc {
  font-size: 12px;
  color: var(--txtM);
  margin-bottom: var(--md);
}

.role-badge {
  display: inline-block;
  background: var(--orbit);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

.grid-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--lg);
}

.zt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--lg);
}

.proj-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--lg);
  margin-bottom: var(--xl);
}

.proj-card {
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--xl);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  border-left: 3px solid var(--orbit);
  animation: fadeInUp 0.5s ease-out;
  position: relative;
}

.proj-card::before {
  display: none;
}

.proj-card:hover {
  background-color: #141414;
  border-left-color: var(--orbit-h);
}

.proj-card::after {
  content: '→';
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 14px;
  color: var(--orbit);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.proj-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.proj-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--sm);
  display: flex;
  align-items: center;
  gap: var(--md);
  color: var(--txt);
  transition: color 0.3s ease;
}

.proj-card:hover .proj-card-title {
  color: var(--orbit);
}

.proj-card-icon {
  font-size: 20px;
}

.proj-card-status {
  display: inline-block;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.10);
  color: var(--orbit);
  margin-bottom: var(--sm);
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.20);
}

.proj-card-meta {
  font-size: 11px;
  color: var(--txtM);
  margin-top: var(--md);
  padding-top: var(--md);
  border-top: 1px solid var(--rim);
}

.proj-card-meta-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sm);
}

/* ──────────────────────────────────────────────────────────────── */
/* FORM STYLES - MEJORADO                                           */
/* ──────────────────────────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
  animation: fadeInUp 0.4s ease-out;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  background-color: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--md) var(--lg);
  color: var(--txt);
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--txtD);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10);
  background-color: #0d0d0d;
}

.form-input:disabled {
  background-color: var(--panel);
  color: var(--txtM);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--fs);
}

.form-row {
  display: flex;
  gap: var(--md);
  margin-bottom: var(--md);
}

.form-row .form-input {
  flex: 1;
  margin: 0;
}

.form-hint {
  font-size: 10px;
  color: var(--txtM);
  line-height: 1.6;
}

.form-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--md);
  margin-bottom: var(--md);
}

.url-input-group {
  display: flex;
  gap: var(--md);
}

.url-input-group .form-input {
  flex: 1;
  font-family: var(--fm);
  font-size: 11px;
}

/* ══════════════════════════════════════════════════════════════════ */
/* HAMBURGER SIDEBAR TOGGLE (CSS-only)                               */
/* ══════════════════════════════════════════════════════════════════ */

/* Hidden checkbox — the toggle state */
.st-input {
  display: none;
}

/* Hamburger button — visible only on mobile */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  cursor: pointer;
  flex-shrink: 0;
  color: var(--txtM);
  font-size: 16px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.hamburger-btn:hover {
  background-color: var(--hover);
  color: var(--txt);
}

/* Overlay — closes sidebar on mobile when tapped */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 39;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN                                                  */
/* ══════════════════════════════════════════════════════════════════ */

/* ── Tablet 768px – 1024px ────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--lg);
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .proj-cards {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .test-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 240px;
  }

  .audit-log-item {
    grid-template-columns: 80px 1fr 80px;
    gap: var(--md);
  }
}

/* ── Mobile < 768px ───────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Sidebar: off-canvas by default */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    z-index: 40;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--rim);
    overflow-y: auto;
  }

  /* Sidebar open state */
  .st-input:checked ~ .app .sidebar {
    left: 0;
  }

  /* Overlay visible when open */
  .st-input:checked ~ .app .sidebar-overlay {
    display: block;
  }

  /* Scroll lock when sidebar open */
  .st-input:checked ~ .app .content {
    overflow: hidden;
  }

  .topbar {
    height: 60px;
    padding: 0 var(--md);
  }

  .tb-sub {
    display: none;
  }

  .topbar-actions {
    gap: var(--sm);
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--md);
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .grid-col-right {
    gap: var(--md);
  }

  .proj-cards {
    grid-template-columns: 1fr;
    gap: var(--md);
  }

  .proj-card {
    padding: var(--lg);
  }

  .panel-header {
    padding: var(--md) var(--lg);
  }

  .panel-body {
    padding: var(--md) var(--lg);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--md);
  }

  .form-buttons {
    grid-template-columns: 1fr;
    gap: var(--sm);
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents iOS auto-zoom */
  }

  .search-wrap {
    min-width: 100%;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select {
    width: 100%;
  }

  .data-table {
    font-size: 10px;
  }

  .data-table th,
  .data-table td {
    padding: var(--sm);
  }

  .tab-row {
    gap: var(--sm);
    margin-bottom: var(--lg);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: var(--sm) var(--md);
    font-size: 12px;
  }

  .section-title {
    font-size: 18px;
    margin-bottom: var(--lg);
  }

  .zt-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .upload-zone {
    padding: 20px var(--md);
  }

  .drop-zone {
    padding: 20px;
  }

  .btn {
    padding: var(--sm) var(--md);
    font-size: 12px;
  }

  .btn-sm {
    padding: 6px var(--sm);
    font-size: 10px;
  }

  .audit-log-item {
    grid-template-columns: 1fr;
    gap: var(--sm);
    padding: var(--sm);
  }

  .audit-logs {
    padding: var(--lg) var(--md);
  }

  .test-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Small Mobile < 480px ─────────────────────────────────────── */
@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: 1fr;
    gap: var(--md);
  }

  .proj-cards {
    gap: var(--sm);
  }

  .proj-card {
    padding: var(--md);
  }

  .form-buttons {
    grid-template-columns: 1fr;
    gap: var(--sm);
  }

  .topbar {
    height: 56px;
  }

  .tb-title {
    font-size: 14px;
  }

  .test-buttons {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    padding: 16px;
  }
}

/* ──────────────────────────────────────────────────────────────── */
/* BUTTONS                                                          */
/* ──────────────────────────────────────────────────────────────── */

.btn {
  padding: var(--md) var(--lg);
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--fs);
}

.btn::before { display: none; }

.btn-primary {
  background: var(--orbit);
  color: white;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--orbit-h);
}

.btn-primary:active {
  background: var(--orbit-a);
}

.btn-secondary {
  background-color: var(--hover);
  color: var(--txt);
  border-color: var(--rim);
}

.btn-secondary:hover {
  background-color: #1f1f1f;
  border-color: #3a3a3a;
}

.btn-ghost {
  background-color: transparent;
  color: var(--txtM);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--hover);
  color: var(--txt);
}

.btn-sm {
  padding: var(--sm) var(--md);
  font-size: 11px;
}

/* ──────────────────────────────────────────────────────────────── */
/* BADGES                                                           */
/* ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-red {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--nova);
}

.badge-green {
  background-color: rgba(34, 197, 94, 0.15);
  color: var(--orbit);
}

.badge-yellow {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--solar);
}

.badge-blue {
  background-color: rgba(34, 197, 94, 0.10);
  color: var(--orbit);
}

/* ──────────────────────────────────────────────────────────────── */
/* TABLES                                                           */
/* ──────────────────────────────────────────────────────────────── */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--rL);
  border: 1px solid var(--rim);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead {
  background: #141414;
  border-bottom: 1px solid var(--rim);
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table th {
  padding: var(--lg) var(--lg);
  text-align: left;
  font-weight: 600;
  color: var(--txtM);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.data-table th:hover {
  color: var(--txt);
}

.data-table td {
  padding: var(--md) var(--lg);
  border-bottom: 1px solid var(--rim);
  color: var(--txt);
  transition: all 0.2s ease;
}

.data-table tbody tr {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

.data-table tbody tr:hover {
  background: #141414;
  box-shadow: inset 2px 0 0 var(--orbit);
}

.data-table tbody tr:hover td {
  color: var(--txt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ──────────────────────────────────────────────────────────────── */
/* GANTT V2 — PROFESSIONAL PROJECT PLANNER                          */
/* ──────────────────────────────────────────────────────────────── */

/* ── Toolbar ── */
.g-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md);
  margin-bottom: var(--lg);
  padding: 10px var(--lg);
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  flex-wrap: wrap;
}

.g-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--sm);
  flex-wrap: wrap;
}

.g-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.g-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--sm);
  background: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: 0 var(--md);
  min-width: 200px;
  height: 34px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.g-search-wrap:focus-within {
  border-color: var(--orbit);
}

.g-search-wrap svg {
  color: var(--txtM);
  flex-shrink: 0;
}

.g-search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--txt);
  font-size: 13px;
  width: 100%;
}

.g-search-input::placeholder { color: var(--txtM); }

.g-filter {
  font-size: 12px;
  padding: 6px 10px;
  height: 34px;
}

.g-scale-group {
  display: flex;
  background: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  overflow: hidden;
}

.g-scale-btn {
  background: none;
  border: none;
  color: var(--txtM);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.18s;
}

.g-scale-btn:hover { color: var(--txt); background: rgba(34,197,94,0.08); }
.g-scale-btn.active { background: var(--orbit); color: #fff; }

/* ── Container ── */
.g-container {
  display: flex;
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  height: calc(100vh - 195px);
}

/* ── Left Sidebar ── */
.g-sidebar {
  width: 390px;
  min-width: 390px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--rim);
  background: var(--panel);
  z-index: 3;
}

.g-sidebar-head {
  display: flex;
  align-items: center;
  padding: 0 var(--md);
  height: 58px;
  min-height: 58px;
  background: #141414;
  border-bottom: 2px solid var(--rim);
  gap: var(--sm);
  flex-shrink: 0;
}

.g-sidebar-body {
  flex: 1;
  overflow-y: hidden; /* synced via JS to timeline scroll */
  overflow-x: hidden;
}

.g-col-name {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--txtM);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.g-col-resp  { width: 36px; font-size: 10px; font-weight: 700; color: var(--txtM); text-transform: uppercase; letter-spacing: 0.8px; text-align: center; }
.g-col-pct   { width: 52px; font-size: 10px; font-weight: 700; color: var(--txtM); text-transform: uppercase; letter-spacing: 0.8px; text-align: center; }
.g-col-state { width: 86px; font-size: 10px; font-weight: 700; color: var(--txtM); text-transform: uppercase; letter-spacing: 0.8px; text-align: center; }

/* ── Project Row (sidebar) ── */
.g-proj-row {
  display: flex;
  align-items: center;
  padding: 0 var(--md);
  height: 44px;
  background: rgba(34,197,94,0.04);
  border-bottom: 1px solid var(--rim);
  cursor: pointer;
  transition: background 0.15s;
  gap: 6px;
  user-select: none;
}

.g-proj-row:hover { background: rgba(34,197,94,0.08); }

.g-proj-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txtM);
  font-size: 9px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.g-proj-toggle.open { transform: rotate(90deg); }

.g-proj-icon { font-size: 13px; flex-shrink: 0; }

.g-proj-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-proj-count {
  font-size: 9px;
  color: var(--txtM);
  background: var(--hover);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.g-proj-resp { width: 36px; display: flex; justify-content: center; flex-shrink: 0; }

.g-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  cursor: default;
}

.g-proj-pct {
  width: 52px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.g-proj-state { width: 86px; display: flex; justify-content: center; }

/* ── Task Row (sidebar) ── */
.g-task-row {
  display: flex;
  align-items: center;
  padding: 0 var(--md) 0 28px;
  height: 38px;
  border-bottom: 1px solid rgba(42,47,69,0.5);
  transition: background 0.12s;
  gap: 6px;
}

.g-task-row:hover { background: rgba(34,197,94,0.04); }

.g-task-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.g-task-name {
  flex: 1;
  font-size: 12px;
  color: var(--txtS);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-task-resp { width: 36px; display: flex; justify-content: center; flex-shrink: 0; }

.g-task-pct-wrap {
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.g-task-pct-num {
  font-size: 9px;
  font-weight: 700;
  color: var(--txtM);
}

.g-task-pct-bar {
  width: 40px;
  height: 3px;
  background: var(--hover);
  border-radius: 2px;
  overflow: hidden;
}

.g-task-pct-fill {
  height: 100%;
  border-radius: 2px;
}

.g-task-state { width: 86px; display: flex; justify-content: center; }

/* ── Status Badges ── */
.g-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.g-badge-blue   { background: rgba(34,197,94,0.10);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.g-badge-green  { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.30); }
.g-badge-amber  { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.g-badge-red    { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.g-badge-gray   { background: rgba(71,85,105,0.25);   color: #94a3b8; border: 1px solid rgba(71,85,105,0.4); }
.g-badge-purple { background: rgba(139,92,246,0.15);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }

/* ── Right Timeline ── */
.g-timeline-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}

.g-timeline-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--panel);
  border-bottom: 2px solid var(--rim);
}

.g-tl-months {
  position: relative;
  height: 32px;
  background: #141414;
  border-bottom: 1px solid var(--rim);
}

.g-tl-month {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--orbit);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-left: 1px solid rgba(34,197,94,0.20);
  overflow: hidden;
  white-space: nowrap;
}

.g-tl-weeks {
  position: relative;
  height: 24px;
  background: var(--panel);
}

.g-tl-week-tick {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--txtD);
  border-left: 1px solid var(--rim);
  white-space: nowrap;
  overflow: hidden;
}

.g-tl-week-tick.now-week {
  color: var(--solar);
  border-left-color: rgba(245,158,11,0.5);
}

/* ── Timeline body rows ── */
.g-tl-body-inner { position: relative; }

.g-tl-proj-row {
  height: 44px;
  border-bottom: 1px solid var(--rim);
  position: relative;
  background: rgba(34,197,94,0.02);
}

.g-tl-task-row {
  height: 38px;
  border-bottom: 1px solid rgba(42,47,69,0.5);
  position: relative;
}

/* ── Grid lines ── */
.g-tl-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(42,47,69,0.45);
  pointer-events: none;
  z-index: 0;
}

.g-tl-grid-line.month { background: rgba(34,197,94,0.15); }

/* ── Today marker ── */
.g-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--solar);
  z-index: 5;
  pointer-events: none;
}

.g-today-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background: var(--solar);
  color: #000;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 0 0 4px 4px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* ── Bars ── */
.g-bar-wrap {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  min-width: 4px;
}

.g-bar {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: filter 0.15s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  min-width: 4px;
}

.g-bar:hover { filter: brightness(1.18); transform: scaleY(1.08); }

.g-bar-proj {
  height: 28px;
  border-radius: 6px;
}

.g-bar-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  opacity: 0.28;
  pointer-events: none;
}

.g-bar-label {
  position: relative;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  z-index: 1;
  pointer-events: none;
}

/* ── Tooltip ── */
.g-tooltip {
  position: fixed;
  background: #0d0d0d;
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  padding: var(--md) var(--lg);
  box-shadow: 0 20px 48px rgba(0,0,0,0.6);
  z-index: 9999;
  pointer-events: none;
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.12s;
}

.g-tooltip.on { opacity: 1; }

.g-tooltip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rim);
  padding-bottom: 6px;
}

.g-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--txtM);
  margin-top: 4px;
}

.g-tooltip-row strong { color: var(--txt); }

/* ── Empty state ── */
.g-empty-state {
  padding: 60px 40px;
  text-align: center;
  color: var(--txtM);
  font-size: 13px;
}

/* ──────────────────────────────────────────────────────────────── */
/* FILTER BAR - MEJORADO                                             */
/* ──────────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--md);
  margin-bottom: var(--lg);
  padding: var(--lg);
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  animation: slideInDown 0.5s ease-out;
}

.filter-row {
  display: flex;
  gap: var(--md);
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.search-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  background-color: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--md) var(--lg);
  color: var(--txt);
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--txtD);
}

.search-input:focus {
  outline: none;
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10);
  background-color: #0d0d0d;
}

.filter-select {
  background-color: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--md) var(--lg);
  color: var(--txt);
  font-size: 12px;
  cursor: pointer;
  min-width: 160px;
  transition: border-color 0.15s ease;
}

.filter-select:hover {
  border-color: var(--orbit);
  background-color: #0d0d0d;
}

.filter-select:focus {
  outline: none;
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10);
  background-color: #0d0d0d;
}

/* ──────────────────────────────────────────────────────────────── */
/* TABS - MEJORADO                                                   */
/* ──────────────────────────────────────────────────────────────── */

.tab-row {
  display: flex;
  gap: var(--md);
  margin-bottom: var(--xl);
  border-bottom: 2px solid var(--rim);
  padding-bottom: var(--md);
  animation: slideInDown 0.5s ease-out;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: var(--md) var(--lg);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--txtM);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  bottom: -2px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--txt);
}

.tab.active {
  color: var(--orbit);
  border-bottom-color: var(--orbit);
}

/* ──────────────────────────────────────────────────────────────── */
/* SECTION TITLE                                                    */
/* ──────────────────────────────────────────────────────────────── */

.section-title {
  font-family: var(--fd);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: var(--xl);
  color: var(--txt);
  animation: slideInLeft 0.5s ease-out;
  letter-spacing: -0.5px;
}

/* ──────────────────────────────────────────────────────────────── */
/* FILE CHIP                                                        */
/* ──────────────────────────────────────────────────────────────── */

.file-chip-area {
  display: flex;
  gap: var(--md);
  flex-wrap: wrap;
  margin-bottom: var(--xl);
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sm);
  background-color: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 20px;
  padding: var(--sm) var(--md);
  font-size: 11px;
  color: var(--pulse);
}

.file-chip-close {
  cursor: pointer;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────── */
/* MATURITY BAR                                                     */
/* ──────────────────────────────────────────────────────────────── */

.maturity-bar {
  display: flex;
  gap: var(--sm);
  margin-bottom: var(--md);
}

.mat-seg {
  flex: 1;
  height: 6px;
  background-color: var(--rim);
  border-radius: 3px;
}

.mat-seg.filled {
  background: linear-gradient(135deg, var(--orbit) 0%, var(--pulse) 100%);
}

.mat-seg.partial {
  background: linear-gradient(135deg, var(--solar) 0%, var(--orbit) 100%);
}

/* ──────────────────────────────────────────────────────────────── */
/* SPARKLINE                                                        */
/* ──────────────────────────────────────────────────────────────── */

.sparkline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sm);
  height: 40px;
}

.spark-bar {
  flex: 1;
  border-radius: 2px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.spark-bar:hover {
  opacity: 1;
}

/* ──────────────────────────────────────────────────────────────── */
/* CONFIG PANEL                                                     */
/* ──────────────────────────────────────────────────────────────── */

.config-status {
  display: flex;
  align-items: center;
  gap: var(--md);
  padding: var(--lg);
  background-color: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: var(--r);
}

.config-status span {
  font-size: 20px;
}

.config-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
}

.config-desc {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--txtM);
}

.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--md) var(--lg);
  border-bottom: 1px solid var(--rim);
}

.cfg-row:last-child {
  border-bottom: none;
}

.cfg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
}

/* ══════════════════════════════════════════════════════════════════ */
/* VISTA USUARIOS - ESTILOS COMPACTOS                                 */
/* ══════════════════════════════════════════════════════════════════ */

#view-usuarios .section-title {
  font-size: 18px;
  margin-bottom: var(--lg);
}

#view-usuarios .grid-4col {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--md);
  margin-bottom: var(--lg);
}

#view-usuarios .stat-card {
  padding: var(--lg) var(--md);
  border-radius: 8px;
}

#view-usuarios .stat-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

#view-usuarios .stat-value {
  font-size: 22px;
  margin-bottom: 4px;
}

#view-usuarios .stat-label {
  font-size: 11px;
  letter-spacing: 0.5px;
}

#view-usuarios .grid-2col {
  gap: var(--md);
  margin-bottom: var(--lg);
}

#view-usuarios .panel {
  border-radius: 8px;
}

#view-usuarios .panel-header {
  padding: var(--md) var(--lg);
  gap: var(--md);
}

#view-usuarios .panel-title {
  font-size: 12px;
}

#view-usuarios .panel-body {
  padding: var(--md) var(--lg);
}

#view-usuarios .stat-mini {
  padding: var(--sm) var(--md);
  margin-bottom: 6px;
}

#view-usuarios .stat-mini .stat-label {
  font-size: 12px;
}

#view-usuarios .stat-mini .stat-value {
  font-size: 16px;
}

#view-usuarios .role-item {
  padding: var(--md) var(--lg);
  margin-bottom: var(--sm);
  border-radius: 6px;
}

#view-usuarios .role-name {
  font-size: 13px;
  margin-bottom: 4px;
}

#view-usuarios .role-desc {
  font-size: 11px;
  margin-bottom: var(--sm);
}

#view-usuarios .role-badge {
  font-size: 9px;
  padding: 1px 6px;
}

#usersListArea {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
}

/* Tabla de usuarios compacta */
#usersListArea .user-row {
  padding: var(--md) var(--lg);
  background: var(--orbital);
  border-left: 3px solid var(--pulse);
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--md);
  transition: all 0.2s ease;
}

#usersListArea .user-row:hover {
  background: rgba(34, 197, 94, 0.06);
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--orbit);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--txtM);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 4px;
  font-size: 10px;
  color: var(--orbit);
  font-weight: 500;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pulse);
}

.cfg-desc {
  font-size: 10px;
  color: var(--txtM);
}

.integration-item {
  display: flex;
  align-items: center;
  gap: var(--md);
}

.integration-item span {
  font-size: 16px;
}

.toggle {
  width: 40px;
  height: 24px;
  background-color: var(--rim);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.toggle.on {
  background: linear-gradient(135deg, var(--orbit) 0%, var(--pulse) 100%);
}

.toggle.on::after {
  left: 18px;
}

/* ──────────────────────────────────────────────────────────────── */
/* ALERT PANEL                                                      */
/* ──────────────────────────────────────────────────────────────── */

.alert-panel {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--rL);
  padding: var(--lg);
  margin-bottom: var(--lg);
}

.alert-title {
  font-family: var(--fd);
  font-size: 14px;
  font-weight: 700;
  color: var(--nova);
  margin-bottom: var(--sm);
}

.alert-message {
  font-size: 12px;
  color: var(--txtS);
  margin-bottom: var(--md);
}

.alert-details {
  font-size: 11px;
  color: var(--txtM);
  line-height: 1.6;
}

.alert-details code {
  background-color: var(--panel);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--fm);
  font-size: 10px;
}

/* ──────────────────────────────────────────────────────────────── */
/* TEST PANEL                                                       */
/* ──────────────────────────────────────────────────────────────── */

.test-panel {
  background-color: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--rL);
  padding: var(--lg);
  margin-bottom: var(--lg);
}

.test-title {
  font-family: var(--fd);
  font-size: 14px;
  font-weight: 700;
  color: #f97316;
  margin-bottom: var(--md);
}

.test-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--md);
  margin-bottom: var(--md);
}

.test-results {
  font-size: 10px;
  color: var(--txtM);
  font-family: var(--fm);
  line-height: 1.7;
  max-height: 200px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.1);
  padding: var(--md);
  border-radius: var(--r);
}

/* ──────────────────────────────────────────────────────────────── */
/* ENV CONFIG                                                       */
/* ──────────────────────────────────────────────────────────────── */

.env-config {
  background-color: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  padding: var(--lg);
  font-family: var(--fm);
  font-size: 11px;
  color: var(--txtS);
  line-height: 1.8;
  margin-bottom: var(--md);
}

.env-key {
  color: var(--orbit);
  font-weight: 600;
}

.env-pass {
  color: var(--solar);
}

.env-hint {
  font-size: 10px;
  color: var(--txtM);
  line-height: 1.6;
}

.env-hint code {
  background-color: rgba(34, 197, 94, 0.12);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: var(--fm);
  color: var(--orbit);
}

/* ──────────────────────────────────────────────────────────────── */
/* ROLES LIST                                                       */
/* ──────────────────────────────────────────────────────────────── */

.roles-list {
  padding: var(--md);
}

.role-item {
  display: flex;
  align-items: center;
  gap: var(--md);
  padding: var(--md);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--r);
  border: 1px solid var(--rim);
  margin-bottom: var(--md);
}

.role-item span {
  font-size: 20px;
}

/* ──────────────────────────────────────────────────────────────── */
/* AUDIT LOGS                                                       */
/* ──────────────────────────────────────────────────────────────── */

.audit-logs {
  padding: var(--lg) var(--xl);
  display: flex;
  flex-direction: column;
  gap: var(--md);
  max-height: 500px;
  overflow-y: auto;
}

.audit-log-item {
  display: grid;
  grid-template-columns: 100px 150px 1fr 100px;
  gap: var(--lg);
  padding: var(--md);
  background-color: rgba(34, 197, 94, 0.03);
  border-left: 3px solid var(--orbit);
  border-radius: var(--r);
  font-size: 11px;
}

.log-time {
  font-family: var(--fm);
  color: var(--txtM);
}

.log-type {
  display: inline-block;
  background-color: rgba(34, 197, 94, 0.12);
  color: var(--orbit);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.log-message {
  color: var(--txt);
}

.log-user {
  text-align: right;
  color: var(--txtM);
}

/* ──────────────────────────────────────────────────────────────── */
/* ISO CONTROLS                                                     */
/* ──────────────────────────────────────────────────────────────── */

.iso-group-nav {
  display: flex;
  gap: var(--md);
  flex-wrap: wrap;
  margin-top: var(--md);
}

.iso-group-btn {
  padding: var(--sm) var(--md);
  background-color: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.iso-group-btn:hover,
.iso-group-btn.active {
  background-color: var(--rim);
  border-color: var(--orbit);
  color: var(--orbit);
}

.iso-breadcrumb {
  margin-top: var(--md);
  color: var(--txtM);
  font-size: 10px;
}

.iso-control-card {
  background-color: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  padding: var(--lg);
  margin-bottom: var(--md);
  cursor: pointer;
  transition: all 0.3s ease;
}

.iso-control-card:hover {
  border-color: var(--orbit);
  background-color: #141414;
}

.iso-control-code {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 600;
  color: var(--orbit);
  margin-bottom: var(--sm);
}

.iso-control-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: var(--sm);
}

.iso-control-desc {
  font-size: 11px;
  color: var(--txtM);
  margin-bottom: var(--md);
  line-height: 1.6;
}

.iso-control-status {
  display: inline-block;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────── */
/* SOC EVENTS                                                       */
/* ──────────────────────────────────────────────────────────────── */

.soc-event {
  display: flex;
  align-items: flex-start;
  gap: var(--lg);
  padding: var(--md);
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--rim);
}

.soc-event:last-child {
  border-bottom: none;
}

.soc-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}

.soc-event-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt);
}

.soc-event-details {
  font-size: 10px;
  color: var(--txtM);
  margin-top: 2px;
}

.soc-event-time {
  font-family: var(--fm);
  font-size: 9px;
  color: var(--txtM);
}

/* ──────────────────────────────────────────────────────────────── */
/* SCROLLBAR PERSONALIZADO                                          */
/* ──────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--panel);
}

::-webkit-scrollbar-thumb {
  background-color: var(--rim);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--orbit);
}

/* ── Users module filter panel ── */
.filters-panel {
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: var(--rL);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filters-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--txtM);
  margin-bottom: 14px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txtM);
  letter-spacing: 0.3px;
}

.filter-input {
  background: var(--hover);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  height: 34px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.filter-input:focus { border-color: var(--orbit); }
.filter-input::placeholder { color: var(--txtD); }

.filters-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .filters-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════ */
