:root {
  --primary: #4293E1;
  --bg-hub: #05080f;
  --font: "Segoe UI", "Nunito Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg-hub);
  color: #fff;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.view { display: none; }
.view.active { display: flex; }

#hub-view.active {
  flex-direction: column;
  background: radial-gradient(circle at center, #182742, #0a1220 60%, #05080f);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.hub-top {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 14px;
  flex-shrink: 0;
  z-index: 60;
  width: 100%;
}
.hub-top-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hub-brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}
.hub-brand small {
  display: block;
  opacity: 0.75;
  font-size: 0.75rem;
}
.hub-phone {
  display: block;
  margin-top: 2px;
  color: #9ec9f5;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.hub-phone:hover {
  color: #fff;
  text-decoration: underline;
}
.hub-mark,
.hub-center-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #6bb0f0);
  display: grid;
  place-items: center;
  font-weight: 900;
  flex-shrink: 0;
}
.hub-center-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.hub-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  background: #000;
}
.hub-logo-sm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
}
.hub-logo-center {
  width: min(120px, 58%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 0 4px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.hub-clock {
  font-size: 0.85rem;
  opacity: 0.85;
  white-space: nowrap;
}

.radial-menu-container {
  --orbit-radius: 270px;
  --module-size: 96px;
  position: relative;
  flex: 1 1 auto;
  width: calc(var(--orbit-radius) * 2 + var(--module-size));
  height: calc(var(--orbit-radius) * 2 + var(--module-size));
  max-width: min(100vw - 16px, 100%);
  max-height: min(100dvh - 96px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 1;
  overflow: visible;
}

.radial-center {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(145deg, #111827, #0a1220);
  border: 2px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 0 80px rgba(66, 147, 225, 0.35), 0 0 140px rgba(37, 99, 235, 0.15);
  z-index: 50;
  transition: 0.25s ease;
  line-height: 1.2;
  padding: 12px;
  overflow: hidden;
}
.radial-center-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}
.radial-center-ico { font-size: 28px; line-height: 1; }
.radial-center small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}

.orbit {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  overflow: visible;
}
.orbit .radial-module {
  pointer-events: auto;
  z-index: 60;
}

.radial-module {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--module-size);
  height: var(--module-size);
  margin-top: calc(var(--module-size) / -2);
  margin-left: calc(var(--module-size) / -2);
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 5px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.25);
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  color: #fff;
  line-height: 1.05;
  overflow: hidden;
}
.radial-module .rm-ico {
  font-size: 22px;
  margin-bottom: 1px;
  line-height: 1;
  pointer-events: none;
}
.radial-module .rm-label {
  pointer-events: none;
  max-width: 94%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  word-break: break-word;
}
.radial-module:hover,
.radial-module:focus,
.radial-module:active {
  border-color: #fff;
  box-shadow: 0 0 22px rgba(255,255,255,0.25);
  z-index: 100;
}

.rm-blue   { background: rgba(66, 147, 225, 0.95); }
.rm-green  { background: rgba(26, 188, 156, 0.92); }
.rm-orange { background: rgba(255, 140, 0, 0.92); }
.rm-red    { background: rgba(255, 75, 92, 0.92); }
.rm-purple { background: rgba(142, 68, 173, 0.92); }
.rm-cyan   { background: rgba(0, 207, 232, 0.92); }
.rm-teal   { background: rgba(15, 118, 110, 0.95); }
.rm-amber  { background: rgba(217, 119, 6, 0.94); }

/* Vista módulo placeholder */
#module-view.active {
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f5f7fb;
  color: #152033;
}
.module-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5eaf2;
  position: sticky;
  top: 0;
  z-index: 20;
}
.module-bar h1 {
  margin: 0;
  font-size: 1.05rem;
}
.btn-back {
  border: 1px solid #d7e0ec;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #152033;
}
.module-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.module-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(21, 32, 51, 0.06);
}
.module-ico { font-size: 2.4rem; margin-bottom: 8px; }
.module-card h2 { margin: 0 0 8px; }
.module-card p { margin: 0; color: #667085; }

@media (max-width: 900px) {
  .radial-menu-container { --orbit-radius: 160px; --module-size: 64px; }
  .radial-center { width: 112px; height: 112px; font-size: 13px; padding: 8px; }
  .radial-center small { font-size: 9px; }
  .radial-module { font-size: 8px; padding: 3px; border-width: 1.5px; }
  .radial-module .rm-ico { font-size: 16px; }
  .hub-center-mark { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 12px; }
}
@media (max-width: 600px) {
  .radial-menu-container { --orbit-radius: 128px; --module-size: 58px; }
  .radial-center { width: 88px; height: 88px; font-size: 11px; padding: 6px; }
  .radial-center small { font-size: 8px; }
  .radial-module { font-size: 7.5px; padding: 4px; }
  .radial-module .rm-ico { font-size: 16px; }
  .hub-clock { display: none; }
  .hub-center-mark { width: 34px; height: 34px; font-size: 0.95rem; }
}
@media (max-width: 380px), (max-height: 620px) {
  .radial-menu-container { --orbit-radius: 112px; --module-size: 52px; }
  .radial-center { width: 76px; height: 76px; font-size: 10px; padding: 5px; }
  .radial-module { font-size: 7px; }
  .radial-module .rm-ico { font-size: 15px; }
}
