/* =============================================
   ESTILOS GENERALES - FORMULARIO PARTES REISA
   ============================================= */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
    font-size: 16px;
    line-height: 1.4;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

/* ----- Cabecera tipo REISA ----- */
.parte-header {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.parte-header .logo {
    font-weight: bold;
    font-size: 26px;
    color: #1d4f9a;
    letter-spacing: 1px;
}
.parte-header .empresa {
    font-size: 13px;
    color: #555;
}
.parte-header .oficinas {
    font-size: 12px;
    text-align: right;
    color: #555;
}

/* ----- Formularios ----- */
form .row {
    margin-bottom: 14px;
}
label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}
input[type=text],
input[type=date],
input[type=number],
input[type=time],
input[type=password],
input[type=email],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #c4c4c4;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1d4f9a;
    box-shadow: 0 0 0 3px rgba(29,79,154,0.15);
}

/* ----- Tabla de operarios ----- */
.operarios-wrap { margin: 16px 0; }
.operario-row {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}
.operario-row h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #1d4f9a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.operario-row .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.operario-row .grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}
.operario-row .horario-block { margin-bottom: 8px; }
.operario-row .horario-block .label-block {
    font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px;
}
.btn-remove {
    background: #d93025; color: #fff; border: none; border-radius: 4px;
    padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.btn-add {
    background: #1d4f9a; color: #fff; border: none; border-radius: 6px;
    padding: 10px 16px; font-size: 15px; cursor: pointer; width: 100%;
}

/* ----- Botones ----- */
.btn {
    display: inline-block;
    background: #1d4f9a; color: #fff; border: none;
    border-radius: 6px; padding: 12px 22px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    text-decoration: none; text-align: center;
}
.btn:hover { background: #16407c; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }
.btn-success { background: #2e7d32; }
.btn-success:hover { background: #256328; }
.btn-block { display: block; width: 100%; }

/* ----- Firma ----- */
.firma-wrap {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
}
.firma-wrap canvas {
    width: 100%; height: 180px;
    background: #fafafa;
    border: 1px dashed #999;
    border-radius: 6px;
    touch-action: none;
    display: block;
}
.firma-actions { margin-top: 8px; text-align: right; }

/* ----- Checkbox terminado ----- */
.terminado-wrap {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
    display: flex; justify-content: space-between; align-items: center;
}
.terminado-wrap label { margin: 0; cursor: pointer; }

/* ----- Alertas ----- */
.alert {
    padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ----- Login ----- */
.login-box {
    max-width: 360px; margin: 60px auto;
    background: #fff; padding: 24px;
    border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.login-box h2 { text-align: center; color: #1d4f9a; margin-top: 0; }

/* ----- Panel admin ----- */
.topbar {
    background: #1d4f9a; color: #fff;
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.topbar a { color: #fff; text-decoration: none; margin-left: 12px; }
.topbar a:hover { text-decoration: underline; }

.filtros {
    background: #fff; border: 1px solid #ddd; border-radius: 8px;
    padding: 16px; margin-bottom: 16px;
}
.filtros .grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px; align-items: end;
}

.tabla-partes {
    width: 100%; border-collapse: collapse; background: #fff;
    border: 1px solid #ddd; border-radius: 8px; overflow: hidden;
}
.tabla-partes th, .tabla-partes td {
    padding: 10px; text-align: left; border-bottom: 1px solid #eee;
    font-size: 14px;
}
.tabla-partes th { background: #f0f2f5; }
.tabla-partes tr:hover { background: #fafbfc; }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
}
.badge-si { background: #d4edda; color: #155724; }
.badge-no { background: #f8d7da; color: #721c24; }
.badge-tickets { background: #fff3cd; color: #856404; }
.badge-tickets:hover { background: #ffe8a1; }

@media (max-width: 600px) {
    .parte-header .oficinas { text-align: left; }
    .operario-row .grid-4 { grid-template-columns: 1fr 1fr; }
    .filtros .grid { grid-template-columns: 1fr; }
    .tabla-partes { font-size: 13px; }
    .tabla-partes th, .tabla-partes td { padding: 6px; }
}
