/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === ESTILO GENERAL === */
body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.2px;
    color: #2c3e50;
    background-color: #f5f6fa;
}


/* === MENÚ LATERAL === */
.sidebar {
    width: 240px;
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #ecf0f1;
}

.sidebar a {
    text-decoration: none;
    color: white;
    padding: 10px;
    margin: 5px 0;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.sidebar a:hover {
    background-color: #34495e;
}

/* === CONTENIDO PRINCIPAL === */
.main-content {
    flex: 1;
    padding: 2rem;
    background: #f5f6fa;
}


/* CABECERA */
header {
    background: #ecf0f1;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
}

header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
}

header h2 {
    font-size: 1.4rem;
}

header a {
    color: #ecf0f1;
    font-weight: bold;
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}

/* CONTENIDO PRINCIPAL */
main, .container {
    padding: 2rem;
    max-width: 1200px;
    margin: auto;
}

/* === BOTONES === */
.btn, button, input[type="submit"] {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s ease;
}

.btn:hover, button:hover, input[type="submit"]:hover {
    background-color: #2980b9;
}

/* INPUTS Y FORMULARIOS */
input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

form label {
  display: block;
    font-weight: 500;
    margin: 1rem 0 0.3rem;
    color: #2c3e50;
}

form input[type="text"],
form input[type="password"],
form input[type="file"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}
form textarea {
    min-height: 100px;
    resize: vertical;
}

form button,
form input[type="submit"] {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover,
form input[type="submit"]:hover {
    background-color: #2980b9;
}

/* TABLAS */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

table thead {
    background: #ecf0f1;
}

table th, table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

table tr:hover {
    background: #f9f9f9;
}

.alert {
    padding: 15px;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.alert-success {
    background-color: #dff0d8;
    color: #3c763d;
    border-left: 5px solid #2ecc71;
}

.alert-error {
    background-color: #f2dede;
    color: #a94442;
    border-left: 5px solid #e74c3c;
}

.alert-warning {
    background-color: #fcf8e3;
    color: #8a6d3b;
    border-left: 5px solid #f1c40f;
}


/* === TARJETAS === */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: scale(1.01);
}

.card h3 {
   margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card p {
    margin: 0.3rem 0;
}

/* === POPUP MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* un poco más suave */
    backdrop-filter: blur(6px);     /* desenfoque principal */
    -webkit-backdrop-filter: blur(6px); /* compatibilidad Safari */
    justify-content: center;
    align-items: center;
    z-index: 999;
}




.modal {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.modal-close:hover {
    color: #000;
}


/* === ETIQUETAS DE ESTADO === */
.etiqueta {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: white;
    display: inline-block;
}

.verde { background-color: #2ecc71; }
.azul { background-color: #3498db; }
.amarillo { background-color: #f1c40f; color: black; }
.rojo { background-color: #e74c3c; }
.negro { background-color: #2c3e50; }

/* === RESPONSIVO === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .main-content {
        padding: 1rem;
    }
}

.btn + .btn {
    margin-left: 10px;
}
h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #2c3e50;
}


label {
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
}

.sidebar h2,
header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

@media (max-width: 600px) {
    .chart-container {
        padding: 1rem;
    }

    canvas {
        height: 250px !important;
    }
}

