/*
 * DatomWorx Social — Diseño v3
 * https://datomworx.com
 *
 * Cambios clave:
 *  - Paleta cremosa cálida (#fdfaf3 base) en lugar de blanco frío
 *  - PRO dorado/ámbar elegante (sin gradiente azul-naranja)
 *  - Botones primarios azul sólido (sin degradados)
 *  - Fondos suaves por página (azul claro general, color del ambiente en grupos)
 *  - Mensajes de chat propios en tono crema del ambiente, no en color sólido
 *
 * Copyright © 2026
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
    /* ===== Fondos cremas ===== */
    --bg: #fbf9f4;
    --bg-elev-1: #fefcf7;
    --bg-elev-2: #f6f2e8;
    --bg-elev-3: #ebe5d2;
    --bg-glass: rgba(254, 252, 247, 0.75);
    --bg-glass-strong: rgba(254, 252, 247, 0.92);
    --bg-white: #ffffff;

    /* ===== Fondo de página por contexto ===== */
    --page-bg:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.06), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(212, 161, 23, 0.05), transparent 50%),
        linear-gradient(180deg, #fbf9f4 0%, #fefcf7 100%);

    /* ===== Bordes ===== */
    --border: #ece6d4;
    --border-strong: #d8d1bd;
    --border-soft: #f3eee0;

    /* ===== Texto ===== */
    --text: #1a1a1a;
    --text-soft: #2a2a2a;
    --text-dim: #565248;
    --text-mute: #8a857a;
    --text-faint: #b8b3a4;
    --text-inverse: #ffffff;

    /* ===== Azul de marca (más calmado) ===== */
    --brand: #2563eb;
    --brand-deep: #1e3a8a;
    --brand-hover: #1d4ed8;
    --brand-light: #93c5fd;
    --brand-soft: #eff5ff;
    --brand-glow: rgba(37, 99, 235, 0.14);

    /* ===== PRO dorado/ámbar ===== */
    --pro: #ca8a04;
    --pro-deep: #854d0e;
    --pro-light: #fbbf24;
    --pro-soft: #fef9e7;
    --pro-glow: rgba(202, 138, 4, 0.20);

    /* ===== Estados (suavizados) ===== */
    --success: #15803d;
    --success-soft: #f0fbf4;
    --success-text: #14532d;
    --warning: #b45309;
    --warning-soft: #fffaeb;
    --warning-text: #92400e;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --danger-text: #7f1d1d;

    /* ===== Radios ===== */
    --r-xs: 8px;
    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-2xl: 36px;
    --r-full: 999px;

    /* ===== Sombras ===== */
    --shadow-xs: 0 1px 2px rgba(58, 47, 20, 0.04);
    --shadow-sm: 0 2px 6px rgba(58, 47, 20, 0.06);
    --shadow: 0 6px 16px rgba(58, 47, 20, 0.08);
    --shadow-md: 0 12px 28px rgba(58, 47, 20, 0.10);
    --shadow-lg: 0 24px 60px rgba(58, 47, 20, 0.14);

    /* ===== Layout ===== */
    --header-h: 64px;
    --tabbar-h: 68px;

    /* ===== Transiciones ===== */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-bounce: 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-smooth: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    letter-spacing: -0.005em;
}

body {
    background: var(--page-bg);
    background-attachment: fixed;
}

/* ===== Fondo de página por contexto: gradiente diagonal 2 tonos ===== */
/* Patrón: color arriba-izq → blanco abajo-der, encuentro en el centro */
:root {
    --page-bg:
        linear-gradient(135deg,
            rgba(37, 99, 235, 0.20) 0%,
            rgba(37, 99, 235, 0.10) 30%,
            #fefcf7 55%,
            #ffffff 100%);
}

body[data-page="feed"],
body[data-page="default"] {
    --page-bg: linear-gradient(135deg,
        rgba(37, 99, 235, 0.22) 0%,
        rgba(37, 99, 235, 0.11) 30%,
        #fefcf7 55%,
        #ffffff 100%);
}

body[data-page="grupos"] {
    --page-bg: linear-gradient(135deg,
        rgba(124, 58, 237, 0.22) 0%,
        rgba(124, 58, 237, 0.10) 30%,
        #fefcf7 55%,
        #ffffff 100%);
}

body[data-page="mis_proyectos"] {
    --page-bg: linear-gradient(135deg,
        rgba(21, 128, 61, 0.20) 0%,
        rgba(21, 128, 61, 0.09) 30%,
        #fefcf7 55%,
        #ffffff 100%);
}

body[data-page="perfil"] {
    --page-bg: linear-gradient(135deg,
        rgba(202, 138, 4, 0.20) 0%,
        rgba(202, 138, 4, 0.09) 30%,
        #fefcf7 55%,
        #ffffff 100%);
}

body[data-page="explorar"] {
    --page-bg: linear-gradient(135deg,
        rgba(6, 182, 212, 0.20) 0%,
        rgba(6, 182, 212, 0.09) 30%,
        #fefcf7 55%,
        #ffffff 100%);
}

/* Fondo de página de grupo: hereda el color de su tema */
body[data-grupo-tema="cafe"]      { --page-bg: linear-gradient(135deg, rgba(194, 65, 12, 0.22) 0%, rgba(194, 65, 12, 0.10) 30%, #fef9f1 55%, #ffffff 100%); }
body[data-grupo-tema="aula"]      { --page-bg: linear-gradient(135deg, rgba(30, 64, 175, 0.24) 0%, rgba(30, 64, 175, 0.11) 30%, #fefcf7 55%, #ffffff 100%); }
body[data-grupo-tema="proyectos"] { --page-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.24) 0%, rgba(124, 58, 237, 0.11) 30%, #fefcf7 55%, #ffffff 100%); }
body[data-grupo-tema="resultados"]{ --page-bg: linear-gradient(135deg, rgba(21, 128, 61, 0.22) 0%, rgba(21, 128, 61, 0.10) 30%, #fefcf7 55%, #ffffff 100%); }
body[data-grupo-tema="charla"]    { --page-bg: linear-gradient(135deg, rgba(190, 24, 93, 0.22) 0%, rgba(190, 24, 93, 0.10) 30%, #fefcf7 55%, #ffffff 100%); }
body[data-grupo-tema="examen"]    { --page-bg: linear-gradient(135deg, rgba(185, 28, 28, 0.22) 0%, rgba(185, 28, 28, 0.10) 30%, #fefcf7 55%, #ffffff 100%); }

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; display: block; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: rgba(37, 99, 235, 0.22); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; border: 2px solid transparent; }

/* ==========================================================
   LAYOUT
   ========================================================== */

.dw-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 16px calc(var(--tabbar-h) + 32px) 16px;
    min-height: calc(100vh - var(--header-h));
}

@media (min-width: 768px) {
    .dw-main { padding: 28px 20px 48px 20px; }
}

/* ==========================================================
   HEADER
   ========================================================== */

.dw-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.dw-header__inner {
    max-width: 760px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dw-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    flex-shrink: 0;
    min-width: 0;
}

.dw-logo__img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--brand);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}

.dw-logo__text-block {
    display: none;
    flex-direction: column;
    line-height: 1;
    min-width: 0;
}

@media (min-width: 520px) { .dw-logo__text-block { display: flex; } }

.dw-logo__name {
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.dw-logo__tag {
    display: none;
    font-size: 10px;
    color: #4a4a4a;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: 3px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 880px) { .dw-logo__tag { display: block; } }

.dw-header__nav {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

@media (min-width: 768px) { .dw-header__nav { display: flex; } }

.dw-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 40px;
    padding: 0 9px;
    border-radius: 11px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 13px;
    transition: background var(--t), color var(--t), box-shadow var(--t), padding 320ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.dw-nav-link svg { width: 19px; height: 19px; flex-shrink: 0; }

.dw-nav-link__label {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    transition: max-width 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 220ms 100ms, margin-left 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dw-nav-link:hover { color: var(--brand); background: var(--brand-soft); }

.dw-nav-link.is-active {
    color: white;
    background: var(--brand);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    padding: 0 14px 0 11px;
}

.dw-nav-link.is-active:hover { color: white; background: var(--brand-hover); }

.dw-nav-link.is-active .dw-nav-link__label {
    max-width: 120px;
    opacity: 1;
    margin-left: 7px;
}

.dw-header__user { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Campana notificaciones */
.dw-bell {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t);
    box-shadow: var(--shadow-xs);
}

.dw-bell:hover { color: var(--brand); border-color: var(--brand-light); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.dw-bell svg { width: 18px; height: 18px; }

.dw-bell__badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--pro);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-elev-1);
}

.dw-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: all var(--t);
    box-shadow: var(--shadow-xs);
}

.dw-user-pill:hover { border-color: var(--brand-light); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.dw-user-pill__name { font-weight: 600; font-size: 13px; color: var(--text); display: none; }

@media (min-width: 480px) { .dw-user-pill__name { display: inline; } }

/* ==========================================================
   AVATAR (más sutil, sin sombras agresivas)
   ========================================================== */

.dw-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.dw-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.20) 0%, transparent 50%);
    border-radius: inherit;
}

.dw-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.dw-avatar--lg { width: 58px; height: 58px; font-size: 19px; }
.dw-avatar--xl { width: 104px; height: 104px; font-size: 36px; box-shadow: 0 0 0 5px rgba(254, 252, 247, 0.95), 0 8px 24px rgba(58, 47, 20, 0.10); }

/* ==========================================================
   TAGS (suaves, sin colores agresivos)
   ========================================================== */

.dw-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    background: var(--bg-elev-2);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-xs);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.3;
    border: 1px solid var(--border-soft);
}

/* PRO dorado elegante */
.dw-tag--pro {
    background: linear-gradient(135deg, #fbbf24 0%, #d4a017 100%);
    color: #5a3a02;
    border: 1px solid #b8860b;
    box-shadow: 0 1px 2px rgba(180, 134, 11, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dw-tag--ciudad   { background: #eff5ff; color: #1e40af; border-color: #c7daf9; }
.dw-tag--maniobra { background: #fdf6e7; color: #92580d; border-color: #f1e0b5; }
.dw-tag--facil    { background: #f0fbf4; color: #166534; border-color: #c8ebd2; }
.dw-tag--medio    { background: #fdf6e7; color: #854d0e; border-color: #f1e0b5; }
.dw-tag--dificil  { background: #fcefef; color: #991b1b; border-color: #f1c8c8; }

/* ==========================================================
   TABBAR MÓVIL (suave)
   ========================================================== */

.dw-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-glass-strong);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

@media (min-width: 768px) { .dw-tabbar { display: none; } }

.dw-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-mute);
    font-size: 11px;
    font-weight: 500;
    transition: all var(--t);
    padding: 4px 0;
    position: relative;
}

.dw-tab svg { width: 22px; height: 22px; transition: transform var(--t-bounce); }
.dw-tab.is-active { color: var(--brand); font-weight: 600; }
.dw-tab.is-active svg { transform: scale(1.1); }

.dw-tab.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 24px;
    height: 3px;
    background: var(--brand);
    border-radius: 0 0 3px 3px;
}

.dw-tab--center { position: relative; }
.dw-tab__plus {
    width: 52px;
    height: 52px;
    background: var(--brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
    margin-top: -14px;
    border: 4px solid var(--bg);
    transition: transform var(--t-bounce);
    position: relative;
    overflow: hidden;
}

.dw-tab__plus:hover { transform: scale(1.08) rotate(90deg); }

.dw-tab__plus::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
}

.dw-tab__plus svg { width: 24px; height: 24px; z-index: 1; }
.dw-tab--center span { display: none; }

/* ==========================================================
   CARDS Y SIMULACIONES (preview cremoso, sin azul-naranja)
   ========================================================== */

.dw-card {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t);
    box-shadow: var(--shadow-xs);
}

.dw-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.dw-sim {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all var(--t);
    box-shadow: var(--shadow-xs);
}

.dw-sim:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }

.dw-sim__header {
    padding: 16px 18px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dw-sim__author { flex: 1; min-width: 0; }

.dw-sim__author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dw-sim__author-meta {
    font-size: 12px;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dw-sim__menu {
    background: none;
    border: 0;
    color: var(--text-mute);
    padding: 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t);
}

.dw-sim__menu:hover { background: var(--bg-elev-2); color: var(--text); }
.dw-sim__menu svg { width: 18px; height: 18px; }

.dw-sim__body { padding: 0 18px 14px; }

.dw-sim__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.dw-sim__desc {
    font-size: 14px;
    color: var(--text-dim);
    margin: 0 0 12px;
    line-height: 1.5;
}

.dw-sim__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* Preview SIN gradiente azul-naranja: cremoso */
.dw-sim__preview {
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 30% 30%, rgba(202, 138, 4, 0.06), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(37, 99, 235, 0.04), transparent 50%),
        #f6f2e8;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mute);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.dw-sim__preview-icon { width: 56px; height: 56px; opacity: 0.45; z-index: 1; }

.dw-sim__preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, transparent 49%, rgba(58, 47, 20, 0.04) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(58, 47, 20, 0.03) 50%, transparent 51%);
    background-size: 36px 36px;
}

.dw-sim__footer {
    display: flex;
    align-items: center;
    padding: 8px;
    border-top: 1px solid var(--border);
    gap: 4px;
    background: var(--bg-elev-2);
}

.dw-sim__action {
    flex: 1;
    background: none;
    border: 0;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--t);
}

.dw-sim__action svg { width: 18px; height: 18px; transition: transform var(--t-bounce); }
.dw-sim__action:hover { background: var(--bg-elev-1); color: var(--text); }
.dw-sim__action:hover svg { transform: scale(1.15); }

.dw-sim__action.is-active { color: var(--pro); }
.dw-sim__action.is-active svg { fill: currentColor; transform: scale(1.1); }

.dw-sim__action--primary {
    background: var(--brand);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.dw-sim__action--primary:hover {
    background: var(--brand-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

/* Acción "Guardado" (cuando ya está en mis proyectos) */
.dw-sim__action--guardado {
    background: var(--success-soft);
    color: var(--success-text);
    border: 1px solid #c8ebd2;
}
.dw-sim__action--guardado:hover { background: #e7f6ec; color: var(--success-text); }
.dw-sim__action--guardado svg { fill: currentColor; }

/* ==========================================================
   BOTONES (azul sólido elegante, sin gradiente azul-naranja)
   ========================================================== */

.dw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-elev-1);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.dw-btn:hover {
    background: var(--bg-elev-2);
    border-color: var(--text-mute);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.dw-btn:active { transform: translateY(0); }

/* Botón primario: azul sólido (NO gradiente) */
.dw-btn--primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22);
}

.dw-btn--primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.30);
}

/* Botón "PRO" / accent dorado */
.dw-btn--pro {
    background: linear-gradient(135deg, #fbbf24 0%, #ca8a04 100%);
    color: #4a2e02;
    border: 1px solid #b8860b;
    box-shadow: 0 4px 10px rgba(202, 138, 4, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dw-btn--pro:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #a16207 100%);
    color: #3d2401;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(202, 138, 4, 0.35);
}

.dw-btn--danger {
    background: var(--danger-soft);
    color: var(--danger-text);
    border-color: rgba(185, 28, 28, 0.25);
}

.dw-btn--danger:hover {
    background: #fce8e8;
    border-color: var(--danger);
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.15);
}

.dw-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-dim);
}

.dw-btn--ghost:hover { background: var(--bg-elev-2); color: var(--text); box-shadow: none; }

.dw-btn--block { width: 100%; }
.dw-btn--sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-xs); }
.dw-btn--lg { padding: 14px 26px; font-size: 16px; border-radius: var(--r); }

.dw-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ==========================================================
   FORMULARIOS
   ========================================================== */

.dw-form { display: flex; flex-direction: column; gap: 14px; }
.dw-field { display: flex; flex-direction: column; gap: 6px; }

.dw-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: -0.005em;
}

.dw-input,
.dw-textarea,
.dw-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 15px;
    transition: all var(--t);
}

.dw-input:hover, .dw-textarea:hover, .dw-select:hover { border-color: var(--text-mute); }

.dw-input:focus,
.dw-textarea:focus,
.dw-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
    background: var(--bg-white);
}

.dw-textarea { resize: vertical; min-height: 100px; }
.dw-input::placeholder, .dw-textarea::placeholder { color: var(--text-mute); }
.dw-hint { font-size: 12px; color: var(--text-mute); }

.dw-error { color: var(--danger-text); font-size: 13px; padding: 10px 14px; background: var(--danger-soft); border-radius: var(--r-sm); border-left: 3px solid var(--danger); }
.dw-success { color: var(--success-text); font-size: 13px; padding: 10px 14px; background: var(--success-soft); border-radius: var(--r-sm); border-left: 3px solid var(--success); }

/* ==========================================================
   PAGE HEADER
   ========================================================== */

.dw-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.dw-page-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.dw-page-subtitle { font-size: 14px; color: var(--text-dim); margin: 4px 0 0; }

@media (max-width: 480px) {
    .dw-page-title { font-size: 24px; }
}

/* ==========================================================
   FILTROS Y CHIPS (sin gradientes, simple azul sólido)
   ========================================================== */

.dw-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 12px;
    margin: 0 -16px 16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.dw-filters::-webkit-scrollbar { display: none; }

.dw-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--t);
    user-select: none;
}

.dw-chip:hover { background: var(--bg-elev-2); color: var(--text); border-color: var(--border-strong); }

.dw-chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */

.dw-empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-mute);
    background: var(--bg-elev-1);
    border-radius: var(--r-lg);
    border: 1px dashed var(--border-strong);
    position: relative;
    overflow: hidden;
}

.dw-empty__icon { width: 72px; height: 72px; margin: 0 auto 18px; color: var(--brand); opacity: 0.45; }
.dw-empty__title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 8px; letter-spacing: -0.01em; }
.dw-empty__text { font-size: 14px; margin: 0 0 18px; color: var(--text-dim); }

/* ==========================================================
   AUTH PAGES (fondo cremoso suave)
   ========================================================== */

.dw-auth-body {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.10), transparent 60%),
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(202, 138, 4, 0.06), transparent 60%),
        linear-gradient(180deg, #fbf9f4 0%, #fefcf7 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.dw-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--r-2xl);
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
}

.dw-auth-logo { text-align: center; margin-bottom: 32px; }

.dw-auth-logo__mark {
    width: 72px;
    height: 72px;
    background: var(--brand);
    border-radius: var(--r-lg);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 34px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    position: relative;
    overflow: hidden;
}

.dw-auth-logo__mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.30) 0%, transparent 50%);
}

.dw-auth-logo__name { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.dw-auth-logo__sub { font-size: 13px; color: var(--text-mute); margin-top: 6px; }

.dw-auth-tabs {
    display: flex;
    background: var(--bg-elev-2);
    border-radius: var(--r-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.dw-auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: 0;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--t);
}

.dw-auth-tab.is-active {
    background: var(--bg-elev-1);
    color: var(--brand);
    box-shadow: var(--shadow-xs);
}

.dw-auth-footer { margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-mute); }
.dw-auth-footer a { color: var(--brand); font-weight: 600; }

.dw-auth-demo {
    margin-top: 24px;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-soft) 0%, var(--pro-soft) 100%);
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.7;
    border: 1px solid var(--border);
}

.dw-auth-demo strong { color: var(--text); }
.dw-auth-demo code {
    background: var(--bg-elev-1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--border);
    color: var(--text);
}

/* ==========================================================
   TOASTS
   ========================================================== */

.dw-toast-container {
    position: fixed;
    bottom: calc(var(--tabbar-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 92vw;
}

@media (min-width: 768px) { .dw-toast-container { bottom: 24px; } }

.dw-toast {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    color: var(--text);
    padding: 12px 18px;
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: dw-toast-in 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 100%;
}

.dw-toast--success { border-left: 3px solid var(--success); }
.dw-toast--success svg { color: var(--success); }
.dw-toast--error { border-left: 3px solid var(--danger); }
.dw-toast--error svg { color: var(--danger); }
.dw-toast--info { border-left: 3px solid var(--brand); }
.dw-toast--info svg { color: var(--brand); }

@keyframes dw-toast-in {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================
   MODAL (fondo cremoso, no oscuro feo)
   ========================================================== */

.dw-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(58, 47, 20, 0.40);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: dw-overlay-in 250ms ease-out;
}

@media (min-width: 600px) { .dw-modal-overlay { align-items: center; padding: 20px; } }

@keyframes dw-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.dw-modal {
    background: var(--bg-elev-1);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 22px calc(20px + env(safe-area-inset-bottom, 0px));
    animation: dw-modal-in 380ms cubic-bezier(0.32, 0.72, 0, 1);
    border: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 0 -12px 40px rgba(58, 47, 20, 0.20);
}

@media (min-width: 600px) {
    .dw-modal {
        border-radius: var(--r-2xl);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 24px 60px rgba(58, 47, 20, 0.24);
    }
}

@keyframes dw-modal-in {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dw-modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dw-modal__title { font-size: 19px; font-weight: 700; margin: 0; color: var(--text); letter-spacing: -0.015em; }
.dw-modal__close {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t);
}
.dw-modal__close:hover { background: var(--bg-elev-3); color: var(--text); transform: rotate(90deg); }
.dw-modal__close svg { width: 18px; height: 18px; }

/* ==========================================================
   LISTAS
   ========================================================== */

.dw-list { display: flex; flex-direction: column; gap: 8px; }

.dw-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    transition: all var(--t);
    text-decoration: none;
    color: var(--text);
}

.dw-list-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-white);
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
}

.dw-list-item__body { flex: 1; min-width: 0; }
.dw-list-item__title { font-weight: 600; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-list-item__meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.dw-list-item__actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ==========================================================
   PERFIL
   ========================================================== */

.dw-profile-hero {
    text-align: center;
    padding: 32px 18px 28px;
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
        radial-gradient(circle at 50% 100%, rgba(202, 138, 4, 0.06), transparent 60%),
        var(--bg-elev-1);
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.dw-profile-hero .dw-avatar { margin: 0 auto 16px; border: 5px solid var(--bg-elev-1); }
.dw-profile-name { font-size: 26px; font-weight: 800; margin: 0; color: var(--text); letter-spacing: -0.025em; }
.dw-profile-meta { font-size: 14px; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dw-profile-bio { font-size: 14px; color: var(--text-dim); margin-top: 12px; max-width: 480px; margin-left: auto; margin-right: auto; line-height: 1.55; }

.dw-profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; max-width: 380px; margin-left: auto; margin-right: auto; }

.dw-stat {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    padding: 14px 10px;
    border-radius: var(--r);
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: all var(--t);
}

.dw-stat:hover { border-color: var(--brand-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Estadísticas en sólido azul (sin gradiente azul-naranja feo) */
.dw-stat__value { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.dw-stat__label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; font-weight: 600; }

/* ==========================================================
   COMENTARIOS
   ========================================================== */

.dw-comments {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev-2);
}

.dw-comment { display: flex; gap: 10px; }

.dw-comment__body {
    flex: 1;
    background: var(--bg-elev-1);
    padding: 11px 14px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.dw-comment__author { font-weight: 600; font-size: 13px; color: var(--text); }
.dw-comment__time { font-size: 11px; color: var(--text-mute); }
.dw-comment__text { font-size: 14px; color: var(--text); margin-top: 4px; line-height: 1.55; }

.dw-comment-form {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    align-items: flex-end;
    background: var(--bg-elev-1);
}

.dw-comment-form .dw-textarea { min-height: 40px; max-height: 100px; padding: 10px 12px; flex: 1; }

/* ==========================================================
   HEADINGS DE SECCIÓN
   ========================================================== */

.dw-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================
   UTILIDADES
   ========================================================== */

.dw-hidden { display: none !important; }
.dw-mt-sm { margin-top: 8px; }
.dw-mt { margin-top: 16px; }
.dw-mt-lg { margin-top: 24px; }
.dw-mb-sm { margin-bottom: 8px; }
.dw-mb { margin-bottom: 16px; }
.dw-mb-lg { margin-bottom: 24px; }
.dw-text-center { text-align: center; }
.dw-text-dim { color: var(--text-dim); }
.dw-text-mute { color: var(--text-mute); }
.dw-text-brand { color: var(--brand); }
.dw-text-pro { color: var(--pro); }
.dw-text-sm { font-size: 13px; }
.dw-flex { display: flex; }
.dw-flex-1 { flex: 1; }
.dw-gap { gap: 8px; }
.dw-gap-lg { gap: 16px; }
.dw-items-center { align-items: center; }
.dw-justify-between { justify-content: space-between; }
.dw-w-full { width: 100%; }

@media (max-width: 480px) { .dw-hidden-sm { display: none; } }

/* ==========================================================
   SKELETON LOADING
   ========================================================== */

.dw-skeleton {
    background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-elev-3) 50%, var(--bg-elev-2) 100%);
    background-size: 200% 100%;
    animation: dw-shimmer 1.5s infinite;
    border-radius: var(--r);
}

@keyframes dw-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================
   GRUPOS — LISTA
   ========================================================== */

.dw-grupos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 600px) {
    .dw-grupos-grid { grid-template-columns: repeat(2, 1fr); }
}

.dw-grupo-card {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}

.dw-grupo-card:hover {
    border-color: var(--g-color, var(--brand));
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.dw-grupo-card__banner {
    height: 96px;
    background: var(--g-banner, linear-gradient(135deg, var(--g-bg, #f0f5fc) 0%, var(--bg-elev-1) 100%));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.dw-grupo-card__banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--g-pattern, none);
    background-size: var(--g-pattern-size, 24px 24px);
    opacity: var(--g-pattern-opacity, 0.45);
    pointer-events: none;
}

.dw-grupo-card__emoji {
    font-size: 48px;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(58, 47, 20, 0.12));
    transition: transform var(--t-bounce);
}

.dw-grupo-card:hover .dw-grupo-card__emoji { transform: scale(1.12) rotate(-4deg); }

.dw-grupo-card__body { padding: 16px 18px 18px; }
.dw-grupo-card__title { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--text); letter-spacing: -0.015em; }
.dw-grupo-card__desc { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; line-height: 1.5; }
.dw-grupo-card__meta { font-size: 12px; color: var(--text-mute); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ==========================================================
   GRUPO — SELECTOR DE TEMA
   ========================================================== */

.dw-temas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) { .dw-temas-grid { grid-template-columns: repeat(3, 1fr); } }

.dw-tema-card { position: relative; cursor: pointer; user-select: none; }
.dw-tema-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.dw-tema-card__inner {
    padding: 16px 12px;
    background: var(--g-bg);
    border: 2px solid transparent;
    border-radius: var(--r);
    text-align: center;
    transition: all var(--t-bounce);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.dw-tema-card__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--g-pattern, none);
    background-size: var(--g-pattern-size, 24px 24px);
    opacity: 0.30;
    pointer-events: none;
}

.dw-tema-card:hover .dw-tema-card__inner { transform: translateY(-3px); box-shadow: var(--shadow); }

.dw-tema-card.is-active .dw-tema-card__inner {
    border-color: var(--g-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-color) 20%, transparent), var(--shadow);
}

.dw-tema-card__emoji { font-size: 36px; line-height: 1; z-index: 1; }
.dw-tema-card__name { font-weight: 700; font-size: 13px; color: var(--text); z-index: 1; }
.dw-tema-card__desc { font-size: 11px; color: var(--text-dim); line-height: 1.4; z-index: 1; }

/* ==========================================================
   GRUPO — HERO
   ========================================================== */

.dw-grupo-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    background: var(--g-banner, linear-gradient(135deg, var(--g-bg) 0%, var(--bg-elev-1) 100%));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.dw-grupo-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--g-pattern, none);
    background-size: var(--g-pattern-size, 24px 24px);
    opacity: var(--g-pattern-opacity, 0.40);
    pointer-events: none;
}

.dw-grupo-hero__banner {
    width: 72px;
    height: 72px;
    background: var(--bg-elev-1);
    border-radius: var(--r);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    z-index: 1;
    position: relative;
}

.dw-grupo-hero__emoji { font-size: 42px; }
.dw-grupo-hero__body { z-index: 1; min-width: 0; }

.dw-grupo-hero__title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dw-grupo-hero__desc { font-size: 14px; color: var(--text-dim); margin: 6px 0 0; line-height: 1.5; }
.dw-grupo-hero__meta { font-size: 12px; color: var(--text-mute); margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dw-grupo-hero__actions { display: flex; gap: 6px; z-index: 1; flex-shrink: 0; }

@media (max-width: 480px) {
    .dw-grupo-hero { grid-template-columns: auto 1fr; padding: 16px; }
    .dw-grupo-hero__actions { grid-column: 1 / -1; justify-content: flex-end; }
    .dw-grupo-hero__title { font-size: 18px; }
    .dw-grupo-hero__banner { width: 60px; height: 60px; }
    .dw-grupo-hero__emoji { font-size: 34px; }
}

/* ==========================================================
   GRUPO — PESTAÑAS
   ========================================================== */

.dw-grupo-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 0 -16px 18px;
    padding: 0 16px 4px;
    scrollbar-width: none;
}
.dw-grupo-tabs::-webkit-scrollbar { display: none; }

.dw-grupo-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: all var(--t);
    box-shadow: var(--shadow-xs);
}

.dw-grupo-tab:hover { background: var(--bg-white); color: var(--text); border-color: var(--g-color, var(--border-strong)); }

.dw-grupo-tab.is-active {
    background: var(--g-color, var(--brand));
    border-color: var(--g-color, var(--brand));
    color: white;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--g-color, var(--brand)) 25%, transparent);
}

.dw-grupo-tab__icon { font-size: 16px; }
.dw-grupo-tab__count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    background: rgba(58, 47, 20, 0.08);
    color: var(--text-dim);
    font-size: 11px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
}

.dw-grupo-tab.is-active .dw-grupo-tab__count { background: rgba(255, 255, 255, 0.25); color: white; }

/* ==========================================================
   GRUPO — PANEL CONTENIDO
   ========================================================== */

.dw-grupo-panel {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    min-height: 300px;
    box-shadow: var(--shadow-xs);
}

/* ==========================================================
   GRUPO — CHAT (mensajes en tonos cremas suaves)
   ========================================================== */

.dw-chat {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--g-bg, var(--bg-elev-2));
    position: relative;
}

.dw-chat::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--g-pattern, none);
    background-size: var(--g-pattern-size, 24px 24px);
    opacity: var(--g-pattern-opacity, 0.22);
    pointer-events: none;
}

.dw-chat-msg {
    display: flex;
    gap: 10px;
    animation: dw-msg-in 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

@keyframes dw-msg-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mensaje normal (de otros): blanco crema */
.dw-chat-msg__body {
    flex: 1;
    background: var(--bg-elev-1);
    padding: 11px 15px;
    border-radius: 6px 16px 16px 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    min-width: 0;
}

/* Mensaje propio: tono crema del ambiente (NO color fuerte) */
.dw-chat-msg.is-mio { flex-direction: row-reverse; }
.dw-chat-msg.is-mio .dw-chat-msg__body {
    background: var(--g-mio-bg, color-mix(in srgb, var(--g-color, var(--brand)) 8%, var(--bg-elev-1)));
    border-radius: 16px 6px 16px 16px;
    border-color: color-mix(in srgb, var(--g-color, var(--brand)) 18%, transparent);
    color: var(--text);
}

/* Texto siempre legible en oscuro */
.dw-chat-msg.is-mio .dw-chat-msg__author,
.dw-chat-msg.is-mio .dw-chat-msg__text { color: var(--text); }
.dw-chat-msg.is-mio .dw-chat-msg__time { color: var(--text-mute); }

.dw-chat-msg__header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.dw-chat-msg__author { font-weight: 600; font-size: 13px; color: var(--text); }
.dw-chat-msg__time { font-size: 11px; color: var(--text-mute); }
.dw-chat-msg__text { font-size: 14px; color: var(--text); line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word; }

.dw-chat-form {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    align-items: flex-end;
    background: var(--bg-elev-1);
    position: relative;
    z-index: 1;
}

.dw-chat-form__input { min-height: 44px; max-height: 120px; padding: 11px 14px; resize: none; flex: 1; border-radius: var(--r); }

.dw-chat-form__send {
    width: 46px;
    height: 46px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--g-color, var(--brand));
    border-color: var(--g-color, var(--brand));
    color: white;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--g-color, var(--brand)) 25%, transparent);
}

.dw-chat-form__send:hover {
    background: var(--g-color-strong, var(--brand-hover));
    border-color: var(--g-color-strong, var(--brand-hover));
    color: white;
    transform: translateY(-2px) scale(1.05);
}

/* ==========================================================
   GRUPO — EVENTOS / AGENDA
   ========================================================== */

.dw-evento {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-left: 4px solid var(--e-color, var(--brand));
    border-radius: var(--r);
    transition: all var(--t);
    align-items: flex-start;
}

.dw-evento:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.dw-evento.is-pasado { opacity: 0.5; }

.dw-evento__fecha {
    flex-shrink: 0;
    width: 56px;
    text-align: center;
    background: color-mix(in srgb, var(--e-color, var(--brand)) 6%, var(--bg-elev-2));
    border-radius: var(--r-sm);
    padding: 8px 4px;
    border: 1px solid color-mix(in srgb, var(--e-color, var(--brand)) 18%, transparent);
}

.dw-evento__dia { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--e-color, var(--brand)); letter-spacing: -0.02em; }
.dw-evento__mes { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-mute); letter-spacing: 0.5px; margin-top: 2px; }
.dw-evento__body { flex: 1; min-width: 0; }
.dw-evento__titulo { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.dw-evento__meta { font-size: 12px; color: var(--text-mute); }
.dw-evento__desc { font-size: 13px; color: var(--text-dim); margin: 6px 0 0; line-height: 1.5; }

/* ==========================================================
   AMBIENTES POR TEMA (mismos colores que antes, ahora más suaves)
   ========================================================== */

[data-tema="cafe"] {
    --g-color: #c2410c;
    --g-color-strong: #9a3412;
    --g-bg: #fdf6ec;
    --g-banner: linear-gradient(135deg, #fce6cb 0%, #fefcf7 100%);
    --g-mio-bg: #fef0dc;
    --g-pattern-size: 22px 22px;
    --g-pattern-opacity: 0.40;
    --g-pattern: radial-gradient(circle at 1px 1px, rgba(194, 65, 12, 0.16) 1px, transparent 1.5px);
}

[data-tema="aula"] {
    --g-color: #1e40af;
    --g-color-strong: #1e3a8a;
    --g-bg: #f0f5fc;
    --g-banner: linear-gradient(135deg, #d8e6f9 0%, #fefcf7 100%);
    --g-mio-bg: #e2ecfb;
    --g-pattern-size: 28px 28px;
    --g-pattern-opacity: 0.35;
    --g-pattern: repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(30, 64, 175, 0.14) 27px, rgba(30, 64, 175, 0.14) 28px);
}

[data-tema="proyectos"] {
    --g-color: #7c3aed;
    --g-color-strong: #5b21b6;
    --g-bg: #f5f0fc;
    --g-banner: linear-gradient(135deg, #e2d4fa 0%, #d4f0fb 60%, #fefcf7 100%);
    --g-mio-bg: #ede1fb;
    --g-pattern-size: 36px 36px;
    --g-pattern-opacity: 0.40;
    --g-pattern: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.22) 1px, transparent 2px),
                 radial-gradient(circle at 20% 70%, rgba(6, 182, 212, 0.20) 1px, transparent 2px),
                 radial-gradient(circle at 80% 30%, rgba(168, 85, 247, 0.18) 1px, transparent 2px);
}

[data-tema="resultados"] {
    --g-color: #15803d;
    --g-color-strong: #14532d;
    --g-bg: #f0f9f3;
    --g-banner: linear-gradient(135deg, #cdebd8 0%, #fdf6e7 100%);
    --g-mio-bg: #defaee;
    --g-pattern-size: 32px 32px;
    --g-pattern-opacity: 0.30;
    --g-pattern: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(21, 128, 61, 0.10) 12px, rgba(21, 128, 61, 0.10) 13px),
                 repeating-linear-gradient(-45deg, transparent, transparent 12px, rgba(202, 138, 4, 0.08) 12px, rgba(202, 138, 4, 0.08) 13px);
}

[data-tema="charla"] {
    --g-color: #be185d;
    --g-color-strong: #9d174d;
    --g-bg: #fbf0f6;
    --g-banner: linear-gradient(135deg, #fcd6e6 0%, #efddff 100%);
    --g-mio-bg: #fce4ef;
    --g-pattern-size: 24px 24px;
    --g-pattern-opacity: 0.35;
    --g-pattern: radial-gradient(circle at 30% 30%, rgba(190, 24, 93, 0.14) 4px, transparent 5px),
                 radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.12) 3px, transparent 4px);
}

[data-tema="examen"] {
    --g-color: #b91c1c;
    --g-color-strong: #7f1d1d;
    --g-bg: #fbf0f0;
    --g-banner: linear-gradient(135deg, #fad5d5 0%, #fef3f3 100%);
    --g-mio-bg: #fbe1e1;
    --g-pattern-size: 14px 14px;
    --g-pattern-opacity: 0.32;
    --g-pattern: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(185, 28, 28, 0.10) 6px, rgba(185, 28, 28, 0.10) 7px);
}

/* ==========================================================
   GRUPO — ENCUESTAS
   ========================================================== */

.dw-encuesta {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-bottom: 12px;
    transition: all var(--t);
}

.dw-encuesta:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.dw-encuesta__header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.dw-encuesta__body { flex: 1; }
.dw-encuesta__pregunta { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 4px; letter-spacing: -0.01em; line-height: 1.4; }
.dw-encuesta__meta { font-size: 12px; color: var(--text-mute); }
.dw-encuesta__opciones { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.dw-encuesta-opcion {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    cursor: pointer;
    transition: all var(--t);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
}

.dw-encuesta-opcion:hover { border-color: var(--g-color, var(--brand)); background: var(--bg-white); }

.dw-encuesta-opcion.is-votado { background: color-mix(in srgb, var(--g-color, var(--brand)) 4%, var(--bg-elev-1)); border-color: color-mix(in srgb, var(--g-color, var(--brand)) 25%, transparent); cursor: default; }
.dw-encuesta-opcion.is-mi-voto { background: color-mix(in srgb, var(--g-color, var(--brand)) 8%, var(--bg-elev-1)); border-color: var(--g-color, var(--brand)); }

.dw-encuesta-opcion__radio { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-radius: 50%; flex-shrink: 0; transition: all var(--t); position: relative; }
.dw-encuesta-opcion.is-mi-voto .dw-encuesta-opcion__radio { border-color: var(--g-color, var(--brand)); background: var(--g-color, var(--brand)); }
.dw-encuesta-opcion.is-mi-voto .dw-encuesta-opcion__radio::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 6px; height: 6px; background: white; border-radius: 50%; }

.dw-encuesta-opcion__texto { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); z-index: 1; }
.dw-encuesta-opcion__votos { font-size: 12px; color: var(--text-dim); font-weight: 600; z-index: 1; }

.dw-encuesta-opcion__barra {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--g-color, var(--brand)) 10%, transparent);
    transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 0;
}

.dw-encuesta-opcion.is-mi-voto .dw-encuesta-opcion__barra { background: color-mix(in srgb, var(--g-color, var(--brand)) 18%, transparent); }

/* ==========================================================
   SELECTOR SIMULACIONES
   ========================================================== */

.dw-sim-selector {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}

@media (min-width: 480px) {
    .dw-sim-selector { grid-template-columns: repeat(2, 1fr); }
}

.dw-sim-selector__item {
    background: var(--bg-elev-1);
    border: 2px solid var(--border);
    border-radius: var(--r);
    padding: 12px;
    cursor: pointer;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    color: inherit;
    font: inherit;
    position: relative;
}

.dw-sim-selector__item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }

.dw-sim-selector__item.is-selected {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.dw-sim-selector__check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: white; display: none; align-items: center; justify-content: center; }
.dw-sim-selector__item.is-selected .dw-sim-selector__check { display: flex; }

.dw-sim-selector__title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; padding-right: 26px; }
.dw-sim-selector__meta { font-size: 11px; color: var(--text-mute); }

/* ==========================================================
   NOTIFICACIONES (dropdown desde la campana)
   ========================================================== */

.dw-notifs {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 6px;
    animation: dw-notifs-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dw-notifs-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dw-notif-empty { padding: 32px 16px; text-align: center; color: var(--text-mute); font-size: 13px; }

.dw-notif {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    transition: background var(--t);
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    align-items: flex-start;
}

.dw-notif:hover { background: var(--bg-elev-2); }

.dw-notif.is-unread { background: var(--brand-soft); border-left: 3px solid var(--brand); }
.dw-notif.is-unread:hover { background: #e2eafb; }

.dw-notif__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elev-2);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.dw-notif__body { flex: 1; min-width: 0; }
.dw-notif__title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dw-notif__msg { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.dw-notif__time { font-size: 11px; color: var(--text-mute); margin-top: 4px; }

/* ==========================================================
   MIS PROYECTOS (guardados)
   ========================================================== */

.dw-info-banner {
    background:
        radial-gradient(circle at 0% 50%, rgba(37, 99, 235, 0.06), transparent 60%),
        var(--brand-soft);
    border: 1px solid #c7daf9;
    border-radius: var(--r-lg);
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dw-info-banner__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--bg-elev-1);
    border: 1px solid #c7daf9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.dw-info-banner__body { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.dw-info-banner__body strong { color: var(--text); }
