/* Panel de cada servidor (2.13.0): Inicio, formularios por secciones, vistas previas y registros.
   Azul medianoche de Nightcord con el plateado de Kanade y el rosa de Shiru. Va después de style.css y solo toca el panel. */
#view-dashboard { --k-silver: #cfe0f5; --k-blue: #8fd3ff; --k-lilac: #c3a6ff; --k-line: rgba(207, 224, 245, 0.14); --k-glass: rgba(29, 22, 48, 0.72); --k-raised: rgba(255, 255, 255, 0.04); }

/* ── Estructura ── */
#view-dashboard .app-main { max-width: 1240px; padding-top: 26px; }
#view-dashboard .app-sidebar { width: 264px; gap: 12px; padding: 16px 14px; }
#view-dashboard .sys-card { max-width: none; }
#view-dashboard .card { border-color: var(--k-line); border-radius: 20px; background: var(--k-glass); backdrop-filter: blur(10px); }
#view-dashboard .card::before { display: none; }
#view-dashboard :focus-visible { outline: 2px solid var(--k-blue); outline-offset: 2px; }
#view-dashboard .hidden { display: none !important; }
.sys-field.hidden { display: none; }

/* ── Menú lateral ── */
.nav-search { width: 100%; padding: 9px 12px 9px 34px; border-radius: 12px; border: 1px solid var(--k-line); background: rgba(0, 0, 0, 0.22) no-repeat 11px center / 15px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a99bc4' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); color: var(--text); font: 600 0.86rem 'Nunito', sans-serif; flex-shrink: 0; }
.nav-search::placeholder { color: var(--text-muted); }
.nav-search:focus { outline: none; border-color: var(--k-blue); box-shadow: 0 0 0 3px rgba(143, 211, 255, 0.16); }
.nav-search::-webkit-search-cancel-button { filter: invert(0.7); }
#view-dashboard .system-nav { gap: 12px; }
#view-dashboard .system-btn { width: 100%; border-radius: 12px; padding: 7px 10px; min-height: 40px; transition: background 0.15s ease, border-color 0.15s ease; }
#view-dashboard .system-btn .system-icon { width: 28px; height: 28px; flex-shrink: 0; font-size: 0.95rem; }
#view-dashboard .system-btn.active { background: linear-gradient(100deg, rgba(255, 138, 200, 0.2), rgba(143, 211, 255, 0.12)); }
.system-btn-home { font-weight: 800; }

/* ── Cabecera de cada sistema ── */
#panel-system .app-header { margin-bottom: 18px; }
.sys-back { display: inline-block; margin-bottom: 8px; padding: 2px 0; border: 0; background: none; color: var(--text-muted); font: 700 0.84rem 'Nunito', sans-serif; cursor: pointer; }
.sys-back:hover { color: var(--text); }
#panel-system .sys-title-row { align-items: center; gap: 12px; flex-wrap: wrap; }
.sys-title-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.45rem; background: linear-gradient(135deg, rgba(255, 138, 200, 0.2), rgba(143, 211, 255, 0.16)); border: 1px solid var(--k-line); flex-shrink: 0; }
#panel-system .app-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0; }
#panel-system .app-sub { max-width: 70ch; margin-top: 8px; }

/* ── Formularios ── */
.sys-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; align-items: start; }
.sys-field-wide { grid-column: 1 / -1; }
.sys-field-bool { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--k-raised); border: 1px solid var(--k-line); }
.sys-field-bool > label:first-child { margin: 0; flex: 1; min-width: 0; }
.sys-field-bool .sys-hint { flex-basis: 100%; margin: 0; }
.sys-section { margin-bottom: 12px; border: 1px solid var(--k-line); border-radius: 14px; background: var(--k-raised); overflow: hidden; }
.sys-section > summary { display: flex; align-items: center; gap: 9px; padding: 12px 14px; font: 800 0.95rem 'Nunito', sans-serif; cursor: pointer; list-style: none; user-select: none; }
.sys-section > summary::-webkit-details-marker { display: none; }
.sys-section > summary::after { content: '▾'; margin-left: auto; color: var(--text-muted); transition: transform 0.15s ease; }
.sys-section:not([open]) > summary::after { transform: rotate(-90deg); }
.sys-section > summary:hover { background: rgba(255, 255, 255, 0.03); }
.sys-section > .sys-fields { padding: 4px 14px 2px; }
/* Dentro de las secciones casi todo es opcional: repetirlo solo descuadra las columnas */
.sys-section .sys-optional { display: none; }
#view-dashboard .sys-actions { margin-top: 14px; }
#view-dashboard .list-add { padding: 14px; }
.sys-savebar { position: sticky; bottom: 14px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0; padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(38, 29, 61, 0.94); border: 1px solid rgba(255, 138, 200, 0.42); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px); font-weight: 700; animation: view-fade-in 0.18s ease both; }
.sys-savebar > div { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-savebar .btn { width: auto; min-width: 0; padding: 8px 18px; }

/* ── Vista previa ── */
#view-dashboard .sys-preview-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
#view-dashboard .rr-preview-wrap { max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
.sys-pv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sys-pv-tab { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-raised); color: var(--text-muted); font: 700 0.79rem 'Nunito', sans-serif; cursor: pointer; }
.sys-pv-tab:hover { color: var(--text); }
.sys-pv-tab.is-on { color: var(--accent-text); border-color: transparent; background: linear-gradient(100deg, #ff8ac8, #c3a6ff); }
.sys-sim { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--k-glass); border: 1px solid var(--k-line); }
.sys-sim h4 { margin: 0 0 10px; font-size: 0.95rem; }
.sys-sim p { margin: 6px 0 0; font-size: 0.87rem; }
.gd-slider { display: block; margin-bottom: 10px; font-size: 0.84rem; color: var(--text-muted); }
.gd-slider span { display: flex; justify-content: space-between; }
.gd-slider b { color: var(--text); }
.gd-slider input { width: 100%; margin-top: 4px; accent-color: #ff8ac8; }
.gd-sim-main { font-weight: 800; font-size: 0.95rem !important; color: var(--text); }
.gd-sim-table { display: grid; gap: 2px; margin-top: 8px; }
.gd-sim-table > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 9px; border-radius: 8px; font-size: 0.85rem; background: var(--k-raised); }
.gd-rank { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: linear-gradient(120deg, #2a2148, #1b2238); border: 1px solid var(--k-line); max-width: 380px; }
.gd-rank img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #8fd3ff; flex-shrink: 0; }
.gd-rank-body { flex: 1; min-width: 0; }
.gd-rank-top, .gd-rank-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 0.74rem; color: #c9cedd; }
.gd-rank-top > b { font-size: 0.95rem; color: #fff; }
.gd-rank-bar { height: 8px; margin: 6px 0; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.gd-rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8fd3ff, #ff8ac8); }

/* ── Cómo funciona y puntos de partida ── */
#view-dashboard .gd-box { margin-bottom: 16px; }
.gd-title { margin: 0 0 10px; font: 800 1rem 'Nunito', sans-serif; }
.gd-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.gd-steps li { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: var(--k-raised); border: 1px solid var(--k-line); }
.gd-step-icon { font-size: 1.3rem; line-height: 1.3; }
.gd-steps p { margin: 3px 0 0; font-size: 0.83rem; color: var(--text-muted); }
.gd-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.gd-preset { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; text-align: left; color: var(--text); border-radius: 14px; border: 1px solid var(--k-line); background: var(--k-raised); font: inherit; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.gd-preset:hover { border-color: #ff8ac8; transform: translateY(-1px); }
.gd-preset small { color: var(--text-muted); font-size: 0.79rem; }

/* ── Registros ── */
#view-dashboard .lg-card .gd-presets { margin: 12px 0 16px; }
.lg-groups { columns: 2 340px; column-gap: 14px; }
.lg-group { break-inside: avoid; margin-bottom: 14px; padding: 10px 12px; border-radius: 14px; background: var(--k-raised); border: 1px solid var(--k-line); }
.lg-group header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.lg-group h4 { margin: 0; font-size: 0.92rem; }
.lg-group h4 small { color: var(--text-muted); font-weight: 600; margin-left: 4px; }
.lg-mini { padding: 2px 8px; margin-left: 4px; border: 1px solid var(--k-line); border-radius: 999px; background: none; color: var(--text-muted); font: 700 0.72rem 'Nunito', sans-serif; cursor: pointer; }
.lg-mini:hover { color: var(--text); border-color: #ff8ac8; }
#view-dashboard .lg-row { display: flex; width: 100%; margin: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.86rem; font-weight: 600; color: var(--text); cursor: pointer; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.lg-row > span:first-child { flex: 1; min-width: 0; }
.lg-row .switch { flex-shrink: 0; }
.lg-row:first-of-type { border-top: 0; }

/* ── Inicio ── */
.hm-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; margin-bottom: 16px; border-radius: 24px; overflow: hidden; border: 1px solid var(--k-line); background: radial-gradient(420px 220px at 92% 10%, rgba(143, 211, 255, 0.2), transparent 70%), radial-gradient(520px 260px at 6% 0%, rgba(255, 138, 200, 0.22), transparent 70%), linear-gradient(120deg, #231a3c, #151a30); }
.hm-hero-text { flex: 1 1 320px; min-width: 0; }
.hm-hero h1 { margin: 0; font: 800 clamp(1.7rem, 3.6vw, 2.5rem) 'Baloo 2', sans-serif; line-height: 1.1; overflow-wrap: anywhere; background: linear-gradient(90deg, #ffe0f3, #ff8ac8, #c3a6ff, #8fd3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-hero p { margin: 8px 0 14px; max-width: 58ch; color: var(--text-muted); }
.hm-hero p b { color: var(--text); }
.hm-hero-links { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-hero-links .btn { width: auto; padding: 7px 14px; font-size: 0.85rem; }
.hm-meter { width: 124px; height: 124px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#ff8ac8 0, #c3a6ff calc(var(--p) * 0.5%), #8fd3ff calc(var(--p) * 1%), rgba(255, 255, 255, 0.09) 0); }
.hm-meter > div { width: 100px; height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: #1b1830; text-align: center; }
.hm-meter b { font: 800 1.5rem 'Baloo 2', sans-serif; line-height: 1; }
.hm-meter small { font-size: 0.8rem; color: var(--text-muted); }
.hm-meter span { font-size: 0.64rem; color: var(--text-muted); line-height: 1.15; max-width: 80px; }
#view-dashboard .hm-card { margin-bottom: 16px; }
.hm-card h2, .hm-all h2 { margin: 0 0 4px; font: 800 1.1rem 'Nunito', sans-serif; }
.hm-recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.hm-rec { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; color: var(--text); border-radius: 14px; border: 1px solid var(--k-line); background: var(--k-raised); font: inherit; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.hm-rec:hover { border-color: #ff8ac8; transform: translateY(-1px); }
.hm-rec small { display: block; color: var(--text-muted); font-size: 0.78rem; }
.hm-rec-check { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.07); }
.hm-rec.is-done { border-color: rgba(116, 252, 102, 0.3); }
.hm-rec.is-done .hm-rec-check { background: rgba(116, 252, 102, 0.18); color: #74fc66; font-weight: 800; }
.hm-quick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; margin-top: 10px; }
#view-dashboard .hm-quick-list .community-public { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; width: auto; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--k-raised); border: 1px solid var(--k-line); }
#view-dashboard .hm-quick-list .community-public-text { flex: 1; min-width: 0; }
#view-dashboard .hm-quick-list .switch { flex-shrink: 0; }
.hm-all-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; }
.hm-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.hm-filter { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-raised); color: var(--text-muted); font: 700 0.8rem 'Nunito', sans-serif; cursor: pointer; }
.hm-filter.is-on { color: var(--accent-text); border-color: transparent; background: linear-gradient(100deg, #ff8ac8, #c3a6ff); }
.hm-group { margin-bottom: 16px; }
.hm-group h3 { margin: 0 0 8px; font: 800 0.74rem 'Nunito', sans-serif; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hm-sys { display: flex; align-items: flex-start; gap: 11px; padding: 12px; text-align: left; color: var(--text); border-radius: 16px; border: 1px solid var(--k-line); background: var(--k-glass); font: inherit; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.hm-sys:hover { border-color: #8fd3ff; transform: translateY(-1px); }
.hm-sys-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 255, 255, 0.07); font-size: 1.1rem; }
.hm-sys-text { flex: 1; min-width: 0; }
.hm-sys-text small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.35; }
.hm-pill { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; white-space: nowrap; background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }
.hm-pill.is-on { background: rgba(116, 252, 102, 0.15); color: #74fc66; }
.hm-pill.is-warn { background: rgba(245, 196, 81, 0.16); color: #f5c451; }

@media (max-width: 1180px) {
    #view-dashboard .sys-preview-layout { grid-template-columns: minmax(0, 1fr); }
    #view-dashboard .rr-preview-wrap { position: static; max-height: none; }
}
html[data-theme="light"] #view-dashboard .system-btn.active, html[data-theme="light"] #view-dashboard .system-btn.active .system-btn-name { color: #3d1a4f; }
html[data-theme="light"] #view-dashboard .dc-app { color: #fff; }
.nav-toggle { display: none; }
@media (max-width: 900px) {
    #view-dashboard .app-sidebar { width: 100%; height: auto; }
    /* En el celular el menú se abre con un botón: si no, hay que bajar por 40 sistemas para llegar al contenido */
    .nav-toggle { display: block; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--k-line); background: var(--k-raised); color: var(--text); font: 800 0.9rem 'Nunito', sans-serif; text-align: left; cursor: pointer; }
    #view-dashboard .app-sidebar:not(.nav-open) .system-nav, #view-dashboard .app-sidebar:not(.nav-open) .nav-search { display: none; }
    #view-dashboard .app-sidebar-bottom { display: none; }
    .hm-hero { padding: 20px 18px; }
    .hm-grid, .hm-recs, .hm-quick-list { grid-template-columns: minmax(0, 1fr); }
    .lg-groups { columns: 1; }
    .sys-savebar { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-sys, .hm-rec, .gd-preset, .sys-savebar { transition: none; animation: none; transform: none !important; }
}
