/* ============================================================
   MEDUZOS — Sistema visual
   Interfaz responsive, accesible y orientada a producto
   ============================================================ */

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

* {
    margin: 0;
    padding: 0;
}

:root {
    color-scheme: light;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --primary-soft: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.14);
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0284c7;
    --info-light: #f0f9ff;

    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-muted: #f1f5f9;
    --surface-glass: rgba(255, 255, 255, 0.92);
    --text: #172033;
    --text-secondary: #526076;
    --text-muted: #8792a5;
    --border: #e4e9f1;
    --border-strong: #d5dce8;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.055);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.075);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);

    --header-height: 68px;
    --nav-height: 72px;
    --sidebar-width: 248px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition-fast: 140ms ease;
    --transition: 220ms cubic-bezier(0.2, 0, 0, 1);
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.055), transparent 28rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea {
    font: inherit;
}

a {
    color: inherit;
}

button, a, input, select, textarea, summary {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.25);
    outline-offset: 2px;
}

::selection {
    color: #fff;
    background: var(--primary);
}

/* Animaciones discretas */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { to { opacity: 0; transform: scale(4); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes checkmark {
    0% { transform: scale(0.65); }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.7); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    50% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.1); }
}

.animate-in { animation: fadeInUp 0.35s ease both; }
.animate-in-scale { animation: fadeInScale 0.3s ease both; }
.animate-in-right, .animate-in-left { animation: fadeInUp 0.35s ease both; }
.delay-1 { animation-delay: 40ms; }
.delay-2 { animation-delay: 80ms; }
.delay-3 { animation-delay: 120ms; }
.delay-4 { animation-delay: 160ms; }
.delay-5 { animation-delay: 200ms; }
.delay-6 { animation-delay: 240ms; }
.delay-7 { animation-delay: 280ms; }
.delay-8 { animation-delay: 320ms; }

/* Shell principal */
.app-header {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(228, 233, 241, 0.86);
    background: var(--surface-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: box-shadow var(--transition), background var(--transition);
}

.app-header.scrolled {
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.97);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.header-left { gap: 11px; min-width: 0; }
.header-right { gap: 10px; flex-shrink: 0; }

.header-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-subtle);
    box-shadow: var(--shadow-xs);
    font-size: 21px;
}

.header-copy { min-width: 0; }

.header-eyebrow {
    display: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.header-title {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user {
    display: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.header-badge {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: var(--danger);
    background: var(--danger-light);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.header-badge svg { width: 16px; height: 16px; }

.header-puntos {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #a16207;
    background: var(--warning-light);
    font-size: 13px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.app-content {
    width: 100%;
    max-width: 780px;
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--header-height) + 22px) 16px calc(var(--nav-height) + var(--safe-bottom) + 28px);
}

/* Navegación */
.bottom-nav {
    position: fixed;
    z-index: 110;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px var(--safe-bottom);
    border-top: 1px solid rgba(228, 233, 241, 0.9);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-brand { display: none; }

.nav-item {
    position: relative;
    min-width: 54px;
    min-height: 52px;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    text-decoration: none;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.nav-item:hover { color: var(--text-secondary); background: var(--surface-subtle); }
.nav-item:active { transform: scale(0.96); }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }

.nav-icon { display: grid; place-items: center; line-height: 1; }
.nav-icon svg, .nav-icon i { width: 21px; height: 21px; stroke-width: 2; }
.nav-item.active .nav-icon svg { stroke-width: 2.4; }
.nav-label { line-height: 1.1; white-space: nowrap; }

.nav-item.nav-fab {
    top: -10px;
    background: transparent;
}

.nav-item.nav-fab .nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}

.nav-item.nav-fab .nav-icon svg { width: 23px; height: 23px; }
.nav-item.nav-fab .nav-label { display: none; }

.nav-badge {
    position: absolute;
    top: 2px;
    right: max(2px, calc(50% - 25px));
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: var(--radius-full);
    color: #fff;
    background: var(--danger);
    font-size: 9px;
    font-weight: 800;
}

/* Tipografía de página */
.welcome { margin: 2px 0 26px; }
.welcome-name {
    color: var(--text);
    font-size: clamp(25px, 6vw, 32px);
    font-weight: 780;
    letter-spacing: -0.045em;
    line-height: 1.18;
}
.welcome-date {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.welcome-puntos {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 8px 13px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #a16207;
    background: var(--warning-light);
    font-size: 16px;
    font-weight: 760;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 28px 0 11px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.section-title:first-child { margin-top: 0; }
.section-title::before {
    width: 4px;
    height: 15px;
    border-radius: 4px;
    background: var(--primary);
    content: "";
}
.section-title svg, .section-title i { width: 14px; height: 14px; color: var(--primary); }

/* Superficies */
.card {
    position: relative;
    margin-bottom: 12px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 720;
}
.card-title svg, .card-title i { width: 17px; height: 17px; color: var(--primary); }
.card-subtitle { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }

.list-item, .user-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 8px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.list-item[onclick] { cursor: pointer; }
.list-item:active, .user-row:active { transform: scale(0.99); }
.list-item-content { min-width: 0; flex: 1; }
.list-item-title { color: var(--text); font-size: 14px; font-weight: 650; }
.list-item-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}
.list-item-check {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 12px;
    transition: all var(--transition);
}
.list-item-check.done { border-color: var(--success); color: #fff; background: var(--success); animation: checkmark 0.3s ease; }
.list-item-check.pending { border-color: #fcd34d; color: var(--warning); background: var(--warning-light); }
.list-item-check.rejected { border-color: #fecaca; color: var(--danger); background: var(--danger-light); }
.list-item-check svg, .list-item-check i { width: 13px; height: 13px; }
.list-item-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 9px;
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-full);
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 750;
}

.user-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-subtle);
    font-size: 23px;
}
.user-info { min-width: 0; flex: 1; }
.user-name { color: var(--text); font-size: 14px; font-weight: 700; }
.user-role { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--text-secondary); font-size: 12px; }

/* Actividad y agenda */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-time {
    min-width: 54px;
    padding-top: 2px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}
.activity-info { min-width: 0; flex: 1; }
.activity-title { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 680; }
.activity-detail { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }
.activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 7px 5px 0 0;
    padding: 4px 8px;
    border-radius: 7px;
    color: var(--info);
    background: var(--info-light);
    font-size: 10px;
    font-weight: 700;
}
.agenda-day {
    margin-bottom: 12px;
    padding: 0 17px 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.agenda-day-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 2px;
    padding: 12px 0 9px;
    border-bottom: 1px solid var(--border);
}
.agenda-day-name { min-width: 30px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.agenda-day-num { color: var(--text); font-size: 14px; font-weight: 750; }
.agenda-day-header.today .agenda-day-num {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
}

/* Chips y estados */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: var(--surface-subtle);
    font-size: 12px;
    font-weight: 650;
}
.chip svg, .chip i { width: 13px; height: 13px; }

/* Iconos de puntos locales: fallback cuando Lucide no está disponible */
i[data-lucide="star"]:empty,
i[data-lucide="zap"]:empty,
i[data-lucide="coins"]:empty {
    display: inline-block;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

i[data-lucide="star"]:empty {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2.5 2.93 5.94 6.56.95-4.75 4.63 1.12 6.53L12 17.47l-5.86 3.08 1.12-6.53-4.75-4.63 6.56-.95L12 2.5Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2.5 2.93 5.94 6.56.95-4.75 4.63 1.12 6.53L12 17.47l-5.86 3.08 1.12-6.53-4.75-4.63 6.56-.95L12 2.5Z'/%3E%3C/svg%3E");
}

i[data-lucide="zap"]:empty {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13.4 2 4.2 13.1h6.7L10.6 22l9.2-11.1h-6.7L13.4 2Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13.4 2 4.2 13.1h6.7L10.6 22l9.2-11.1h-6.7L13.4 2Z'/%3E%3C/svg%3E");
}

i[data-lucide="coins"]:empty {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='9' cy='7' rx='6' ry='3'/%3E%3Cpath d='M3 7v4c0 1.7 2.7 3 6 3 1.1 0 2.1-.1 3-.4M3 11v4c0 1.7 2.7 3 6 3 .7 0 1.4-.1 2-.2'/%3E%3Cellipse cx='16' cy='14' rx='5' ry='2.7'/%3E%3Cpath d='M11 14v4c0 1.5 2.2 2.7 5 2.7s5-1.2 5-2.7v-4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='9' cy='7' rx='6' ry='3'/%3E%3Cpath d='M3 7v4c0 1.7 2.7 3 6 3 1.1 0 2.1-.1 3-.4M3 11v4c0 1.7 2.7 3 6 3 .7 0 1.4-.1 2-.2'/%3E%3Cellipse cx='16' cy='14' rx='5' ry='2.7'/%3E%3Cpath d='M11 14v4c0 1.5 2.2 2.7 5 2.7s5-1.2 5-2.7v-4'/%3E%3C/svg%3E");
}

.chip-primary { border-color: #c7d2fe; color: var(--primary-dark); background: var(--primary-soft); }
.chip-success { border-color: #a7f3d0; color: #047857; background: var(--success-light); }
.chip-warning { border-color: #fde68a; color: #a16207; background: var(--warning-light); }
.chip-danger { border-color: #fecaca; color: var(--danger); background: var(--danger-light); }
.badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: var(--radius-full);
    color: #fff;
    background: var(--primary);
    font-size: 10px;
    font-weight: 800;
}

/* Botones */
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 17px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.005em;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.btn svg, .btn i { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2); }
.btn-success { color: #fff; background: linear-gradient(135deg, #10b981, #06d6a0); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); border: 1px solid rgba(16, 185, 129, 0.1); }
.btn-success:active { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4); }
.btn-danger { color: #fff; background: linear-gradient(135deg, #f87171, #fb923c); box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2); border: 1px solid rgba(248, 113, 113, 0.1); }
.btn-danger:active { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 2px 6px rgba(248, 113, 113, 0.4); }
.btn-outline { border-color: #c7d2fe; color: var(--primary); background: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text-secondary); background: var(--surface); }
.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 12px; }
.btn-lg { min-height: 50px; padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 9px; }
.btn-group .btn { flex: 1; }

/* Formularios */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: #b8c2d2; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: #a1aaba; }
.form-textarea { min-height: 104px; resize: vertical; }
.form-select {
    padding-right: 38px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23526076' d='m2 4 4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.form-check { min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.form-check input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-hint { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--text-muted); font-size: 11px; }
details { border-radius: var(--radius); }
summary { font-weight: 650; }

/* Tabs */
.tab-panel { min-width: 0; }
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}
.tab {
    min-height: 38px;
    display: grid;
    place-items: center;
    flex: 1;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); background: #fff; box-shadow: var(--shadow-sm); }

/* Premios */
.premio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.premio-card {
    position: relative;
    padding: 21px 13px 17px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.premio-emoji { display: block; margin-bottom: 9px; font-size: 34px; line-height: 1.2; }
.premio-nombre { min-height: 34px; margin-bottom: 7px; color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.3; }
.premio-puntos { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: var(--radius-full); color: var(--primary-dark); background: var(--primary-soft); font-size: 11px; font-weight: 750; }

/* Modales y avisos */
.modal-overlay {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
}
.modal-overlay.active { display: flex; animation: fadeInScale 0.18s ease; }
.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    padding: 25px 20px;
    overflow-y: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease both;
}
.modal-handle { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 4px; background: var(--border-strong); }
.modal-title { margin-bottom: 17px; font-size: 19px; font-weight: 760; letter-spacing: -0.025em; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); background: var(--surface-subtle); cursor: pointer; }
.toast {
    position: fixed;
    z-index: 300;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 50%;
    max-width: calc(100% - 32px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 11px;
    color: #fff;
    background: #172033;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 650;
    text-align: center;
    transform: translateX(-50%);
    transition: all var(--transition);
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(12px); }
.toast.success { background: #047857; }
.toast.error { background: #b91c1c; }

/* Progreso, vacíos y carga */
.empty-state { padding: 52px 20px; color: var(--text-muted); text-align: center; }
.empty-state-icon { margin-bottom: 12px; font-size: 45px; filter: grayscale(0.1); opacity: 0.8; }
.empty-state-text { font-size: 14px; font-weight: 600; }
.progress-bar { width: 100%; height: 6px; margin: 8px 0; overflow: hidden; border-radius: 5px; background: var(--surface-muted); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.7s ease; }
.loader { width: 21px; height: 21px; display: inline-block; border: 2px solid #c7d2fe; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; }

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.divider { height: 1px; margin: 21px 0; background: var(--border); }

/* Login */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 12% 10%, rgba(99, 102, 241, 0.18), transparent 25rem),
        radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.1), transparent 24rem),
        #eef2f7;
}
.login-shell {
    width: min(100%, 940px);
    min-height: 580px;
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
}
.login-aside {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #1e1b4b 0%, #3730a3 55%, #4f46e5 100%);
}
.login-aside::after {
    position: absolute;
    right: -110px;
    bottom: -130px;
    width: 320px;
    height: 320px;
    border: 50px solid rgba(255,255,255,0.07);
    border-radius: 50%;
    content: "";
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; letter-spacing: 0.08em; }
.login-brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.2); border-radius: 13px; background: rgba(255,255,255,0.12); font-size: 25px; }
.login-pitch { position: relative; z-index: 1; }
.login-pitch h2 { max-width: 390px; margin-bottom: 14px; font-size: 35px; font-weight: 760; letter-spacing: -0.045em; line-height: 1.12; }
.login-pitch p { max-width: 350px; color: rgba(255,255,255,0.72); font-size: 15px; }
.login-features { position: relative; z-index: 1; display: flex; gap: 18px; color: rgba(255,255,255,0.72); font-size: 11px; font-weight: 650; }
.login-features span { display: flex; align-items: center; gap: 6px; }
.login-features span::before { width: 5px; height: 5px; border-radius: 50%; background: #a5b4fc; content: ""; }
.login-panel { display: flex; align-items: center; padding: 34px 26px; }
.login-card { width: 100%; max-width: 370px; margin: 0 auto; }
.login-logo { margin-bottom: 28px; }
.login-logo .emoji { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #c7d2fe; border-radius: 15px; background: var(--primary-soft); font-size: 27px; }
.login-logo h1 { color: var(--text); font-size: 27px; font-weight: 780; letter-spacing: -0.04em; }
.login-logo p { margin-top: 5px; color: var(--text-secondary); font-size: 14px; }
.login-card .form-group { margin-bottom: 17px; }
.login-card .form-label { font-size: 12px; }
.login-card .form-input { min-height: 48px; }
.btn-login { width: 100%; min-height: 49px; margin-top: 4px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); box-shadow: 0 7px 16px rgba(79,70,229,0.22); cursor: pointer; font-size: 14px; font-weight: 750; transition: all var(--transition-fast); }
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }
.error-msg { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 10px; color: #b91c1c; background: var(--danger-light); font-size: 12px; font-weight: 600; }
.demo-info { margin-top: 22px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); background: var(--surface-subtle); font-size: 11px; line-height: 1.7; }
.demo-info strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 12px; }
.demo-info code { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--primary-dark); background: #fff; font-family: inherit; font-weight: 700; }

/* Tablet */
@media (min-width: 700px) {
    .app-content { padding-right: 28px; padding-left: 28px; }
    .premio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .modal-overlay { align-items: center; padding: 24px; }
    .modal-sheet { max-width: 520px; border-radius: var(--radius-xl); }
    .login-shell { grid-template-columns: minmax(0, 1.18fr) minmax(350px, 0.82fr); }
    .login-aside { display: flex; }
    .login-panel { padding: 46px 38px; }
}

/* Escritorio: shell con navegación lateral */
@media (min-width: 1024px) {
    body:not(.login-body) { padding-left: var(--sidebar-width); }

    .app-header {
        left: var(--sidebar-width);
        height: 76px;
        padding: 0 clamp(30px, 4vw, 54px);
    }
    .header-avatar { width: 41px; height: 41px; flex-basis: 41px; }
    .header-eyebrow { display: block; }
    .header-title { margin-top: 2px; font-size: 18px; }
    .header-user { display: inline; }

    .app-content {
        max-width: 1180px;
        margin: 0 auto;
        padding: 104px clamp(32px, 5vw, 64px) 56px;
    }

    .bottom-nav {
        top: 0;
        right: auto;
        bottom: 0;
        width: var(--sidebar-width);
        height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 5px;
        padding: 26px 18px;
        border: 0;
        color: #cbd5e1;
        background: #111827;
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.08);
        backdrop-filter: none;
    }

    .nav-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 27px;
        padding: 0 10px;
        color: #fff;
        font-size: 16px;
        font-weight: 800;
        letter-spacing: 0.09em;
    }
    .nav-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.1); border-radius: 11px; background: rgba(255,255,255,0.08); font-size: 21px; }

    .nav-item {
        min-width: 0;
        min-height: 46px;
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 0 13px;
        border-radius: 10px;
        color: #94a3b8;
        font-size: 13px;
        font-weight: 650;
    }
    .nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
    .nav-item.active { color: #fff; background: rgba(99,102,241,0.22); }
    .nav-icon { width: 23px; }
    .nav-icon svg, .nav-icon i { width: 19px; height: 19px; }
    .nav-item.nav-fab {
        top: auto;
        order: 10;
        margin-top: auto;
        color: #fff;
        background: var(--primary);
        box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    }
    .nav-item.nav-fab:hover { background: #5b55e7; }
    .nav-item.nav-fab .nav-icon { width: 23px; height: auto; border-radius: 0; background: transparent; box-shadow: none; }
    .nav-item.nav-fab .nav-label { display: inline; }
    .nav-badge { top: 50%; right: 11px; border-color: #111827; transform: translateY(-50%); }

    .card { padding: 20px; }
    .card:hover, .list-item:hover, .user-row:hover, .premio-card:hover {
        border-color: var(--border-strong);
        box-shadow: var(--shadow-sm);
    }
    .premio-card:hover { transform: translateY(-2px); }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(79,70,229,0.25); }
    .btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
    .toast { bottom: 28px; }
}

@media (min-width: 1280px) {
    .premio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .app-header { padding: 0 13px; }
    .header-avatar { width: 35px; height: 35px; flex-basis: 35px; }
    .app-content { padding-right: 13px; padding-left: 13px; }
    .card { padding: 15px; }
    .btn-group { flex-direction: column; }
    .flex-between { gap: 8px; }
    .premio-grid[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .nav-item { min-width: 0; }
    .login-body { padding: 0; background: #fff; }
    .login-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
    .login-panel { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
