:root {
    /* Paleta de colores */
    --color-primary: #402EB6;
    --color-background: #F4F6F5;
    --color-primary-transparent: #402eb61b;
    --color-fields: #E8F0FD;
    --color-add: #45A049;
    --color-add-hover: #377b3a;

    /* Color de texto sugerido para contraste */
    --color-text-on-primary: #FFFFFF;
    --color-text-main: #2D3436;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../media/fonts/Montserrat-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@media (max-width:480px) {

    /* PARA MOVILES*/
    .container {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width:768px) {

    /* PARA TABLETS*/
    .container {
        flex-direction: row;
    }
}

@media (max-width:1024px) {

    /* PARA PORTATILES*/
    .container {
        max-width: 1200px;
        margin: auto;
    }
}

@media (max-width:1200px) {

    /* PARA PC´S*/
    .container {
        display: flex;
        flex-direction: column;
    }
}

/* --- CONTENEDOR PRINCIPAL ESTANDARIZADO --- */
.main-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 3rem;
    width: 100%;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    padding: 20px 3rem;
    align-items: center;
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger-menu svg {
    width: 32px;
    height: 32px;
    fill: white;
}

body {
    font-family: 'Montserrat', sans-serif;
}

nav {
    background: var(--surface);
    padding: 0 3rem;
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    transition: all 0.3s ease-in-out;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 60px;
}

nav button {
    background: transparent;
    border: none;
    padding: 0 1.5rem;
    height: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
}

nav button:hover {
    color: var(--color-primary);
    background: #f8f9ff;
    transform: none;
    box-shadow: none;
}

.actual-page {
    color: var(--color-primary) !important;
    border-bottom: 3px solid var(--color-primary) !important;
    background: #f1f4ff !important;
    font-weight: 700 !important;
    cursor: default;
    box-shadow: none !important;
}

.logo-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;

    transition: transform 0.2s linear, box-shadow 0.2s linear, background-color 0.2s linear;
}

.logo-logout:hover {
    transform: scale(1.1);
    /* Reedimensión */
}

.logout-mobile {
    display: none !important;
}

.logo-logout:active {
    transform: scale(1.05);
}


/* Contenedor del formulario con transición */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background-color: #f9f9f9;
    padding: 0 20px;
    border: 1px solid transparent;
    margin: 0;
    border-radius: 5px;

    /* Transición suave de todas las propiedades */
    transition: all 0.4s ease-in-out;
}

/* Clase que se añade mediante JS para mostrar el contenido */
.collapsible-content.show {
    max-height: 800px;
    opacity: 1;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #ddd;
}

/* El resto de estilos se mantienen igual */
.btn-toggle {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    width: 200px;
    justify-content: space-between;
    margin: 2px 0;
}

.btn-toggle:hover {
    background-color: #332591;
}

.btn-toggle img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.btn-toggle.active {
    background-color: #666;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.table-showphp {
    border-collapse: collapse;
    margin-top: 20px;
    width: 60%;
    margin: auto;
}

.table-showphp th,
.table-showphp td {
    border: 2px solid #0c0c0c;
    padding: 8px;
    text-align: left;
    text-align: center;
    font-size: larger;
}

.table-showphp th {
    background-color: #402eb665;
}

/* DISEÑO DE ALERTAS (ERROR Y ÉXITO) */
.error,
.success {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    border-left: 6px solid;
    /* Barra lateral para dar énfasis */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    /* Sombra suave */
}

/* Variante para Error */
.error {
    background-color: #ffe6e6;
    /* Fondo rojo muy suave */
    color: #cc0000;
    /* Texto rojo fuerte */
    border-color: #ff4d4d;
    /* Barra lateral roja */
}

/* Variante para Éxito */
.success {
    background-color: #e6ffed;
    /* Fondo verde muy suave */
    color: #006622;
    /* Texto verde fuerte */
    border-color: #28a745;
    /* Barra lateral verde */
}

/* ESTILO BASE PARA BOTONES DE ACCIÓN EN TABLAS */
.btn-edit,
.btn-delete,
.btn-assign {
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.95em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s linear;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
    margin: 2px 0;
}

#btn-save {

    background-color: #402EB6;
}

/* BOTÓN EDITAR (AZUL) */
.btn-edit {
    background-color: #402EB6;
}

.btn-edit:hover {
    background-color: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* BOTÓN ASIGNAR (VERDE) */
.btn-assign {
    background-color: #27ae60;
}

.btn-assign:hover {
    background-color: #1e8e4e;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* BOTÓN ELIMINAR (ROJO) */
.btn-delete {
    background-color: #ff4d4d;
}

.btn-delete:hover {
    background-color: #d93636;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.report-main {
    display: flex;
    text-align: center;
}

.report-div {
    background-color: var(--color-background);
    padding: 20px;
    display: grid;
    grid-template-columns: auto;
    border: 1px solid black;
    width: 50%;
    margin: auto;
    margin-top: 30px;
}

.label-year,
.label-month {
    padding-bottom: 30px;
    display: block;
    margin: auto;
    width: 100%;
}

.status-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    border-left: 6px solid;
    /* Borde lateral */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: white;

    /* Animación */
    max-height: 0;
    /* colapsado */
    opacity: 0;
    transform: translateY(-10px);
    overflow: hidden;
    /* evitar que el contenido sobresalga */
    transition: max-height 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

/* Fondo según estado */
.status-message.vacation {
    background-color: #3498db;
    /* azul */
    border-color: #2980b9;
}

.status-message.absent {
    background-color: #7f8c8d;
    /* gris */
    border-color: #5f6a6a;
}

/* Clase para mostrar el mensaje */
.status-message.show {
    max-height: 200px;
    /* suficiente para el contenido */
    opacity: 1;
    transform: translateY(0);
}

table {
    border-collapse: collapse;
}

table,
th,
td {
    border: 1px solid #000;
    padding: 5px;
}

.report-div button {
    display: flex;
    justify-content: center;
    width: 30vw;
    color: white;
    border: none;
    font-size: 0.95em;
    height: 6vh;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s linear;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #3498db;
}

.report-div button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* CONTENEDOR VIRTUAL PARA TABLAS GRANDES */
#workTable {
    width: 100%;
}

@media (max-width: 768px) {
    #workTable {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    #workTable td:last-child {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    #workTable button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .comment-input {
        width: 100%;
        margin-bottom: 5px;
    }

    .comment-form button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 1.5rem;
    }

    .hamburger-menu {
        display: block;
    }

    nav {
        display: none;
        /* Oculto por defecto */
        flex-direction: column;
        padding: 0;
        border-bottom: none;
    }

    nav.show-mobile {
        display: flex;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }

    nav a {
        width: 100%;
        height: auto;
    }

    nav a button {
        width: 100%;
        padding: 20px;
        justify-content: flex-start;
        border-bottom: 1px solid #e2e8f0;
    }

    .logout-mobile {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 20px 1.5rem;
        width: 100%;
        box-sizing: border-box;
        color: #c53030;
        font-weight: 700;
        text-decoration: none;
        background: #fff5f5;
        border-top: 1px solid #fed7d7;
        transition: background 0.2s;
    }

    .logout-mobile:hover {
        background: #fee2e2;
    }

    .logout-mobile img {
        width: 24px;
        filter: invert(24%) sepia(91%) saturate(6445%) hue-rotate(352deg) brightness(97%) contrast(92%);
    }

    /* Ocultar logout del header en móvil */
    header .header-right a[href*="logout.php"] {
        display: none !important;
    }

    .btn-toggle {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 1.05rem;
    }
}


/* ===============================
   BOTONES TYPE="SUBMIT"
   =============================== */
button[type="submit"],
.formAddBtn {
    background-color: var(--color-add);
    /* verde añadir */
    color: var(--color-text-on-primary);
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Hover / efecto visual */
button[type="submit"]:hover,
.formAddBtn:hover {
    background-color: var(--color-add-hover);
    /* un poco más oscuro */
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Presionado */
button[type="submit"]:active,
.formAddBtn:active {
    transform: scale(0.98);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* Deshabilitado */
button[type="submit"]:disabled,
.formAddBtn:disabled {
    background-color: #ccc;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===============================
   BOTONES RESPONSIVE (MÓVIL)
   =============================== */
@media (max-width: 768px) {

    button[type="submit"],
    .formAddBtn {
        width: 100%;
        /* ocupar todo el ancho */
        font-size: 1.05rem;
        padding: 14px;
    }
}

.login-form {
    max-width: 500px;
    /* ancho máximo del formulario */
    margin: 0 auto;
}

.login-fields {
    display: flex;
    align-items: center;
    gap: 15px;
    /* espacio entre inputs y botón */
    flex-wrap: wrap;
    /* para que en móviles los inputs se apilen */
}

.form-group {
    flex: 1;
    /* ocupa todo el espacio disponible */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.iniciar-icon {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.iniciar-icon:hover {
    transform: scale(1.1);
}

/* Responsive: en móviles el botón va debajo de los inputs */
@media (max-width: 480px) {
    .login-fields {
        flex-direction: column;
        gap: 12px;
    }

    .login-button {
        justify-content: flex-start;
    }
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /* ← separación clara entre texto y SVG */
}

@media (max-width: 768px) {
    .btn-toggle {
        width: 100%;
        justify-content: center;
        gap: 12px;
        /* un poco más de aire en móvil */
        padding: 14px;
        font-size: 1.05rem;
    }

    .btn-toggle img {
        width: 22px;
        /* tamaño consistente */
        height: 22px;
    }
}
/* ── PANEL DE PROYECTOS ─────────────────────────────────── */
.projects-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    overflow: hidden;
}
 
.projects-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left;
    border-bottom: 1px solid transparent;
    transition: background .15s;
}
.projects-toggle:hover { background: #f8f9ff; }
.projects-toggle.open  { border-bottom-color: #e2e8f0; }
 
.projects-toggle-count {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: 2px;
}
.projects-toggle-arrow { margin-left: auto; font-size: 1rem; transition: transform .25s; }
.projects-toggle-arrow.rotated { transform: rotate(-180deg); }
 
/* lista colapsable */
.projects-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.projects-list.open { max-height: 1000px; }
 
/* ── ITEM DE PROYECTO ───────────────────────────────────── */
.proj-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f4f8;
    transition: background .15s;
}
.proj-item:last-child { border-bottom: none; }
.proj-item:hover { background: #fafbff; }
 
.proj-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
 
.proj-item-info { display: flex; flex-direction: column; gap: 2px; }
.proj-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}
.proj-client {
    font-size: 0.78rem;
    color: var(--text-muted);
}
 
.proj-item-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}
 
.proj-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}
.proj-status.done    { background: #dcfce7; color: #166534; }
.proj-status.pending { background: #fef3c7; color: #92400e; }
.proj-status.neutral { background: #f1f5f9; color: #64748b; }
 
.proj-deadline {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
}
.proj-deadline.urgent { color: #dc2626; font-weight: 700; }
 
/* barra de progreso */
.proj-progress-bar-wrap {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.proj-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
}
.proj-progress-bar--done     { background: #22c55e; }
.proj-progress-bar--progress { background: #3b82f6; }
.proj-progress-bar--pending  { background: #f59e0b; }
.proj-progress-bar--neutral  { background: #94a3b8; }
.proj-progress-label {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}
 
/* botón quick add */
.proj-quick-add {
    align-self: flex-start;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
    margin-top: 2px;
}
.proj-quick-add:hover { background: #302296; transform: translateY(-1px); }
 
@media (max-width: 640px) {
    .proj-item-main { flex-direction: column; }
    .proj-item-stats { align-items: flex-start; text-align: left; }
}