/* ==========================================================================
   SISTEMA WEB INCLUSIVO - DESIGN SYSTEM
   Paleta: Azul Marino (#0F172A, #1E3A8A) | Tomate (#FF5722, #E64A19) | Blanco (#FFFFFF)
   ========================================================================== */

:root {
    /* Tomate (Acento vibrante y llamadas a la acción) */
    --color-tomato: #ff5722;
    --color-tomato-dark: #e64a19;
    --color-tomato-deep: #d84315;
    --color-tomato-light: #ff7043;
    --color-tomato-soft: #fbe9e7;
    --color-tomato-border: #ffccbc;

    /* Azul Marino (Estructura, navegación y títulos institucionales) */
    --color-navy-darkest: #0a1128;
    --color-navy-dark: #0f172a;
    --color-navy-sidebar: #0f172a;
    --color-navy-surface: #1e293b;
    --color-navy-primary: #1e3a8a;
    --color-navy-light: #2563eb;
    --color-navy-soft: #eff6ff;
    --color-navy-border: #cbd5e1;

    /* Blanco y Neutros */
    --color-surface: #ffffff;
    --color-bg: #f8fafc;
    --color-text: #0f172a;
    --color-text-secondary: #334155;
    --color-muted: #64748b;
    --color-border: #e2e8f0;

    /* Mapeo de compatibilidad */
    --color-primary: var(--color-tomato);
    --color-primary-dark: var(--color-navy-dark);
    --color-primary-soft: var(--color-tomato-soft);
    --color-accent: var(--color-tomato);

    /* Sombras modernas */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 18px 36px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.06);

    /* Sobrescritura de Bootstrap Primary */
    --bs-primary: #ff5722;
    --bs-primary-rgb: 255, 87, 34;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   ENLACE DE ACCESIBILIDAD (Skip Link)
   ========================================================================== */
.skip-link {
    background: var(--color-navy-dark);
    color: #fff;
    left: 1rem;
    padding: .75rem 1.25rem;
    position: absolute;
    top: -4rem;
    z-index: 1050;
    font-weight: 700;
    border-radius: 6px;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.main-content {
    background: var(--color-bg);
    min-height: 100vh;
}

.main-content.with-sidebar {
    margin-left: 292px;
    padding: 0;
}

/* ==========================================================================
   BARRA SUPERIOR (PAGE TOPBAR)
   ========================================================================== */
.page-topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    padding: .85rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.page-actionbar {
    align-items: center;
    display: flex;
}

.btn-back {
    align-items: center;
    background: #ffffff !important;
    border: 1.5px solid var(--color-border) !important;
    border-radius: 999px !important;
    color: var(--color-navy-dark) !important;
    display: inline-flex;
    font-size: .92rem;
    font-weight: 700;
    gap: .55rem;
    line-height: 1;
    min-height: 42px;
    padding: .6rem 1.2rem !important;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: all .18s ease;
    cursor: pointer;
}

.btn-back:hover,
.btn-back:focus {
    background: var(--color-tomato-soft) !important;
    border-color: var(--color-tomato) !important;
    color: var(--color-tomato-deep) !important;
    box-shadow: 0 6px 16px rgba(255, 87, 34, 0.15);
    transform: translateX(-3px);
}

/* ==========================================================================
   MENÚ DE USUARIO (TOPBAR)
   ========================================================================== */
.user-menu {
    margin-left: auto;
}

.user-menu-button {
    align-items: center;
    background: #ffffff !important;
    border: 1.5px solid var(--color-border) !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    color: var(--color-navy-dark) !important;
    display: inline-flex;
    gap: .75rem;
    min-height: 46px;
    padding: .35rem .65rem .35rem 1.1rem !important;
    text-decoration: none;
    transition: all .18s ease;
}

.user-menu-button:hover,
.user-menu-button:focus {
    background: #ffffff !important;
    border-color: var(--color-tomato) !important;
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.12);
}

.user-menu-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
}

.user-menu-text strong {
    font-size: .92rem;
    color: var(--color-navy-dark);
}

.user-menu-text small {
    color: var(--color-muted);
    font-size: .75rem;
    font-weight: 600;
}

.user-menu-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--color-navy-dark), var(--color-navy-primary));
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.user-menu-avatar-image {
    border: 2px solid #ffffff;
    border-radius: 999px;
    object-fit: cover;
}

.user-menu-button > .bi-chevron-down {
    color: var(--color-muted);
    font-size: .85rem;
    margin-right: .2rem;
}

.user-dropdown {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    margin-top: .6rem !important;
    min-width: 220px;
    padding: .5rem;
    background: #ffffff;
}

.user-dropdown .dropdown-item {
    align-items: center;
    border-radius: 8px;
    display: flex;
    gap: .65rem;
    padding: .65rem .85rem;
    font-size: .92rem;
    font-weight: 500;
    color: var(--color-navy-dark);
    transition: all .15s ease;
}

.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
    background: var(--color-tomato-soft);
    color: var(--color-tomato-deep);
}

/* ==========================================================================
   BARRA LATERAL (APP SIDEBAR - AZUL MARINO ELEGANTE)
   ========================================================================== */
.app-sidebar {
    background: var(--color-navy-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    width: 292px;
    z-index: 1030;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.app-sidebar-mobile {
    background: var(--color-navy-sidebar);
    color: #ffffff;
    width: 292px !important;
}

.sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 1rem;
}

.sidebar-brand {
    align-items: center;
    color: #ffffff;
    display: flex;
    gap: .85rem;
    padding: .5rem .5rem 1.35rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.sidebar-brand:hover,
.sidebar-brand:focus {
    color: #ffffff;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.sidebar-brand small {
    color: var(--color-tomato-light);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Isotipo / Brand Mark en Tomate vibrante */
.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--color-tomato), var(--color-tomato-dark));
    border-radius: 10px;
    color: #ffffff;
    display: inline-flex;
    font-size: 1.35rem;
    height: 42px;
    justify-content: center;
    width: 42px;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.4);
}

.sidebar-user {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding: .85rem .95rem;
}

.user-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--color-tomato), var(--color-tomato-dark));
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar-image {
    border: 1px solid rgba(255, 255, 255, 0.4);
    object-fit: cover;
}

.sidebar-user strong {
    display: block;
    color: #ffffff;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-user span {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .25rem;
    overflow-y: auto;
    padding-right: .25rem;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.sidebar-nav::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.app-sidebar-mobile::-webkit-scrollbar,
.sidebar-shell::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.app-sidebar,
.app-sidebar-mobile,
.sidebar-shell,
.offcanvas-body {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.sidebar-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    font-size: .95rem;
    font-weight: 600;
    gap: .75rem;
    padding: .75rem .85rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
    transition: all .16s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 1.35rem;
    color: #94a3b8;
    transition: color .16s ease;
}

.sidebar-link:hover,
.sidebar-link:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link:hover i,
.sidebar-link:focus i {
    color: var(--color-tomato-light);
}

.sidebar-collapse[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar-collapse[aria-expanded="true"] i {
    color: var(--color-tomato-light);
}

.sidebar-submenu {
    margin: .2rem 0 .5rem 2rem;
}

.sidebar-submenu a {
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    display: block;
    font-size: .88rem;
    font-weight: 500;
    padding: .45rem .85rem;
    text-decoration: none;
    transition: all .15s ease;
}

.sidebar-submenu a:hover,
.sidebar-submenu a:focus {
    color: #ffffff;
    border-left-color: var(--color-tomato);
    padding-left: 1rem;
}

.sidebar-toggle {
    align-items: center;
    background: var(--color-navy-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    display: none;
    font-size: 1.45rem;
    height: 44px;
    justify-content: center;
    left: 1rem;
    position: fixed;
    top: .9rem;
    width: 44px;
    z-index: 1040;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

/* ==========================================================================
   BOTONES (TOMATE & AZUL MARINO)
   ========================================================================== */
.btn-primary {
    --bs-btn-bg: var(--color-tomato);
    --bs-btn-border-color: var(--color-tomato);
    --bs-btn-hover-bg: var(--color-tomato-dark);
    --bs-btn-hover-border-color: var(--color-tomato-dark);
    --bs-btn-focus-shadow-rgb: 255, 87, 34;
    background-color: var(--color-tomato) !important;
    border-color: var(--color-tomato) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 87, 34, 0.2);
    transition: all .16s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-tomato-dark) !important;
    border-color: var(--color-tomato-dark) !important;
    box-shadow: 0 6px 18px rgba(255, 87, 34, 0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    --bs-btn-color: var(--color-tomato-deep);
    --bs-btn-border-color: var(--color-tomato);
    --bs-btn-hover-bg: var(--color-tomato);
    --bs-btn-hover-border-color: var(--color-tomato);
    --bs-btn-hover-color: #ffffff;
    color: var(--color-tomato-deep) !important;
    border-color: var(--color-tomato) !important;
    font-weight: 600;
    background: transparent;
    transition: all .16s ease;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--color-tomato) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.25);
}

.btn-outline-secondary {
    --bs-btn-color: var(--color-navy-dark);
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-bg: #f1f5f9;
    --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-hover-color: var(--color-navy-dark);
    font-weight: 600;
}

.btn-dark {
    background-color: var(--color-navy-dark) !important;
    border-color: var(--color-navy-dark) !important;
    color: #ffffff !important;
}

.btn-dark:hover,
.btn-dark:focus {
    background-color: var(--color-navy-surface) !important;
    border-color: var(--color-navy-surface) !important;
}

/* ==========================================================================
   BADGES / INSIGNIAS
   ========================================================================== */
.badge.bg-primary {
    background-color: var(--color-tomato) !important;
    color: #ffffff !important;
}

.badge.bg-primary-subtle,
.bg-primary-subtle {
    background-color: var(--color-tomato-soft) !important;
    color: var(--color-tomato-deep) !important;
    border: 1px solid var(--color-tomato-border) !important;
}

.text-primary {
    color: var(--color-tomato-deep) !important;
}

/* ==========================================================================
   PANELES Y TARJETAS (BLANCO PURO CON BORDE SUAVE)
   ========================================================================== */
.auth-card,
.module-card,
.status-panel,
.content-panel,
.table-panel,
.metric-card,
.picto-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.table-panel {
    padding: 1.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-panel {
    padding: 1.75rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-bar .form-control,
.filter-bar .form-select {
    flex: 1 1 200px;
}

.filter-bar .btn {
    flex: 0 0 auto;
}

/* Hero de Autenticación / Login */
.auth-section {
    background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-navy-surface) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.auth-card {
    padding: 2.25rem;
    border-top: 5px solid var(--color-tomato);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.auth-card h1 {
    color: var(--color-navy-dark);
    font-weight: 800;
}

.section-label {
    color: var(--color-tomato);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Dashboard Hero */
.dashboard-hero {
    background: linear-gradient(120deg, #ffffff 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 2.5rem 0;
}

.display-title {
    color: var(--color-navy-dark);
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.status-panel {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.25rem;
    border-left: 5px solid var(--color-tomato);
}

.status-panel strong {
    color: var(--color-navy-dark);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Tarjetas de Módulo (Dashboard) */
.module-card {
    height: 100%;
    padding: 1.5rem;
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.module-card:hover,
.module-card:focus-within {
    border-color: var(--color-tomato);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.module-card h2 {
    color: var(--color-navy-dark);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.module-card p {
    color: var(--color-muted);
    font-size: .92rem;
    margin-bottom: 0;
}

/* ==========================================================================
   TABLAS Y FORMULARIOS
   ========================================================================== */
.table > :not(caption) > * > * {
    background: transparent;
    border-bottom-color: var(--color-border);
}

.table thead th {
    color: var(--color-navy-dark);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: #f8fafc;
}

.form-label {
    color: var(--color-navy-dark);
    font-size: .92rem;
    font-weight: 700;
}

.form-control,
.form-select {
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    min-height: 44px;
    color: var(--color-navy-dark);
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-tomato);
    box-shadow: 0 0 0 .22rem rgba(255, 87, 34, 0.18);
    outline: 0;
}

/* Pestañas de navegación */
.nav-tabs .nav-link {
    color: var(--color-muted);
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: .75rem 1.25rem;
}

.nav-tabs .nav-link:hover {
    color: var(--color-navy-dark);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--color-tomato);
    border-bottom: 3px solid var(--color-tomato);
    background: transparent;
    font-weight: 700;
}

/* ==========================================================================
   PERFIL Y MÉTRICAS
   ========================================================================== */
.profile-header {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem;
}

.profile-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--color-navy-dark), var(--color-navy-primary));
    border-radius: 12px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.75rem;
    font-weight: 800;
    height: 70px;
    justify-content: center;
    width: 70px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.profile-section-icon {
    align-items: center;
    background: var(--color-tomato-soft);
    border-radius: 10px;
    color: var(--color-tomato-deep);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.25rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.profile-session-panel {
    border-left: 5px solid var(--color-tomato);
}

.metric-card {
    padding: 1.5rem;
}

.metric-card span {
    color: var(--color-muted);
    font-size: .88rem;
    font-weight: 600;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--color-navy-dark);
    font-size: 2.25rem;
    font-weight: 800;
}

/* ==========================================================================
   INTERFAZ PARA NIÑOS (PICTOGRAMAS Y ACCESIBILIDAD)
   ========================================================================== */
.child-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    padding: 2rem 0 4rem;
}

.child-header h1 {
    color: var(--color-navy-dark);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
}

.child-picto,
.activity-button {
    align-items: center;
    background: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 16px;
    color: var(--color-navy-dark);
    display: flex;
    flex-direction: column;
    font-size: 1.35rem;
    font-weight: 800;
    gap: .75rem;
    min-height: 190px;
    padding: 1.25rem;
    width: 100%;
    box-shadow: var(--shadow-soft);
    transition: all .18s ease;
}

.child-picto:focus,
.child-picto:hover,
.activity-button:focus,
.activity-button:hover {
    border-color: var(--color-tomato);
    box-shadow: 0 10px 28px rgba(255, 87, 34, 0.22);
    transform: translateY(-4px);
}

.sentence-box {
    background: #ffffff;
    border: 3px solid var(--color-navy-border);
    border-radius: 14px;
    color: var(--color-navy-dark);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 800;
    min-height: 90px;
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.child-menu-link {
    align-items: center;
    background: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 16px;
    color: var(--color-navy-dark);
    display: flex;
    font-size: 1.6rem;
    font-weight: 800;
    justify-content: center;
    min-height: 150px;
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: all .18s ease;
}

.child-menu-link:hover,
.child-menu-link:focus {
    border-color: var(--color-tomato);
    color: var(--color-tomato-deep);
    box-shadow: 0 10px 28px rgba(255, 87, 34, 0.22);
    transform: translateY(-3px);
}

/* ==========================================================================
   SISTEMA DE BOTONES Y TARJETAS ACCESIBLES PARA NIÑOS (ALTA VISIBILIDAD)
   ========================================================================== */
.btn-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    padding: 0.9rem 1.8rem;
    min-height: 64px;
    font-size: 1.25rem;
    border: 3px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    box-sizing: border-box;
}

.btn-child:active {
    transform: translateY(4px);
}

.btn-child-lg {
    min-height: 74px;
    font-size: 1.45rem;
    padding: 1.1rem 2.4rem;
    border-radius: 24px;
}

.btn-child-green {
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    color: #ffffff !important;
    border-color: #2E7D32;
    box-shadow: 0 6px 0 #1B5E20, 0 10px 20px rgba(46, 125, 50, 0.3);
}
.btn-child-green:hover {
    background: linear-gradient(180deg, #66BB6A 0%, #388E3C 100%);
    box-shadow: 0 8px 0 #1B5E20, 0 14px 26px rgba(46, 125, 50, 0.4);
    transform: translateY(-2px);
}
.btn-child-green:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #1B5E20;
}

.btn-child-orange {
    background: linear-gradient(180deg, #FF7043 0%, #E64A19 100%);
    color: #ffffff !important;
    border-color: #D84315;
    box-shadow: 0 6px 0 #BF360C, 0 10px 20px rgba(230, 74, 25, 0.35);
}
.btn-child-orange:hover {
    background: linear-gradient(180deg, #FF8A65 0%, #F4511E 100%);
    box-shadow: 0 8px 0 #BF360C, 0 14px 26px rgba(230, 74, 25, 0.45);
    transform: translateY(-2px);
}
.btn-child-orange:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #BF360C;
}

.btn-child-amber {
    background: linear-gradient(180deg, #FFA726 0%, #FB8C00 100%);
    color: #212121 !important;
    border-color: #F57C00;
    box-shadow: 0 6px 0 #E65100, 0 10px 20px rgba(251, 140, 0, 0.3);
}
.btn-child-amber:hover {
    background: linear-gradient(180deg, #FFB74D 0%, #FFA726 100%);
    box-shadow: 0 8px 0 #E65100, 0 14px 26px rgba(251, 140, 0, 0.4);
    transform: translateY(-2px);
}
.btn-child-amber:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #E65100;
}

.btn-child-red {
    background: linear-gradient(180deg, #EF5350 0%, #C62828 100%);
    color: #ffffff !important;
    border-color: #B71C1C;
    box-shadow: 0 6px 0 #880E4F, 0 10px 20px rgba(198, 40, 40, 0.35);
}
.btn-child-red:hover {
    background: linear-gradient(180deg, #E57373 0%, #D32F2F 100%);
    box-shadow: 0 8px 0 #880E4F, 0 14px 26px rgba(198, 40, 40, 0.45);
    transform: translateY(-2px);
}
.btn-child-red:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #880E4F;
}

.btn-child-blue {
    background: linear-gradient(180deg, #42A5F5 0%, #1565C0 100%);
    color: #ffffff !important;
    border-color: #0D47A1;
    box-shadow: 0 6px 0 #0A387E, 0 10px 20px rgba(21, 101, 192, 0.35);
}
.btn-child-blue:hover {
    background: linear-gradient(180deg, #64B5F6 0%, #1976D2 100%);
    box-shadow: 0 8px 0 #0A387E, 0 14px 26px rgba(21, 101, 192, 0.45);
    transform: translateY(-2px);
}
.btn-child-blue:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #0A387E;
}

.btn-child-purple {
    background: linear-gradient(180deg, #AB47BC 0%, #6A1B9A 100%);
    color: #ffffff !important;
    border-color: #4A148C;
    box-shadow: 0 6px 0 #38006B, 0 10px 20px rgba(106, 27, 154, 0.35);
}
.btn-child-purple:hover {
    background: linear-gradient(180deg, #BA68C8 0%, #7B1FA2 100%);
    box-shadow: 0 8px 0 #38006B, 0 14px 26px rgba(106, 27, 154, 0.45);
    transform: translateY(-2px);
}
.btn-child-purple:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #38006B;
}

.btn-child-gray {
    background: linear-gradient(180deg, #FFFFFF 0%, #ECEFF1 100%);
    color: #37474F !important;
    border-color: #90A4AE;
    box-shadow: 0 6px 0 #78909C, 0 10px 18px rgba(0,0,0,0.08);
}
.btn-child-gray:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F7F8 100%);
    box-shadow: 0 8px 0 #78909C, 0 14px 22px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.btn-child-gray:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #78909C;
}

/* Tarjetas Grandes de Acciones Rápidas del Niño */
.child-quick-card {
    background: #ffffff;
    border-radius: 28px;
    border: 4px solid var(--card-border-color, #E2E8F0);
    padding: 1.6rem 1.2rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 0 var(--card-shadow-color, #CBD5E1), 0 14px 28px rgba(0, 0, 0, 0.08);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    width: 100%;
}
.child-quick-card:hover,
.child-quick-card:focus {
    transform: translateY(-6px);
    box-shadow: 0 14px 0 var(--card-shadow-color, #CBD5E1), 0 20px 36px rgba(0, 0, 0, 0.14);
    outline: none;
}
.child-quick-card:active {
    transform: translateY(5px);
    box-shadow: 0 3px 0 var(--card-shadow-color, #CBD5E1), 0 6px 14px rgba(0, 0, 0, 0.1);
}
.child-quick-card .picto-circle {
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: var(--circle-bg, #FFF3E0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s ease;
}
.child-quick-card:hover .picto-circle {
    transform: scale(1.08);
}
.child-quick-card .picto-circle img {
    max-height: 85px;
    max-width: 85px;
    object-fit: contain;
}
.child-quick-card .picto-circle .fallback-icon {
    font-size: 3.8rem;
    line-height: 1;
}
.child-quick-card .card-label {
    font-family: 'Poppins', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--label-color, #0F172A);
    margin: 0;
    line-height: 1.25;
}
.child-quick-card .speaker-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--card-border-color, #64748B);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.2s ease;
}
.child-quick-card:hover .speaker-badge {
    background: var(--card-border-color, #FF5722);
    color: #ffffff;
    transform: rotate(-10deg) scale(1.1);
}

/* Tarjeta Hero de Juegos en Dashboard Niño */
.child-hero-banner {
    background: linear-gradient(135deg, #FF6B00 0%, #FF3D00 50%, #D84315 100%);
    border-radius: 32px;
    padding: 2.5rem 2rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 0 #BF360C, 0 20px 40px rgba(255, 87, 34, 0.35);
    border: 4px solid #FF8A65;
    margin-bottom: 2.5rem;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}
.child-hero-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 0 #BF360C, 0 26px 48px rgba(255, 87, 34, 0.45);
    color: #ffffff;
}
.child-hero-banner:active {
    transform: translateY(5px);
    box-shadow: 0 4px 0 #BF360C, 0 10px 20px rgba(255, 87, 34, 0.3);
}

/* Tarjetas de Pictogramas Mejoradas para Juegos */
.picto-card-large {
    background: #ffffff;
    border: 3.5px solid #E2E8F0;
    border-radius: 22px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 6px 0 #CBD5E1, 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.16s ease;
    user-select: none;
}
.picto-card-large:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: #FF5722;
    box-shadow: 0 10px 0 #D84315, 0 14px 28px rgba(255, 87, 34, 0.25);
}
.picto-card-large:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #D84315;
}
.picto-card-large img {
    max-height: 105px;
    min-height: 90px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}
.picto-card-large .picto-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

/* Banner de Toast / Notificación Infantil */
.child-feedback-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #ffffff;
    border-radius: 24px;
    border: 4px solid #4CAF50;
    padding: 1.25rem 2rem;
    box-shadow: 0 10px 0 #2E7D32, 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90vw;
}
.child-feedback-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.child-feedback-toast .toast-icon {
    font-size: 3rem;
    line-height: 1;
}
.child-feedback-toast .toast-msg {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}


/* ==========================================================================
   RESPONSIVE (TABLETS, MÓVILES Y COMPUTADORAS)
   ========================================================================== */
@media (max-width: 991.98px) {
    .main-content.with-sidebar {
        margin-left: 0;
        padding-top: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        position: fixed;
        top: 10px;
        left: 0.85rem;
        width: 44px;
        height: 44px;
        z-index: 1040;
    }

    .app-sidebar-mobile {
        max-width: 86vw !important;
        width: 300px !important;
    }

    .app-sidebar-mobile .sidebar-shell {
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4rem;
    }

    .page-topbar {
        padding-left: 4.5rem;
        padding-right: 1.25rem;
        min-height: 64px;
    }

    .dashboard-hero {
        padding: 2rem 0;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        padding: 1.5rem 0;
    }

    .display-title {
        font-size: 1.6rem;
    }

    .status-panel {
        padding: 0.85rem 1rem;
    }

    .table-panel,
    .content-panel {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }

    .table-responsive {
        border-radius: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-panel > .table,
    .table-responsive > .table {
        min-width: 580px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 0.85rem;
        padding: 1.25rem 1rem;
    }

    .profile-avatar {
        margin: 0 auto;
    }

    .module-card {
        padding: 1.25rem 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-card strong {
        font-size: 1.85rem;
    }

    .app-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .app-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.92rem;
        padding: 0.65rem 0.95rem;
    }

    .child-quick-card {
        border-radius: 20px;
        padding: 1.2rem 0.8rem;
        min-height: 180px;
    }
    .child-quick-card .picto-circle {
        width: 88px;
        height: 88px;
        margin-bottom: 0.75rem;
    }
    .child-quick-card .picto-circle img {
        max-height: 62px;
        max-width: 62px;
    }
    .child-quick-card .card-label {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .page-topbar {
        padding-left: 4.15rem;
        padding-right: 0.65rem;
        min-height: 60px;
    }

    .sidebar-toggle {
        top: 8px;
        left: 0.65rem;
        width: 42px;
        height: 42px;
        font-size: 1.35rem;
    }

    .btn-back {
        min-height: 38px;
        padding: 0.45rem 0.8rem !important;
        font-size: 0.82rem;
    }

    .user-menu-text {
        display: none;
    }

    .user-menu-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.95rem;
    }

    .filter-bar .form-control,
    .filter-bar .form-select,
    .filter-bar .btn {
        width: 100%;
        flex: 1 1 100%;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .list-header .d-flex {
        width: 100%;
        justify-content: flex-start;
    }

    .list-header .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-dark {
        min-height: 42px;
    }
}

/* Optimización táctil para Tablets y Pantallas Touch */
@media (hover: none) and (pointer: coarse) {
    .child-quick-card,
    .quick-action-btn,
    .picto-card-step,
    .btn-child-primary,
    .btn-child-conector,
    .sidebar-toggle,
    .user-menu-button,
    .module-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}
