:root {
  --rojo: #c33;
  --rojo-oscuro: #a62b2b;
  --fondo: #fffaf7;
  --claro: #ffefe6;
}
* { box-sizing: border-box; }
body { font-family: "Segoe UI", system-ui, Arial, sans-serif; background: var(--fondo); color:#333; margin:0; }
.header { background: var(--claro); text-align:center; padding:30px 10px; border-bottom:4px solid var(--rojo); }
.logo { width:100px; height:auto; }
h1 { color:var(--rojo); font-size:1.9rem; margin:10px 0 5px; }
.slogan { color:#555; font-style:italic; }
.consulta { text-align:center; margin:40px auto; padding:0 12px; }
.consulta h2 { color:var(--rojo); margin-bottom:10px; }
.buscador { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:10px; margin:20px auto; width:100%; max-width:720px; }
.buscador input { flex:1; min-width:260px; padding:16px; font-size:1.1rem; border-radius:10px; border:1px solid #ccc;  text-align: center;  }
.buscador button { background:var(--rojo); color:#fff; border:none; border-radius:10px; padding:16px 26px; font-size:1.1rem; cursor:pointer; transition:background .3s, transform .06s; }
.buscador button:hover { background:var(--rojo-oscuro); }
.buscador button:active { transform:scale(.98); }

#resultado { margin:30px auto; width:98%; max-width:980px; overflow-x:auto; min-height:60px; }
.spinner { display:inline-block; position:relative; width:64px; height:64px; margin:10px auto; }
.spinner::before { content:""; position:absolute; top:50%; left:50%; width:48px; height:48px; margin:-24px; border-radius:50%; border:4px solid #ddd; border-top-color:var(--rojo); animation:spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg);} }

.empty-state { background:#fff; border:1px solid #eee; border-radius:12px; padding:22px; max-width:560px; margin:10px auto; box-shadow:0 1px 2px rgba(0,0,0,.04); text-align:center; }
.empty-state .icon { font-size:28px; margin-bottom:6px; }
.empty-state h3 { margin:0 0 6px; color:#222; font-size:1.2rem; }
.empty-state p { margin:0; color:#666; }

.table-wrap { width:100%; overflow-x:auto; }
table { width:100%; border-collapse:collapse; margin-top:15px; background:#fff; border-radius:10px; overflow:hidden; }
th, td { padding:12px; border:1px solid #eee; text-align:center; }
th { background:var(--rojo); color:#fff; position:sticky; top:0; }
tr:hover { background:#fff3ef; }

.estado-badge { display:inline-block; padding:6px 10px; border-radius:999px; background: color-mix(in srgb, var(--estado-color) 18%, white); border:1px solid var(--estado-color); color: var(--estado-color); font-weight:700; font-size:.95rem; }

/* Modal */
.btn-ver { background:var(--rojo); color:#fff; border:none; border-radius:6px; padding:6px 14px; cursor:pointer; font-size:.9rem; transition:background .2s, transform .05s; }
.btn-ver:hover { background:var(--rojo-oscuro); }
.btn-ver:active { transform:scale(.97); }
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; z-index:9999; animation:fadeIn .2s ease; }
.modal-box { background:#fff; border-radius:12px; padding:25px; width:min(90%, 420px); max-height:80vh; overflow-y:auto; box-shadow:0 4px 10px rgba(0,0,0,.2); text-align:center; }
.modal-box h3 { margin-top:0; color:var(--rojo); font-size:1.2rem; }
.modal-box p { color:#333; margin:15px 0; white-space:normal; }
.btn-cerrar { background:var(--rojo); color:#fff; border:none; padding:8px 16px; border-radius:6px; cursor:pointer; transition:background .2s; }
.btn-cerrar:hover { background:var(--rojo-oscuro); }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* Admin */
.formularios { width:min(1100px,95%); margin:30px auto; padding:10px; }
.card { background:#fff; border:1px solid #eee; border-radius:12px; padding:20px; margin-bottom:20px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.form-grid textarea { grid-column:1/-1; min-height:90px; resize:vertical; }
.form-grid button { grid-column:1/-1; justify-self:start; background:var(--rojo); color:#fff; border:0; padding:12px 18px; border-radius:10px; cursor:pointer; }
.form-grid input, .form-grid select, .form-grid textarea { padding:10px; border:1px solid #ccc; border-radius:10px; }
.btn-link { display:inline-block; padding:12px 18px; border-radius:10px; background:#eee; color:#333; text-decoration:none; margin-left:8px; }
.btn-link:hover { background:#e4e4e4; }

/* Footer centered */
footer { background: var(--claro); padding:15px; }
footer p { margin:0; text-align:center; color: #555; }

@media (max-width:700px) {
  h1 { font-size:1.6rem; }
  .form-grid { grid-template-columns:1fr; }
  .buscador input, .buscador button { width:100%; }
}
