/* FILE: tema-glass-base.css */

:root {
  color-scheme: dark;
  --fondo: #0A1428;
  --panel: rgba(255, 255, 255, .045);
  --borde: rgba(120, 160, 255, .14);
  --texto: #E8EEF9;
  --tenue: #8A9BB8;
  --acento: #0A84FF;
  --acento-texto: #70B8FF;
  --tinta: #F5F8FF;
  --nav: #081225;
  --superficie: #112239;
  --critica: #FB7185;
  --relevante: #FBBF24;
  --anomalia: #FBBF24;
  --ok: #34D399;
  --vidrio: rgba(255, 255, 255, .045);
  --vidrio-borde: rgba(120, 160, 255, .14);
  --glow: 0 8px 28px rgba(10, 132, 255, .14);
  --radio: 15px;
  --sombra: 0 8px 30px rgba(0, 0, 0, .2);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(10, 132, 255, .12), transparent 42%),
    radial-gradient(ellipse at 15% 75%, rgba(34, 86, 170, .07), transparent 45%),
    var(--fondo);
  color: var(--texto);
  font: 14px/1.6 'Inter', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  min-width: 0;
}

.app-body {
  margin-left: 252px;
  min-width: 0;
  min-height: 100vh;
}

h1, h2, h3 {
  color: var(--tinta);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h1 {
  margin: 7px 0 8px;
  font-size: 32px;
  letter-spacing: -1px;
}

h2 {
  margin: 5px 0 20px;
  font-size: 21px;
  letter-spacing: -.5px;
}

h3 { font-size: 17px; }

a {
  color: var(--acento-texto);
  text-underline-offset: 3px;
}

a:hover { color: #A1D2FF; }

button, input, select, textarea {
  font-family: inherit;
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

button {
  padding: 10px 18px;
  border: 1px solid rgba(90, 200, 250, .22);
  border-radius: 999px;
  background: var(--acento);
  color: #FFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #1E90FF;
  filter: none;
  box-shadow: var(--glow);
}

button:active { transform: translateY(1px); }

button:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #70B8FF;
  outline-offset: 3px;
}

input, select, textarea {
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: rgba(5, 15, 31, .7);
  color: var(--texto);
  font-size: 13px;
}

input::placeholder, textarea::placeholder {
  color: var(--tenue);
  opacity: 1;
}

input:hover, select:hover, textarea:hover {
  border-color: rgba(120, 160, 255, .3);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .16);
}

select option {
  background: var(--superficie);
  color: var(--texto);
}

textarea { resize: vertical; }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--acento);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--borde);
  background: #122239;
  color: #ADBCD2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--borde);
  color: var(--texto);
  overflow-wrap: anywhere;
}

tbody tr { transition: background .2s ease; }
tbody tr:hover { background: rgba(10, 132, 255, .07); }

.tabla-caja {
  max-width: 100%;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.sidebar {
  width: 252px;
  color: #BCCBE0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(10, 132, 255, .13), transparent 55%),
    linear-gradient(180deg, #0C1A30, var(--nav));
  border-right: 1px solid var(--borde);
  box-shadow: 10px 0 40px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  scrollbar-width: thin;
  scrollbar-color: #2A4364 transparent;
}

.brand { color: #FFF; }

.brand small {
  color: #A8BCD7;
  letter-spacing: 1.1px;
}

.brand-symbol {
  border: 1px solid rgba(90, 200, 250, .35);
  border-radius: 12px;
  background: linear-gradient(140deg, #259BFF, #075CC7);
  box-shadow: 0 6px 24px rgba(10, 132, 255, .23);
}

.workspace-label { color: var(--tenue); }
.workspace-label small { color: #D4E0F2; }

.nav-item {
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #B3C3DA;
  box-shadow: none;
  text-decoration: none;
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    box-shadow .2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .045);
  color: #FFF;
  box-shadow: none;
}

.nav-item.active {
  border: 1px solid rgba(10, 132, 255, .24);
  border-left: 3px solid var(--acento);
  background: linear-gradient(90deg, rgba(10, 132, 255, .25), rgba(10, 132, 255, .1));
  color: #FFF;
  box-shadow: 0 4px 18px rgba(10, 132, 255, .08);
}

.nav-icon { color: #8FAACD; }
.nav-item.active .nav-icon { color: #52ACFF; }
.nav-item:hover .nav-icon { color: #70B8FF; }
.nav-item i { background: #70B8FF; }

.nav-group {
  position: relative;
  margin-top: 21px;
}

.nav-group-toggle {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9AAFCB;
  box-shadow: none;
}

.nav-group-toggle:hover {
  background: transparent;
  color: #D5E7FF;
  box-shadow: none;
}

.nav-group .nav-item {
  position: relative;
  width: calc(100% - 12px);
  margin-left: 12px;
  padding-left: 17px;
}

.nav-group .nav-item::before {
  content: "";
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: -10px;
  width: 1px;
  background: rgba(120, 160, 255, .18);
  pointer-events: none;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 12px;
  border: 1px solid var(--vidrio-borde);
  border-radius: 14px;
  background: var(--vidrio);
  color: var(--texto);
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.sidebar-bottom > span { color: #70B8FF; }
.sidebar-bottom small { color: #9AAFCB; }

.sidebar-footer {
  margin-top: 16px;
  border-top: 1px solid var(--borde);
  color: #95A8C4;
}

.topbar {
  background: rgba(10, 20, 40, .84);
  border-bottom: 1px solid var(--borde);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.breadcrumbs { color: var(--tenue); }
.breadcrumbs strong { color: var(--texto); }
.top-actions, .dropdown-wrap { min-width: 0; }

.project-trigger {
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--texto);
}

.project-trigger:hover {
  border-color: rgba(10, 132, 255, .45);
  background: rgba(10, 132, 255, .1);
}

.project-trigger > span:first-child { color: #70B8FF; }

.icon-button, .text-button, .sec {
  border: 1px solid rgba(120, 160, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: #8CC5FF;
}

.icon-button:hover, .text-button:hover, .sec:hover {
  border-color: rgba(10, 132, 255, .5);
  background: rgba(10, 132, 255, .12);
  color: #D3E9FF;
  box-shadow: var(--glow);
}

.icon-button { padding: 9px; }

.notification-button i {
  width: 6px;
  height: 6px;
  background: var(--acento);
  border: 1px solid #0A1428;
  box-shadow: 0 0 8px rgba(10, 132, 255, .5);
}

.profile-trigger {
  border-left: 1px solid var(--borde);
  border-radius: 0;
  background: transparent;
  color: var(--texto);
}

.profile-trigger:hover {
  background: transparent;
  color: #FFF;
  box-shadow: none;
}

.avatar {
  flex-shrink: 0;
  border: 2px solid rgba(120, 160, 255, .25);
  background: linear-gradient(145deg, #153E70, #102944);
  color: #A1D2FF;
}

.profile-text small { color: var(--tenue); }

.popover, .notifications {
  max-width: calc(100vw - 24px);
  border: 1px solid rgba(120, 160, 255, .2);
  border-radius: 14px;
  background: rgba(13, 27, 46, .96);
  color: var(--texto);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  scrollbar-width: thin;
  scrollbar-color: #2A4364 transparent;
}

.popover > small { color: var(--tenue); }

.popover button:not(.text-button) {
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--texto);
}

.popover button:not(.text-button):hover {
  border-color: rgba(10, 132, 255, .4);
  background: rgba(10, 132, 255, .12);
}

.popover-heading { color: var(--tinta); }

.text-button {
  padding: 4px 9px;
  font-size: 11px;
}

.main-content {
  min-width: 0;
  width: 100%;
  max-width: 1600px;
  padding: 33px 32px 20px;
}

.main-content > *, .page-heading > *, .panel-heading > * {
  min-width: 0;
}

.page-heading p { color: var(--tenue); }
.eyebrow { color: #70B8FF; }

.connection {
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, .035);
  color: #B3C3DA;
}

.connection i { background: var(--relevante); }

.connection.online {
  border-color: rgba(52, 211, 153, .2);
  background: rgba(52, 211, 153, .06);
  color: var(--ok);
}

.connection.online i {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, .3);
}

.metric, .panel {
  border: 1px solid var(--vidrio-borde);
  border-radius: var(--radio);
  background: var(--panel);
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.panel {
  min-width: 0;
  padding: 25px;
}

.metric { padding: 20px; }

@media (hover: hover) and (pointer: fine) {
  /* .panel envuelve páginas enteras: no se eleva al pasar el cursor, solo las tarjetas KPI */
  .metric:hover {
    transform: translateY(-2px);
    border-color: rgba(120, 160, 255, .27);
    box-shadow: var(--sombra), 0 5px 24px rgba(10, 132, 255, .08);
  }
}

.panel-heading {
  gap: 12px;
  flex-wrap: wrap;
}

.panel-heading h2 { margin-top: 7px; }

.overview-hero {
  border: 1px solid rgba(90, 170, 255, .25);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 90% 80%, rgba(10, 132, 255, .35), transparent 58%),
    linear-gradient(110deg, rgba(18, 41, 74, .96), rgba(15, 54, 104, .88));
  color: #D4E5FF;
  box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .035);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.hero-copy { min-width: 0; }

.hero-tag {
  border: 1px solid rgba(112, 184, 255, .25);
  background: rgba(10, 132, 255, .1);
  color: #BDDEFF;
}

.hero-copy h2 { color: #FFF; }
.hero-copy p { color: #BCCFEA; }

.hero-copy button {
  border: 1px solid rgba(90, 200, 250, .3);
  border-radius: 999px;
  background: var(--acento);
  color: #FFF;
}

.hero-copy button:hover {
  background: #1E90FF;
  box-shadow: var(--glow);
}

.blueprint {
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(90, 200, 250, .07) 26px 27px),
    repeating-linear-gradient(90deg, transparent 0 25px, rgba(90, 200, 250, .07) 26px 27px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%);
  mask-image: linear-gradient(90deg, transparent, #000 20%);
  pointer-events: none;
}

.tower {
  border-color: rgba(140, 210, 255, .55);
  background:
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(140, 210, 255, .28) 19px 20px),
    repeating-linear-gradient(90deg, rgba(10, 132, 255, .08) 0 15px, rgba(140, 210, 255, .28) 16px 17px);
  box-shadow: 15px 12px 0 rgba(4, 20, 47, .25), 0 0 24px rgba(10, 132, 255, .08);
}

.blueprint-base {
  border-color: rgba(140, 210, 255, .4);
  background: rgba(90, 200, 250, .04);
}

.blueprint > span { color: #B5DBFF; }

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
}

.metric-top { color: #A5B5CE; }

.metric-icon {
  flex-shrink: 0;
  border: 1px solid rgba(10, 132, 255, .22);
  border-radius: 50%;
  background: rgba(10, 132, 255, .12);
  color: #70B8FF;
}

.metric-1 .metric-icon {
  border-color: rgba(52, 211, 153, .22);
  background: rgba(52, 211, 153, .1);
  color: var(--ok);
}

.metric-2 .metric-icon {
  border-color: rgba(251, 191, 36, .22);
  background: rgba(251, 191, 36, .1);
  color: var(--relevante);
}

.metric-3 .metric-icon {
  border-color: rgba(90, 200, 250, .22);
  background: rgba(90, 200, 250, .1);
  color: #5AC8FA;
}

.metric > strong {
  color: var(--tinta);
  font-variant-numeric: tabular-nums;
}

.metric > small { color: #9CADC6; }

.dashboard-grid {
  min-width: 0;
  grid-template-columns: 1.65fr 1fr;
  gap: 23px;
}

.chart-panel { min-width: 0; }

.chart-empty {
  border: 1px solid rgba(120, 160, 255, .09);
  background: linear-gradient(180deg, rgba(10, 132, 255, .035), rgba(255, 255, 255, .015));
}

.chart-empty p { color: #9CADC6; }

.empty-chart-icon {
  border: 1px solid rgba(10, 132, 255, .22);
  border-radius: 16px;
  background: rgba(10, 132, 255, .1);
  color: #70B8FF;
}

.shortcuts { min-width: 0; }

.shortcut {
  border: 0;
  border-bottom: 1px solid var(--borde);
  border-radius: 0;
  background: transparent;
  color: var(--texto);
}

.shortcut:hover {
  background: rgba(10, 132, 255, .065);
  color: #FFF;
  box-shadow: none;
}

.shortcut-icon {
  border: 1px solid rgba(10, 132, 255, .18);
  background: rgba(10, 132, 255, .1);
  color: #70B8FF;
}

.shortcut small, .shortcut > span:last-child { color: #9CADC6; }
.shortcut > span { min-width: 0; }

.info-note {
  border: 1px solid rgba(10, 132, 255, .18);
  background: rgba(10, 132, 255, .065);
}

.info-note > span { color: #70B8FF; }
.info-note p { color: #ABC3E2; }

.project-strip {
  min-width: 0;
  border: 1px solid var(--vidrio-borde);
  border-radius: var(--radio);
  background: var(--vidrio);
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.project-strip p { color: #9CADC6; }

.outline-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(138, 155, 184, .25);
  background: rgba(138, 155, 184, .09);
  color: #BDCADF;
}

.outline-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

.content-footer {
  gap: 12px;
  border-top: 1px solid var(--borde);
  color: #95A8C4;
}

.panel svg [stroke="#2463eb"],
.overview-hero svg [stroke="#2463eb"],
.metric svg [stroke="#2463eb"] { stroke: #0A84FF; }

.panel svg [fill="#2463eb"],
.overview-hero svg [fill="#2463eb"],
.metric svg [fill="#2463eb"] { fill: #0A84FF; }

.panel svg [stroke="#168465"],
.metric svg [stroke="#168465"] { stroke: #34D399; }

.panel svg [fill="#168465"],
.metric svg [fill="#168465"] { fill: #34D399; }

.panel svg [stroke="#a66512"],
.panel svg [stroke="#aa7519"] { stroke: #FBBF24; }

.panel svg [fill="#a66512"],
.panel svg [fill="#aa7519"] { fill: #FBBF24; }

.panel svg [stroke="#c53551"] { stroke: #FB7185; }
.panel svg [fill="#c53551"] { fill: #FB7185; }

@media (min-width: 1600px) {
  .main-content { padding: 40px 48px; }
}

@media (max-width: 1200px) {
  .main-content { padding: 28px 24px; }
  .metrics { gap: 12px; }
  .metric { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1.3fr 1fr; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .sidebar { width: 252px; }
  .app-body { margin-left: 252px; }
  .topbar { gap: 10px; padding-inline: 16px; }
  .breadcrumbs { min-width: 0; white-space: normal; }
  .project-trigger > span:nth-child(2) { max-width: 105px; }
}

@media (max-width: 980px) {
  .main-content { padding: 25px 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  /* Existing off-canvas transform, visibility and control display rules remain intact. */
  .sidebar { width: 252px; }
  .app-body { margin-left: 0; }
  .main-content { padding: 25px 16px 16px; }
  .panel { padding: 20px; }
  .topbar { flex-wrap: nowrap; }
  .breadcrumbs { min-width: 0; }
  .top-actions { flex-shrink: 0; }
  h1 { font-size: 28px; }

  .mobile-toggle {
    border: 1px solid var(--borde);
    background: rgba(255, 255, 255, .04);
    color: #BDDFFF;
  }

  .mobile-close {
    border: 0;
    background: transparent;
    color: #FFF;
    box-shadow: none;
  }

  .sidebar-scrim.visible {
    background: rgba(3, 10, 23, .7);
    border: 0;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  .popover, .notifications, .project-dropdown .popover {
    position: fixed;
    top: 83px;
    right: 12px;
    width: 290px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 100px);
    padding: 16px;
  }

  .project-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .content-footer { flex-wrap: wrap; }
}

@media (max-width: 440px) {
  .main-content { padding-inline: 12px; }
  .metrics { gap: 10px; }
  .metric { padding: 14px; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 26px; height: 26px; font-size: 18px; }
  .metric > strong { font-size: 27px; }
  .topbar { padding-inline: 10px; }
  .project-trigger > span:nth-child(2) { max-width: 110px; }
  .hero-copy { padding: 25px 20px; }
  .hero-copy h2 { font-size: 25px; }
  .panel-heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .metric:hover, .panel:hover { transform: none; }
}
