:root {
    --bg-color: #0a0e1a;
    --card-bg: #1a1f35;
    --text-color: #f8fafc;
    --muted-color: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --border-color: #2d3548;
    --gradient-start: #6366f1;
    --gradient-end: #8b5cf6;
}

/* Loading State */
html.app-loading body {
    visibility: hidden;
    opacity: 0;
}

html.app-loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;
    z-index: 9999;
}

html.app-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    z-index: 10000;
}

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

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
}

/* Page Specific Body Styles */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 50%, #1a1f35 100%);
    position: relative;
    position: relative;
    overflow-y: auto;
    /* Allow scrolling if content is tall */
    overflow-x: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: pulse 8s ease-in-out infinite;
}

body.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

body.dashboard-page {
    margin-top: 5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
}

/* Common Components */
.btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.4);
}

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

/* Login Page Styles */
.login-card {
    background: rgba(26, 31, 53, 0.8);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--muted-color);
    margin: 0;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-color);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(10, 14, 26, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted-color);
}

.footer-text a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Dashboard Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.welcome-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    color: var(--muted-color);
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
}

.card-grid {
    display: grid;
    /* First card takes 2x space of others */
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
        /* 2x2 grid on tablets */
    }

    .card:first-child {
        grid-column: span 2;
        /* Make first card span full width on tablets if desired, or just simple grid */
    }
}

@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .card:first-child {
        grid-column: span 1;
    }
}

.card {
    background: rgba(26, 31, 53, 0.6);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--muted-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.card .value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-logout {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-logout:hover {
    background-color: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-top: 100px;
    /* Space for floating glass navbar */
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
        margin: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

/* Priority Badges */
.priority-media {
    color: #f59e0b !important;
}

.priority-alta {
    color: #ef4444 !important;
    font-weight: 700;
}

.priority-baja {
    color: #10b981 !important;
}