/* ============================================================
   PALETA INSTITUCIONAL
============================================================ */
:root {
    --amarillo: #FCDF5B;
    --verde: #93D500;
    --gris: #908E8F;
    --negro: #1d1d1b;
    --blanco: #ffffff;
    --rosa: #e61942;

    --radius: 6px;
    --shadow: 0 2px 6px rgba(0,0,0,0.08);

    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;
}

/* ============================================================
   RESET MODERNO
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--blanco);
    color: var(--negro);
    line-height: 1.5;
}

/* ============================================================
   HEADER
============================================================ */
.header {
    background: #e6f6f7;
    color: var(--negro);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header nav a {
    color: var(--negro);
    margin-left: 1.5rem;
    text-decoration: none;
    font-weight: 500;
}

.header nav a:hover {
    color: var(--rosa);
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
    background: #e6f6f7;
    color: #555;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #e5e5e5;
    margin-top: 3rem;
}

/* ============================================================
   TARJETAS INSTITUCIONALES
============================================================ */
.card {
    background: #efeff8;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card.shadow {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================================
   BOTONES INSTITUCIONALES
============================================================ */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary,
.btn-success {
    background: var(--rosa);
    color: var(--blanco);
}

.btn-primary:hover,
.btn-success:hover {
    background: #f74670;
}

/* ============================================================
   INPUTS INSTITUCIONALES
============================================================ */
input, select, textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--gris);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--verde);
    outline: none;
}

/* ============================================================
   GRIDS RESPONSIVOS
============================================================ */
.grid-2, .grid-3 {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================================
   PESTAÑAS INSTITUCIONALES
============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gris);
    margin-bottom: 1rem;
}

.tab {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--gris);
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.tab:hover {
    color: var(--negro);
}

.tab.active {
    color: var(--negro);
    border-bottom: 3px solid var(--rosa);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   TABLAS INSTITUCIONALES
============================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.table th {
    background: #f5f5f5;
    color: #333;
    padding: 0.8rem;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e5e5e5;
}

.table tr:hover {
    background: #fafafa;
}

/* ============================================================
   FORMULARIO DE EMPLEADOS (ESTÁNDAR INSTITUCIONAL)
============================================================ */
.formulario-empleados .card {
    background: var(--blanco);
    border: 1px solid var(--gris);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.formulario-empleados label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

.formulario-empleados input,
.formulario-empleados select,
.formulario-empleados textarea {
    padding: 0.6rem;
    border: 1px solid var(--gris);
    border-radius: var(--radius);
}

.formulario-empleados input:focus,
.formulario-empleados select:focus,
.formulario-empleados textarea:focus {
    border-color: var(--verde);
}

/* ============================================================
   ENCABEZADOS Y ACCIONES DE LISTA
============================================================ */
.encabezado-lista {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.encabezado-lista h2 {
    margin: 0;
    font-weight: 700;
    line-height: 1;
}

.acciones-lista {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
}

.input-filtro {
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.9rem;
}

.acciones-lista .btn-primary {
    height: 36px;
    line-height: 36px;
    padding: 0 1rem;
    display: inline-block;
    white-space: nowrap;
}

/* ============================================================
   SIDEBAR INSTITUCIONAL
============================================================ */

.layout-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 220px;
    background: #efeff8;
    border-right: 1px solid #ddd;
    padding: 1.5rem 1rem;
    transition: width 0.25s ease;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar nav a {
    padding: 0.6rem 1rem;
    background: #e5e5e5;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.sidebar nav a:hover {
    background: #d4d4d4;
}

/* Sidebar colapsado */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed nav a {
    text-align: center;
    padding: 0.6rem 0;
}

/* ============================================================
   CONTENIDO CENTRAL INSTITUCIONAL
============================================================ */
.main-content {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

.input-error {
    border: 2px solid #d9534f !important;
    background: #fff5f5;
}

.error-msg {
    color: #d9534f;
    font-size: 0.85rem;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* --- LOGIN INSTITUCIONAL --- */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f3f6fb;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem;
    width: 380px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.login-header h2 {
    font-family: var(--font-secondary);
    margin-top: 0.8rem;
    color: #2a4d8f;
}

.login-logo {
    width: 70px;
    height: auto;
}

.input-group {
    position: relative;
    margin: 1.2rem 0;
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: 0.2s ease;
}

.input-group input:focus {
    border-color: #2a4d8f;
    box-shadow: 0 0 0 3px rgba(42,77,143,0.15);
    outline: none;
}

.input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
}

.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: #2a4d8f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-login:hover {
    background: #1f3a6b;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #777;
}

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

/* Selector de empresa con estilo institucional */
.input-group select {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    font-family: var(--font-primary);
    appearance: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.input-group select:focus {
    border-color: #2a4d8f;
    box-shadow: 0 0 0 3px rgba(42,77,143,0.15);
    outline: none;
}