@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-base: #03060a;
    --bg-surface: #0a101d;
    --gold-metallic: #d4af37;
    --gold-bright: #f59e0b;
    --gold-light: #fef08a;
    --gold-dark: #b45309;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --gold-glow-strong: rgba(245, 158, 11, 0.6);
    --navy-royal: #1e293b;
    --navy-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --glass-bg: rgba(10, 16, 26, 0.85);
    --glass-border: rgba(212, 175, 55, 0.25);
    --glass-border-strong: rgba(212, 175, 55, 0.6);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    --gold-foil: linear-gradient(135deg, #fef08a 0%, #d4af37 35%, #f59e0b 70%, #b45309 100%);
    --navy-gold-grad: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-code: 'Space Grotesk', monospace;
    --apple-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    object-fit: contain;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Fondo de estrellas (Uiverse.io by amir_6539, adaptado a SASRE) --- */
/* El fondo anterior de esferas está respaldado en RESPALDO_FONDO_ESFERAS.md */

.stars-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(ellipse at bottom, #0d1730 0%, #03060a 100%);
}

#stars,
#stars2,
#stars3 {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
}

#stars {
    width: 1px;
    height: 1px;
    box-shadow: var(--stars-small);
    animation: animStar 150s linear infinite;
}

#stars::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: var(--stars-small);
}

#stars2 {
    width: 2px;
    height: 2px;
    box-shadow: var(--stars-medium);
    animation: animStar 100s linear infinite;
}

#stars2::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: var(--stars-medium);
}

#stars3 {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    box-shadow: var(--stars-big);
    animation: animStar 60s linear infinite;
}

#stars3::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: transparent;
    box-shadow: var(--stars-big);
}

@keyframes animStar {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

/* --- Página de Inicio (Homepage) --- */
.home-hero {
    position: relative;
    overflow: hidden;
    padding: 36px 34px;
    margin-bottom: 22px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background:
        linear-gradient(120deg, rgba(212, 175, 55, 0.14) 0%, rgba(30, 58, 138, 0.14) 55%, rgba(4, 7, 10, 0.4) 100%);
    animation: heroEnter 0.7s var(--apple-ease, ease) both;
}

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

/* Escudo como marca de agua gigante */
.home-hero::before {
    content: '';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    height: 340px;
    background: url('../images/logo.webp') center / contain no-repeat;
    opacity: 0.07;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.4));
}

/* Destello dorado que recorre el hero */
.home-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(212, 175, 55, 0.08) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: heroSheen 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroSheen {
    0%, 55% { left: -80%; }
    85%, 100% { left: 140%; }
}

.home-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.home-hero-avatar-ring {
    position: relative;
    padding: 5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gold-metallic), rgba(212, 175, 55, 0.15), var(--gold-metallic), rgba(212, 175, 55, 0.15), var(--gold-metallic));
    animation: ringSpin 8s linear infinite;
}

.home-hero-avatar-ring > * {
    animation: ringSpinReverse 8s linear infinite;
    display: block;
}

@keyframes ringSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ringSpinReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.home-hero-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-bottom: 8px;
}

.home-hero-title {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.15;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.gold-text {
    background: linear-gradient(100deg, #f5e7b8 0%, var(--gold-metallic) 45%, #a8842a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-hero-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(4, 7, 10, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-metallic);
    font-family: var(--font-code);
}

.hero-chip-live {
    border-color: #34d399;
    color: #34d399;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
    50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

.home-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.home-hero-clock {
    font-size: 2.2rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--gold-metallic);
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.35);
    letter-spacing: 2px;
    line-height: 1;
}

.home-hero-clock-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: var(--font-code);
}

.hub-logo-mini {
    height: 18px;
    width: 18px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(80, 80, 255, 0.5));
}

/* ============================================================
   CLASIFICACIÓN SRE — Ranking competitivo
   ============================================================ */

.ranking-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 30px;
    margin-bottom: 22px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(120deg, rgba(212, 175, 55, 0.12), rgba(30, 58, 138, 0.1) 60%, transparent);
}

.ranking-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(212, 175, 55, 0.07) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: heroSheen 8s ease-in-out infinite;
    pointer-events: none;
}

.ranking-hero-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
}

.ranking-hero-title .fa-trophy {
    color: var(--gold-metallic);
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.5);
}

.ranking-hero-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 6px;
    max-width: 640px;
    line-height: 1.5;
}

.ranking-points-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.ranking-controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

/* --- Podio --- */
.podium-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 16px;
    align-items: end;
    margin-bottom: 22px;
}

.podium-col {
    position: relative;
    text-align: center;
    padding: 24px 14px 0 14px;
    border-radius: 18px 18px 0 0;
    animation: heroEnter 0.6s var(--apple-ease, ease) both;
}

.podium-1 { animation-delay: 0.1s; }
.podium-2 { animation-delay: 0.25s; }
.podium-3 { animation-delay: 0.4s; }

.podium-avatar-slot {
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px;
    transition: transform 0.25s ease;
}

.podium-avatar-slot:hover {
    transform: scale(1.07);
}

.podium-1 .podium-avatar-slot {
    background: conic-gradient(from 0deg, #f5e7b8, var(--gold-metallic), #a8842a, var(--gold-metallic), #f5e7b8);
    box-shadow: 0 0 34px rgba(212, 175, 55, 0.45);
    animation: ringSpin 6s linear infinite;
}

.podium-1 .podium-avatar-slot > * { animation: ringSpinReverse 6s linear infinite; display: block; }

.podium-2 .podium-avatar-slot {
    background: linear-gradient(135deg, #e8e8ee, #9a9aac);
    box-shadow: 0 0 22px rgba(220, 220, 235, 0.25);
}

.podium-3 .podium-avatar-slot {
    background: linear-gradient(135deg, #e2a15c, #8c5a2b);
    box-shadow: 0 0 22px rgba(205, 127, 50, 0.3);
}

.podium-crown {
    font-size: 1.7rem;
    color: var(--gold-metallic);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.7);
    margin-bottom: 6px;
    animation: crownFloat 2.6s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.podium-name {
    font-weight: 900;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-rank-title {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-code);
    margin-top: 2px;
}

.podium-value {
    font-size: 1.35rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--gold-metallic);
    margin-top: 8px;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.podium-points {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-top: 2px;
}

.podium-base {
    margin-top: 14px;
    border-radius: 12px 12px 0 0;
    font-size: 2.2rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.podium-1 .podium-base {
    height: 96px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0.12));
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-bottom: none;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

.podium-2 .podium-base {
    height: 66px;
    background: linear-gradient(180deg, rgba(200, 200, 215, 0.4), rgba(200, 200, 215, 0.08));
    border: 1px solid rgba(200, 200, 215, 0.45);
    border-bottom: none;
}

.podium-3 .podium-base {
    height: 46px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.45), rgba(205, 127, 50, 0.08));
    border: 1px solid rgba(205, 127, 50, 0.5);
    border-bottom: none;
}

.podium-empty {
    opacity: 0.45;
}

.podium-empty .podium-avatar-slot {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--glass-border);
    color: var(--text-muted);
    font-size: 1.4rem;
}

.podium-me .podium-name { color: var(--gold-light); }

/* --- Mi posición --- */
.ranking-me-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    margin-bottom: 22px;
    border: 1px solid var(--gold-metallic);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.03));
    flex-wrap: wrap;
}

.ranking-me-pos {
    font-size: 1.9rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--gold-metallic);
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.4);
    min-width: 64px;
    text-align: center;
}

.ranking-me-value {
    font-size: 1.4rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--text-primary);
}

.me-tag {
    display: inline-block;
    background: var(--gold-metallic);
    color: #10131a;
    font-size: 0.58rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 1px;
    vertical-align: middle;
}

/* --- Tabla de posiciones --- */
.ranking-table-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--gold-metallic);
    font-size: 1rem;
    padding: 4px 8px 16px 8px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 8px;
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    animation: heroEnter 0.45s var(--apple-ease, ease) both;
    animation-delay: calc(var(--stagger-index, 0) * 0.05s);
}

.rank-row:hover {
    background: rgba(212, 175, 55, 0.07);
    transform: translateX(4px);
}

.rank-row-me {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.rank-pos {
    min-width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: var(--font-code);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.rank-pos.pos-gold {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.1));
    border-color: var(--gold-metallic);
    color: var(--gold-light);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
}

.rank-pos.pos-silver {
    background: linear-gradient(135deg, rgba(200, 200, 215, 0.3), rgba(200, 200, 215, 0.06));
    border-color: rgba(200, 200, 215, 0.6);
    color: #e8e8ee;
}

.rank-pos.pos-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.35), rgba(205, 127, 50, 0.08));
    border-color: rgba(205, 127, 50, 0.6);
    color: #e2a15c;
}

.rank-row-info {
    flex: 1;
    min-width: 0;
}

.rank-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.rank-row-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-code);
    margin-top: 2px;
}

.rank-bar-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.5), var(--gold-metallic));
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transition: width 0.8s var(--apple-ease, ease);
}

.rank-bar-fill.pos-silver { background: linear-gradient(90deg, rgba(200, 200, 215, 0.4), #c8c8d7); box-shadow: 0 0 10px rgba(200, 200, 215, 0.3); }
.rank-bar-fill.pos-bronze { background: linear-gradient(90deg, rgba(205, 127, 50, 0.4), #cd7f32); box-shadow: 0 0 10px rgba(205, 127, 50, 0.3); }

.rank-row-stats {
    display: flex;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-code);
    white-space: nowrap;
}

.rank-row-stats i {
    color: var(--gold-metallic);
    margin-right: 3px;
}

.rank-row-value {
    min-width: 92px;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--gold-metallic);
}

.ranking-empty {
    text-align: center;
    padding: 60px 30px;
}

.ranking-empty i {
    font-size: 2.6rem;
    color: var(--gold-metallic);
    margin-bottom: 14px;
    display: block;
}

.ranking-empty h3 {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ranking-empty p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .podium-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .podium-1 { order: 1; }
    .podium-2 { order: 2; }
    .podium-3 { order: 3; }

    .podium-1 .podium-base, .podium-2 .podium-base, .podium-3 .podium-base { height: 40px; font-size: 1.4rem; }

    .rank-row-stats { display: none; }

    .ranking-controls { flex-direction: column; }
}

/* ============================================================
   OPTIMIZACIÓN MÓVIL COMPLETA
   ============================================================ */

@media (max-width: 860px) {

    /* --- Navbar compacta --- */
    .navbar {
        padding: 14px 16px;
        margin-bottom: 20px;
        gap: 12px;
    }

    .brand {
        justify-content: center;
    }

    .brand-logo-img {
        height: 44px;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .brand-subtitle {
        font-size: 0.62rem;
        letter-spacing: 1.5px;
    }

    .nav-user-info {
        gap: 8px;
    }

    .nav-user-info .btn {
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .user-badge {
        padding: 6px 12px 6px 8px;
        gap: 8px;
    }

    .user-badge .user-rank-tag {
        display: none;
    }

    /* --- Hero de inicio --- */
    .home-hero {
        padding: 26px 18px;
    }

    .home-hero::before {
        width: 240px;
        height: 240px;
        opacity: 0.05;
    }

    .home-hero-title {
        font-size: 1.5rem;
    }

    .home-hero-clock {
        font-size: 1.9rem;
    }

    .home-hero-avatar-ring {
        margin: 0 auto;
    }

    .hero-chip {
        padding: 5px 11px;
        font-size: 0.7rem;
    }

    .home-quick-card {
        padding: 18px 12px;
    }

    .home-quick-card .svg-icon {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    .home-quick-card h4 {
        font-size: 0.85rem;
    }

    .home-quick-card p {
        font-size: 0.7rem;
    }

    /* --- Tarjetas de estadísticas superiores --- */
    .stat-card {
        padding: 12px 14px !important;
    }

    .stat-value {
        font-size: 1.15rem !important;
    }

    .stat-label {
        font-size: 0.62rem !important;
    }

    /* --- Contenido general --- */
    .glass-card {
        border-radius: 16px;
    }

    .form-card,
    .modal-box {
        padding: 20px 16px !important;
    }

    .tabs-nav {
        gap: 8px;
        padding: 8px 6px 12px 6px;
        margin-bottom: 18px;
    }

    .tabs-nav .tab-btn {
        padding: 10px 14px;
        font-size: 0.78rem;
    }

    .view-mode-switcher {
        flex-wrap: wrap;
    }

    .action-btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .custom-table {
        min-width: 640px;
    }

    .report-item {
        padding: 16px 14px;
    }

    .report-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .report-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* --- Barras laterales como tarjetas compactas --- */
    .officer-sidebar .sidebar-card,
    .officer-sidebar .month-officer-banner {
        padding: 16px;
    }

    /* --- Clasificación --- */
    .ranking-hero {
        padding: 20px 16px;
    }

    .ranking-hero-title {
        font-size: 1.25rem;
    }

    .ranking-points-legend .hero-chip {
        font-size: 0.65rem;
        padding: 4px 9px;
    }

    .rank-row {
        gap: 10px;
        padding: 11px 8px;
    }

    .rank-pos {
        min-width: 34px;
        height: 34px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .rank-row-value {
        min-width: 70px;
        font-size: 0.9rem;
    }

    .ranking-me-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .ranking-me-pos {
        font-size: 1.4rem;
        min-width: 46px;
    }

    .ranking-me-value {
        font-size: 1.1rem;
    }

    /* --- Modales y formularios --- */
    .modal-box {
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 18px;
    }

    .form-control {
        font-size: 16px; /* evita el zoom automático de iOS al enfocar */
    }

    .search-filter-bar {
        gap: 10px;
    }

    /* --- Notificaciones y búsqueda --- */
    .notif-dropdown {
        width: calc(100vw - 24px);
    }

    #global-search-modal .modal-box {
        margin-top: 8vh;
        align-self: flex-start;
    }
}

@media (max-width: 520px) {

    /* Navbar: fila de botones centrada y compacta */
    .nav-user-info .btn {
        padding: 9px 10px;
        font-size: 0.72rem;
    }

    #btn-logout {
        padding: 9px 10px;
    }

    .brand-subtitle {
        display: none;
    }

    /* Hero: todo centrado y apilado */
    .home-hero {
        padding: 22px 14px;
    }

    .home-hero-title {
        font-size: 1.3rem;
    }

    .home-hero-clock {
        font-size: 1.6rem;
    }

    .home-quick-grid {
        gap: 10px;
    }

    /* Podio más compacto */
    .podium-value {
        font-size: 1.1rem;
    }

    .podium-name {
        font-size: 0.85rem;
    }

    /* KPIs del panel admin en columna */
    .stats-kpi-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Botones de ancho completo en formularios */
    .form-card button[type="submit"],
    .btn-show-more {
        font-size: 0.85rem;
    }

    /* Timeline de carrera y anuncios más compactos */
    .career-entry {
        padding: 10px;
        gap: 10px;
    }

    .announcement-item {
        padding: 10px 12px;
    }

    /* Cropper de imágenes ajustado a pantalla */
    #cropper-canvas {
        max-width: 100%;
        height: auto;
    }

    /* Grillas de usuarios/directorio a una columna */
    .social-directory-grid,
    .user-cards-grid {
        grid-template-columns: 1fr !important;
    }

    /* Detalle de expediente */
    #report-detail-body .grid-2 {
        grid-template-columns: 1fr !important;
    }

    .modal-watermark {
        display: none;
    }
}

/* Táctil: sin resaltado azul al tocar y objetivos táctiles cómodos */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    .btn,
    .tab-btn,
    .view-toggle-btn {
        min-height: 42px;
    }

    .rank-row:hover,
    .home-quick-card:hover {
        transform: none;
    }
}

.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.home-quick-card {
    position: relative;
    overflow: hidden;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: heroEnter 0.6s var(--apple-ease, ease) both;
}

.home-quick-card:nth-child(1) { animation-delay: 0.08s; }
.home-quick-card:nth-child(2) { animation-delay: 0.16s; }
.home-quick-card:nth-child(3) { animation-delay: 0.24s; }
.home-quick-card:nth-child(4) { animation-delay: 0.32s; }

.home-quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-metallic), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.home-quick-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-metallic);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.12);
}

.home-quick-card:hover::before {
    opacity: 1;
}

.home-quick-card .svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-metallic);
    font-size: 1.4rem;
    margin-bottom: 12px;
    transition: transform 0.25s ease;
}

.home-quick-card:hover .svg-icon {
    transform: scale(1.12);
}

.home-quick-card h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.home-quick-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.home-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.home-recent-item:hover {
    background: rgba(212, 175, 55, 0.08);
}

.home-recent-item:last-child {
    border-bottom: none;
}

.home-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.home-summary-row:last-of-type {
    border-bottom: none;
}

@media (max-width: 900px) {
    .home-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .home-hero-sub {
        justify-content: center;
    }

    .home-hero-right {
        align-items: center;
        text-align: center;
    }

    .home-hero::before {
        right: 50%;
        transform: translate(50%, -50%);
    }

    .home-hero-date {
        justify-content: center;
    }
}

.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 50%), var(--glass-bg);
    backdrop-filter: blur(32px) saturate(210%);
    -webkit-backdrop-filter: blur(32px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1.2px solid rgba(255, 255, 255, 0.18);
    border-left: 1.2px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 
        var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.5s var(--apple-ease);
}

.glass-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    border-top-color: rgba(212, 175, 55, 0.6);
    border-left-color: rgba(212, 175, 55, 0.6);
    box-shadow: 
        0 24px 55px rgba(212, 175, 55, 0.18),
        var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.svg-icon {
    font-size: 1.15rem;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.3s var(--apple-ease);
}

.btn .svg-icon, .tab-btn .svg-icon, .view-toggle-btn .svg-icon {
    margin-top: -1px;
}

.svg-icon-lg {
    font-size: 1.8em;
    flex-shrink: 0;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 44px;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #fef08a 25%, #d4af37 50%, #f59e0b 75%, transparent 100%);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.auth-tabs {
    display: flex;
    background: rgba(4, 7, 12, 0.7);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 30px;
    border: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s var(--apple-ease);
}

.auth-tab.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    color: var(--gold-light);
    border: 1px solid var(--glass-border-strong);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--gold-metallic);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-control {
    width: 100%;
    background: rgba(5, 9, 16, 0.85);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 500;
    transition: all 0.3s var(--apple-ease);
}

select.form-control {
    padding: 10px 16px;
    height: 44px;
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-metallic);
    box-shadow: 0 0 22px var(--gold-glow);
    background: rgba(5, 9, 16, 0.98);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s var(--apple-ease), background 0.25s, box-shadow 0.25s, border-color 0.25s;
    text-decoration: none;
    outline: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.85) 0%, rgba(245, 158, 11, 0.85) 100%);
    color: #ffffff;
    font-size: 1.02rem;
    padding: 14px 28px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.15);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.25);
}

.btn-danger:active {
    transform: scale(0.96);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.btn-success:active {
    transform: scale(0.96);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 45px;
    margin: 0 0 35px 0;
    width: 100%;
    max-width: 100%;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    border: none;
    border-bottom: 1.5px solid var(--glass-border);
    background: rgba(10, 16, 26, 0.9);
    box-shadow: 
        var(--glass-shadow),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
    gap: 6px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.brand-logo-img {
    height: 66px;
    width: auto;
    max-height: 66px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2.5px;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 10px;
    background: rgba(4, 7, 12, 0.75);
    border: 1.5px solid var(--glass-border);
    border-radius: 40px;
    transition: all 0.3s var(--apple-ease);
}

.user-badge:hover {
    border-color: var(--gold-metallic);
    box-shadow: 0 0 18px var(--gold-glow);
}

.user-badge-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.user-rank-tag {
    font-size: 0.75rem;
    color: var(--gold-metallic);
    font-weight: 700;
    font-family: var(--font-code);
}

.main-container {
    width: 95%;
    max-width: 1850px;
    padding: 0 0 60px 0;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 35px;
    width: 100%;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 16, 26, 0.88);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    width: 100%;
}

.stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-metallic);
    flex-shrink: 0;
}

.stat-icon .svg-icon {
    width: 1.1em;
    height: 1.1em;
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f8fafc;
    font-family: var(--font-code);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
}

.tabs-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1.5px solid var(--glass-border);
    padding: 12px 10px 16px 10px;
    overflow-x: auto;
    width: 100%;
}

.tab-btn {
    background: rgba(10, 16, 26, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 12px 24px;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    transition: all 0.3s var(--apple-ease);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(30, 58, 138, 0.5);
    border-color: rgba(212, 175, 55, 0.4);
    border-top-color: rgba(212, 175, 55, 0.6);
    border-left-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(30, 58, 138, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-color: var(--gold-metallic);
    border-top-color: rgba(255, 255, 255, 0.25);
    border-left-color: rgba(255, 255, 255, 0.25);
    color: var(--gold-light);
    box-shadow: 
        0 8px 30px rgba(212, 175, 55, 0.2), 
        0 0 15px rgba(212, 175, 55, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s var(--apple-ease) both;
    width: 100%;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(12px) scale(0.99); 
        filter: blur(4px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
        filter: blur(0);
    }
}

.form-card {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 45px 55px;
    background: rgba(10, 16, 26, 0.88);
    border: 1.5px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.form-card-title {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--gold-metallic);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1.5px solid var(--glass-border);
    padding-bottom: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 850px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.radio-group {
    display: flex;
    gap: 18px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-content {
    padding: 16px 22px;
    border-radius: 16px;
    border: 1.5px solid var(--glass-border);
    background: rgba(4, 7, 12, 0.7);
    text-align: center;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s var(--apple-ease);
}

.radio-card input:checked + .radio-content {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-color: var(--gold-metallic);
    color: var(--gold-light);
    box-shadow: 0 0 22px var(--gold-glow);
}

.tags-input-container {
    background: rgba(5, 9, 16, 0.85);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 54px;
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-strong);
    border-radius: 12px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 8px;
}

.autocomplete-item {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-item:hover {
    background: rgba(212, 175, 55, 0.1);
}

.avatar-circle-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.2px solid var(--glass-border-strong);
}

.tags-input-field {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.98rem;
    flex: 1;
    min-width: 160px;
    outline: none;
}

.tag-chip {
    background: var(--navy-royal);
    color: var(--gold-light);
    border: 1.5px solid var(--glass-border-strong);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tag-chip-remove {
    cursor: pointer;
    font-weight: 900;
    color: var(--danger-color);
}

.file-dropzone {
    border: 2px dashed var(--glass-border-strong);
    border-radius: 20px;
    padding: 36px;
    text-align: center;
    background: rgba(4, 7, 12, 0.6);
    cursor: pointer;
    transition: all 0.3s var(--apple-ease);
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--gold-metallic);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 24px var(--gold-glow);
}

.dropzone-icon {
    font-size: 2.6rem;
    color: var(--gold-metallic);
    margin-bottom: 12px;
}

.file-preview {
    margin-top: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.preview-thumb {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 14px;
    border: 1.5px solid var(--gold-metallic);
}

.search-filter-bar {
    display: flex;
    gap: 18px;
    margin-bottom: 30px;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.report-item {
    padding: 28px;
    cursor: pointer;
    width: 100%;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.report-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge-unit {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-metallic);
    border: 1.5px solid var(--gold-metallic);
    padding: 5px 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.84rem;
    font-family: var(--font-code);
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-aprobado {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1.5px solid rgba(16, 185, 129, 0.4);
}

.status-pendiente {
    background: rgba(245, 158, 11, 0.2);
    color: #fde047;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
}

.status-rechazado {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1.5px solid rgba(239, 68, 68, 0.4);
}

.report-body {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.65;
}

.report-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1.5px solid var(--glass-border);
    font-size: 0.86rem;
    color: var(--text-muted);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 6, 10, 0.88);
    backdrop-filter: blur(14px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 740px;
    padding: 40px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-watermark {
    position: absolute;
    right: 20px;
    bottom: 20px;
    height: 140px;
    width: auto;
    max-height: 140px;
    max-width: 140px;
    object-fit: contain;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.rank-badge-img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.rank-badge-inline {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.rank-badge-lg {
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-metallic);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.avatar-circle-lg {
    width: 84px;
    height: 84px;
    max-width: 84px;
    max-height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold-metallic);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.avatar-circle-xl {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold-metallic);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
    margin-top: 15px;
}

.custom-table th {
    text-align: left;
    padding: 16px 20px;
    color: var(--gold-metallic);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1.5px solid var(--glass-border);
}

.custom-table td {
    padding: 18px 20px;
    color: var(--text-secondary);
    font-size: 0.94rem;
    border-top: 1.5px solid var(--glass-border);
    border-bottom: 1.5px solid var(--glass-border);
    background: rgba(10, 16, 26, 0.45);
    transition: all 0.3s var(--apple-ease);
}

.custom-table td:first-child {
    border-left: 1.5px solid var(--glass-border);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.custom-table td:last-child {
    border-right: 1.5px solid var(--glass-border);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.custom-table tr:hover td {
    border-color: var(--glass-border-strong);
    background: rgba(212, 175, 55, 0.05);
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.action-btn-group {
    display: flex;
    gap: 8px;
}

.action-btn-group .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 30px;
    font-weight: 700;
    gap: 6px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 22px;
    width: 100%;
}

@media (max-width: 1200px) {
    .user-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .user-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .user-cards-grid {
        grid-template-columns: 1fr;
    }
}

.user-profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1.5px solid var(--glass-border);
    border-radius: 22px;
    padding: 26px;
    text-align: center;
    position: relative;
    transition: all 0.35s var(--apple-ease);
}

.user-profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-metallic);
    box-shadow: 0 14px 35px var(--gold-glow);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.user-card-badge-id {
    font-size: 0.78rem;
    font-family: var(--font-code);
    color: var(--gold-metallic);
    font-weight: 700;
}

.user-card-avatar {
    margin: 0 auto 16px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 80px;
    height: 80px;
}

.user-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-card-handle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.user-card-rank-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--navy-royal);
    color: var(--gold-light);
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.rank-badge-inline-tag {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.view-mode-switcher {
    display: flex;
    background: rgba(4, 7, 12, 0.7);
    padding: 5px;
    border-radius: 14px;
    border: 1.5px solid var(--glass-border);
}

.view-toggle-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 9px 18px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s var(--apple-ease);
}

.view-toggle-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    color: var(--gold-metallic);
    border: 1px solid var(--glass-border-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.cropper-viewport-container {
    position: relative;
    width: 560px;
    height: 320px;
    margin: 0 auto;
    background: #03060a;
    border-radius: 18px;
    border: 1.5px solid var(--glass-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropper-canvas {
    cursor: move;
}

.cropper-mask-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-shadow: inset 0 0 0 9999px rgba(4, 7, 10, 0.75);
    transition: all 0.3s var(--apple-ease);
}

.social-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    margin-top: 22px;
    width: 100%;
}

.social-officer-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1.5px solid var(--glass-border);
    border-radius: 22px;
    position: relative;
    transition: all 0.35s var(--apple-ease);
    display: flex;
    flex-direction: column;
}

.social-officer-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-metallic);
    box-shadow: 0 14px 35px var(--gold-glow);
}

.social-card-banner {
    height: 110px;
    width: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(30, 58, 138, 0.15) 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    border-top-left-radius: 21px;
    border-top-right-radius: 21px;
}

.social-card-avatar-wrapper {
    position: relative;
    margin-top: -38px;
    margin-left: 20px;
    display: inline-flex;
    align-items: flex-end;
    width: max-content;
}

.social-card-rank-overlay {
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: var(--navy-dark);
    border-radius: 50%;
    padding: 2px;
    border: 1.5px solid var(--gold-metallic);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-card-content {
    padding: 16px 20px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.social-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.social-card-handle {
    font-size: 0.8rem;
    color: var(--gold-metallic);
    font-family: var(--font-code);
    margin-bottom: 10px;
}

.social-card-bio {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
    background: rgba(4, 7, 10, 0.5);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--glass-border);
    margin-bottom: 16px;
    flex: 1;
}

.social-card-footer {
    margin-top: auto;
}

.social-card-hierarchy-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(4, 7, 10, 0.75);
    border: 1.5px solid var(--gold-metallic);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--gold-light);
    font-family: var(--font-code);
}

.public-wall-header {
    height: 160px;
    background: var(--navy-gold-grad);
    background-size: cover;
    background-position: center;
    position: relative;
}

.public-wall-avatar-container {
    position: absolute;
    bottom: -45px;
    left: 24px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.public-wall-info {
    padding: 60px 28px 28px 28px;
}

@media (max-width: 640px) {
    .cropper-viewport-container {
        width: 100%;
        height: 240px;
    }
    #cropper-canvas {
        max-width: 100%;
    }
}

[style*="--stagger-index"] {
    animation: fadeInUpStagger 0.6s var(--apple-ease) both;
    animation-delay: calc(var(--stagger-index) * 0.06s);
}

@keyframes fadeInUpStagger {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-card-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.admin-section-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.admin-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.select-compact {
    padding: 8px 12px !important;
    height: 38px !important;
    font-size: 0.88rem !important;
    flex: 1;
}

.btn-compact-plus {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--apple-ease);
}

.btn-compact-plus:hover {
    background: rgba(16, 185, 129, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.btn-compact-plus:active {
    transform: scale(0.92);
}

.btn-compact-arrow {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(30, 58, 138, 0.3);
    border: 1px solid rgba(30, 58, 138, 0.5);
    color: #60a5fa;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--apple-ease);
}

.btn-compact-arrow:hover {
    background: rgba(37, 99, 235, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.btn-compact-arrow:active {
    transform: scale(0.92);
}

.btn-card-action {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: all 0.2s var(--apple-ease);
}

.btn-yellow {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.btn-yellow:hover {
    background: rgba(245, 158, 11, 0.85);
    color: #04070a;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.btn-yellow:active { transform: scale(0.96); }

.btn-green {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.btn-green:hover {
    background: rgba(16, 185, 129, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.btn-green:active { transform: scale(0.96); }

.admin-actions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.btn-row-action {
    padding: 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s var(--apple-ease);
}

.btn-purple {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #c084fc;
}

.btn-purple:hover {
    background: rgba(139, 92, 246, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
}
.btn-purple:active { transform: scale(0.96); }

.btn-blue {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.btn-blue:hover {
    background: rgba(59, 130, 246, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}
.btn-blue:active { transform: scale(0.96); }

.btn-grey {
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
}

.btn-grey:hover {
    background: rgba(100, 116, 139, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(100, 116, 139, 0.25);
}
.btn-grey:active { transform: scale(0.96); }

.btn-card-delete {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s var(--apple-ease);
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}
.btn-card-delete:active { transform: scale(0.96); }

.status-role {
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #cbd5e1;
}

/* Patrullaje en Vivo Styles */
.patrol-timer {
    font-family: var(--font-code);
    font-size: 5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 4px;
    margin: 0;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.patrol-timer.paused {
    opacity: 0.5;
    color: var(--text-secondary);
    text-shadow: none;
}

#patrol-step-2, #patrol-step-3 {
    animation: fadeIn 0.4s ease forwards;
}

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

/* --- Reordenamiento de Rangos (Drag & Drop) --- */
.rank-draggable-row {
    cursor: grab;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.rank-draggable-row:active {
    cursor: grabbing;
}

.rank-draggable-row.dragging-rank {
    opacity: 0.35;
    background: rgba(212, 175, 55, 0.08);
    outline: 1px dashed var(--gold-metallic);
}

.rank-drag-handle {
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: grab;
    user-select: none;
}

.rank-draggable-row:hover .rank-drag-handle {
    color: var(--gold-metallic);
}

.btn-rank-move {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.55rem;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-rank-move:hover:not(:disabled) {
    color: var(--gold-metallic);
    border-color: var(--gold-metallic);
    background: rgba(212, 175, 55, 0.1);
}

.btn-rank-move:disabled {
    opacity: 0.25;
    cursor: default;
}

/* --- Notificaciones --- */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger-color, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    z-index: 3000;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* La navbar debe quedar por encima del contenido para que el desplegable no se corte */
header.navbar {
    position: relative;
    z-index: 2500;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 800;
    color: var(--gold-metallic);
    font-size: 0.9rem;
}

#notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.notif-item:hover {
    background: rgba(212, 175, 55, 0.09);
}

.notif-item.unread {
    background: rgba(212, 175, 55, 0.05);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gold-metallic);
}

.notif-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border: 1px solid;
    margin-top: 2px;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-body p {
    font-size: 0.83rem;
    color: var(--text-primary);
    line-height: 1.45;
    margin: 0;
    font-weight: 600;
}

.notif-item:not(.unread) .notif-body p {
    color: var(--text-secondary);
    font-weight: 500;
}

.notif-body small {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 4px;
    font-family: var(--font-code);
}

.notif-action-hint {
    color: var(--gold-metallic);
    font-weight: 700;
}

.notif-unread-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-metallic);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
    margin-top: 8px;
}

.notif-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
}

.notif-empty i {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
    color: var(--text-secondary);
}

.notif-empty p {
    font-size: 0.8rem;
    line-height: 1.5;
}

/* --- Búsqueda expandible (dock animado con rebote elástico) --- */
.expanding-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 640px;
    height: 46px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(4, 7, 10, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition:
        max-width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.expanding-search.collapsed {
    max-width: 46px;
    cursor: pointer;
}

.expanding-search.collapsed:hover {
    border-color: var(--gold-metallic);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}

.expanding-search:not(.collapsed) {
    border-color: var(--gold-metallic);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    background: rgba(4, 7, 10, 0.85);
}

.es-toggle,
.es-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
}

.es-toggle {
    width: 46px;
    height: 46px;
    transition: color 0.2s ease, transform 0.3s ease;
}

.expanding-search.collapsed .es-toggle:hover i,
.es-toggle:hover {
    color: var(--gold-metallic);
}

.expanding-search:not(.collapsed) .es-toggle {
    color: var(--gold-metallic);
}

.expanding-search .es-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 6px !important;
    opacity: 1;
    transition: opacity 0.25s ease 0.18s;
}

.expanding-search.collapsed .es-input {
    flex: 0;
    width: 0;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.es-close {
    width: 34px;
    height: 34px;
    margin-right: 6px;
    border-radius: 50%;
    transform: scale(1);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease, background 0.2s ease;
}

.es-close:hover {
    color: #f87171;
    background: rgba(255, 255, 255, 0.07);
    transform: scale(1.12);
}

.es-close:active {
    transform: scale(0.9);
}

.expanding-search.collapsed .es-close {
    width: 0;
    margin: 0;
    transform: scale(0);
    pointer-events: none;
}

/* --- Tarjetas de gestión de usuarios (admin) rediseñadas --- */
.user-card-footer {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-card-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-card-rank-label {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-metallic);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.8rem;
}

.uc-rank-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
}

.uc-rank-apply {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.uc-rank-apply:hover {
    background: rgba(52, 211, 153, 0.25);
    transform: scale(1.06);
}

.user-card-toolbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.uc-tool {
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.uc-tool:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* --- Tarjeta de usuario premium --- */
.uc-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(4, 7, 12, 0.85) 45%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 0 16px 16px 16px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: heroEnter 0.5s var(--apple-ease, ease) both;
    animation-delay: calc(var(--stagger-index, 0) * 0.06s);
}

.uc-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 26px rgba(212, 175, 55, 0.1);
}

.uc-banner {
    position: relative;
    height: 74px;
    margin: 0 -16px;
    background: linear-gradient(120deg, rgba(30, 58, 138, 0.55), rgba(212, 175, 55, 0.3));
    background-size: cover;
    background-position: center;
}

.uc-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 7, 12, 0.05), rgba(4, 7, 12, 0.55));
}

.uc-role-badge,
.uc-status-badge {
    position: absolute;
    top: 10px;
    z-index: 2;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
}

.uc-role-badge { left: 10px; }
.uc-status-badge { right: 10px; }

.uc-rol-admin { background: rgba(212, 175, 55, 0.2); border: 1px solid var(--gold-metallic); color: var(--gold-light); }
.uc-rol-supervisor { background: rgba(167, 139, 250, 0.18); border: 1px solid #a78bfa; color: #c4b5fd; }
.uc-rol-oficial { background: rgba(96, 165, 250, 0.15); border: 1px solid rgba(96, 165, 250, 0.6); color: #93c5fd; }

.uc-st-activo { background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.6); color: #6ee7b7; }
.uc-st-pendiente { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.6); color: #fcd34d; }
.uc-st-archivado { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.6); color: #fca5a5; }

.uc-avatar-wrap {
    position: relative;
    z-index: 3;
    width: 88px;
    height: 88px;
    margin: -44px auto 0 auto;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--gold-metallic), rgba(212, 175, 55, 0.25));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.uc-avatar-wrap > * {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
}

.uc-body {
    text-align: center;
    padding-top: 10px;
}

.uc-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-primary);
}

.uc-handle {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-top: 2px;
}

.uc-discord {
    font-size: 0.72rem;
    color: #7d8cf5;
    margin-top: 3px;
    font-family: var(--font-code);
}

.uc-rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-metallic);
    font-size: 0.78rem;
    font-weight: 800;
}

.uc-alert-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.uc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 14px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.uc-stat {
    text-align: center;
}

.uc-stat + .uc-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.uc-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
    font-family: var(--font-code);
    color: var(--gold-metallic);
}

.uc-stat span {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ============================================================
   SELECTOR DE UNIDADES CON LOGO
   ============================================================ */
.unit-picker {
    position: relative;
    width: 100%;
}

.unit-picker-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--glass-border);
    background: rgba(4, 7, 10, 0.6);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.unit-picker-btn:hover,
.unit-picker-btn:focus {
    border-color: var(--gold-metallic);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.12);
    outline: none;
}

.unit-picker-logo {
    width: 104px;
    height: 62px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.35);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 2px;
}

.unit-picker-texts {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.unit-picker-texts strong {
    font-size: 1.05rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-picker-texts small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 500;
    max-height: 340px;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid var(--gold-metallic);
    background: rgba(6, 10, 16, 0.97);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6);
}

.unit-picker-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.unit-picker-option:last-child {
    border-bottom: none;
}

.unit-picker-option:hover {
    background: rgba(212, 175, 55, 0.1);
}

.unit-picker-option.selected {
    background: rgba(212, 175, 55, 0.07);
}

.unit-mini-logo {
    width: 48px;
    height: 30px;
    border-radius: 6px;
    object-fit: contain;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 1px;
}

.badge-unit .unit-mini-logo {
    width: 44px;
    height: 27px;
    margin-right: 4px;
}

.badge-unit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-chip .unit-mini-logo {
    margin-right: 4px;
}

/* ============================================================
   PANTALLA "¿QUIÉN ERES?" (identificación sin login)
   ============================================================ */
.auth-question {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.auth-question-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}

.auth-foot-note {
    margin-top: 18px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-foot-note i {
    color: var(--gold-metallic);
    margin-right: 4px;
}

.identify-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    margin-top: 6px;
    border-radius: 14px;
    border: 1px solid var(--gold-metallic);
    background: rgba(6, 10, 16, 0.98);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    max-height: 250px;
    overflow-y: auto;
}

.identify-suggestion {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.identify-suggestion:last-child {
    border-bottom: none;
}

.identify-suggestion:hover {
    background: rgba(212, 175, 55, 0.12);
}

.idsg-name {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.idsg-rank {
    font-size: 0.72rem;
    color: var(--gold-metallic);
    font-family: var(--font-code);
}

/* ============================================================
   PANTALLA DE CARGA (21)
   ============================================================ */
#sre-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(ellipse at bottom, #0d1730 0%, #03060a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.6s ease;
}

#sre-loader.hide {
    opacity: 0;
    pointer-events: none;
}

.sre-loader-badge {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sre-loader-badge img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.45));
    animation: loaderPulse 2s ease-in-out infinite;
}

.sre-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(212, 175, 55, 0.15);
    border-top-color: var(--gold-metallic);
    animation: ringSpin 1.1s linear infinite;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

.sre-loader-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--gold-metallic);
}

.sre-loader-text {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    font-family: var(--font-code);
    animation: loaderPulse 1.6s ease-in-out infinite;
}

/* ============================================================
   SELLO APROBADO / RECHAZADO (22)
   ============================================================ */
#status-stamp {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 99998;
    padding: 18px 44px;
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 6px;
    font-family: var(--font-code);
    border: 6px solid;
    border-radius: 14px;
    background: rgba(4, 7, 10, 0.55);
    backdrop-filter: blur(4px);
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    animation: stampIn 0.45s cubic-bezier(0.22, 1.4, 0.36, 1) both;
    text-transform: uppercase;
}

#status-stamp.stamp-ok {
    color: #34d399;
    border-color: #34d399;
    text-shadow: 0 0 30px rgba(52, 211, 153, 0.6);
    box-shadow: 0 0 60px rgba(52, 211, 153, 0.25);
}

#status-stamp.stamp-bad {
    color: #f87171;
    border-color: #f87171;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.25);
}

@keyframes stampIn {
    0% { transform: translate(-50%, -50%) rotate(-12deg) scale(3); opacity: 0; }
    100% { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; }
}

#status-stamp.stamp-out {
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-12deg) scale(0.85);
}

/* ============================================================
   LOGROS Y NIVELES (12, 13)
   ============================================================ */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid;
    transition: transform 0.2s ease;
}

.achievement-badge:hover {
    transform: translateY(-3px);
}

.achievement-badge i {
    font-size: 1.25rem;
}

.achievement-badge span {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.25;
}

.achievement-badge.earned {
    border-color: rgba(212, 175, 55, 0.55);
    background: linear-gradient(160deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
    color: var(--gold-light);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.12);
}

.achievement-badge.locked {
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    opacity: 0.55;
    filter: grayscale(1);
}

.level-bar-wrap {
    margin-bottom: 4px;
}

.level-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    flex-wrap: wrap;
    gap: 6px;
}

.level-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 14px;
    background: linear-gradient(100deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.08));
    border: 1px solid var(--gold-metallic);
    color: var(--gold-light);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.level-xp {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.level-bar-track {
    height: 9px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.level-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #a8842a, var(--gold-metallic), #f5e7b8);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.5);
    transition: width 0.9s var(--apple-ease, ease);
}

/* ============================================================
   SALÓN DE LA FAMA (14)
   ============================================================ */
.hall-of-fame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.hof-card {
    text-align: center;
    padding: 18px 12px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(170deg, rgba(212, 175, 55, 0.12), rgba(4, 7, 12, 0.6));
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hof-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(212, 175, 55, 0.15);
}

.hof-month {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: var(--gold-metallic);
    margin-bottom: 10px;
    font-family: var(--font-code);
}

.hof-card .avatar-circle-lg {
    margin: 0 auto;
}

.hof-name {
    font-weight: 900;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-top: 10px;
}

.hof-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-code);
}

.hof-points {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--gold-metallic);
    font-family: var(--font-code);
}

/* ============================================================
   ANUNCIOS: entendido + lectores (8)
   ============================================================ */
.annc-ack {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-metallic);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.annc-ack:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.2);
}

.annc-ack.done {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    cursor: default;
}

.annc-readers {
    margin-top: 10px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.annc-readers i {
    color: #34d399;
    margin-right: 4px;
}

.annc-readers-names {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* ============================================================
   MODO MANTENIMIENTO (19)
   ============================================================ */
#maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    background: radial-gradient(ellipse at bottom, #0d1730 0%, #03060a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 30px;
}

#maintenance-overlay img {
    width: 100px;
    filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.4));
}

#maintenance-overlay h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold-metallic);
    letter-spacing: 2px;
}

#maintenance-overlay p {
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
}

#maintenance-overlay .maint-line {
    width: 220px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-metallic), transparent);
    animation: loaderPulse 1.8s ease-in-out infinite;
}

#maintenance-admin-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    padding: 10px 22px;
    border-radius: 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #f87171;
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.uc-tool.uc-gold:hover { color: var(--gold-metallic); border-color: var(--gold-metallic); background: rgba(212, 175, 55, 0.1); }
.uc-tool.uc-purple:hover { color: #a78bfa; border-color: #a78bfa; background: rgba(167, 139, 250, 0.1); }
.uc-tool.uc-blue:hover { color: #60a5fa; border-color: #60a5fa; background: rgba(96, 165, 250, 0.1); }
.uc-tool.uc-warn:hover { color: #f59e0b; border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.uc-tool.uc-green:hover { color: #34d399; border-color: #34d399; background: rgba(52, 211, 153, 0.1); }
.uc-tool.uc-danger:hover { color: #f87171; border-color: #f87171; background: rgba(239, 68, 68, 0.1); }

.btn-link-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link-sm:hover {
    color: var(--gold-metallic);
}

/* --- Búsqueda global --- */
.gs-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gs-result-item:hover {
    background: rgba(212, 175, 55, 0.1);
}

.gs-group-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-metallic);
    font-weight: 800;
    margin: 12px 4px 6px 4px;
}

/* --- Badges LOA / inactividad / oficial del mes --- */
.badge-loa {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid var(--warning-color, #f59e0b);
    color: var(--warning-color, #f59e0b);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
}

.month-officer-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    margin-bottom: 22px;
    border: 1px solid var(--gold-metallic);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.02));
    border-radius: 16px;
}

/* --- Estadísticas: gráficas y deltas --- */
.stats-charts-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-delta {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 4px;
    font-family: var(--font-code);
}

.kpi-delta.up { color: #34d399; }
.kpi-delta.down { color: #f87171; }
.kpi-delta.neutral { color: var(--text-muted); }

/* --- Historial de carrera --- */
.career-entry {
    display: flex;
    gap: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--gold-metallic);
    background: rgba(4, 7, 10, 0.55);
    border-radius: 0 12px 12px 0;
    margin-bottom: 10px;
    align-items: flex-start;
}

.career-entry.sancion { border-left-color: #ef4444; }
.career-entry.medalla { border-left-color: #f59e0b; }
.career-entry.ascenso { border-left-color: #34d399; }

.career-entry-icon { font-size: 1.1rem; margin-top: 2px; }

/* --- Academia --- */
.exam-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.exam-question-row {
    background: rgba(4, 7, 10, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.exam-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.exam-option-label:hover {
    border-color: var(--gold-metallic);
    color: var(--text-primary);
}

/* --- Evidencias múltiples --- */
.evidence-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.evidence-thumb-wrap {
    position: relative;
}

.evidence-thumb-wrap img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--gold-metallic);
}

.evidence-thumb-remove {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger-color, #ef4444);
    color: #fff;
    border: none;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    font-size: 0.8rem;
}

/* --- Motivo de rechazo --- */
.reject-reason-box {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #fca5a5;
}

/* --- Botón "Mostrar más" (paginación) --- */
.btn-show-more {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-show-more:hover {
    border-color: var(--gold-metallic);
    color: var(--gold-metallic);
}

/* --- Responsive móvil --- */
@media (max-width: 860px) {
    .navbar {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }

    .nav-user-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tabs-nav .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

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

    .grid-2,
    .grid-3,
    .stats-kpi-row,
    .stats-charts-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-box {
        max-width: 95vw !important;
        max-height: 92vh;
        overflow-y: auto;
    }

    .notif-dropdown {
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    .main-container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .search-filter-bar {
        flex-direction: column;
    }
}

/* --- Layout de 3 columnas (condecoraciones | contenido | anuncios) --- */
.officer-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.officer-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.officer-main {
    min-width: 0;
}

.sidebar-card {
    padding: 18px;
}

.sidebar-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold-metallic);
    font-weight: 800;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Oficial del mes en vertical dentro de la barra lateral */
.officer-sidebar .month-officer-banner {
    flex-direction: column;
    text-align: center;
    margin-bottom: 0;
    gap: 10px;
}

.award-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.award-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.award-item .award-icon {
    font-size: 1.1rem;
    margin-top: 1px;
}

.award-item .award-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.award-item .award-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.35;
}

.award-item .award-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-top: 3px;
}

.announcement-item {
    padding: 12px 14px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    margin-bottom: 10px;
}

.announcement-item h5 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--gold-light);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.announcement-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.announcement-item .annc-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-top: 8px;
}

.annc-delete-btn {
    background: none;
    border: none;
    color: var(--danger-color, #ef4444);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
}

@media (max-width: 1280px) {
    .officer-layout {
        grid-template-columns: 1fr;
    }

    .officer-sidebar {
        position: static;
    }

    .officer-main { order: 1; }
    #sidebar-announcements { order: 2; }
    #sidebar-awards { order: 3; }

    .officer-sidebar .month-officer-banner {
        flex-direction: row;
        text-align: left;
    }
}

.stepper-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
    padding: 0 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(4, 7, 12, 0.95);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 800;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.4s ease;
}

.step-line {
    flex: 1;
    height: 2.5px;
    background: var(--glass-border);
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
}

.step-item.active .step-circle {
    border-color: var(--gold-metallic);
    color: var(--gold-metallic);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(212, 175, 55, 0.18);
}

.step-item.active .step-label {
    color: var(--gold-light);
    text-shadow: 0 0 5px rgba(254, 240, 138, 0.3);
}

.step-item.completed .step-circle {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.18);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.step-item.completed .step-label {
    color: #22c55e;
}

.step-line.active {
    background: var(--gold-metallic);
    box-shadow: 0 0 5px var(--gold-glow);
}

.step-line.completed {
    background: #22c55e;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.2);
}

.discord-connect-box {
    text-align: center;
    padding: 24px;
    background: rgba(88, 101, 242, 0.08);
    border: 1.5px solid rgba(88, 101, 242, 0.25);
    border-radius: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.discord-connect-box:hover {
    border-color: rgba(88, 101, 242, 0.45);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.15);
}

.btn-discord {
    background: #5865F2;
    color: #fff;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 12px;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.btn-discord:active {
    transform: translateY(1px);
}

.btn-discord:disabled {
    background: rgba(88, 101, 242, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status-indicator-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #0a101a;
    z-index: 5;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.status-online {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-online::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: ripple-green 2.5s infinite ease-out;
    pointer-events: none;
    box-sizing: border-box;
}

.status-patrolling {
    background-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.status-patrolling::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border-radius: 50%;
    border: 2.5px solid #3b82f6;
    animation: ripple-blue 1.5s infinite ease-out;
    pointer-events: none;
    box-sizing: border-box;
}

.status-offline {
    background-color: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.4);
}

@keyframes ripple-green {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes ripple-blue {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    100% {
        transform: scale(3.0);
        opacity: 0;
    }
}

.uc-avatar-wrap > .status-indicator-badge {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
}
