/* ══════════════════════════════════════════════════════
   ROCATRANS Fleet Command — Layout
   App Shell · Sidebar · Topbar · Main Content
══════════════════════════════════════════════════════ */

/* ────────────────────────────────
   APP SHELL
──────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(
    180deg,
    var(--brand-600)  0%,
    var(--brand-800)  38%,
    var(--brand-900)  68%,
    var(--bg-deep)   100%
  );
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-slow);
  will-change: transform;
}

/* ── Noise texture overlay ── */
.sidebar-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* Todos los hijos directos encima del noise */
.sidebar > *:not(.sidebar-noise) {
  position: relative;
  z-index: 1;
}

/* ── Logo area ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0, 232, 184, 0.28));
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.07em;
  background: linear-gradient(135deg, #ffffff 25%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  line-height: 1.1;
}

.sidebar-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Navigation ── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.sidebar-nav:hover {
  scrollbar-color: var(--border) transparent;
}

.nav-group-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 14px 10px 5px;
  margin-top: 2px;
  user-select: none;
}

.nav-group-label:first-child {
  padding-top: 6px;
}

/* ── Nav item ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 232, 184, 0.18);
  font-weight: 600;
}

/* Barra lateral izquierda del activo */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 2px 0 10px var(--accent-glow);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.65;
  transition: opacity var(--transition);
}

.nav-item:hover  .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: all var(--transition);
}

.nav-item.active .nav-badge {
  background: rgba(0, 232, 184, 0.15);
  border-color: rgba(0, 232, 184, 0.30);
  color: var(--accent);
}

/* Badge EN VIVO especial */
.nav-badge.badge-live {
  background: var(--accent-dim);
  border-color: rgba(0, 232, 184, 0.25);
  color: var(--accent);
  letter-spacing: 0.06em;
  font-size: 8.5px;
  gap: 4px;
  padding: 0 7px;
}

.nav-badge.badge-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Clock */
.sidebar-clock {
  text-align: center;
  padding: 2px 0;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.10em;
  line-height: 1;
  text-shadow: 0 0 14px rgba(0, 232, 184, 0.22);
}

.clock-date {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-top: 5px;
}

/* Separator */
.sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* Status row */
.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow), 0 0 12px var(--accent-glow2);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.status-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-text.muted {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 9.5px;
}

/* Online count */
.sidebar-online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.sidebar-online svg {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-online strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Mobile Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
  animation: fadeIn 0.2s ease;
}


/* ══════════════════════════════
   TOPBAR
══════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: rgba(6, 19, 24, 0.92);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 22px;
  gap: 16px;
  transition: left var(--transition-slow);
}

/* ── Topbar Left ── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--transition);
  flex-shrink: 0;
}

.topbar-hamburger:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.breadcrumb-brand {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-300);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb-sep {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}

.breadcrumb-page {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

/* ── Live badge (topbar) ── */
.badge-live-topbar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 232, 184, 0.28);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Topbar Right ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.topbar-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

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

.topbar-btn--accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 232, 184, 0.28);
}

.topbar-btn--accent svg {
  opacity: 1;
}

.topbar-btn--accent:hover {
  background: rgba(0, 232, 184, 0.20);
  color: var(--accent-hover);
  border-color: rgba(0, 232, 184, 0.45);
  box-shadow: var(--shadow-accent);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-400) 100%);
  border: 2px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
  user-select: none;
}

.topbar-avatar:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  transform: scale(1.04);
}


/* ══════════════════════════════
   MAIN CONTENT
══════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
  background: var(--bg-primary);
  flex: 1;
  min-width: 0;
  transition: margin-left var(--transition-slow);
}

.section-inner {
  padding: 28px 28px 48px;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-header-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.section-header-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}


/* ══════════════════════════════
   PLACEHOLDER SECTIONS (Fase 1)
══════════════════════════════ */
.section-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-height) - 56px);
  text-align: center;
  padding: 48px 32px;
  animation: fadeIn 0.35s ease;
}

.placeholder-icon {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-xl);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 232, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  color: var(--accent);
  box-shadow: 0 0 32px rgba(0, 232, 184, 0.10);
  animation: glowPulse 3s ease-in-out infinite;
}

.placeholder-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.placeholder-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.placeholder-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 400px;
  margin: 0 auto;
}

.placeholder-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.placeholder-tag svg {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}
