@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --text: #1f2734;
  --border: #d9deea;

  /* Colores institucionales UdeA */
  --udea-green-900: #01602d;
  --udea-green-700: #348f41;
  --udea-green-500: #3dae2b;
  --udea-lime: #93d500;
  --udea-aqua: #3bbfad;
  --udea-teal-600: #009579;
  --udea-teal-700: #007473;
  --udea-plum: #752157;
  --udea-blue: #007297;
  --udea-red: #f5333f;

  --nav-bg: var(--udea-teal-700);
  --nav-active: var(--udea-teal-600);
  --nav-accent: var(--udea-aqua);
  --nav-text: #ffffff;
  --nav-muted: rgba(255, 255, 255, 0.72);
  --nav-hover: rgba(255, 255, 255, 0.1);

  --brand: var(--udea-teal-700);
  --brand-soft: #e3f2ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ---------------------------------------------------------------- navbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 2px solid var(--nav-accent);
  color: var(--nav-text);
}

.navbar {
  width: min(1440px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--nav-text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  height: 34px;
  width: auto;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

/* Marca «Nutabe» en peso liviano (barra, portada y recuadro del ingreso). */
.brand-name {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.brand-sub {
  color: var(--nav-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-collapse {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--nav-text);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.nav-button:hover,
.nav-item.is-open .nav-button {
  background: var(--nav-hover);
}

.nav-button.is-active {
  background: var(--nav-active);
}

.nav-button:focus-visible,
.nav-toggle:focus-visible,
.nav-logout:focus-visible,
.dropdown a:focus-visible {
  outline: 2px solid var(--udea-lime);
  outline-offset: 2px;
}

.nav-caret {
  width: 10px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

.nav-item.is-open .nav-caret {
  transform: rotate(180deg);
}

.dropdown {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(0, 60, 59, 0.16);
  display: none;
}

.nav-item.is-open .dropdown {
  display: block;
}

.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.dropdown a:hover {
  background: var(--brand-soft);
  color: var(--udea-teal-700);
}

.dropdown a[aria-current="page"] {
  color: var(--udea-teal-700);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--udea-teal-600);
}

.nav-session {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-user {
  max-width: 200px;
  overflow: hidden;
  color: var(--nav-muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: var(--nav-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-logout:hover {
  background: var(--nav-hover);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--nav-text);
}

/* El pie de página queda abajo aunque el contenido sea corto */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1 0 auto;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px 16px 24px;
}

/* ---------------------------------------------------------------- portada */
.home {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(20px, 2.6vw, 32px) clamp(22px, 3vw, 40px);
  border-radius: 12px;
  background: radial-gradient(circle at 92% 20%, rgba(255, 255, 255, 0.12), transparent 30%), var(--udea-teal-600);
  box-shadow: 0 4px 12px rgba(0, 116, 115, 0.18);
  color: #fff;
}

.home-kicker {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.home-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.98rem;
  line-height: 1.55;
}

.home-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.home-btn {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.home-btn.light {
  background: #fff;
  color: var(--udea-teal-700);
}

.home-btn.light:hover {
  background: var(--brand-soft);
}

.home-btn.outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.home-btn.outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.home-hero-logo {
  flex: none;
  width: 78px;
  height: auto;
  opacity: 0.9;
}

.home-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-kpi {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: hidden;
  padding: 12px 18px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
  color: #262626;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--kpi-color);
}

.home-kpi:hover {
  border-color: #d0d0d0;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.065);
  transform: translateY(-1px);
}

.home-kpi .label {
  color: #8c8c8c;
  font-size: 0.84rem;
}

.home-kpi strong {
  margin: 2px 0;
  color: #1f1f1f;
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
}

.home-kpi .note {
  color: #595959;
  font-size: 0.82rem;
}

.home-kpi .note.muted {
  color: #8c8c8c;
}

.home-access {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 18px;
  border: 1px solid #e5e5e5;
  border-top: 3px solid var(--card-color);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
}

.home-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-card-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card-color);
  color: #fff;
  font-size: 15px;
}

.home-card h2 {
  margin: 0;
  color: #262626;
  font-size: 1.15rem;
  font-weight: 500;
}

.home-card > p {
  margin: 0;
  color: #595959;
  font-size: 0.9rem;
  line-height: 1.5;
}

.home-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-tags span {
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-color) 8%, #fff);
  color: var(--card-color);
  font-size: 0.78rem;
  font-weight: 500;
}

.home-card-cta {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--udea-teal-700);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.home-card-cta:hover {
  background: var(--udea-green-900);
}

.home-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  color: #262626;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

a.home-item:hover {
  border-color: var(--card-color);
  background: color-mix(in srgb, var(--card-color) 5%, #fff);
}

.home-item .title {
  font-weight: 500;
}

a.home-item .title::after {
  content: " →";
  color: var(--card-color);
}

.home-item .meta {
  color: #8c8c8c;
  font-size: 0.82rem;
}

.home-item .urgent {
  display: inline-block;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--udea-red);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
}

.home-item.is-disabled {
  background: #fafafa;
  color: #8c8c8c;
}

.home-freshness {
  margin: 2px 4px 0;
  color: #8c8c8c;
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------- pie de página */
.site-footer {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.site-footer-inner {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 14px 16px;
  color: #8c8c8c;
  font-size: 0.82rem;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

.site-footer a {
  color: var(--udea-teal-700);
  font-weight: 500;
  text-decoration: none;
}

.site-footer-credit {
  display: block;
  margin-top: 2px;
  color: #8c8c8c;
  font-size: 0.72rem;
}

.site-footer .site-footer-credit a {
  font-weight: 400;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1000px) {
  .home-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 600px) {
  .home-kpis {
    grid-template-columns: 1fr;
  }

  .home-hero-logo {
    display: none;
  }
}

.dashboard-shell h1 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.dash-frame {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: 520px;
  display: block;
}

.dash-frame-form {
  min-height: 900px;
}

.auth-shell {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 72px) 16px;
}

.auth-card {
  width: min(480px, 100%);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 76, 129, 0.11), transparent 36%),
    var(--surface);
  box-shadow: 0 24px 70px rgba(19, 39, 62, 0.1);
  text-align: center;
}

.auth-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #16843a;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.auth-mark-brand {
  font-weight: 400;
}

.auth-mark-error {
  background: #b74435;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: #16713a;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  color: #172333;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.15;
}

.auth-copy {
  margin: 16px auto 24px;
  color: #5d6a79;
  line-height: 1.6;
}

.auth-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #172333;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-button:hover {
  transform: translateY(-1px);
  background: #24364c;
  box-shadow: 0 12px 24px rgba(23, 35, 51, 0.18);
}

.auth-button:focus-visible {
  outline: 3px solid rgba(15, 76, 129, 0.25);
  outline-offset: 3px;
}

.microsoft-mark {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.auth-note {
  margin: 18px 0 0;
  color: #788493;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .navbar {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 12px;
  }

  .brand-sub {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-collapse {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding-bottom: 8px;
  }

  .navbar.is-expanded .nav-collapse {
    display: flex;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-button {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown {
    position: static;
    margin-top: 4px;
    box-shadow: none;
  }

  .nav-session {
    border-left: 0;
    padding-left: 0;
    justify-content: space-between;
  }
}

/* ---------------------------------------------------------------- informe por unidad académica */
.report-page {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.report-head {
  padding: 16px clamp(18px, 2.2vw, 28px);
  border-radius: 12px;
  background: var(--udea-teal-600);
  box-shadow: 0 4px 12px rgba(0, 116, 115, 0.18);
  color: #fff;
}

.report-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 500;
}

.report-head p {
  max-width: 820px;
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 18px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
}

.report-toolbar label {
  color: #595959;
  font-size: 0.88rem;
  font-weight: 500;
}

.report-toolbar select {
  flex: 0 1 460px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  color: #262626;
  font: inherit;
  font-size: 0.92rem;
}

.report-toolbar select:focus {
  border-color: var(--udea-teal-600);
  outline: 3px solid rgba(0, 149, 121, 0.14);
}

.report-download {
  margin-left: auto;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--udea-teal-700);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.report-download:hover {
  background: var(--udea-green-900);
}

.report-preview {
  overflow: hidden;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #e9ecef;
}

.report-preview iframe {
  display: block;
  width: 100%;
  height: calc(11in + 40px); /* la vista previa lo ajusta a su alto real */
  border: 0;
}
