/* ============================================================
   IncluEdu — Shared app shell styles
   Used by the authenticated platform screens (Mi Aula,
   Biblioteca, Generador PAI, Configuración).
   ============================================================ */
:root {
  --navy: #1A2F6B; --navy-dark: #0F1E4A;
  --green: #4DB84E; --green-dark: #3A9B3B;
  --orange: #F47A3F; --purple: #7B3FA0;
  --teal: #26C6DA; --yellow: #F5D436;
  --white: #FFFFFF; --bg2: #F8F9FF;
  --text: #1A2F6B; --text2: #5A6A8A; --text3: #8A99BB;
  --border: #E5EAF5;
  --shadow: 0 2px 16px rgba(26,47,107,0.09);
  --shadow-lg: 0 8px 32px rgba(26,47,107,0.14);
  --radius: 16px; --radius-sm: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: var(--bg2); color: var(--text); display: flex; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ===== Real logo emblem tile ===== */
.ie-emblem { height: 36px; width: 36px; object-fit: contain; background: #fff; border-radius: 9px; padding: 3px; box-shadow: 0 0 0 1px rgba(26,47,107,0.07), 0 1px 3px rgba(26,47,107,0.12); flex-shrink: 0; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px; min-height: 100vh; background: var(--navy);
  display: flex; flex-direction: column; padding: 0;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
}
.sidebar-logo {
  padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.logo-wordmark { font-size: 1.3rem; font-weight: 800; color: white; line-height: 1; }
.logo-wordmark .te { color: var(--teal); }
.logo-wordmark .gr { color: var(--green); }
.sidebar-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 10px; font-size: 0.92rem; font-weight: 600;
  color: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(255,255,255,0.15); color: white; }
.nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 10px 14px; }
.nav-badge {
  margin-left: auto; background: var(--orange); color: white;
  font-size: 0.68rem; font-weight: 900; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 50px; display: flex; align-items: center; justify-content: center;
}
.sidebar-user {
  padding: 16px 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: white; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.88rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* ===== MAIN ===== */
.main { margin-left: 240px; flex: 1; min-width: 0; }
.top-header {
  background: white; border-bottom: 1px solid var(--border);
  padding: 20px 32px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 8px rgba(26,47,107,0.06);
}
.header-left h1 { font-size: 1.4rem; font-weight: 800; color: var(--navy); }
.header-left p { font-size: 0.88rem; color: var(--text2); margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-chip {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 20px; font-size: 0.83rem; font-weight: 700;
  color: var(--text2); display: flex; align-items: center; gap: 6px;
}
.header-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.notif-btn {
  width: 38px; height: 38px; border-radius: 10px; background: var(--bg2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer; position: relative;
}
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--orange); border-radius: 50%; border: 2px solid white; }
.content { padding: 32px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 10px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.92rem; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.btn-primary { background: var(--green); color: white; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(77,184,78,0.32); }
.btn-navy { background: var(--navy); color: white; border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-dark); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); color: var(--text2); background: transparent; }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ===== SHARED SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.section-action { font-size: 0.88rem; font-weight: 700; color: var(--teal); cursor: pointer; }
.section-action:hover { text-decoration: underline; }

/* ===== NEE BADGES (Decreto 170 colour coding) ===== */
.nee-chip { font-size: 0.72rem; font-weight: 800; padding: 3px 9px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; }
.nee-chip.p { background: #FAF5FF; color: var(--purple); border-color: #E9D5FF; }   /* permanente */
.nee-chip.t { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }          /* transitoria */
.nee-chip.i { background: #ECFEFF; color: #0E7490; border-color: #A5F0FA; }           /* info / teal */
.nee-chip.g { background: #F0FDF4; color: var(--green-dark); border-color: #BBF7D0; }

/* ===== PAI STATUS ===== */
.status { font-size: 0.74rem; font-weight: 800; padding: 4px 11px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.status.ok { background: #F0FDF4; color: var(--green-dark); }
.status.warn { background: #FFF7ED; color: var(--orange); }
.status.none { background: #F1F5F9; color: var(--text3); }

/* ===== CARD ===== */
.card { background: white; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,30,74,0.45); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; }
.modal-head { padding: 22px 26px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; border-radius: var(--radius) var(--radius) 0 0; }
.modal-head h3 { font-size: 1.15rem; font-weight: 900; color: var(--navy); }
.modal-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg2); cursor: pointer; font-size: 1rem; color: var(--text2); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { border-color: var(--orange); color: var(--orange); }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 18px 26px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: 0; background: white; }

@media (max-width: 1000px) {
  .sidebar { width: 66px; }
  .sidebar-logo .logo-wordmark, .nav-item span:not(.nav-icon), .sidebar-user .user-info { display: none; }
  .nav-item { justify-content: center; }
  .main { margin-left: 66px; }
}
