:root {
    --dorado: #9c7a2e;
    --dorado-oscuro: #7a5f22;
    --dorado-claro: #f5ecd8;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
.topbar {
    background: #1c1a14;
    color: #fff;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--dorado);
}
.topbar .marca { display: flex; align-items: center; gap: 10px; }
.topbar .marca img { height: 40px; display: block; }
.topbar a { color: #fff; text-decoration: none; }
.topbar nav { display: flex; align-items: center; }
.topbar nav a { margin-right: 18px; opacity: .9; color: var(--dorado-claro); white-space: nowrap; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; color: #fff; }
.btn-menu-movil {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
}
.btn-menu-movil svg { width: 26px; height: 26px; display: block; }
.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 20px;
}
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 20px;
}
h1 { font-size: 22px; margin-top: 0; color: #1c1a14; }
h2 { font-size: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { color: #6b7280; font-weight: 600; }
.btn {
    display: inline-block;
    background: var(--dorado);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { background: var(--dorado-oscuro); }
.btn-secondary { background: #6b7280; }
.btn-danger { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.badge { padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-empleado { background: #dbeafe; color: #1e40af; }
.badge-contratista { background: #fef3c7; color: #92400e; }
.badge-borrador { background: #e5e7eb; color: #374151; }
.badge-generado { background: #dbeafe; color: #1e40af; }
.badge-enviado { background: #fef3c7; color: #92400e; }
.badge-firmado { background: #d1fae5; color: #065f46; }
form .field { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #374151; }
input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.text-muted { color: #6b7280; font-size: 13px; }
.actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.table-scroll { overflow-x: auto; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.editar { background: #6b7280; }
.icon-btn.editar:hover { background: #4b5563; }
.icon-btn.ficha { background: var(--dorado); }
.icon-btn.ficha:hover { background: var(--dorado-oscuro); }
.icon-btn.asistencia { background: #0e7490; }
.icon-btn.asistencia:hover { background: #0c5c74; }
.icon-btn.eliminar { background: #b91c1c; }
.icon-btn.eliminar:hover { background: #991b1b; }
.icon-btn.pdf { background: var(--dorado); }
.icon-btn.pdf:hover { background: var(--dorado-oscuro); }
.icon-btn.comprobante { background: #4f46e5; }
.icon-btn.comprobante:hover { background: #4338ca; }
.icon-btn.correo { background: #2563eb; }
.icon-btn.correo:hover { background: #1d4ed8; }
.icon-btn.whatsapp { background: #25D366; }
.icon-btn.whatsapp:hover { background: #1ebe5a; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(17,17,17,.5);
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-caja {
    background: #fff; border-radius: 8px; padding: 22px; max-width: 380px; width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal-caja p { margin: 0 0 18px; font-size: 14px; color: #1f2937; }
.modal-acciones { display: flex; justify-content: flex-end; gap: 8px; }

.encabezado-tarjeta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

/* ---- Responsivo (celular / tablet) ---- */
@media (max-width: 768px) {
    .topbar { flex-wrap: wrap; padding: 10px 16px; }
    .btn-menu-movil { display: block; }
    .topbar nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,.15);
    }
    .topbar nav.abierto { display: flex; }
    .topbar nav a { margin-right: 0; padding: 10px 4px; border-radius: 6px; }
    .topbar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }

    .container { padding: 0 12px; margin: 16px auto; }
    .card { padding: 14px; }
    .grid-2 { grid-template-columns: 1fr; }
    h1 { font-size: 19px; }

    .modal-caja { padding: 18px; }
}
