/* =========================
   BASE (PC + estilos comunes)
========================= */
*{ box-sizing:border-box; font-family: Arial, Helvetica, sans-serif; }
body{ margin:0; background:#f4f6f8; color:#222; }

/* =========================
   HEADER
========================= */
.topbar{
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}
.topbar-inner{
  max-width:1200px;
  margin:0 auto;
  padding:14px 16px;
}
.brand{ display:flex; gap:14px; align-items:center; }

/* Logo */
.brand img{
  width:250px;
  max-width:250px;
  height:auto;
  display:block;
}

/* HERO */
.hero{
  background:#B13030;
  color:#fff;
}
.hero-inner{
  max-width:1200px;
  margin:0 auto;
  padding:18px 16px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.hero h1{
  margin:0;
  font-size:22px;
  letter-spacing:.7px;
}

/* =========================
   NAVBAR + DROPDOWN
========================= */
.navbar{
  background:#0B6B3A;
  border-bottom:1px solid #e5e7eb;
}
.nav-inner{
  max-width:1200px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:12px;
}
.nav-item{ position:relative; }

.nav-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:10px;
  text-decoration:none;
  font-weight:900;
  color:#ffffff;
}
.nav-link:hover,
.nav-link:focus{
  background:#FFD200;
  color:#000;
}

.dropdown{
  position:absolute;
  top:0;
  left:100%;
  margin-left:6px;
  min-width:260px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.15);
  overflow:hidden;
  display:none;
  z-index:50;
}
.nav-item:hover .dropdown{ display:block; }

.dropdown a{
  display:block;
  padding:12px 14px;
  text-decoration:none;
  color:#111827;
  font-weight:800;
}
.dropdown a:hover{
  background:#FFF3BF;
  color:#000;
}
.dropdown small{
  display:block;
  font-weight:700;
  color:#6b7280;
  margin-top:2px;
}

/* =========================
   LAYOUT
========================= */
html, body{ height:100%; }
body{
  display:flex;
  flex-direction:column;
}
.wrap{
  flex:1;
  max-width:1200px;
  margin:22px auto 54px auto;
  padding:0 16px;
}

/* =========================
   PANEL
========================= */
.panel{
  background:#fff;
  border-radius:10px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
  overflow:hidden;
}

.panel.panel-card{
  background: rgba(255,255,255,.92);
  border: 4px solid #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,.10);
  overflow: hidden;
}

/* Header base */
.panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:16px;
  border-bottom:1px solid #eef2f7;
}
.panel.panel-card .panel-head{
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: linear-gradient(to bottom, rgba(255,255,255,.95), rgba(255,255,255,.85));
}

/* =========================
   STACK (título arriba + tools abajo)
========================= */
.panel-head.panel-head-stack{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
}

.panel-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.panel-top-left{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.panel-title{
  margin:0;
  font-size:22px;
  font-weight:900;
  color:#1f2937;
}

/* Tabs */
.tabs{ display:flex; gap:8px; flex-wrap:wrap; }
.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #d1d5db;
  background:#fff;
  color:#374151;
  text-decoration:none;
  font-weight:900;
  font-size:13px;
}
.tab.active{
  background:#e8f5ee;
  border-color:#0b6b3a;
  color:#0b6b3a;
}

/* Panel bottom: tools + botón formatos */
.panel-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:nowrap;
}

.panel-bottom .pub-tools-form{
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}

/* =========================
   TOOLS
========================= */
.tools{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}

.searchbox{
  position:relative;
  display:flex;
  align-items:center;
  width:360px;
  flex: 1 1 360px;
}
.searchbox input{
  width:100%;
  padding:10px 38px 10px 12px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#fff;
  outline:none;
  font-weight:700;
}
.searchbox input:focus{
  border-color:#0b6b3a;
  box-shadow:0 0 0 3px rgba(11,107,58,.12);
}

.btn-clear{
  position:absolute;
  right:8px;
  width:28px;
  height:28px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  background:#f3f4f6;
  color:#111827;
  display:none;
  font-weight:900;
}
.btn-clear:hover{ opacity:.9; }

.estado-select{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#fff;
  font-weight:900;
  outline:none;
  min-width:200px;
  flex: 0 0 200px;
}
.estado-select:focus{
  border-color:#0b6b3a;
  box-shadow:0 0 0 3px rgba(11,107,58,.12);
}

.perpage-select{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#fff;
  font-weight:900;
  outline:none;
  min-width:120px;
  flex: 0 0 120px;
}
.perpage-select:focus{
  border-color:#0b6b3a;
  box-shadow:0 0 0 3px rgba(11,107,58,.12);
}

.btn-formatos{
  background:#6d28d9;
  color:#fff;
  border:none;
  border-radius:10px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
  white-space:nowrap;
}
.btn-formatos:hover{ opacity:.92; }

/* =========================
   TABLE (PC real)
========================= */
.table-wrap{
  overflow-x:auto;
  padding: 14px 14px 18px;
  -webkit-overflow-scrolling: touch;
}

.pub-table{
  width:100%;
  min-width:1100px; /* clave para que móvil se vea igual: scroll horizontal */
  border-collapse: separate;
  border-spacing: 0;
  background:#fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.pub-table thead th{
  background:#0b6b3a;
  color:#fff;
  padding:12px 10px;
  text-align:center;
  font-size:13px;
  border-right:1px solid rgba(255,255,255,.15);
}
.pub-table thead th:first-child{ border-top-left-radius: 14px; }
.pub-table thead th:last-child{ border-top-right-radius: 14px; border-right:none; }

.pub-table tbody td{
  padding:12px 10px;
  border-bottom:1px solid #eef2f7;
  font-size:13px;
  vertical-align:middle;
}

.pub-table tbody tr:nth-child(even) td{ background: rgba(0,0,0,.012); }
.pub-table tbody tr:hover td{ background:#f3faf6; }

.col-proc{ width:120px; }
.col-puesto{ width:420px; text-align:left !important; }
.col-vac{ width:90px; }
.col-doc{ width:95px; }
.col-estado{ width:120px; }

.puesto{ text-align:left; }
.vac{ text-align:center; font-weight:900; }
.doc{ text-align:center; }
.estado{ text-align:center; }

.pub-table th.col-proc,
.pub-table td.proc{
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 900;
  text-align:center;
  vertical-align: middle;
}
.pub-table td.proc{ color:#2563eb; }

.doc-link{
  display:inline-flex;
  width:40px;
  height:40px;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  text-decoration:none;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.96);
}
.doc-link:hover{ opacity:.92; transform:translateY(-1px); }
.doc-link img{ width:32px; height:32px; display:block; }

.doc-off{
  display:inline-flex;
  width:40px;
  height:40px;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:#f3f4f6;
  color:#9ca3af;
  font-weight:900;
  border: 1px solid rgba(0,0,0,.06);
}

.pill{
  display:inline-block;
  padding:7px 12px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  text-transform:uppercase;
  min-width:110px;
  border: 2px solid rgba(0,0,0,.06);
}
.pill.ok{ background:#d1fae5; color:#065f46; border-color: rgba(6,95,70,.16); }
.pill.fin{ background:#e5e7eb; color:#374151; border-color: rgba(55,65,81,.16); }
.pill.bad{ background:#fee2e2; color:#991b1b; border-color: rgba(153,27,27,.16); }

.empty{ text-align:center; padding:18px !important; color:#6b7280; font-weight:800; }

tr.focus td{
  background:#fff7ed !important;
  border-bottom:1px solid #fed7aa;
}

/* =========================
   MODAL FORMATOS
========================= */
.modal-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  opacity:0; pointer-events:none;
  transition:.2s;
  z-index:999;
}
.modal-overlay.show{ opacity:1; pointer-events:auto; }

.modal{
  position:fixed; inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  opacity:0; pointer-events:none;
  transition:.2s;
  z-index:1000;
}
.modal.show{ opacity:1; pointer-events:auto; }

.modal-card{
  width:100%;
  max-width:520px;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
}
.modal-head{
  background:#6d28d9;
  color:#fff;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.modal-head h3{ margin:0; font-size:18px; font-weight:900; }
.modal-close{
  background:transparent;
  border:none;
  color:#fff;
  font-size:18px;
  cursor:pointer;
  padding:6px 10px;
  border-radius:10px;
}
.modal-close:hover{ background:rgba(255,255,255,.18); }

.modal-body{ padding:14px 16px 16px 16px; }
.muted{ color:#6b7280; font-weight:800; }

.fmt-list{ list-style:none; margin:0; padding:0; }
.fmt-list li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #eef2f7;
}
.fmt-name{ font-weight:900; color:#111827; }
.fmt-dl{
  background:#0b6b3a;
  color:#fff;
  text-decoration:none;
  padding:8px 12px;
  border-radius:10px;
  font-weight:900;
}
.fmt-dl:hover{ opacity:.92; }

/* =========================
   PAGINACIÓN
========================= */
.pub-pagination{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  margin:16px 0 6px;
}
.pp-item{
  min-width:40px;
  height:40px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#fff;
  text-decoration:none;
  font-weight:900;
  color:#111827;
}
.pp-item:hover{ transform: translateY(-1px); }
.pp-item.active{
  background:#0b6b3a;
  border-color:#0b6b3a;
  color:#fff;
}
.pp-item.disabled{
  opacity:.45;
  pointer-events:none;
}
.pp-dots{
  font-weight:900;
  opacity:.6;
  padding:0 6px;
}
.pub-meta{
  text-align:center;
  font-weight:800;
  opacity:.7;
  margin-bottom:10px;
}

/* =========================
   ACCESIBILIDAD
========================= */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* =========================
   FOOTER (PC)
========================= */
.site-footer{
  margin-top: 28px;
  background:#C8D0D9;
  color:#1f2937;
  border-top:2px solid #ffffff;
  padding:10px 0;
}
.site-footer-inner{
  max-width:1200px;
  margin:0 auto;
  padding:16px 16px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:16px;
  align-items:center;
  font-size:13px;
  font-weight:400;
}
.footer-col{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.footer-col strong{
  font-weight:800;
  letter-spacing:.3px;
}
.footer-center{ text-align:center; }
.footer-right{ text-align:right; }

.site-footer a{
  color:#0B6B3A;
  font-weight:400;
  text-decoration:none;
}
.site-footer a:hover{ text-decoration:underline; }
