/* ============================================
   WEBCLASS · LOS 7 HÁBITOS
   Sistema de diseño
   ============================================ */

:root {
    /* Marca */
    --primary-color: #003b6f;
    --primary-dark: #00294d;
    --secondary-color: #1a5a96;
    --accent-color: #0ea5a3;
    --accent-dark: #0b7f7d;
    --accent-soft: #e3f6f5;

    /* Estado */
    --success-color: #1a9f6b;
    --success-soft: #e7f7f0;
    --danger-color: #d64545;
    --danger-soft: #fbebeb;
    --warning-color: #c9821a;
    --warning-soft: #fbf1e0;
    --info-color: #3498db;

    /* Neutros */
    --ink: #101a2b;
    --text-color: #1f2937;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg-color: #f5f7fa;
    --surface: #ffffff;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Elevación / forma */
    --shadow-xs: 0 1px 2px rgba(16, 26, 43, 0.06);
    --shadow-sm: 0 2px 8px rgba(16, 26, 43, 0.06), 0 1px 2px rgba(16, 26, 43, 0.04);
    --shadow-md: 0 8px 24px rgba(16, 26, 43, 0.08);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    /* Espaciado */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Movimiento */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);        /* entradas, feedback de presión */
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* movimiento/morph en pantalla */
    --duration-fast: 150ms;   /* hover, color, botones pequeños */
    --duration-base: 250ms;   /* acordeones, toasts */
    --duration-slow: 400ms;   /* entradas de tarjetas grandes (habito-enter) */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-color);
}

button {
    font-family: inherit;
}

::selection {
    background: var(--accent-soft);
    color: var(--primary-dark);
}

.eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 6px;
}

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

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-5);
}

.top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.top-bar .user-info {
    margin-left: auto;
}

.top-bar-resources {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-left: var(--space-4);
    border-left: 1px solid var(--border-strong);
}

.top-bar-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 160ms var(--ease-out);
}

.top-bar-resource-link:hover {
    background-color: var(--bg-color);
    border-color: var(--text-muted);
    color: var(--ink);
    transform: translateY(-1px);
}

.dashboard-book-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-text h1 {
    font-size: 17px;
    font-weight: 700;
}

.brand-text span {
    display: block;
    font-size: 12px;
    color: var(--text-light);
}

.top-bar h1 {
    font-size: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info span {
    font-size: 13px;
    color: var(--text-light);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 600;
}

.user-chip .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 160ms var(--ease-out);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-color);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
    border-color: var(--text-muted);
    color: var(--ink);
}

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

.btn-ghost:hover {
    background: var(--bg-color);
    color: var(--ink);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--danger-color);
    border-color: var(--border-color);
}

.btn-danger-ghost:hover {
    background: var(--danger-soft);
    border-color: var(--danger-color);
}

.btn:active {
    transform: scale(0.97);
}

.btn-small {
    padding: 7px 12px;
    font-size: 12.5px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 15px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-danger {
    background-color: var(--danger-soft);
    color: #9c2b2b;
    border-color: #f3c9c9;
}

.alert-success {
    background-color: var(--success-soft);
    color: #14664a;
    border-color: #bfe8d7;
}

.alert-info {
    background-color: var(--accent-soft);
    color: var(--accent-dark);
    border-color: #bfe9e7;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-color);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    min-height: 52px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group input[type="text"] + input[type="text"],
.form-group input[type="text"] + input[type="date"] {
    margin-top: 10px;
}

.form-group-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-group-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

.form-quote {
    text-align: center;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: var(--space-5);
    font-size: 14px;
}

.page-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-color);
}

.page-footer .form-quote {
    margin-bottom: 0;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-color);
    padding-top: 14px;
    margin-left: calc(-1 * var(--space-5));
    margin-right: calc(-1 * var(--space-5));
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

.form-progress {
    background: var(--surface);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-5);
}

.form-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.form-progress-label {
    display: flex;
    gap: 8px;
    align-items: baseline;
    color: var(--primary-color);
    font-size: 12.5px;
    font-weight: 600;
}

.progress-track {
    height: 8px;
    background: var(--bg-color);
    border-radius: 99px;
    overflow: hidden;
}

.progress-track span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 99px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-base) var(--ease-in-out);
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: var(--space-5) 0;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.step-navigation span {
    color: var(--primary-color);
    background: var(--bg-color);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 700;
}

.step-navigation .btn {
    min-width: 120px;
}

/* ============================================
   HABIT RAIL — navegación de los 7 hábitos
   ============================================ */

.habit-rail {
    position: relative;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 14px 10px;
    margin-bottom: var(--space-5);
    scrollbar-width: thin;
    background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 140%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.form-progress .habit-rail {
    margin: 14px -20px -14px;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--accent-soft) 140%);
}

.habit-rail::-webkit-scrollbar {
    height: 5px;
}

.habit-rail::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
}

.habit-rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 0 64px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: none;
    border: none;
    font-family: inherit;
    cursor: default;
    transition: background-color 0.15s ease;
}

button.habit-rail-item {
    cursor: pointer;
}

button.habit-rail-item:hover {
    background: var(--bg-color);
}

.habit-rail-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.habit-rail-item.is-done .habit-rail-dot {
    background: var(--accent-soft);
    border-color: var(--accent-color);
    color: var(--accent-dark);
}

.habit-rail-item.is-current .habit-rail-dot {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.habit-rail-item.is-current span:last-child {
    color: var(--primary-color);
}

.habit-rail-item span {
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    max-width: 72px;
}

/* ============================================
   PÁGINA DE LOGIN / REGISTRO
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-7);
    background:
        linear-gradient(160deg, rgba(0, 59, 111, 0.65) 0%, rgba(0, 41, 77, 0.75) 100%),
        url('https://images.unsplash.com/photo-1685438531044-ef75606db89d?auto=format&fit=crop&w=1600&q=80') center/cover;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 30% 20%, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 100% 100% at 30% 20%, #000 40%, transparent 85%);
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(14, 165, 163, 0.18);
    right: -160px;
    bottom: -160px;
}

.auth-brand-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -120px;
    left: -100px;
    pointer-events: none;
}

@keyframes brandPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 163, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(14, 165, 163, 0); }
}

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.auth-brand-top .brand-mark {
    background: rgba(255,255,255,0.12);
    animation: brandPulse 3.2s ease-in-out infinite;
}

.auth-brand-top span {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.auth-brand-body {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.auth-brand-body h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 14px;
}

.auth-brand-body p:not(.eyebrow) {
    color: rgba(255,255,255,0.78);
    font-size: 14.5px;
    line-height: 1.7;
}

.auth-habit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--space-5);
    position: relative;
    z-index: 1;
}

.auth-habit-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15.5px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.habit-mini-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.habit-mini-icon svg {
    width: 16px;
    height: 16px;
}

.habit-mini-1 { color: #7fb3ff; }
.habit-mini-2 { color: #c9a8ff; }
.habit-mini-3 { color: #ffb98a; }
.habit-mini-4 { color: #ff9fc7; }
.habit-mini-5 { color: #8fe0f2; }
.habit-mini-6 { color: #93e6ae; }
.habit-mini-7 { color: #7fdbd0; }

.auth-brand-foot {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--surface);
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: var(--space-5);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-footer {
    text-align: center;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 13.5px;
    color: var(--text-light);
}

.link {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: var(--space-5);
        min-height: 220px;
    }

    .auth-brand-body h2 {
        font-size: 22px;
    }

    .auth-habit-list {
        display: none;
    }
}

/* ============================================
   DASHBOARD COLABORADOR
   ============================================ */

.dashboard-page .container,
.formulario-page .container {
    max-width: 880px;
}

.welcome-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eef6fb 0%, var(--accent-soft) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    margin-bottom: var(--space-5);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 59, 111, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    -webkit-mask-image: linear-gradient(120deg, #000 10%, transparent 70%);
    mask-image: linear-gradient(120deg, #000 10%, transparent 70%);
}

.welcome-banner-watermark {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 170px;
    height: 170px;
    color: var(--primary-color);
    opacity: 0.08;
    pointer-events: none;
}

.welcome-banner-watermark svg {
    width: 100%;
    height: 100%;
}

.welcome-section {
    position: relative;
    z-index: 1;
}

.celebration-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--success-soft) 0%, #eef6fb 100%);
    border: 1px solid var(--success-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: var(--space-5);
    animation: celebrationIn var(--duration-slow) var(--ease-out);
}

@keyframes celebrationIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.celebration-badge {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--success-color);
    color: #fff;
    box-shadow: 0 0 0 6px var(--success-soft);
}

.celebration-badge svg {
    width: 28px;
    height: 28px;
}

.celebration-text {
    position: relative;
    z-index: 1;
}

.celebration-text .eyebrow {
    color: var(--success-color);
}

.celebration-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.celebration-confetti i {
    position: absolute;
    top: -14px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0.85;
    animation-name: confettiFall;
    animation-duration: 2.4s;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.85; }
    100% { transform: translateY(160px) rotate(var(--rot, 180deg)); opacity: 0; }
}

/* ============================================
   PANTALLA "SOBRE EL LIBRO"
   ============================================ */

.book-hero {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    background: linear-gradient(135deg, #eef6fb 0%, var(--accent-soft) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: var(--space-5);
}

.book-hero-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: #fff;
}

.book-hero-cover svg {
    width: 32px;
    height: 32px;
}

.book-author {
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 10px;
}

.book-resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: var(--space-5);
}

.book-resource-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.book-resource-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.book-resource-media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: #fff;
}

.book-resource-media svg {
    width: 74px;
    height: 74px;
}

.book-resource-media-book {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.book-resource-media-audio {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-color) 100%);
}

.book-resource-media-guide {
    background: linear-gradient(135deg, #b8720f 0%, var(--warning-color) 100%);
}

.book-resource-body {
    padding: 24px 26px 28px;
}

.book-resource-card strong {
    display: block;
    color: var(--ink);
    font-size: 19px;
    margin-bottom: 6px;
}

.book-resource-body > span {
    color: var(--text-light);
    font-size: 15px;
}

.book-habit-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.book-habit-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-color);
}

.book-habit-grid .habit-mini-icon {
    background: var(--bg-color);
}

.book-habit-grid .habit-mini-1 { color: #2563eb; }
.book-habit-grid .habit-mini-2 { color: #7c3aed; }
.book-habit-grid .habit-mini-3 { color: #ea580c; }
.book-habit-grid .habit-mini-4 { color: #db2777; }
.book-habit-grid .habit-mini-5 { color: #0891b2; }
.book-habit-grid .habit-mini-6 { color: #16a34a; }
.book-habit-grid .habit-mini-7 { color: #0d9488; }

@media (max-width: 600px) {
    .book-hero {
        flex-direction: column;
    }
}

/* ============================================
   RESUMEN INTERACTIVO
   ============================================ */

.resumen-accordion {
    margin-top: 0;
    margin-bottom: var(--space-6);
}

.resumen-item {
    border-radius: var(--radius);
}

.resumen-header {
    padding: 16px 18px;
    gap: 14px;
}

.resumen-header-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    text-align: left;
}

.resumen-header-text strong {
    font-size: 14.5px;
    color: var(--ink);
}

.resumen-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

.resumen-cita {
    background: var(--bg-color);
    border-left: 3px solid var(--accent-color);
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-color);
    font-size: 14px;
}

.resumen-cita span {
    display: block;
    margin-top: 6px;
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.resumen-cta {
    text-align: center;
    background: linear-gradient(135deg, #eef6fb 0%, var(--accent-soft) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
}

.resumen-cta h3 {
    font-size: 20px;
    margin-bottom: var(--space-4);
}

.welcome-section h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.welcome-section p:not(.eyebrow) {
    color: var(--text-light);
    font-size: 14.5px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: var(--space-6);
}

.habit-learn p {
    margin: 0 0 12px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-color);
}

.habit-learn-example,
.habit-learn-concept {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 4px 0 12px;
}

.habit-learn-concept {
    background: var(--bg-color);
    border: 1px dashed var(--border-strong);
}

.habit-learn-example {
    background: var(--accent-soft);
}

.habit-learn-example p,
.habit-learn-concept p {
    margin: 0;
}

.habit-learn-tag {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.habit-learn-concept .habit-learn-tag {
    color: var(--text-light);
}

.habit-learn-example .habit-learn-tag {
    color: var(--accent-dark);
}

.habito-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.habito-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.habito-resource-link:hover {
    border-color: var(--habit-color, var(--accent-color));
    background: var(--habit-soft, var(--accent-soft));
    transform: translateY(-1px);
}

.habito-resources-note {
    font-size: 11.5px;
    color: var(--text-light);
    margin: 6px 0 0;
}

.habito-learn-toggle {
    cursor: pointer;
}

.habito-learn-toggle[aria-expanded="true"] {
    border-color: var(--habit-color, var(--accent-color));
    background: var(--habit-soft, var(--accent-soft));
}

.habito-learn-inline {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-base) var(--ease-in-out);
    margin-top: 4px;
}

.habito-learn-inline.is-open {
    grid-template-rows: 1fr;
}

.habito-learn-inline-body {
    overflow: hidden;
    min-height: 0;
}

.habito-learn-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--habit-color, var(--accent-color));
    border-radius: var(--radius);
    padding: 12px 14px 2px;
}

.habito-learn-heading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--habit-soft, var(--accent-soft));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--habit-color, var(--accent-dark));
}

.habito-learn-heading-icon {
    font-size: 11px;
}

.habito-learn-card .habit-learn p {
    font-size: 13px;
    line-height: 1.5;
}

.habito-learn-card .habit-learn-tag {
    font-size: 9.5px;
}

.framework-intro {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: var(--space-5);
}

.framework-intro h3 {
    font-size: 14px;
    color: var(--ink);
    margin: 0 0 8px;
}

.framework-intro p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

.discussion-guide-note {
    font-size: 12.5px;
    color: var(--text-light);
    margin: 14px 0 var(--space-5);
}

.status-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: var(--space-5);
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid transparent;
}

.status-badge.status-pending {
    background: var(--surface);
    border-color: var(--border-color);
    color: var(--text-light);
}

.status-badge.status-in_progress {
    background: var(--warning-soft);
    color: #8a5c10;
    border-color: #f0dcae;
}

.status-badge.status-completed {
    background: var(--success-soft);
    color: #14664a;
    border-color: #bfe8d7;
}

.status-badge strong {
    color: inherit;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: var(--space-4);
}

.admin-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-filters input,
.admin-filters select {
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 13.5px;
    background: var(--surface);
}

.admin-filters input {
    flex: 1;
}

.preview-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: var(--space-4);
    color: var(--accent-dark);
    background: var(--accent-soft);
    border: 1px solid #bfe9e7;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.preview-banner span {
    flex: 1;
}

.preview-status {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: var(--space-5);
    color: var(--primary-color);
    background: #eef6fb;
    border-radius: var(--radius);
}

.preview-form {
    opacity: 0.92;
}

.dashboard-habits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: var(--space-5);
}

.dashboard-habit {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-habit strong {
    font-size: 13.5px;
    color: var(--ink);
}

.dashboard-habit span {
    font-size: 12.5px;
    color: var(--text-light);
}

.responses-section {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-color);
}

.responses-section h3 {
    font-size: 16px;
    margin-bottom: var(--space-4);
}

.response-info {
    background-color: var(--bg-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: 13.5px;
}

.empty-state {
    position: relative;
    text-align: center;
    padding: var(--space-7) var(--space-5);
    color: var(--text-light);
}

.empty-state .empty-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.empty-state .empty-icon::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 72%);
    z-index: -1;
}

.empty-state .empty-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state h3 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--ink);
}

.empty-state p {
    font-size: 13.5px;
    max-width: 340px;
    margin: 0 auto;
}

/* ============================================
   FORMULARIO
   ============================================ */

.formulario-page {
    padding-bottom: var(--space-6);
}

.formulario {
    background: transparent;
}

.habito {
    position: relative;
    overflow: hidden;
    padding: 32px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-top: 5px solid var(--habit-color, var(--accent-color));
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, var(--habit-soft, var(--surface)) 0%, var(--surface) 55%);
    box-shadow: var(--shadow-xs);
}

.habito-intro,
.habito > .form-group,
.habito > .habito-futuro {
    position: relative;
    z-index: 1;
}

.habito-intro {
    margin-bottom: 4px;
}

/* Portada fotográfica por hábito */
.habito-cover {
    position: relative;
    margin: -32px -32px 26px;
    padding: 36px 32px 26px;
    min-height: 240px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.habito-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(190deg, rgba(0, 20, 40, 0.55) 0%, rgba(6, 12, 22, 0.85) 100%);
    background: linear-gradient(190deg, color-mix(in srgb, var(--habit-color, #001a30) 45%, transparent) 0%, rgba(6, 12, 22, 0.82) 100%);
    z-index: 0;
}

.habito-cover .habito-header {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.habito-cover .habito-header h2 {
    color: #fff;
}

.habito-cover .habito-header p {
    color: rgba(255, 255, 255, 0.85);
}

.habito-cover .habito-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(2px);
    color: #fff;
}

.habito-cover .habito-icon svg {
    width: 26px;
    height: 26px;
}

.habito-cover .habito-header h2 {
    font-size: 21px;
}

.habito:nth-of-type(1) .habito-cover { background-image: url('https://images.unsplash.com/photo-1723341500626-e00bda7470ec?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(2) .habito-cover { background-image: url('https://images.unsplash.com/photo-1652270451362-7d0cb56e4433?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(3) .habito-cover { background-image: url('https://images.unsplash.com/photo-1435527173128-983b87201f4d?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(4) .habito-cover { background-image: url('https://images.unsplash.com/photo-1752159400890-d906038f1b35?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(5) .habito-cover { background-image: url('https://images.unsplash.com/photo-1758274252296-a63b1d7d4bb8?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(6) .habito-cover { background-image: url('https://images.unsplash.com/photo-1758873269317-51888e824b28?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(7) .habito-cover { background-image: url('https://images.unsplash.com/photo-1758274526693-551a974de7f6?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(8) .habito-cover { background-image: url('https://images.unsplash.com/photo-1675453988015-304184957af2?auto=format&fit=crop&w=1600&q=80'); }
.habito:nth-of-type(9) .habito-cover { background-image: url('https://images.unsplash.com/photo-1750277120336-ca98ec2e2f90?auto=format&fit=crop&w=1600&q=80'); }

/* Paleta distintiva por hábito — hace que cada "slide" tenga identidad propia */
.habito:nth-of-type(1), .habit-rail-item:nth-child(1) { --habit-color: #2563eb; --habit-soft: #eaf1fd; }
.habito:nth-of-type(2), .habit-rail-item:nth-child(2) { --habit-color: #7c3aed; --habit-soft: #f3edfd; }
.habito:nth-of-type(3), .habit-rail-item:nth-child(3) { --habit-color: #ea580c; --habit-soft: #fdece0; }
.habito:nth-of-type(4), .habit-rail-item:nth-child(4) { --habit-color: #db2777; --habit-soft: #fbe7f0; }
.habito:nth-of-type(5), .habit-rail-item:nth-child(5) { --habit-color: #0891b2; --habit-soft: #e3f4f7; }
.habito:nth-of-type(6), .habit-rail-item:nth-child(6) { --habit-color: #16a34a; --habit-soft: #e6f6ec; }
.habito:nth-of-type(7), .habit-rail-item:nth-child(7) { --habit-color: #0d9488; --habit-soft: #e1f5f3; }
.habito:nth-of-type(8), .habit-rail-item:nth-child(8) { --habit-color: #d97706; --habit-soft: #fcefdc; }
.habito:nth-of-type(9), .habit-rail-item:nth-child(9) { --habit-color: #4f46e5; --habit-soft: #ebeafc; }

.habit-rail-item.is-current .habit-rail-dot {
    background: var(--habit-color, var(--primary-color));
    border-color: var(--habit-color, var(--primary-color));
}

.habit-rail-item.is-done .habit-rail-dot {
    background: var(--habit-soft, var(--accent-soft));
    color: var(--habit-color, var(--accent-dark));
    border-color: var(--habit-color, var(--accent-color));
}

@keyframes habitoEnter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.habito.habito-enter {
    animation: habitoEnter var(--duration-slow) var(--ease-out);
    min-height: min(58vh, 560px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes questionEnter {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: none; }
}

.form-group.question-enter,
.habito-futuro.question-enter {
    animation: questionEnter var(--duration-base) var(--ease-out);
}

.question-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.question-progress #question-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--habit-color, var(--primary-color));
}

.question-dots {
    display: flex;
    gap: 6px;
}

.question-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-strong);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.question-dots .dot.is-done {
    background: var(--habit-color, var(--accent-color));
    opacity: 0.5;
}

.question-dots .dot.is-active {
    background: var(--habit-color, var(--primary-color));
    transform: scale(1.35);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 16px);
    background: var(--ink);
    color: #fff;
    padding: 12px 20px;
    border-radius: 99px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.habito-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 14px;
    row-gap: 2px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.habito-icon {
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 16px;
    background: var(--habit-soft, var(--bg-color));
    color: var(--habit-color, var(--accent-dark));
}

.habito-icon svg {
    width: 30px;
    height: 30px;
}

.habito-header h2 {
    grid-column: 2;
    color: var(--ink);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
}

.habito-header p {
    grid-column: 2;
    color: var(--text-light);
    font-size: 12.5px;
    margin: 0;
}

.habito-definicion {
    background: var(--habit-soft, var(--bg-color));
    border-left: 3px solid var(--habit-color, var(--accent-color));
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.65;
}

.habito-tips-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13.5px;
}

.habito-tips {
    list-style: none;
    margin: 0 0 20px 0;
    color: var(--text-light);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.habito-tips li {
    padding-left: 18px;
    position: relative;
}

.habito-tips li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--habit-color, var(--accent-color));
}

.dimensiones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 15px;
}

.dimensiones > div {
    background: var(--bg-color);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.dimensiones label {
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-color);
}

.dimensiones input[type="range"] {
    width: 100%;
    height: 4px;
    cursor: pointer;
    accent-color: var(--habit-color, var(--accent-color));
}

.dimensiones .valor {
    display: inline-block;
    margin-left: 8px;
    font-weight: 700;
    color: var(--habit-color, var(--accent-dark));
    font-size: 12.5px;
}

.dimensiones input[type="text"] {
    width: 100%;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
}

.habito-futuro {
    background: var(--habit-soft, #eef9f8);
    border: 1px dashed var(--habit-color, #cdeeeb);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 20px;
}

.habito-futuro label {
    color: var(--habit-color, var(--accent-dark));
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
}

.habito-futuro textarea,
.habito-futuro input[type="text"] {
    width: 100%;
    min-height: 130px;
    padding: 15px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-color);
    background: var(--surface);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.habito-futuro textarea:focus,
.habito-futuro input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================
   ACORDEÓN
   ============================================ */

.accordion {
    margin-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.accordion-header {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--surface);
    border: none;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-color);
    transition: background-color 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.01em;
}

.accordion-header:hover {
    background-color: var(--bg-color);
}

.accordion-header::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform var(--duration-fast) var(--ease-in-out);
    flex-shrink: 0;
}

.accordion-item.active .accordion-header::after {
    transform: rotate(-135deg);
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    background: var(--surface);
    transition: grid-template-rows var(--duration-base) var(--ease-in-out);
}

.accordion-content-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 16px;
}

.accordion-item.active .accordion-content {
    grid-template-rows: 1fr;
}

.accordion-item.active .accordion-content-inner {
    padding: 4px 16px 18px;
}

.response-text {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 13.5px;
}

.response-text h4 {
    color: var(--primary-color);
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 13.5px;
}

.response-text p {
    margin-bottom: 8px;
}

.response-text ul {
    margin-left: 4px;
    list-style: none;
}

.response-text li {
    margin-bottom: 10px;
    padding-left: 14px;
    border-left: 2px solid var(--border-color);
}

/* ============================================
   PANEL ADMIN — LAYOUT CON SIDEBAR
   ============================================ */

.admin-shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(190deg, var(--primary-dark) 0%, #001a30 100%);
    color: #fff;
    padding: var(--space-5) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: relative;
    overflow: hidden;
}

.admin-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 60%);
    mask-image: linear-gradient(200deg, #000 0%, transparent 60%);
    pointer-events: none;
}

.admin-sidebar > * {
    position: relative;
    z-index: 1;
}

.admin-sidebar .brand-text h1,
.admin-sidebar .brand-text span {
    color: #fff;
}

.admin-sidebar .brand-text span {
    color: rgba(255,255,255,0.6);
}

.admin-sidebar .brand-mark {
    background: rgba(255,255,255,0.12);
}

.admin-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.72);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-nav a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.admin-nav a.active {
    background: rgba(14, 165, 163, 0.22);
    color: #fff;
}

.admin-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.admin-sidebar-user .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-sidebar-footer .btn {
    justify-content: flex-start;
    background: transparent;
    color: rgba(255,255,255,0.72);
    border-color: rgba(255,255,255,0.16);
}

.admin-sidebar-footer .btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.admin-main {
    padding: var(--space-6) var(--space-6) var(--space-7);
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: var(--space-6);
}

.admin-page-header h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.admin-page-header p:not(.eyebrow) {
    color: var(--text-light);
    font-size: 13.5px;
}

.admin-content {
    padding: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: var(--space-6);
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    top: -40px;
    right: -30px;
    pointer-events: none;
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-card > * {
    position: relative;
    z-index: 1;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

/* Gráficos del panel admin */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: var(--space-6);
}

.chart-card {
    background: var(--surface);
    padding: 20px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 16px;
}

.status-distribution-bar {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-color);
    margin-bottom: 16px;
}

.status-segment {
    flex-grow: 0;
    flex-shrink: 0;
    height: 100%;
    transform-origin: left;
    animation: barGrow var(--duration-slow) var(--ease-out) backwards;
}

.status-segment-completed { background: var(--success-color); }
.status-segment-progress { background: var(--warning-color); }
.status-segment-pending { background: var(--border-strong); }

.status-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.legend-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-swatch svg {
    width: 13px;
    height: 13px;
}

.legend-completed { background: var(--success-soft); color: var(--success-color); }
.legend-progress { background: var(--warning-soft); color: var(--warning-color); }
.legend-pending { background: var(--bg-color); color: var(--text-light); }

.legend-label {
    color: var(--text-color);
    font-weight: 500;
}

.legend-value {
    margin-left: auto;
    color: var(--text-light);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.habit-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.habit-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.habit-bar-label {
    font-size: 12.5px;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.habit-bar-track {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-color);
    overflow: hidden;
}

.habit-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-color);
    transform-origin: left;
    animation: barGrow var(--duration-slow) var(--ease-out) backwards;
}

@keyframes barGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.habit-bar-row:nth-child(1) .habit-bar-fill { animation-delay: 0.03s; }
.habit-bar-row:nth-child(2) .habit-bar-fill { animation-delay: 0.07s; }
.habit-bar-row:nth-child(3) .habit-bar-fill { animation-delay: 0.11s; }
.habit-bar-row:nth-child(4) .habit-bar-fill { animation-delay: 0.15s; }
.habit-bar-row:nth-child(5) .habit-bar-fill { animation-delay: 0.19s; }
.habit-bar-row:nth-child(6) .habit-bar-fill { animation-delay: 0.23s; }
.habit-bar-row:nth-child(7) .habit-bar-fill { animation-delay: 0.27s; }

.habit-bar-value {
    font-size: 12.5px;
    color: var(--text-light);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .habit-bar-row {
        grid-template-columns: 92px 1fr 36px;
    }
}

.admin-section {
    background: var(--surface);
    padding: var(--space-5);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}

.admin-section h2 {
    font-size: 16px;
    margin-bottom: var(--space-4);
}

/* ============================================
   BADGES DE ESTADO
   ============================================ */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-pending {
    background: var(--bg-color);
    color: var(--text-light);
}

.pill-in_progress {
    background: var(--warning-soft);
    color: #8a5c10;
}

.pill-completed {
    background: var(--success-soft);
    color: #14664a;
}

.pill-active {
    background: var(--success-soft);
    color: #14664a;
}

.pill-inactive {
    background: var(--danger-soft);
    color: #9c2b2b;
}

.pill-admin {
    background: #eef1fb;
    color: #38439e;
}

.pill-collaborator {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* ============================================
   TABLA
   ============================================ */

.responses-table {
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 13.5px;
}

table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

table tbody tr {
    transition: background-color 0.12s ease;
}

table tbody tr:hover {
    background-color: var(--bg-color);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   DETALLES DE RESPUESTAS
   ============================================ */

.responses-details {
    margin-top: var(--space-5);
    padding: var(--space-4);
    background-color: var(--bg-color);
    border-radius: var(--radius);
}

.response-detail {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.detail-header {
    background-color: var(--primary-color);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.detail-header h3 {
    margin: 0;
    font-size: 15px;
    color: #fff;
}

.detail-header p {
    font-size: 12.5px;
    margin: 4px 0 0 0;
    color: rgba(255,255,255,0.85);
}

.detail-header .btn-small {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: transparent;
}

.detail-header .btn-small:hover {
    background: rgba(255,255,255,0.24);
}

.detail-content {
    padding: 18px 20px;
}

/* ============================================
   MOVIMIENTO REDUCIDO
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .auth-brand-top .brand-mark {
        animation: none;
    }

    .habito.habito-enter {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .form-group.question-enter,
    .habito-futuro.question-enter {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .book-resource-card:hover,
    .stat-card:hover {
        transform: none;
    }

    .question-dots .dot.is-active {
        transform: none;
    }

    .btn:active {
        transform: none;
    }

    .progress-track span {
        transition: none;
    }

    .toast,
    .toast.is-visible {
        transform: translate(-50%, 0);
        transition: opacity 0.25s ease;
    }

    .celebration-banner {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .celebration-confetti {
        display: none;
    }

    .habit-bar-fill,
    .status-segment {
        animation: none;
        transform: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 12px var(--space-4);
    }

    .admin-nav {
        flex-direction: row;
        flex: none;
    }

    .admin-sidebar-footer {
        flex-direction: row;
        border-top: none;
        border-left: 1px solid rgba(255,255,255,0.12);
        padding-top: 0;
        padding-left: var(--space-4);
        margin-left: auto;
    }

    .admin-sidebar-user span {
        display: none;
    }

    .admin-main {
        padding: var(--space-5) var(--space-4) var(--space-6);
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .top-bar h1 {
        font-size: 18px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .top-bar-resources {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-strong);
        padding-top: 12px;
    }

    .form-group-buttons {
        flex-direction: column;
    }

    .step-navigation {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .habito-header {
        flex-wrap: wrap;
    }

    .habito {
        padding: 20px;
    }

    .dimensiones {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .preview-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-filters {
        flex-direction: column;
    }

    table {
        font-size: 12.5px;
    }

    table th, table td {
        padding: 10px;
    }

    .btn-small {
        width: 100%;
    }

    .form-progress {
        position: static;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .habito {
        padding: 16px;
    }

    .habito-header h2 {
        font-size: 15px;
    }

    .brand-text span {
        display: none;
    }
}
