/* ===== Variables y base ===== */
:root {
    --verde: #0d3b34;
    --verde-claro: #2f7a68;
    --verde-hover: #145c50;
    --fondo: #f4f4f4;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: var(--fondo);
    margin: 0;
    font-size: 16px;
}

h1 { color: var(--verde); font-size: 22px; margin-top: 0; }

/* ===== Encabezado ===== */
header {
    background: var(--verde);
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
header a { color: white; text-decoration: none; font-size: 14px; }
header img { height: 24px; display: block; }

/* ===== Contenedores principales ===== */
main {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
@media (max-width: 640px) {
    main { margin: 12px; padding: 16px; border-radius: 6px; }
}

/* Pantalla de login: caja centrada aparte, no usa <main> */
.pagina-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--verde);
    padding: 20px;
}
.pagina-login .caja {
    background: white;
    padding: 32px;
    border-radius: 8px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== Formularios ===== */
.campo { margin-bottom: 16px; }
.campo.checkbox-linea { display: flex; align-items: center; gap: 8px; }
.campo.checkbox-linea label { margin-bottom: 0; }

label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px; /* evita zoom automático en iPhone */
}
input[type=checkbox] { width: auto; }

small { color: #777; display: block; margin-top: 3px; }
.error { color: #b00020; font-size: 13px; margin-top: 3px; }

button, .boton-nuevo {
    display: inline-block;
    background: var(--verde);
    color: white;
    border: none;
    padding: 13px 22px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 8px;
}
button:hover, .boton-nuevo:hover { background: var(--verde-hover); }
@media (max-width: 480px) {
    button { width: 100%; text-align: center; }
}

/* ===== Enlaces de navegación (inicio) ===== */
.enlaces { margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.enlaces a {
    background: white;
    color: var(--verde);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ===== Tarjetas del dashboard ===== */
.tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.tarjeta { background: white; border-radius: 8px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.tarjeta .numero { font-size: 24px; font-weight: bold; color: var(--verde); }
.tarjeta .etiqueta { font-size: 13px; color: #666; margin-top: 4px; }

.graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grafico-caja { background: white; border-radius: 8px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.grafico-caja h3 { color: var(--verde); font-size: 15px; margin-top: 0; }

/* ===== Tablas: scroll horizontal en pantallas chicas ===== */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; min-width: 480px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; white-space: nowrap; }
th { background: #f0f0f0; color: var(--verde); }
.vacio { color: #777; padding: 20px 0; }
a.accion { color: var(--verde); font-size: 13px; margin-right: 8px; }

/* ===== Etiquetas de estado ===== */
.etiqueta-estado, .etiqueta-rol {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    background: var(--verde-claro);
    white-space: nowrap;
}
.pendiente { background: #d18b00; }
.realizada { background: var(--verde-claro); }
.inactivo { color: #b00020; font-size: 12px; }