:root {
    --bg: #eef4f8;
    --bg-accent: #dbe8f2;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-muted: #f4f8fb;
    --border: rgba(96, 125, 139, 0.18);
    --shadow: 0 18px 50px rgba(24, 43, 58, 0.08);
    --primary: #1f6f78;
    --primary-dark: #18575e;
    --primary-soft: #d7eef0;
    --text-dark: #19313d;
    --text-light: #5f7480;
    --danger: #c84f5a;
    --danger-dark: #a53d47;
    --celeste: #0ea5e9;
    --verde: #22c55e;
    --amarillo: #f59e0b;
    --rojo: #ef4444;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
        radial-gradient(circle at top right, rgba(215, 238, 240, 0.9), transparent 32%),
        linear-gradient(180deg, var(--bg) 0%, #f7fafc 100%);
    color: var(--text-dark);
    margin: 0;
    min-height: 100vh;
    padding: 28px 18px 48px;
    line-height: 1.5;
    position: relative;
}

.page-shell {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(140deg, rgba(31, 111, 120, 0.04), transparent 35%),
        linear-gradient(320deg, rgba(217, 188, 143, 0.08), transparent 40%);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header,
.filters-container,
.okr-card,
.global-progress-wrapper,
.admin-panel {
    backdrop-filter: blur(12px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px 28px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}

.brand h1 {
    margin: 0 0 6px;
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.1rem);
    letter-spacing: -0.03em;
    color: #14313b;
}

.brand p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-box {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.auth-box input,
.filter-group select,
.auth-box button,
.btn-clear,
.page-btn,
.custom-file-upload {
    transition: 0.22s ease;
}

.auth-box input,
.filter-group select {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    font-size: 0.92rem;
    outline: none;
    line-height: 1.2;
}

.auth-box input:focus,
.filter-group select:focus {
    border-color: rgba(31, 111, 120, 0.45);
    box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.12);
}

.auth-box button,
.btn-clear,
.custom-file-upload {
    min-height: 44px;
    border: none;
    border-radius: 14px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.auth-box button,
.custom-file-upload {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(31, 111, 120, 0.2);
}

.auth-box button:hover,
.custom-file-upload:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
}

.admin-panel {
    display: none;
    background: linear-gradient(135deg, rgba(215, 238, 240, 0.72), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(31, 111, 120, 0.2);
    padding: 20px 22px;
    margin-bottom: 22px;
    border-radius: 22px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.25s ease;
}

.admin-panel h3,
.global-info h3,
.okr-card h2 {
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-panel h3 {
    margin: 0 0 5px;
    color: #153842;
    font-size: 1.4rem;
}

.admin-panel p {
    margin: 0 0 16px;
    color: var(--text-light);
}

#excel-upload {
    display: none;
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    justify-content: center;
    gap: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    align-items: end;
}

.filter-group {
    min-width: 0;
    width: 100%;
}

.filter-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-clear {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #17333d;
    color: white;
    margin-top: 4px;
    text-align: center;
}

.filter-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 38px;
}

.btn-clear:hover {
    background: #10242b;
}

.global-progress-container {
    margin-bottom: 20px;
}

.global-progress-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.global-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.global-info h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #23404c;
}

.progress-stat {
    font-weight: 800;
    font-size: 1.15rem;
}

.progress-track {
    height: 18px;
    background-color: #e6edf2;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}

#global-progress-bar,
#filtered-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 1rem 1rem;
}

.okr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 22px;
}

.okr-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 252, 253, 0.92));
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(96, 125, 139, 0.15);
    box-shadow: var(--shadow);
}

.okr-card small {
    color: var(--text-light);
}

.kr-item {
    margin-bottom: 14px;
    padding: 15px;
    background: var(--surface-muted);
    border-radius: 16px;
    border-left: 6px solid #cbd5e1;
}

.progress-bg {
    background: #dfe8ee;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 999px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 34px 0 0;
    padding: 20px;
}

.site-footer {
    margin-top: 34px;
    padding-bottom: 10px;
}

.site-footer__content,
.legal-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.site-footer__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.site-footer__content p,
.legal-meta,
.legal-lead,
.legal-section p,
.legal-section li {
    color: var(--text-light);
}

.site-footer__content p {
    margin: 0;
    font-size: 0.92rem;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.site-footer__links a,
.legal-back {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.site-footer__links a:hover,
.legal-back:hover {
    text-decoration: underline;
}

.legal-page {
    padding-top: 36px;
}

.legal-shell {
    max-width: 940px;
    margin: 0 auto;
    padding: 32px;
}

.legal-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.legal-header h1 {
    margin: 0;
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #14313b;
    letter-spacing: -0.03em;
}

.legal-meta {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.legal-lead {
    margin: 0;
    font-size: 1rem;
}

.legal-section + .legal-section {
    margin-top: 24px;
}

.legal-section h2 {
    margin: 0 0 10px;
    font-family: 'Merriweather', serif;
    font-style: italic;
    color: #153842;
    font-size: 1.35rem;
}

.legal-section p,
.legal-section ul {
    margin: 0;
    font-size: 0.98rem;
}

.legal-section ul {
    padding-left: 20px;
}

.legal-section li + li {
    margin-top: 8px;
}

.legal-contact {
    color: var(--primary-dark);
    font-weight: 700;
}

.page-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-dark);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.page-btn:hover:not(:disabled) {
    background: #f6fafc;
    border-color: rgba(31, 111, 120, 0.4);
    transform: translateY(-1px);
}

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

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

.page-info {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 15px;
}

.btn-logout {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%) !important;
    box-shadow: 0 10px 20px rgba(200, 79, 90, 0.18);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 250, 252, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #dce6ec;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-overlay p {
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
}

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-box {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    body {
        padding: 18px 12px 36px;
    }

    .header,
    .filters-container,
    .okr-card,
    .global-progress-wrapper,
    .admin-panel {
        border-radius: 18px;
    }

    .header,
    .okr-card,
    .global-progress-wrapper,
    .admin-panel {
        padding: 18px;
    }

    .auth-box {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-container {
        grid-template-columns: 1fr;
    }

    .global-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer__content,
    .legal-shell {
        border-radius: 18px;
    }

    .site-footer__content,
    .legal-shell {
        padding: 18px;
    }

    .site-footer__content {
        flex-direction: column;
        align-items: flex-start;
    }

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