/* ==========================================================================
   Layout: shell (sidebar + topbar), login, hub
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.42s var(--ease-out);
}
.app.is-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
}

/* ---------- Sidebar ---------- */
.sb {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sb-bg);
  color: var(--sb-ink);
  z-index: 40;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}
.sb::after {
  /* textura sutil */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px 260px at 0% 0%, rgba(57, 147, 158, 0.18), transparent 70%);
  opacity: 0.8;
}
.sb > :not(.sb-collapse) {
  position: relative;
  z-index: 1;
}

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 16px;
  min-height: 78px;
}
.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none !important;
}
.sb-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand-navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
}
.sb-logo-mark b {
  color: var(--brand-teal);
  font-weight: 700;
}
.sb-logo-img {
  height: 27px;
  width: auto;
}
.sb-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  padding-left: 12px;
  border-left: 1px solid var(--sb-line);
}
.sb-logo-text strong {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  font-weight: 600;
  color: #fff;
}
.sb-logo-text span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--sb-ink-2);
  text-transform: uppercase;
  margin-top: 3px;
}

.sb-collapse {
  position: absolute;
  right: -14px;
  top: 88px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm);
  z-index: 5;
  transition: transform 0.4s var(--ease-out), background 0.3s;
}
.sb-collapse:hover {
  transform: scale(1.08);
}
.is-collapsed .sb-collapse {
  transform: rotate(180deg);
}

/* Selector rápido de paneles */
.ws-rail {
  display: grid;
  grid-template-columns: repeat(var(--rail-cols, 5), 1fr);
  gap: 6px;
  margin: 0 16px 14px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--sb-line);
  position: relative;
}
.ws-rail-btn {
  position: relative;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--sb-ink-2);
  transition: color var(--t);
  z-index: 1;
}
.ws-rail-btn:hover {
  color: #fff;
}
.ws-rail-btn.is-active {
  color: #fff;
}
.ws-rail-thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 6px 18px -6px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 0;
}
.ws-rail-btn[data-off="1"] {
  opacity: 0.35;
}

.sb-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 10px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--sb-field);
  border: 1px solid var(--sb-line);
  color: var(--sb-ink-2);
  font-size: 13px;
  transition: background var(--t), border-color var(--t);
}
.sb-search:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
}
.sb-search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sb-ink-2);
}

.sb-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px 16px;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.sb-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  background-clip: content-box;
}

.sb-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sb-ink-3);
  padding: 16px 12px 8px;
  white-space: nowrap;
}

.sb-item,
.sb-group-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--sb-ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.sb-item svg,
.sb-group-btn svg {
  color: var(--sb-ink-2);
  transition: color var(--t);
}
.sb-item:hover,
.sb-group-btn:hover {
  background: var(--sb-hover);
}
.sb-item:hover svg,
.sb-group-btn:hover svg {
  color: #fff;
}
.sb-item.is-active {
  background: linear-gradient(90deg, var(--accent-soft), rgba(255, 255, 255, 0.04));
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.sb-item.is-active svg {
  color: var(--accent);
}
.sb-item .sb-badge,
.sb-group-btn .sb-badge {
  margin-left: auto;
}
.sb-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.sb-group {
  margin: 4px 0;
  border-radius: 13px;
  border: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.sb-group.is-open {
  border-color: var(--sb-line);
  background: rgba(0, 0, 0, 0.12);
}
.sb-group-btn {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
}
.sb-group-btn .chev {
  margin-left: auto;
  transition: transform 0.35s var(--ease-out);
}
.sb-group.is-open .sb-group-btn .chev {
  transform: rotate(90deg);
}
.sb-group.has-active .sb-group-btn {
  color: #fff;
}
.sb-group.has-active .sb-group-btn > svg:first-child {
  color: var(--accent);
}
.sb-group-body {
  overflow: hidden;
  height: 0;
}
.sb-group.is-open .sb-group-body {
  height: auto;
}
.sb-group-inner {
  padding: 2px 6px 8px 22px;
  position: relative;
}
.sb-group-inner::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 4px;
  bottom: 12px;
  width: 1px;
  background: var(--sb-line);
}
.sb-sub {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px 0 18px;
  border-radius: 9px;
  color: var(--sb-ink-2);
  font-size: 13px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.sb-sub svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}
.sb-sub:hover {
  color: #fff;
  background: var(--sb-hover);
}
.sb-sub.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.sb-sub.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.sb-sub.is-active svg {
  color: var(--accent);
}

/* Pie del sidebar: tarjetas de contexto como en HANIL */
.sb-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--sb-line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.sb-ctx {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sb-line);
  border-left: 3px solid var(--accent);
  text-align: left;
  color: #fff;
  transition: background var(--t);
}
.sb-ctx:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sb-ctx small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
.sb-ctx b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-ctx svg {
  color: var(--sb-ink-2);
}

/* Sidebar contraído */
.is-collapsed .sb-logo-text,
.is-collapsed .sb-label,
.is-collapsed .sb-item span,
.is-collapsed .sb-group-btn span,
.is-collapsed .sb-group-btn .chev,
.is-collapsed .sb-search span,
.is-collapsed .sb-search kbd,
.is-collapsed .sb-ctx span,
.is-collapsed .sb-item .sb-badge,
.is-collapsed .sb-group-body {
  display: none !important;
}
.is-collapsed .sb-head {
  justify-content: center;
  padding-inline: 0;
}
.is-collapsed .ws-rail {
  grid-template-columns: 1fr;
  margin-inline: 14px;
}
.is-collapsed .ws-rail-thumb {
  display: none;
}
.is-collapsed .ws-rail-btn.is-active {
  background: var(--accent);
}
.is-collapsed .sb-search,
.is-collapsed .sb-item,
.is-collapsed .sb-group-btn,
.is-collapsed .sb-ctx {
  justify-content: center;
  padding: 0;
}
.is-collapsed .sb-search {
  margin-inline: 14px;
}
.is-collapsed .sb-nav {
  padding-inline: 14px;
}
.is-collapsed .sb-ctx {
  height: 44px;
  border-left-width: 1px;
}
.is-collapsed .sb-group.is-open {
  background: none;
  border-color: transparent;
}

/* Barra de progreso de navegación */
.route-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 500;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
  box-shadow: 0 0 10px var(--accent);
}

/* ---------- Main + Topbar ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tb {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-menu {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background var(--t);
}
.tb-menu:hover {
  background: var(--surface-3);
}
.tb-title {
  min-width: 0;
}
.tb-title .eyebrow {
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 600;
}
.tb-title h1 {
  font-size: 19px;
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tb-crumbs a {
  color: inherit;
}
.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-clock {
  text-align: right;
  line-height: 1.15;
  margin-right: 6px;
}
.tb-clock .mono {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.tb-clock strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px 0 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
.tb-user:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.tb-user-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.view {
  position: relative;
  padding: 26px var(--gutter) 48px;
  min-width: 0;
  flex: 1 1 auto;
}
.view-inner {
  max-width: 1480px;
  margin: 0 auto;
}

/* ---------- Encabezado de página ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h2 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-head p {
  color: var(--ink-3);
  margin-top: 4px;
}
.page-head .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
.sb-scrim {
  display: none;
}
@media (max-width: 1024px) {
  .app,
  .app.is-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .sb {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 300px);
    transform: translateX(-105%);
    transition: transform 0.45s var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .app.is-mobile-open .sb {
    transform: none;
  }
  .sb-collapse {
    display: none;
  }
  .sb-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
  }
  .app.is-mobile-open .sb-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .tb-clock {
    display: none;
  }
  :root {
    --gutter: 18px;
  }
}
@media (max-width: 640px) {
  .tb-user-name,
  .tb-user .chev {
    display: none;
  }
  .tb-user {
    padding: 0 6px;
  }
  .page-head h2 {
    font-size: 23px;
  }
  :root {
    --gutter: 16px;
  }
}

/* ==========================================================================
   Login
   ========================================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  background: var(--bg);
}
.auth-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #133f63 0%, #0d2d48 45%, #081a2b 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-grid {
  position: absolute;
  inset: -2px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.auth-orb.o1 {
  width: 380px;
  height: 380px;
  background: #39939e;
  left: -80px;
  top: 18%;
}
.auth-orb.o2 {
  width: 300px;
  height: 300px;
  background: #c0995f;
  right: -60px;
  bottom: 8%;
  opacity: 0.35;
}
.auth-orb.o3 {
  width: 220px;
  height: 220px;
  background: #7a68e8;
  right: 20%;
  top: -60px;
  opacity: 0.3;
}
.auth-art > :not(.auth-orb):not(.auth-grid) {
  position: relative;
  z-index: 1;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-brand img {
  height: 34px;
  width: auto;
}
.auth-hero h1 {
  color: #fff;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 13ch;
}
.auth-hero h1 em {
  font-style: normal;
  color: #7fd0d8;
}
.auth-hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin-top: 18px;
  max-width: 44ch;
  line-height: 1.6;
}
.auth-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin-top: 34px;
}
.auth-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}
.auth-panel i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--c);
}
.auth-panel b {
  display: block;
  font-size: 14px;
}
.auth-panel small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}
.auth-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}
.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card h2 {
  font-size: 30px;
  letter-spacing: -0.025em;
}
.auth-card .lead {
  color: var(--ink-3);
  margin: 8px 0 28px;
}
.auth-card .field {
  margin-bottom: 16px;
}
.auth-card .btn {
  width: 100%;
  height: 50px;
  font-size: 15px;
}
@media (max-width: 960px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 32px 24px;
    min-height: auto;
  }
  .auth-panels {
    display: none;
  }
  .auth-hero h1 {
    font-size: 32px;
  }
  .auth-foot {
    display: none;
  }
}

/* ==========================================================================
   Hub (Centro de mando)
   ========================================================================== */
.hub-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.hub-hero h2 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.03em;
  font-weight: 600;
}
.hub-hero h2 span {
  color: var(--accent-ink);
}
.hub-hero p {
  color: var(--ink-3);
  margin-top: 6px;
  font-size: 15px;
}
.hub-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(242px, 1fr));
  gap: 18px;
}
@media (max-width: 1360px) {
  .hub-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .hub-panels {
    grid-template-columns: 1fr;
  }
}
.hub-card {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none !important;
  isolation: isolate;
  transition: border-color 0.3s, box-shadow 0.4s var(--ease-out);
}
.hub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px 200px at 100% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%);
  z-index: -1;
  transition: opacity 0.4s;
}
.hub-card:hover {
  border-color: color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: var(--shadow);
}
.hub-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hub-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--c);
  box-shadow: 0 10px 24px -10px var(--c);
}
.hub-card h3 {
  font-size: 19px;
}
.hub-card .hub-sub {
  font-size: 12.5px;
  color: var(--ink-3);
}
.hub-card-go {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: background 0.3s, color 0.3s, transform 0.4s var(--ease-out), border-color 0.3s;
}
.hub-card:hover .hub-card-go {
  background: var(--c);
  color: #fff;
  border-color: var(--c);
  transform: rotate(-45deg);
}
.hub-kpis {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.hub-kpi .eyebrow {
  font-size: 9.5px;
}
.hub-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.hub-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hub-kpi-row strong {
  font-size: 18px;
}
.hub-card-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-top: 1px dashed var(--line);
}
.hub-card-foot svg {
  color: var(--c);
}
.hub-card.is-down {
  opacity: 0.75;
}
.hub-card.is-down .hub-card-icon {
  background: var(--neutral);
}

/* Botón para elegir los accesos directos del rail (favoritos) */
.ws-rail-edit {
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--sb-ink-2);
  border: 1px dashed var(--sb-line);
  opacity: 0.6;
  transition: opacity var(--t), color var(--t), border-color var(--t);
  z-index: 1;
}
.ws-rail-edit:hover { opacity: 1; color: var(--sb-ink); border-color: var(--sb-ink-3, var(--sb-ink-2)); }
.is-collapsed .ws-rail-edit { display: none; }

/* Selector de accesos directos */
.rail-pick { display: grid; gap: 6px; }
.rail-pick-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.rail-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.rail-pick-item.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); }
.rail-pick-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
}
.rail-pick-item .rp-check { opacity: 0; color: var(--c); transition: opacity var(--t); }
.rail-pick-item.is-on .rp-check { opacity: 1; }
.rail-pick-item input:disabled ~ .rail-pick-ico,
.rail-pick-item input:disabled ~ .grow { opacity: 0.45; }

/* ===================== Menú inferior flotante (solo teléfono) ===================== */
.mob-tabbar { display: none; }
@media (max-width: 760px) {
  .mob-tabbar:not(.hidden) {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 60;
    gap: 1px;
    padding: 6px 5px;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 14px 38px rgba(5, 18, 29, 0.30), 0 2px 8px rgba(5, 18, 29, 0.12);
    width: calc(100vw - 20px);
    max-width: 460px;
  }
  /* Con el cajón (drawer) abierto, el menú inferior sobra: se oculta */
  .app.is-mobile-open .mob-tabbar { display: none; }
  .mtb-ind {
    position: absolute;
    top: 6px; left: 0;
    height: calc(100% - 12px);
    width: 0; opacity: 0;
    border-radius: 16px;
    background: var(--accent-soft);
    pointer-events: none;
    will-change: transform, width;
  }
  .mtb-item {
    position: relative; z-index: 1;
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    padding: 7px 1px 6px;
    border: 0; background: transparent;
    color: var(--ink-3); text-decoration: none;
    border-radius: 16px; cursor: pointer;
    font: inherit;
    transition: color .22s ease, transform .14s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mtb-item .mtb-ico { display: flex; transition: transform .22s cubic-bezier(.34,1.56,.64,1); }
  .mtb-item .mtb-lbl {
    max-width: 100%;
    font-size: 9.5px; font-weight: 600; letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mtb-item.is-active { color: var(--accent); }
  .mtb-item.is-active .mtb-ico { transform: translateY(-1px) scale(1.08); }
  .mtb-item:active { transform: scale(0.9); }
  .main .view-inner { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
}
