/* Centro Baki - Estilos Principales */

/* Material Icons Configuration */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Base Typography */
body {
    font-family: 'Manrope', sans-serif;
    background-color: #f7f5ef;
    overflow-x: hidden;
}

html {
    font-size: 16px;
}

html.ui-scale-90 {
    font-size: 90%;
}

html.ui-scale-100 {
    font-size: 100%;
}

html.ui-scale-110 {
    font-size: 110%;
}

html.ui-scale-120 {
    font-size: 120%;
}

h1, h2, h3, .font-headline {
    font-family: 'Noto Serif', serif;
}

.font-label {
    font-family: 'Manrope', sans-serif;
}

.font-serif {
    font-family: 'Noto Serif', serif;
}

/* Scrollbar Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Custom Scrollbar for tables */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #ebe7dd;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c9c3b5;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #3f7824;
}

/* Sidebar: icono + etiqueta debajo */
.sidebar-nav-icon {
    font-size: 2.125rem;
    line-height: 1;
}

.sidebar-logo-block {
    flex-shrink: 0;
    padding-bottom: 0.75rem;
}

.app-logo {
    display: block;
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
    object-position: center;
    border-radius: 1rem;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.app-logo--login {
    width: 7rem;
    height: 7rem;
    margin-left: auto;
    margin-right: auto;
}

.sidebar-menu-block {
    margin-top: 2.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #ddd8cc;
}

.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid #ddd8cc;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.sidebar-brand-tag {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c574f;
}

.sidebar-nav-list {
    padding-top: 0.5rem;
}

.sidebar-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.125rem;
    border-radius: 0.875rem;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.875rem;
    height: 3.875rem;
    border-radius: 0.875rem;
    background-color: transparent;
    color: #3f3b36;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.2;
    color: #5c574f;
    max-width: 100%;
    padding: 0 0.125rem;
    transition: color 0.15s ease;
}

/* Hover: fondo gris muy claro, icono gris oscuro */
.sidebar-nav-link:hover .sidebar-nav-item,
.sidebar-nav-link:focus-visible .sidebar-nav-item {
    background-color: #f3f1ea;
    color: #2f2c28;
}

.sidebar-nav-link:hover .sidebar-nav-label,
.sidebar-nav-link:focus-visible .sidebar-nav-label {
    color: #2f2c28;
}

/* Activo: solo la sección actual — verde sólido + icono blanco */
.sidebar-nav-link--active .sidebar-nav-item {
    background-color: #3f7824;
    color: #ffffff;
}

.sidebar-nav-link--active .sidebar-nav-label {
    color: #3f7824;
}

.sidebar-nav-link--active:hover .sidebar-nav-item,
.sidebar-nav-link--active:focus-visible .sidebar-nav-item {
    background-color: #468a28;
    color: #ffffff;
}

.sidebar-nav-link--active:hover .sidebar-nav-label,
.sidebar-nav-link--active:focus-visible .sidebar-nav-label {
    color: #3f7824;
}

/* Tablet Optimizations */
@media (hover: none) and (pointer: coarse) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    button, 
    a,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* HTMX Loading States */
.htmx-loading {
    opacity: 0.6;
    pointer-events: none;
}

.htmx-request {
    position: relative;
}

.htmx-request::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ebe7dd;
    border-top-color: #3f7824;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Card Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Form Focus States */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 91, 63, 0.14);
}

/* Sidebar Active State */
.nav-item.active {
    background-color: rgba(63, 120, 36, 0.14);
    color: #3f7824;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #ffedd5;
    color: #c2410c;
}

.badge-error {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    line-height: 1.1;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: #3f7824;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(47, 91, 63, 0.15);
}

.btn-primary:hover {
    background: #4d922c;
}

.btn-secondary {
    background: #ebe7dd;
    color: #5e6862;
}

.btn-secondary:hover {
    background: #f1efe7;
    color: #101412;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid #ddd8cc;
    background: #f5f3ec;
    font-weight: 600;
    font-size: 0.875rem;
    color: #101412;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

input[type="checkbox"].form-control {
    width: 1rem;
    height: 1rem;
    padding: 0;
    border-radius: 0.25rem;
    background: #ffffff;
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("/static/img/login-bg.png");
    background-size: cover;
    background-position: center;
    filter: blur(14px);
    transform: scale(1.06);
    z-index: -2;
}

.login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: -1;
}

.progress-width {
    width: var(--progress, 0%);
}

details summary::-webkit-details-marker {
    display: none;
}

details summary {
    list-style: none;
}

.ui-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid #ddd8cc;
    background: #f5f3ec;
    font-weight: 600;
    font-size: 0.875rem;
    color: #101412;
}

.ui-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 91, 63, 0.14);
}
