:root {
    --color-success: #10B981;
    /* Emerald-500 */
    --color-warning: #F59E0B;
    /* Amber-500 */
    --color-critical: #EF4444;
    /* Red-500 */
    --color-info: #3B82F6;
    /* Blue-500 */
    --bg-app: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

/* Desactivar scroll anchoring para evitar saltos en paginación */
#content-area {
    overflow-anchor: none;
}

/* — News Section Focus Overlay — */
.news-focus-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.news-focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.news-focus-target {
    position: relative;
    z-index: 95;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.news-section-animate {
    animation: fadeSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* — Icon Bounce Animation — */
@keyframes icon-wiggle {

    0%,
    100% {
        transform: rotate(-6deg);
    }

    50% {
        transform: rotate(6deg);
    }
}

.group:hover .icon-animate {
    animation: icon-wiggle 0.4s ease-in-out infinite;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Login Grid Pattern */
.bg-grid-pattern {
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Timeline Custom Styles */
.timeline-line {
    position: relative;
}

.timeline-line::before {
    content: '';
    position: absolute;
    top: 2rem;
    bottom: 0;
    left: 24px;
    /* Centrado respecto al icono */
    width: 2px;
    background: #E2E8F0;
    z-index: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
}


.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gradient-text {
    background: linear-gradient(135deg, #0f172a 0%, #334155 50%, #0f172a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.menu-btn {
    width: 100%;
    height: 2.75rem;
    padding: 0 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-btn:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    color: white;
}

.menu-btn.active {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
    color: #FCA5A5;
    border-left-color: #EF4444;
    box-shadow: none;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}



.cursor-wait {
    cursor: wait;
    opacity: 0.7;
    pointer-events: none;
}

/* Estilos adicionales para inputs */
.input {
    width: 100%;
    padding: 0.75rem;
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 0.75rem;
    outline: none;
}

.input:focus {
    border-color: #EF4444;
}

/* --- APPLE STAGGERED FADE-IN --- */
@keyframes staggerUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.stagger-item {
    opacity: 0;
    animation: staggerUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.12s;
}

.stagger-3 {
    animation-delay: 0.19s;
}

.stagger-4 {
    animation-delay: 0.26s;
}

.stagger-5 {
    animation-delay: 0.33s;
}

/* --- SUBMIT BUTTON SHIMMER --- */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.btn-shimmer {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.15) 50%,
            transparent 60%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* --- FLOATING LABELS + INPUT ICONS --- */
.float-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.input-float {
    width: 100%;
    padding: 22px 14px 8px 42px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 0.75rem;
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.2s, background 0.2s;
}

.input-float:focus {
    border-color: #0f172a;
    background: #fff;
}

.float-label {
    position: absolute;
    left: 42px;
    top: 16px;
    font-size: 0.875rem;
    color: #475569;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

select.input-float:not(.filled)~.float-label {
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: normal;
    text-transform: none;
}

.input-float:focus~.float-label,
.input-float:not(:placeholder-shown)~.float-label,
.input-float.filled~.float-label,
.float-label-active {
    top: 5px;
    transform: none;
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.input-float.input-textarea {
    min-height: 8rem;
    resize: vertical;
}

.float-group:has(.input-textarea) .input-icon {
    top: 17px;
    transform: none;
}

.float-group:focus-within .input-icon {
    color: #0f172a;
}

/* --- DROP ZONE --- */
.drop-zone {
    border: 2px dashed #E2E8F0;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drop-zone:hover {
    border-color: #94A3B8;
    background: #F8FAFC;
}

.drop-zone.drag-over {
    border-color: #0f172a;
    background: #F1F5F9;
    transform: scale(1.02);
}

.drop-zone.file-attached {
    border-style: solid;
    border-color: #10B981;
    background: #F0FDF4;
}

.btn-primary {
    background-color: #111827;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
}

.btn-sec {
    color: #94A3B8;
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toast Styles */
.toast-enter {
    animation: slideInRight 0.3s ease-out forwards;
}

.toast-leave {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Live Status Indicator */
.status-live {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Premium KPI Card Hover */
.kpi-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
    /* Sombra más suave */
}

/* --- PAPELERÍA: APPLE STORE STYLE & INTERACTIONS --- */
/* Smart Search Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    /* Slate-900 with high opacity */
    backdrop-filter: blur(8px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-active .search-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Flying Icon Animation */
.flying-icon {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 1;
}

.flying-icon.fly-end {
    opacity: 0;
    transform: scale(0.2);
}

/* Minimalist Card Styles */
.product-card-minimal {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    /* rounded-2xl */
    overflow: hidden;
    border: 1px solid #F1F5F9;
    /* slate-100 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card-minimal:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.product-actions {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
}

.product-card-minimal:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: always show actions */
@media (max-width: 768px) {
    .product-actions {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MORPH VIEW TRANSITION --- */
@keyframes morphOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: scale(0.98) translateY(8px);
        filter: blur(2px);
    }
}

@keyframes morphIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(-8px);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.morph-out {
    animation: morphOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.morph-in {
    animation: morphIn 0.35s cubic-bezier(0, 0, 0.2, 1) forwards;
}

/* --- CARD TILT 3D --- */
.tilt-card {
    perspective: 800px;
    transform-style: preserve-3d;
}

.tilt-card-inner {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* --- COUNTER ANIMATION --- */
.count-up {
    display: inline-block;
}

/* ═══════════════════════════════════════════ */
/* NEWS FEED — Twitter/X Style               */
/* ═══════════════════════════════════════════ */

/* Post Card */
.news-post {
    transition: background-color 0.15s ease;
}

/* Media Container */
.news-media-container {
    transition: opacity 0.15s ease;
}

.news-media-container:hover {
    opacity: 0.92;
}

/* Reaction Button */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.reaction-btn:hover {
    background: #f1f5f9;
    transform: scale(1.08);
}

.reaction-btn.reaction-active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.reaction-count {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    min-width: 12px;
    text-align: center;
}

.reaction-btn.reaction-active .reaction-count {
    color: #3b82f6;
}

.reaction-emoji {
    font-size: 16px;
    line-height: 1;
}

@keyframes reactionPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.reaction-pop .reaction-emoji {
    animation: reactionPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════ */
/* INCIDENCIAS MODULE                         */
/* ═══════════════════════════════════════════ */

/* Autocomplete Dropdown */
.incidencia-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.incidencia-autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.incidencia-autocomplete-item:hover {
    background: #f1f5f9;
}

.incidencia-autocomplete-item .ac-area {
    font-size: 0.7rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.incidencia-autocomplete-item:hover .ac-area {
    background: #e2e8f0;
}

/* Day-of-week Checkboxes */
.inc-day-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inc-day-check {
    display: none;
}

.inc-day-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    letter-spacing: 0.05em;
}

.inc-day-label:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.inc-day-check:checked + .inc-day-label {
    background: #0f172a;
    border-color: #0f172a;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.25);
    transform: scale(1.05);
}

/* Motivo Radio Buttons */
.inc-motivo-radio {
    display: none;
}

.inc-motivo-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.inc-motivo-label:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.inc-motivo-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.inc-motivo-label:has(.inc-motivo-radio:checked) {
    border-color: #0f172a;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
}

.inc-motivo-label:has(.inc-motivo-radio:checked) .inc-motivo-dot {
    border-color: #0f172a;
    background: #0f172a;
}

.inc-motivo-label:has(.inc-motivo-radio:checked) .inc-motivo-dot::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px;
    background: white;
    border-radius: 50%;
}

/* Conditional Fields */
.inc-conditional {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease,
                margin 0.25s ease;
    margin-top: 0;
}

.inc-conditional.active {
    max-height: 200px;
    opacity: 1;
    margin-top: 12px;
}

/* Incidencia Status Badge */
.inc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inc-status-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.inc-status-aprobada {
    background: #d1fae5;
    color: #065f46;
}

.inc-status-rechazada {
    background: #fee2e2;
    color: #991b1b;
}