/* MiSemestre — estilos. Paleta inspirada en el campus virtual. */
:root {
  --ms-azul: #0E4E78;
  --ms-azul-2: #1A6496;
  --ms-azul-claro: #D7EAF6;
  --ms-ambar: #F2B632;
  --ms-ok: #2BB24C;
  --ms-bad: #E03131;
  --ms-wait: #F2B632;
  --ms-fondo: #F3F6F9;
  --bs-primary: #0E4E78;
  --bs-primary-rgb: 14, 78, 120;
  --bs-link-color: #1A6496;
  --bs-link-hover-color: #0E4E78;
  --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .925rem;
}

body { background: var(--ms-fondo); }
.min-w-0 { min-width: 0; }
.mw-640 { max-width: 640px; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.btn-primary { --bs-btn-bg: var(--ms-azul); --bs-btn-border-color: var(--ms-azul); --bs-btn-hover-bg: #0B3F61; --bs-btn-hover-border-color: #0B3F61; --bs-btn-active-bg: #0A3655; }
.btn-outline-primary { --bs-btn-color: var(--ms-azul); --bs-btn-border-color: var(--ms-azul); --bs-btn-hover-bg: var(--ms-azul); --bs-btn-hover-border-color: var(--ms-azul); }
.form-control:focus, .form-select:focus { border-color: var(--ms-azul-2); box-shadow: 0 0 0 .2rem rgba(26, 100, 150, .2); }

/* ---------- Topbar / sidebar ---------- */
.topbar { background: linear-gradient(90deg, var(--ms-azul), var(--ms-azul-2)); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ms-ambar); color: var(--ms-azul); font-size: 1.1rem; font-weight: 700; }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 2rem; }
.periodo-chip { align-items: center; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 999px; padding: .25rem .8rem; font-size: .8rem; margin-left: .5rem; }

.sidebar { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid #E3E8EE; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); }
  .sidebar .offcanvas-body { display: flex; height: 100%; }
}
.sidebar .nav-link { color: #35485A; border-radius: .6rem; font-weight: 500; }
.sidebar .nav-link:hover { background: var(--ms-azul-claro); color: var(--ms-azul); }
.sidebar .nav-link.active { background: var(--ms-azul); color: #fff; }
.main-area { min-width: 0; }

/* ---------- KPIs ---------- */
.kpi-card { border: 0; border-radius: 1rem; box-shadow: 0 1px 3px rgba(16, 40, 60, .08); transition: transform .15s ease, box-shadow .15s ease; color: inherit; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 40, 60, .12); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi-val { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: #1D2B36; }
.kpi-lbl { font-size: .78rem; color: #6B7B88; }
.kpi-blue .kpi-icon { background: var(--ms-azul-claro); color: var(--ms-azul); }
.kpi-amber .kpi-icon { background: #FDF1D3; color: #B7860B; }
.kpi-orange .kpi-icon { background: #FFE8D6; color: #D9622B; }
.kpi-red .kpi-icon { background: #FDE2E2; color: var(--ms-bad); }

/* ---------- Encabezado tipo campus ---------- */
.campus-head { background: var(--ms-azul); color: #fff; border-radius: .8rem; padding: .7rem 1rem; font-weight: 600; }

/* ---------- Tarjeta de materia ---------- */
.materia-card { --mat: var(--ms-azul-2); border: 1px solid #E3E8EE; border-left: 5px solid var(--mat); border-radius: .9rem; transition: box-shadow .15s ease, transform .15s ease; }
.materia-card:hover { box-shadow: 0 6px 18px rgba(16, 40, 60, .1); transform: translateY(-1px); }
.materia-card .card-body { position: relative; }
.codigo-chip { background: var(--ms-azul); color: #fff; font-weight: 600; font-size: .78rem; border-radius: .45rem; padding: .3rem .6rem; white-space: nowrap; position: relative; z-index: 2; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; background: var(--mat, #999); }
.dot-ok { background: var(--ms-ok); }
.dot-bad { background: var(--ms-bad); }
.dot-wait { background: var(--ms-wait); }

.progress-stacked { height: 8px; background: #E9EEF2; border-radius: 99px; }
.bg-ok { background: var(--ms-ok) !important; }
.bg-bad { background: var(--ms-bad) !important; }
.bg-wait { background: var(--ms-wait) !important; }

/* ---------- Próximas entregas ---------- */
.proximas .list-group-item { --mat: var(--ms-azul-2); border-left: 4px solid var(--mat); }
.fecha-box { width: 46px; flex-shrink: 0; text-align: center; border-radius: .6rem; background: var(--ms-azul-claro); color: var(--ms-azul); padding: .3rem 0; line-height: 1.1; }
.fecha-box .dia { display: block; font-weight: 700; font-size: 1.15rem; }
.fecha-box .mes { display: block; font-size: .7rem; text-transform: uppercase; }

/* ---------- Detalle de materia ---------- */
.materia-hero { --mat: var(--ms-azul-2); background: linear-gradient(135deg, var(--ms-azul), var(--mat)); color: #fff; border-radius: 1rem; padding: 1.4rem; box-shadow: 0 6px 20px rgba(14, 78, 120, .2); }
.hero-stats .hs-val { font-size: 1.5rem; font-weight: 700; }
.hero-stats .hs-lbl { font-size: .75rem; opacity: .8; }
.hero-progress { background: rgba(255, 255, 255, .25); height: 10px; }

.tabla-act thead th { background: #F7F9FB; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; color: #5B6B78; white-space: nowrap; }
.tabla-act tfoot td { background: var(--ms-azul-claro); color: var(--ms-azul); }
.tabla-act .obs { max-width: 320px; }
.fila-vencida td { background: #FFF5F5; }
.materia-link { --mat: var(--ms-azul-2); color: #5B6B78; }
.notas-texto { white-space: normal; }

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; background: radial-gradient(circle at 20% 20%, #1A6496 0, #0E4E78 45%, #082F49 100%); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 410px; border-radius: 1.2rem; overflow: hidden; }
.auth-head { background: linear-gradient(135deg, var(--ms-azul), var(--ms-azul-2)); color: #fff; text-align: center; padding: 2rem 1.5rem 1.6rem; }

.card { border-color: #E3E8EE; border-radius: .9rem; }
.card-header:first-child { border-radius: .9rem .9rem 0 0; }
