:root{
  --navy:#083b73;
  --navy2:#0a315f;
  --blue1:#185a9f;
  --blue2:#0d4b88;
  --orange:#ff6b00;
  --line:#c9d9e8;
}
* { box-sizing: border-box; }
body { font-family: Arial, Helvetica, sans-serif; margin: 0; background: linear-gradient(180deg,#f8fafc 0%,#eef3f7 100%); color: #15324f; }

header, .brand {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy2) 100%);
  color: #fff;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
header .marca, .brand .marca { display: flex; align-items: center; gap: 14px; }
header img.logo, .brand img.logo { height: 44px; display: block; }
header h1 { margin: 0; font-size: 20px; }
.subtitle { margin: 4px 0 0; color: #cfe0f0; font-size: 13px; }
header a { color: #fff; text-decoration: underline; font-weight: 700; }

main { padding: 24px 32px; display: flex; flex-direction: column; gap: 20px; max-width: 1230px; margin: 0 auto; width: 100%; }

.panel, .card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 4px 16px rgba(30,60,90,.05);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel h2, .card h2 { margin: 0 0 16px; font-size: 22px; color: #063f7b; font-weight: 800; }
.filtros { display: flex; gap: 10px; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid #eef1f5; }
th { color: #6b7780; font-weight: 700; text-transform: uppercase; font-size: 11px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f7f9fb; }

button, .btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}
button.secundario { background: #7a8a99; }
button:hover { filter: brightness(0.97); }
button:disabled { opacity: .6; cursor: default; }

select, input, textarea {
  padding: 10px 12px;
  border: 1px solid #c5d6e8;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #263442;
  background: #fff;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: #3b79b8;
  box-shadow: 0 0 0 3px rgba(59,121,184,.12);
}

label { font-size: 13px; font-weight: 700; color: #123f71; display: block; margin-bottom: 6px; }

.estado-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.estado-NUEVO { background: #e6f1fb; color: #0c447c; }
.estado-ASIGNADO { background: #eeedfe; color: #3c3489; }
.estado-EN_PROCESO { background: #faeeda; color: #854f0b; }
.estado-ON_HOLD { background: #fcebeb; color: #791f1f; }
.estado-LISTO_PARA_CIERRE { background: #eaf3de; color: #27500a; }
.estado-DEVUELTO { background: #fbeaf0; color: #72243e; }
.estado-CERRADO { background: #f1efe8; color: #444441; }

.modal-overlay { position: fixed; inset: 0; background: rgba(10,25,45,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; padding: 26px; border-radius: 18px; width: 420px; max-width: 92vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 6px; font-size: 22px; color: #063f7b; font-weight: 800; }
.modal form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

#detalleContenido .fila { margin-bottom: 10px; font-size: 14px; }
#detalleContenido label { font-size: 12px; color: #666; display: block; margin-bottom: 4px; font-weight: 600; }
.acciones-estado { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.historial-item { font-size: 12px; color: #555; border-left: 2px solid #ddd; padding-left: 8px; margin-bottom: 6px; }

.types { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.type { position: relative; }
.type input { position: absolute; opacity: 0; pointer-events: none; }
.type label {
  display: flex; align-items: center; justify-content: center; min-height: 52px;
  border: 1px solid #c5d6e8; border-radius: 12px; padding: 8px 10px; background: #fff;
  color: #0d3f77; font-weight: 700; font-size: 14px; text-align: center; cursor: pointer; transition: .15s ease;
}
.type label:hover { border-color: #7da6cf; background: #f8fbff; }
.type input:checked + label { border: 2px solid var(--orange); background: #fff7ef; }

@media (max-width: 700px) {
  main { padding: 16px; }
  header, .brand { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .types { grid-template-columns: 1fr 1fr; }
}
