/* Shared navigation, with FACILGYM dashboard styles and default orange accents. */
.app-shell:is(.facilgym-theme, .gestionatu-theme) {
    --gym-navy: #102033;
    --gym-blue: #b9e5ff;
    --gym-orange: #ffad57;
    --theme-accent: #ffad57;
    --theme-license-color: #ffd2a0;
    --theme-selected-ink: #552d0e;
    --theme-selected-bg: #ffdbb1;
    --theme-selected-border: #eeaf68;
    --theme-selected-accent: #eb8a2e;
    --theme-focus: #bd641d;
    --theme-shortcut-hover: #ffd6a5;
    --theme-shortcut-border: #d88d42;
    --gym-ink: #15334c;
    background: #102033;
    font-family: "Segoe UI", Arial, sans-serif;
}

:is(.facilgym-theme, .gestionatu-theme) .workspace-header {
    background: linear-gradient(110deg, #12243a, #1c354f);
    border-bottom: 2px solid var(--theme-accent);
    box-shadow: 0 4px 18px #07132126;
}

:is(.facilgym-theme, .gestionatu-theme) .workspace-header h1 { color: #b9e5ff; letter-spacing: .035em; }
:is(.facilgym-theme, .gestionatu-theme) .workspace-title-line > .workspace-license-title { color: var(--theme-license-color); font-weight: 600; }
:is(.facilgym-theme, .gestionatu-theme) .environment-pill {
    color: #c9eaff;
    background: #28445e;
    border-color: #496680;
    border-radius: 6px;
    font-size: 11px;
}

:is(.facilgym-theme, .gestionatu-theme) .session-panel {
    padding: 10px 14px;
    border: 1px solid #50708a;
    border-radius: 10px;
    background: #244058;
    color: #b9d4e7;
}
:is(.facilgym-theme, .gestionatu-theme) .session-panel strong { color: #fff2df; }

:is(.facilgym-theme, .gestionatu-theme) .sidebar {
    --sidebar-surface: #13283d;
    --sidebar-border: #567692;
    --sidebar-divider: #334c64;
    --sidebar-text: #e6f3fc;
    background: var(--sidebar-surface);
    border-right: 1px solid var(--sidebar-divider);
    box-shadow: none;
    scrollbar-color: #6688a5 var(--sidebar-surface);
    scrollbar-width: thin;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .brand-area {
    padding: 16px 16px 18px;
    background: var(--sidebar-surface);
    border-bottom: 1px solid var(--sidebar-divider);
    box-shadow: none;
}
:is(.facilgym-theme, .gestionatu-theme) .titular-logo-frame {
    width: auto;
    min-width: 84px;
    min-height: 64px;
    padding: 8px 14px;
    background: #f5fbff;
    border-radius: 12px;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .titular-name-link {
    margin-top: 4px;
    color: var(--sidebar-text);
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-button {
    background: transparent;
    border-color: var(--sidebar-border);
    border-radius: 8px;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-button span,
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-button span::before,
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-button span::after {
    background: var(--sidebar-text);
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .nav-tree { padding: 12px 14px 20px; }
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-group { margin: 6px 0; }
:is(.facilgym-theme, .gestionatu-theme) .sidebar :is(.nav-link, .menu-group-toggle) {
    min-height: 44px;
    color: var(--sidebar-text);
    border: 1px solid var(--sidebar-border);
    border-radius: 9px;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-group-toggle {
    padding: 9px 13px 9px 11px;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar :is(.nav-link, .menu-group-toggle):is(:hover, :focus-visible, .active, [aria-expanded="true"]) {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
    background: transparent;
    box-shadow: none;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .submenu {
    gap: 5px;
    margin: 7px 0 9px 10px;
    padding: 3px 0 3px 10px;
    border-left: 1px solid var(--sidebar-divider);
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .submenu .nav-link.child {
    min-height: 39px;
    margin-right: 0;
    padding: 8px 11px;
    gap: 8px;
    font-size: 13px;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .nav-link.child span:not(.chevron) { white-space: normal; }
:is(.facilgym-theme, .gestionatu-theme) .sidebar .sidebar-global-actions {
    border-top-color: var(--sidebar-divider);
    margin-top: 16px;
    padding-top: 12px;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .logout-classic-icon {
    border-right-color: #9cc7e3;
    border-bottom-color: #9cc7e3;
    border-left-color: #9cc7e3;
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .logout-classic-icon::before { background: #ff9b96; }
:is(.facilgym-theme, .gestionatu-theme) .sidebar .chevron {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    color: #9dbbd1;
    font-size: 0;
    transform: rotate(45deg);
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar [aria-expanded="true"] .chevron {
    color: var(--theme-accent);
    transform: rotate(135deg);
}
:is(.facilgym-theme, .gestionatu-theme) .sidebar .nav-menu-separator { background: var(--sidebar-divider); }
:is(.facilgym-theme, .gestionatu-theme) .sidebar a:focus-visible,
:is(.facilgym-theme, .gestionatu-theme) .sidebar button:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

:is(.facilgym-theme, .gestionatu-theme) .workspace-content:has(> .dashboard-facilgym) {
    display: flex;
    flex-direction: column;
    padding: 16px;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: clamp(110px, 12vh, 140px) 24px 20px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    border: 1px solid #42617a;
    border-radius: 14px;
    box-shadow: 0 10px 30px #07111e26;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .desktop-shortcut-toolbar {
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 12px;
    min-height: 48px;
    background: #d7effbef;
    border: 1px solid #87b6d2;
    border-radius: 12px;
    box-shadow: 0 8px 22px #040c182e;
    overflow: visible;
}
:is(.facilgym-theme, .gestionatu-theme) .desktop-shortcut {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 8px;
}
:is(.facilgym-theme, .gestionatu-theme) .desktop-shortcut:hover,
:is(.facilgym-theme, .gestionatu-theme) .desktop-shortcut:focus-visible {
    background: var(--theme-shortcut-hover);
    border-color: var(--theme-shortcut-border);
    outline: 2px solid var(--theme-accent);
    outline-offset: 1px;
}
:is(.facilgym-theme, .gestionatu-theme) .desktop-shortcut.has-separator::before { background: #92b9d1; }
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-large-access {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(760px, 100%);
    gap: 20px;
    justify-self: center;
    align-self: center;
    margin: 24px 0;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link {
    position: relative;
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    min-height: 156px;
    width: 100%;
    padding: 20px 24px;
    border: 1px solid #6388a4;
    border-top: 3px solid #8fd7ff;
    border-radius: 14px !important;
    background: linear-gradient(120deg, #173149e8, #102236eb);
    box-shadow: 0 8px 24px #020a182e;
    color: #f0f8ff;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-mostrador,
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-reservas { border-top-color: var(--theme-accent); }
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link img {
    width: 92px;
    height: 100px;
    max-width: 35%;
    flex: 0 0 auto;
    object-fit: contain;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-access-caption { display: grid; gap: 8px; min-width: 0; }
:is(.facilgym-theme, .gestionatu-theme) .dashboard-access-caption strong { color: #e6f6ff; font-size: 20px; font-weight: 600; line-height: 1.2; }
:is(.facilgym-theme, .gestionatu-theme) .dashboard-access-caption small { color: #b9d8ec; font-size: 13px; line-height: 1.4; }
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link:hover,
:is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link:focus-visible {
    transform: translateY(-3px);
    border-color: var(--theme-accent);
    background: linear-gradient(120deg, #254662f2, #183148f2);
    outline: 2px solid var(--theme-accent);
    outline-offset: 3px;
    filter: none;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-bottom-panel {
    position: static;
    grid-row: 3;
    justify-self: end;
    padding-top: 8px;
}
:is(.facilgym-theme, .gestionatu-theme) .dashboard-brand-logo { width: clamp(140px, 12vw, 210px); max-height: 90px; }

@media (max-width: 1100px) {
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym { padding: 100px 18px 14px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-large-access { gap: 14px; margin: 20px 0; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link { min-height: 140px; padding: 16px; gap: 12px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-access-caption strong { font-size: 17px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link img { width: 70px; height: 80px; }
}
@media (max-width: 760px) {
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .brand-area { min-height: 70px; padding: 10px 14px; align-items: center; }
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .brand-stack { display: flex; align-items: center; gap: 10px; }
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .titular-logo-frame { width: 50px; min-width: 50px; min-height: 48px; padding: 6px; }
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .titular-logo { max-width: 38px; max-height: 38px; }
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .titular-name-link { text-align: left; font-size: 13px; margin: 0; }
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-button { flex: 0 0 36px; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-header { flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-title-block { flex: 1; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-title-line { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-app-logo { width: 30px; height: 30px; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-header h1 { font-size: 22px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym { min-height: 700px; height: auto; overflow: visible; }
    :is(.facilgym-theme, .gestionatu-theme) .workspace-title-line > .workspace-license-title { font-size: 12px; margin-left: 0; flex-basis: 100%; }
    :is(.facilgym-theme, .gestionatu-theme) .session-panel { padding: 7px 9px; grid-template-columns: 1fr; gap: 4px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-large-access { grid-template-columns: minmax(0, 1fr); width: min(430px, 100%); }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-facilgym .dashboard-gym-access-link { min-height: 112px; }
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-brand-logo { max-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.facilgym-theme, .gestionatu-theme) .dashboard-gym-access-link,
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .nav-link,
    :is(.facilgym-theme, .gestionatu-theme) .sidebar .menu-group-toggle { transition: none; }
}

