* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f3f5f8; color: #1f2933; font-size: 15px; }
header { background: #0f4c81; display: flex; align-items: center; flex-wrap: wrap; padding: 0 18px; }
header .marca { color: #fff; font-weight: bold; font-size: 18px; text-decoration: none; padding: 14px 18px 14px 0; }
header nav { display: flex; flex-wrap: wrap; }
header nav a { color: #cfe3f6; text-decoration: none; padding: 14px 14px; }
header nav a:hover, header nav a.on { background: #0b3a64; color: #fff; }
header nav a.salir { margin-left: 12px; opacity: .8; }
main { max-width: 1200px; margin: 0 auto; padding: 22px 18px 50px; }
h1 { margin: 0 0 6px; font-size: 24px; }
.sub { color: #52606d; margin: 4px 0 14px; }
.nota { color: #52606d; margin-top: 30px; font-size: 13px; }
code { background: #e4e7eb; padding: 1px 5px; border-radius: 3px; }
.err { color: #b42318; }

.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.tarjeta { display: block; background: #fff; border-radius: 8px; padding: 22px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); border-left: 5px solid #0f4c81; }
.tarjeta:hover { box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.tarjeta strong { display: block; font-size: 20px; margin-bottom: 8px; color: #0f4c81; }
.tarjeta span { color: #52606d; font-size: 14px; }

.btn { display: inline-block; background: #0f4c81; color: #fff; border: 0; border-radius: 5px; padding: 9px 16px;
  text-decoration: none; cursor: pointer; font-size: 14px; }
.btn:hover { background: #0b3a64; }
.btn.gris { background: #7b8794; }
.btn.gris:hover { background: #616e7c; }
.btn.peq { padding: 5px 10px; font-size: 13px; }

.buscar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.buscar input[type=text] { flex: 1 1 280px; padding: 9px 11px; border: 1px solid #cbd2d9; border-radius: 5px; font-size: 14px; }
.chk { font-size: 14px; color: #3e4c59; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.tabs a { background: #e4e7eb; color: #3e4c59; padding: 7px 13px; border-radius: 16px; text-decoration: none; font-size: 13px; }
.tabs a.on { background: #0f4c81; color: #fff; }

.tabla-wrap { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #e4e7eb; vertical-align: top; }
thead th { background: #e8eef5; font-size: 13px; color: #243b53; position: sticky; top: 0; }
tbody tr:hover { background: #f7fafd; }
.der { text-align: right; white-space: nowrap; }
.vacio { text-align: center; color: #7b8794; padding: 26px; }
.sinimg { color: #9aa5b1; font-size: 12px; }
.falta-mini { color: #b42318; font-size: 12px; }
small { color: #7b8794; }
table.ficha th { width: 220px; background: #f3f5f8; font-weight: normal; color: #52606d; }

.pag { display: flex; flex-wrap: wrap; gap: 5px; margin: 18px 0; }
.pag a, .pag span { padding: 7px 12px; background: #fff; border-radius: 5px; text-decoration: none; color: #0f4c81;
  box-shadow: 0 1px 2px rgba(0,0,0,.12); font-size: 14px; }
.pag .act { background: #0f4c81; color: #fff; }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 8px; }
.galeria figure { margin: 0; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.galeria figure img { display: block; width: 100%; height: 160px; object-fit: cover; background: #e4e7eb; }
.galeria figcaption { padding: 8px 10px; font-size: 12px; color: #52606d; }
.falta { height: 160px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: #fde8e8; color: #b42318; font-size: 13px; padding: 8px; }

.lb { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.88); z-index: 50; align-items: center; justify-content: center; }
.lbc { max-width: 92vw; max-height: 92vh; text-align: center; }
.lbc img { max-width: 92vw; max-height: 82vh; background: #000; }
.lbt { color: #e4e7eb; margin-top: 8px; font-size: 14px; max-width: 80vw; margin-left: auto; margin-right: auto; }
.lbm { color: #fff; background: #b42318; padding: 24px 32px; border-radius: 8px; }
.lb button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; cursor: pointer; font-size: 34px;
  width: 54px; height: 54px; border-radius: 50%; line-height: 1; }
.lb button:hover { background: rgba(255,255,255,.3); }
.lbx { top: 16px; right: 18px; } .lbp { left: 16px; top: 50%; margin-top: -27px; } .lbn { right: 16px; top: 50%; margin-top: -27px; }

body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.caja { background: #fff; padding: 28px; border-radius: 8px; width: 320px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.caja h1 { text-align: center; margin-bottom: 16px; color: #0f4c81; }
.caja label { display: block; margin: 10px 0 4px; font-size: 13px; color: #52606d; }
.caja input { width: 100%; padding: 9px; border: 1px solid #cbd2d9; border-radius: 5px; }
.caja .btn { width: 100%; margin-top: 16px; }
