/* ═══════════════════════════════════════════════════════════
   LICEO TECNOLÓGICO — Sistema de Control Escolar
   Paleta: Navy #1C2B4A · Gold #C49A3C · Cream #F5F1E8
   Tipografía: Arial (todo el sistema)
   Estilo: Académico institucional — sin sidebar
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --navy:          #1C2B4A;
  --navy-dark:     #111B30;
  --navy-hover:    #253660;
  --navy-muted:    #2D4070;
  --gold:          #C49A3C;
  --gold-dark:     #A67C28;
  --gold-light:    #D4B76A;
  --gold-pale:     #F0E6C8;
  --cream:         #F5F1E8;
  --cream-dark:    #EDE7D8;
  --warm-white:    #FDFBF7;
  --border:        #DDD6C4;
  --border-dark:   #C5BAA5;
  --text-primary:  #1A1A1A;
  --text-body:     #374151;
  --text-muted:    #6B7280;
  --text-light:    #9CA3AF;

  --topnav-height: 62px;
  --radius-sm:     4px;
  --radius:        6px;
  --radius-lg:     8px;

  /* Bootstrap overrides */
  --bs-primary:       #1C2B4A;
  --bs-primary-rgb:   28, 43, 74;
  --bs-body-bg:       #F5F1E8;
  --bs-body-color:    #374151;
  --bs-link-color:    #1C2B4A;
  --bs-link-hover-color: #C49A3C;
  --bs-border-color:  #DDD6C4;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; }

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-body);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h4, h5, h6 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  color: var(--navy);
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* ── Botones ───────────────────────────────────────────────── */
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
  box-shadow: none;
}
.btn-primary:active { background: var(--navy-dark); }

.btn-outline-secondary {
  border-color: var(--border-dark);
  color: var(--text-body);
  border-radius: var(--radius-sm);
}
.btn-outline-secondary:hover {
  background: var(--cream-dark);
  border-color: var(--border-dark);
  color: var(--navy);
}

.btn-gold {
  background: var(--gold);
  border: none;
  color: var(--navy-dark);
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.btn-gold:hover { background: var(--gold-dark); color: #fff; }

/* ── Form controls ─────────────────────────────────────────── */
.form-control {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--warm-white);
  color: var(--text-primary);
  font-size: 0.9375rem;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28, 43, 74, 0.12);
  background: #fff;
  outline: none;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: 0.3rem;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN — Split layout académico
   ═══════════════════════════════════════════════════════════ */
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Panel izquierdo — navy institucional */
.login-panel-left {
  background: var(--navy-dark);
  background-image:
    radial-gradient(ellipse at 30% 60%, rgba(196, 154, 60, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(45, 64, 112, 0.5) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Bordes decorativos académicos */
.login-panel-left::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
}
.login-panel-left::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
}

.login-logo-frame {
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-bottom: 1.75rem;
  box-shadow: 0 0 0 8px rgba(196, 154, 60, 0.2), 0 0 0 16px rgba(196, 154, 60, 0.08);
}

.login-logo-img {
  width: 116px;
  height: 116px;
  object-fit: contain;
}

.login-institution-name {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.login-institution-sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 2rem;
}

.login-divider-gold {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 2rem;
}

.login-tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  font-style: italic;
  max-width: 260px;
  line-height: 1.7;
}

/* Panel derecho — formulario */
.login-panel-right {
  background: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.login-form-container {
  width: 100%;
  max-width: 380px;
}

.login-form-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.login-form-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.login-form-title-underline {
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 1.75rem;
  border-radius: 2px;
}

/* Responsive login */
@media (max-width: 768px) {
  .login-split { grid-template-columns: 1fr; }
  .login-panel-left { display: none; }
  .login-panel-right { padding: 2rem 1.5rem; background: var(--cream); }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN — Topnav horizontal (sin sidebar)
   ═══════════════════════════════════════════════════════════ */

/* Barra principal de navegación */
.admin-topnav {
  background: var(--navy-dark);
  height: var(--topnav-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0;
}

/* Brand: logo + nombre */
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 2rem;
}

.topnav-logo-wrap {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(196,154,60,0.4);
}

.topnav-logo { width: 34px; height: 34px; object-fit: contain; }

.topnav-brand-text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.topnav-brand-sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Divider vertical decorativo */
.topnav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
  margin: 0 1.25rem 0 0;
  flex-shrink: 0;
}

/* Nav links desktop */
.topnav-links {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.125rem;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.875rem;
  height: calc(var(--topnav-height) - 3px); /* resta el border-bottom gold */
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px; /* sube el border al nivel del nav */
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
}

.topnav-link:hover {
  color: #fff;
  border-bottom-color: rgba(196,154,60,0.5);
}

.topnav-link.active,
.topnav-link.show {
  color: #fff;
  border-bottom-color: var(--gold);
}

.topnav-link i { font-size: 0.85rem; opacity: 0.8; }

/* Dropdown del topnav */
.topnav-dropdown {
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  background: var(--warm-white);
  padding: 0.375rem 0;
  margin-top: 6px !important;
}

.topnav-dropdown .dropdown-header {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0.5rem 1rem 0.25rem;
}

.topnav-dropdown .dropdown-item {
  font-size: 0.855rem;
  font-weight: 400;
  color: var(--text-body);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.1s ease, color 0.1s ease;
}

.topnav-dropdown .dropdown-item i {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.topnav-dropdown .dropdown-item:hover {
  background: var(--cream);
  color: var(--navy);
}
.topnav-dropdown .dropdown-item:hover i { color: var(--gold); }

.topnav-dropdown .dropdown-item.active {
  background: var(--gold-pale);
  color: var(--navy);
  font-weight: 600;
}
.topnav-dropdown .dropdown-item.active i { color: var(--gold-dark); }

.topnav-dropdown .dropdown-divider { border-color: var(--border); margin: 0.25rem 0; }

/* Usuario (extremo derecho) */
.topnav-user-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.topnav-user-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Hamburguesa mobile */
.topnav-hamburger {
  display: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.topnav-hamburger:hover { background: rgba(255,255,255,0.18); }

/* Menú móvil colapsado */
.topnav-mobile-menu {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  display: none;
}

.topnav-mobile-menu.open { display: block; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s ease, color 0.1s ease;
}

.mobile-nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.mobile-nav-link.active { color: var(--gold); background: rgba(196,154,60,0.06); }

.mobile-nav-section {
  padding: 0.5rem 1.25rem 0.2rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 0.25rem;
}

/* Responsive: ocultar links, mostrar hamburguesa */
@media (max-width: 991px) {
  .topnav-links  { display: none !important; }
  .topnav-hamburger { display: inline-flex; }
  .topnav-user-desktop { display: none !important; }
}

/* ── Área de contenido admin ────────────────────────────────── */
.admin-content {
  min-height: calc(100vh - var(--topnav-height));
  background: var(--cream);
  padding: 2rem 2rem;
}

.content-area {
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .admin-content { padding: 1.25rem; }
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}

.page-title-line {
  width: 36px;
  height: 3px;
  background: var(--gold);
  margin-top: 6px;
  border-radius: 2px;
}

/* ── Cards académicas ───────────────────────────────────────── */
.card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(28, 43, 74, 0.06);
}

.card-header-academic {
  padding: 0.875rem 1.25rem;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header-academic h6 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

/* ── Stat cards — layout horizontal ─────────────────────────── */
.stat-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--navy);
  padding: 1.125rem 1.25rem;
  box-shadow: 0 1px 3px rgba(28, 43, 74, 0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 14px rgba(28, 43, 74, 0.1);
  transform: translateY(-1px);
}

.stat-card-gold  { border-left-color: var(--gold); }
.stat-card-red   { border-left-color: #dc2626; }
.stat-card-green { border-left-color: #16a34a; }
.stat-card-amber { border-left-color: #d97706; }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--cream);
  color: var(--navy);
  flex-shrink: 0;
}

.stat-body { flex: 1; min-width: 0; }

.stat-value {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 0.1rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
}

.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--navy); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--navy); }

/* ── Tables ─────────────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
  color: var(--text-body);
}
.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--cream);
  border-bottom: 2px solid var(--border);
  padding: 0.75rem 1rem;
}
.table tbody td { padding: 0.75rem 1rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--cream); }

/* ═══════════════════════════════════════════════════════════
   PORTAL ALUMNO / MAESTRO
   ═══════════════════════════════════════════════════════════ */
.portal-topbar {
  background: var(--navy);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 500;
}

.portal-logo-wrap {
  width: 38px;
  height: 38px;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(196,154,60,0.4);
}

.portal-logo { width: 32px; height: 32px; object-fit: contain; }

.portal-brand-name {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.portal-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: rgba(196, 154, 60, 0.2);
  color: var(--gold-light);
  border: 1px solid rgba(196, 154, 60, 0.3);
}

/* Nav tabs del portal */
.portal-tabs-bar {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.portal-tabs-bar .nav-link {
  color: var(--text-muted);
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s, border-color 0.15s;
}
.portal-tabs-bar .nav-link:hover { color: var(--navy); }
.portal-tabs-bar .nav-link.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

.portal-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.portal-area {
  padding: 2rem 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .content-area { padding: 1.25rem; }
  .topbar { padding: 0 1rem; }
}

/* ═══════════════════════════════════════════════════════════
   UTILIDADES INSTITUCIONALES
   ═══════════════════════════════════════════════════════════ */
.text-navy   { color: var(--navy) !important; }
.text-gold   { color: var(--gold) !important; }
.text-muted  { color: var(--text-muted) !important; }
.bg-navy     { background: var(--navy) !important; }
.bg-cream    { background: var(--cream) !important; }
.border-gold { border-color: var(--gold) !important; }

/* Gold underline decorativo */
.title-gold-line::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--gold);
  margin-top: 6px;
  border-radius: 2px;
}

/* Badge de estado */
.badge-pending   { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-active    { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-debt      { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-suspended { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Card hover */
.card-interactive {
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.card-interactive:hover {
  box-shadow: 0 6px 20px rgba(28,43,74,0.1);
  transform: translateY(-2px);
  border-color: var(--gold);
  text-decoration: none;
}

/* Placeholder / empty state */
.empty-state {
  padding: 3.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 2.5rem;
  color: var(--border-dark);
  margin-bottom: 1rem;
}
.empty-state-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
