* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  height: 100vh;
  display: flex;
  background: radial-gradient(circle at top, #1e293b 0%, #020617 60%);
  color: #e5e7eb;
}

/* SIDEBAR */
.sidebar {
  width: 380px;
  background: #020617;
  border-right: 1px solid #1f2937;
  overflow: hidden;
}

.sidebar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CONTENT */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  height: 60px;
  background: linear-gradient(to bottom, #020617, #020617ee);
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.menu {
  position: relative;
}

.menu-btn {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.menu-btn:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.menu-items {
  display: none;
  position: absolute;
  top: 46px;
  left: 0;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 12px;
  min-width: 230px;
  z-index: 1000;
  padding: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.app-link {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s, color .2s;
}

.app-link:hover {
  background: #1f2937;
}

.app-link.active {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  color: #020617;
  font-weight: 600;
}

/* HOME ICON */
.header-home {
  margin-left: auto;
  font-size: 22px;
  cursor: pointer;
  user-select: none;
  opacity: 0.85;
  transition: transform .2s, opacity .2s;
}

.header-home:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* IFRAME */
iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

/* HOME / WELCOME */
.welcome {
  padding: 48px;
  max-width: 1100px;
}

.welcome h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .3px;
}

.welcome p {
  color: #94a3b8;
  margin-bottom: 18px;
  font-size: 16px;
  max-width: 700px;
}

/* TOOLS GRID */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* TOOL CARD */
.tool {
  background: linear-gradient(180deg, #020617, #020617cc);
  border: 1px solid #1f2937;
  border-radius: 18px;
  padding: 24px;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.tool::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(circle at top left, rgba(14,165,233,0.15), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.tool:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  cursor: pointer;
}

.tool:hover::after {
  opacity: 1;
}

.tool h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

.tool p {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.status-box {
  background: linear-gradient(180deg, #020617, #020617cc);
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  max-width: 900px;
}

.status-box h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.status-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.status-box li {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.tool {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.tool-btn {
  align-self: flex-start;
  background: linear-gradient(180deg, #334155, #1f2937);
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.tool-btn:hover {
  background: linear-gradient(180deg, #475569, #334155);
  transform: translateY(-1px);
}

.tool-btn:active {
  transform: translateY(0);
}

.tool-btn.disabled {
  background: #020617;
  border-color: #1f2937;
  color: #64748b;
  cursor: not-allowed;
}

.hide-mobile {
  display: block;
}
.show-mobile {
  display: none;
}
.mobile-only {
  display: none;
}

/* =========================
   RESPONSIVE - MOBILE
   ========================= */
@media (max-width: 768px) {

  body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  display: flex;
  min-height: 100vh; /* ← CAMBIO CLAVE */
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* MUY IMPORTANTE para iOS */
}


  /* Sidebar fuera */
  .sidebar {
    display: none;
  }

  /* Header scrollable */
  .header {
    height: auto;
    padding: 12px;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .menu-btn {
    font-size: 14px;
    padding: 10px 14px;
  }

  /* Ocultar módulos no permitidos */
  .hide-mobile {
    display: none !important;
  }

    .show-mobile {
    display: block;
  }
    .mobile-only {
    display: block;
  }

  /* Home icon fijo */
  .header-home {
    position: sticky;
    right: 0;
    font-size: 20px;
  }

  /* Welcome */
  .welcome {
    padding: 20px;
      /*flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;*/
  }

  .welcome h1 {
    font-size: 22px;
  }

  .welcome p {
    font-size: 14px;
  }

  /* Status box */
  .status-box {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* Tools en 1 columna */
  .tools {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Cards más táctiles */
  .tool {
    padding: 20px;
    border-radius: 16px;
  }

  .tool h3 {
    font-size: 16px;
  }

  .tool p {
    font-size: 14px;
  }

  .tool-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 15px;
  }

  /* iframe ocupa todo */
  iframe {
    min-height: calc(100vh - 60px);
  }

    .tools-menu .menu-items {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}


/* CONTENEDOR GENERAL */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* HEADER FIJO */
.header {
  flex-shrink: 0;
}

/* ZONA SCROLLEABLE */
.welcome {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}
