/* Ajuste visual UNC - Repositorio de Certificados */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.wrap {
  flex: 1;
}

/* Header */
.topbar,
.header {
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #e1e7e4;
  box-shadow: 0 8px 28px rgba(0,0,0,.045);
}

.topbar-inner,
.header-inner {
  max-width: 1240px;
  min-height: 86px;
  padding: 12px 22px;
}

.brand-link {
  align-items: center;
}

.brand-logo {
  width: 205px !important;
  max-width: 205px !important;
  max-height: 62px !important;
  object-fit: contain !important;
}

.brand-text {
  font-size: 19px;
  line-height: 1.08;
}

.brand-sub {
  font-size: 13px;
}

.nav a {
  font-size: 16px;
  font-weight: 800;
}

/* Contenido */
.wrap {
  max-width: 1240px;
}

.card {
  border: 1px solid rgba(225,231,228,.9);
}

h1 {
  letter-spacing: -0.035em;
}

/* Tablas responsive */
.table {
  min-width: 760px;
}

.card:has(.table) {
  overflow-x: auto;
}

/* Botones */
.actions {
  gap: 8px;
}

/* Footer tipo UNC */
.unc-global-footer {
  margin-top: auto;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 0%, rgba(6,128,59,.72) 0%, rgba(6,78,43,.72) 32%, rgba(3,61,34,1) 68%),
    #004b2d;
}

.unc-global-wrap {
  width: min(100% - 44px, 1240px);
  margin-inline: auto;
}

.unc-footer-cta-band {
  border-bottom: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

.unc-footer-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 32px;
}

.unc-footer-cta-row h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  font-weight: 900;
}

.unc-footer-cta-row p {
  max-width: 680px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 17px;
  line-height: 1.55;
}

.unc-footer-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: #fff;
  color: #004b2d;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.unc-footer-main {
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(0, 1.55fr);
  gap: 58px;
  padding-block: 58px;
}

.unc-footer-logo {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  padding: 12px 16px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

.unc-footer-logo img {
  display: block;
  width: 100%;
  max-width: 224px;
  height: auto;
  object-fit: contain;
}

.unc-footer-brand-block p {
  max-width: 430px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.68;
}

.unc-footer-contact {
  display: grid;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255,255,255,.84);
}

.unc-footer-contact a,
.unc-footer-menu a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
}

.unc-footer-contact a:hover,
.unc-footer-menu a:hover {
  color: #fff;
  text-decoration: underline;
}

.unc-footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 28px;
}

.unc-footer-menu-block h3 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.unc-footer-menu {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.unc-footer-menu a {
  font-size: 15px;
  line-height: 1.3;
}

.unc-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
}

.unc-footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 18px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

/* Tablet */
@media (max-width: 1024px) {
  .topbar-inner,
  .header-inner,
  .unc-global-wrap {
    width: min(100% - 30px, 1240px);
  }

  .brand-logo {
    width: 175px !important;
    max-width: 175px !important;
  }

  .wrap {
    width: min(100% - 30px, 1240px);
    margin-top: 30px;
  }

  .unc-footer-main {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .unc-footer-links-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

/* Móvil */
@media (max-width: 767px) {
  .topbar-inner,
  .header-inner {
    min-height: 72px;
    width: min(100% - 24px, 1240px);
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 10px;
  }

  .brand-link {
    min-width: 0;
    flex: 1;
  }

  .brand-logo {
    width: 145px !important;
    max-width: 145px !important;
  }

  .brand-text {
    font-size: 16px;
  }

  .brand-sub {
    font-size: 11px;
  }

  .menu-toggle {
    display: inline-block;
    width: auto;
  }

  .nav {
    display: none;
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    padding: 10px 0 4px;
  }

  .nav.is-open {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nav a {
    width: 100%;
    border-radius: 16px;
    padding: 13px 14px;
  }

  .wrap {
    width: min(100% - 24px, 1240px);
    margin: 24px auto 42px;
  }

  .card {
    padding: 22px;
    border-radius: 20px;
  }

  h1 {
    font-size: 30px;
  }

  p {
    font-size: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .actions a,
  .actions button,
  .btn {
    width: 100%;
  }

  .unc-global-wrap {
    width: min(100% - 28px, 1240px);
  }

  .unc-footer-cta-row {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 28px;
  }

  .unc-footer-cta-button {
    width: 100%;
    text-align: center;
  }

  .unc-footer-main {
    padding-block: 42px;
  }

  .unc-footer-links-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .unc-footer-bottom-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Ocultar franja CTA superior del footer */
.unc-footer-cta-band {
  display: none !important;
}

/* Ajuste de espacio al quitar CTA */
.unc-footer-main {
  padding-top: 46px;
}

/* Header: dejar solo logo institucional */
.brand-text,
.brand-sub,
.unc-app-brand-copy {
  display: none !important;
}

.brand-link,
.unc-app-brand {
  min-width: auto !important;
}

.brand-logo,
.unc-app-brand img {
  width: 220px !important;
  max-width: 220px !important;
  max-height: 72px !important;
}

@media (max-width: 767px) {
  .brand-logo,
  .unc-app-brand img {
    width: 165px !important;
    max-width: 165px !important;
  }
}

/* =========================================================
   Responsive admin / panel interno
   ========================================================= */

body {
  overflow-x: hidden;
}

.card {
  max-width: 100%;
}

.table {
  width: 100%;
}

.card .table {
  min-width: 860px;
}

/* Permitir desplazamiento horizontal dentro de tarjetas con tablas */
.card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Botones de acciones administrativos */
.actions {
  align-items: center;
}

.actions .btn,
.actions a.btn,
.actions button {
  white-space: nowrap;
}

/* Ajustes para pantallas medianas */
@media (max-width: 1024px) {
  .wrap {
    max-width: 100%;
  }

  .card {
    padding: 24px;
  }

  .card .table {
    min-width: 820px;
  }

  .actions {
    gap: 8px;
  }

  .actions .btn,
  .actions a.btn,
  .actions button {
    padding: 11px 13px;
    font-size: 14px;
  }
}

/* Ajustes móviles */
@media (max-width: 767px) {
  body {
    background:
      radial-gradient(circle at 0% 0%, rgba(0,107,63,.08), transparent 32%),
      linear-gradient(180deg, #f8fbfa 0%, #eef5f2 100%);
  }

  .wrap {
    width: min(100% - 24px, 1240px) !important;
    margin: 22px auto 38px !important;
    padding: 0 !important;
  }

  .card {
    padding: 20px !important;
    border-radius: 18px !important;
    margin-bottom: 18px !important;
  }

  h1 {
    font-size: 28px !important;
    line-height: 1.1 !important;
  }

  h2 {
    font-size: 22px !important;
    line-height: 1.15 !important;
  }

  p {
    font-size: 15px !important;
  }

  label {
    font-size: 15px;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 15px !important;
    padding: 13px 14px !important;
    border-radius: 14px !important;
  }

  .grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-width: 150px;
  }

  .actions .btn,
  .actions a.btn,
  .actions button {
    width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .card .table {
    min-width: 780px;
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 11px 8px;
  }

  .badge {
    font-size: 13px;
  }

  .small {
    font-size: 12px;
  }

  /* Header admin/public en móvil */
  .topbar-inner,
  .header-inner {
    width: min(100% - 22px, 1240px) !important;
    min-height: 70px !important;
    padding: 10px 0 !important;
  }

  .brand-logo,
  .brand img {
    width: 145px !important;
    max-width: 145px !important;
    max-height: 58px !important;
    object-fit: contain !important;
  }

  .brand-text {
    font-size: 15px !important;
  }

  .brand-sub {
    font-size: 11px !important;
  }

  .nav a {
    font-size: 15px !important;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 420px) {
  .wrap {
    width: min(100% - 18px, 1240px) !important;
  }

  .card {
    padding: 17px !important;
  }

  h1 {
    font-size: 25px !important;
  }

  h2 {
    font-size: 20px !important;
  }

  .card .table {
    min-width: 740px;
  }

  .brand-logo,
  .brand img {
    width: 132px !important;
    max-width: 132px !important;
  }
}

/* =========================================================
   Ajuste visual tipo WordPress UNC
   Paleta tomada del plugin UNC
   ========================================================= */

:root {
  --unc-green: #06803B;
  --unc-green-deep: #064E2B;
  --unc-green-dark: #033D22;
  --unc-green-pale: #F3F7EA;
  --unc-border: #E4E8DD;
  --unc-text: #1F2933;
  --unc-text-soft: #5F6B66;
}

/* Header y menú principal */
.topbar,
.header {
  background: #ffffff !important;
  border-bottom: 1px solid var(--unc-border) !important;
  box-shadow: 0 8px 26px rgba(3, 61, 34, 0.06) !important;
}

.topbar-inner,
.header-inner {
  max-width: 1240px !important;
}

/* Enlaces del menú: verde oscuro como WordPress */
.nav a,
.unc-app-nav a {
  color: var(--unc-green-dark) !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  background: transparent !important;
}

/* Hover y activo: verde institucional con texto blanco */
.nav a:hover,
.nav a:focus,
.nav a.active,
.unc-app-nav a:hover,
.unc-app-nav a:focus,
.unc-app-nav a.active {
  color: #ffffff !important;
  background: var(--unc-green) !important;
  text-decoration: none !important;
}

/* Botón menú móvil */
.menu-toggle,
.unc-menu-toggle {
  background: var(--unc-green-pale) !important;
  color: var(--unc-green-dark) !important;
  border: 1px solid var(--unc-border) !important;
  font-weight: 900 !important;
}

.menu-toggle:hover,
.unc-menu-toggle:hover {
  background: var(--unc-green) !important;
  color: #ffffff !important;
}

/* Títulos y textos principales */
h1,
h2 {
  color: var(--unc-green-dark) !important;
}

p,
label,
.table td {
  color: var(--unc-text) !important;
}

.small,
.table th {
  color: var(--unc-text-soft) !important;
}

/* Botones principales tipo UNC */
button,
.btn {
  background: var(--unc-green) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

button:hover,
.btn:hover {
  background: var(--unc-green-deep) !important;
  color: #ffffff !important;
}

.btn.secondary {
  background: var(--unc-green-pale) !important;
  color: var(--unc-green-dark) !important;
  border: 1px solid var(--unc-border) !important;
}

.btn.secondary:hover {
  background: var(--unc-green) !important;
  color: #ffffff !important;
}

/* Badges */
.badge {
  background: var(--unc-green-pale) !important;
  color: var(--unc-green-dark) !important;
}

/* Inputs */
input,
select,
textarea {
  border-color: var(--unc-border) !important;
  color: var(--unc-text) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--unc-green) !important;
  outline: 4px solid rgba(6, 128, 59, 0.12) !important;
}

/* Footer */
.unc-global-footer {
  background:
    radial-gradient(circle at 18% 0%, rgba(6, 128, 59, 0.72) 0%, rgba(6, 78, 43, 0.72) 32%, rgba(3, 61, 34, 1) 68%),
    var(--unc-green-dark) !important;
}

.unc-footer-menu-block h3 {
  color: #ffffff !important;
}

.unc-footer-menu a,
.unc-footer-contact a,
.unc-footer-contact,
.unc-footer-brand-block p {
  color: rgba(255,255,255,.86) !important;
}

/* Responsive menú */
@media (max-width: 767px) {
  .nav a,
  .unc-app-nav a {
    color: var(--unc-green-dark) !important;
    background: var(--unc-green-pale) !important;
  }

  .nav a:hover,
  .nav a.active,
  .unc-app-nav a:hover,
  .unc-app-nav a.active {
    background: var(--unc-green) !important;
    color: #ffffff !important;
  }
}
