:root {
    --azul-primario: #2563eb;
    --azul-oscuro: #1d4ed8;
    --verde: #16a34a;
    --rojo: #dc2626;
    --gris-fondo: #f4f6f9;
    --gris-borde: #e2e8f0;
    --gris-texto: #475569;
    --texto-oscuro: #1e293b;
    --blanco: #ffffff;
    --radio: 10px;
    --sombra: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%) !important;
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1e293b;
}

/* Opcional: Para darle un toque más limpio a la barra superior */
/* Opcional: Para agregar en el <style> de index.php */
.header-principal, header {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #bae6fd;
}

/* Sombra suave para el panel de reportes y la tabla */
div[style*="background: #ffffff"], table {
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.1), 0 8px 10px -6px rgba(14, 165, 233, 0.05) !important;
    border-radius: 10px;
}

/* ---------- Login ---------- */
.pagina-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #f4f6f9 100%);
}

.tarjeta-login {
    background: var(--blanco);
    padding: 40px;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    width: 100%;
    max-width: 380px;
}

.tarjeta-login h1 {
    font-size: 22px;
    margin: 0 0 4px;
    text-align: center;
}

.subtitulo {
    text-align: center;
    color: var(--gris-texto);
    margin-bottom: 24px;
    font-size: 14px;
}

.ayuda-credenciales {
    margin-top: 20px;
    padding: 12px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--gris-texto);
    line-height: 1.6;
}

.ayuda-credenciales code {
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
}

/* ---------- Barra superior ---------- */
.barra-superior {
    background: var(--blanco);
    border-bottom: 1px solid var(--gris-borde);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.marca {
    font-weight: 700;
    font-size: 18px;
}

.info-usuario {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.etiqueta-rol {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.rol-admin { background: #dcfce7; color: #166534; }
.rol-vista { background: #e0e7ff; color: #3730a3; }

/* ---------- Contenedores ---------- */
.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px;
}

.contenedor-formulario {
    max-width: 640px;
}

.cabecera-lista {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.formulario-busqueda {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 260px;
}

.formulario-busqueda input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    font-size: 14px;
}

.enlace-volver {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--azul-primario);
    text-decoration: none;
    font-size: 14px;
}
.enlace-volver:hover { text-decoration: underline; }

h1 { font-size: 22px; margin-top: 0; }

/* ---------- Botones ---------- */
.boton {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: filter 0.15s ease;
}
.boton:hover { filter: brightness(0.93); }

.boton-primario { background: var(--azul-primario); color: var(--blanco); }
.boton-secundario { background: #eef2ff; color: var(--azul-oscuro); }
.boton-texto { background: transparent; color: var(--gris-texto); }

/* ---------- Alertas ---------- */
.alerta {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
}
.alerta ul { margin: 4px 0 0 18px; padding: 0; }
.alerta-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alerta-exito { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ---------- Estado vacío ---------- */
.estado-vacio {
    text-align: center;
    padding: 60px 20px;
    color: var(--gris-texto);
    background: var(--blanco);
    border-radius: var(--radio);
    border: 1px dashed var(--gris-borde);
}
.estado-vacio p { margin-bottom: 16px; }

/* ---------- Tabla ---------- */
.tabla-scroll {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow-x: auto;
}

.tabla-proyectos {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 900px;
}

.tabla-proyectos th {
    text-align: left;
    background: #f8fafc;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--gris-texto);
    border-bottom: 1px solid var(--gris-borde);
    white-space: nowrap;
}

.tabla-proyectos td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.tabla-proyectos tbody tr:hover { background: #fafbff; }
.tabla-proyectos tbody tr:last-child td { border-bottom: none; }

.pastilla {
    display: inline-block;
    background: #eef2ff;
    color: var(--azul-oscuro);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.col-acciones { white-space: nowrap; }

/* ---------- Estado ---------- */
.pastilla-estado {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.estado-pendiente { background: #fef9c3; color: #854d0e; }
.estado-enviado   { background: #dcfce7; color: #166534; }
.estado-otro      { background: #e0e7ff; color: #3730a3; }

.formulario-estado-rapido { margin: 0; }

.selector-estado {
    padding: 5px 26px 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    appearance: auto;
}

.selector-estado.estado-pendiente { background: #fef9c3; color: #854d0e; }
.selector-estado.estado-enviado   { background: #dcfce7; color: #166534; }
.selector-estado.estado-otro      { background: #e0e7ff; color: #3730a3; }

.enlace-accion {
    color: var(--azul-primario);
    text-decoration: none;
    font-size: 13px;
    margin-right: 12px;
    font-weight: 600;
}
.enlace-accion:hover { text-decoration: underline; }
.enlace-peligro { color: var(--rojo); }

/* ---------- Formularios ---------- */
.formulario {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formulario label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gris-texto);
    margin-top: 10px;
}

.formulario input,
.formulario select {
    padding: 10px 12px;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    background: var(--blanco);
}

.formulario input:focus,
.formulario select:focus {
    outline: none;
    border-color: var(--azul-primario);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.formulario-proyecto {
    background: var(--blanco);
    padding: 24px 26px 26px;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.grupo-campo { display: flex; flex-direction: column; }

.oculto { display: none !important; }

.acciones-formulario {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--gris-borde);
}

/* ---------- Mensajes / acceso denegado ---------- */
.contenedor-mensaje {
    max-width: 460px;
    margin: 80px auto;
    text-align: center;
    background: var(--blanco);
    padding: 36px;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .barra-superior { flex-direction: column; align-items: flex-start; gap: 10px; }
    .contenedor { padding: 18px; }
    .cabecera-lista { flex-direction: column; align-items: stretch; }
}
