/* Vista escolar integrada: Personal, Grupos y Alumnos del portal Director. */
#dir-portal .dir-school-subtitle { margin: 4px 0 0; color: #64748b; font-size: 12px; }
#dir-portal .dir-school-search { display: flex; align-items: center; gap: 7px; min-width: 270px; padding: 8px 12px; border: 1px solid #dbe3ea; border-radius: 11px; background: #fff; color: #94a3b8; }
#dir-portal .dir-school-search:focus-within { border-color: #4f8ef7; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
#dir-portal .dir-school-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #0f172a; font: 12px 'Sora', sans-serif; }
#dir-portal .dir-school-select { min-width: 175px; padding: 9px 12px; border: 1px solid #dbe3ea; border-radius: 11px; background: #fff; color: #334155; font: 600 12px 'Sora', sans-serif; outline: 0; }
#dir-portal .dir-school-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(310px,360px); gap: 18px; align-items: start; }
#dir-portal .dir-school-panel { min-height: 410px; max-height: calc(100vh - 190px); overflow: auto; position: sticky; top: 0; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: 0 12px 34px rgba(15,23,42,.07); }
#dir-portal .dir-school-panel-empty { min-height: 405px; padding: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #64748b; }
#dir-portal .dir-school-panel-empty > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; margin-bottom: 15px; background: #eff6ff; font-size: 27px; }
#dir-portal .dir-school-panel-empty strong { color: #0f172a; font-size: 15px; }
#dir-portal .dir-school-panel-empty p { max-width: 245px; margin: 7px 0 0; font-size: 11px; line-height: 1.6; }
#dir-portal .dir-school-loading { grid-column: 1/-1; min-height: 180px; display: grid; place-items: center; color: #64748b; font-size: 12px; }
#dir-portal .dir-school-loading::before { content: ''; width: 20px; height: 20px; margin-right: 9px; display: inline-block; vertical-align: middle; border: 2px solid #dbeafe; border-top-color: #2563eb; border-radius: 50%; animation: dirSchoolSpin .75s linear infinite; }
@keyframes dirSchoolSpin { to { transform: rotate(360deg); } }
#dir-portal .dir-school-empty { grid-column: 1/-1; min-height: 240px; padding: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #cbd5e1; border-radius: 17px; background: #f8fafc; text-align: center; color: #64748b; }
#dir-portal .dir-school-empty > span { font-size: 32px; margin-bottom: 10px; }
#dir-portal .dir-school-empty strong { color: #0f172a; font-size: 14px; }
#dir-portal .dir-school-empty p { margin: 6px 0 0; max-width: 360px; font-size: 11px; line-height: 1.55; }
#dir-portal .dir-school-empty.is-error { border-color: #fecaca; background: #fff7f7; }

/* Personal */
#dir-portal .dir-school-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
#dir-portal .dir-school-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
#dir-portal .dir-school-kpi > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #eff6ff; color: #2563eb; font-size: 18px; }
#dir-portal .dir-school-kpi b { display: block; color: #0f172a; font: 800 21px 'Fraunces', serif; }
#dir-portal .dir-school-kpi small { display: block; margin-top: 1px; color: #64748b; font-size: 9.5px; }
#dir-portal .dir-school-kpi.is-green > span { background: #f0fdf4; color: #15803d; }
#dir-portal .dir-school-kpi.is-violet > span { background: #f5f3ff; color: #7c3aed; }
#dir-portal .dir-school-kpi.is-amber > span { background: #fffbeb; color: #b45309; }
#dir-portal .dir-role-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
#dir-portal .dir-role-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border: 1px solid #dce5df; border-radius: 10px; background: #fff; color: #475569; font: 700 10px 'Sora', sans-serif; cursor: pointer; }
#dir-portal .dir-role-filter b { min-width: 19px; padding: 2px 5px; border-radius: 99px; background: #f1f5f9; color: #64748b; font-size: 9px; }
#dir-portal .dir-role-filter.active { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 2px rgba(59,130,246,.07); }
#dir-portal .dir-role-filter.active b { background: #dbeafe; color: #1d4ed8; }
#dir-portal .dir-personal-groups { display: flex; flex-direction: column; gap: 13px; }
#dir-portal .dir-person-section { padding: 15px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; }
#dir-portal .dir-person-section > header { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
#dir-portal .dir-person-section > header > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #f1f5f9; }
#dir-portal .dir-person-section > header strong, #dir-portal .dir-person-section > header small { display: block; }
#dir-portal .dir-person-section > header strong { color: #0f172a; font-size: 12px; }
#dir-portal .dir-person-section > header small { margin-top: 1px; color: #94a3b8; font-size: 9px; }
#dir-portal .dir-person-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#dir-portal .dir-person-card { width: 100%; min-width: 0; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid #edf1f4; border-radius: 12px; background: #fbfcfd; text-align: left; cursor: pointer; transition: .16s ease; }
#dir-portal .dir-person-card:hover, #dir-portal .dir-person-card.active { transform: translateY(-1px); border-color: #93c5fd; background: #f8fbff; box-shadow: 0 7px 20px rgba(30,64,175,.08); }
#dir-portal .dir-person-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; background: var(--role-light); color: var(--role); font-size: 10px; font-weight: 900; }
#dir-portal .dir-person-copy { min-width: 0; flex: 1; }
#dir-portal .dir-person-copy strong, #dir-portal .dir-person-copy small, #dir-portal .dir-person-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dir-portal .dir-person-copy strong { color: #0f172a; font-size: 10.5px; }
#dir-portal .dir-person-copy small { margin-top: 2px; color: #475569; font-size: 8.5px; font-weight: 700; }
#dir-portal .dir-person-copy > span { margin-top: 3px; color: #94a3b8; font-size: 8px; }
#dir-portal .dir-person-arrow { color: #94a3b8; font-size: 18px; }

/* Paneles de detalle */
#dir-portal .dir-panel-profile, #dir-portal .dir-group-detail, #dir-portal .dir-student-detail { padding: 18px; }
#dir-portal .dir-panel-profile-head { padding: 16px; display: flex; align-items: center; gap: 12px; border-radius: 14px; background: linear-gradient(135deg,var(--role-light),#fff); border: 1px solid #dbe4f0; }
#dir-portal .dir-panel-profile-head > span { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; background: var(--role); color: #fff; font-size: 12px; font-weight: 900; }
#dir-portal .dir-panel-profile-head small { color: var(--role); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
#dir-portal .dir-panel-profile-head h3, #dir-portal .dir-group-detail-head h3, #dir-portal .dir-student-detail header h3 { margin: 3px 0 2px; color: #0f172a; font: 750 17px 'Fraunces', serif; }
#dir-portal .dir-panel-profile-head p, #dir-portal .dir-group-detail-head p, #dir-portal .dir-student-detail header p { margin: 0; color: #64748b; font-size: 9.5px; }
#dir-portal .dir-panel-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0; }
#dir-portal .dir-panel-facts > div { padding: 11px; border-radius: 11px; background: #f8fafc; border: 1px solid #edf1f4; }
#dir-portal .dir-panel-facts small, #dir-portal .dir-panel-facts b { display: block; }
#dir-portal .dir-panel-facts small { color: #94a3b8; font-size: 8.5px; }
#dir-portal .dir-panel-facts b { margin-top: 3px; color: #334155; font-size: 10.5px; }
#dir-portal .dir-panel-facts b.is-active { color: #15803d; }
#dir-portal .dir-panel-section { margin-top: 17px; }
#dir-portal .dir-panel-section h4 { margin: 0 0 9px; color: #475569; font-size: 9.5px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
#dir-portal .dir-panel-section > p { color: #64748b; font-size: 10px; line-height: 1.55; }
#dir-portal .dir-panel-section-title { display: flex; align-items: center; justify-content: space-between; }
#dir-portal .dir-panel-section-title > span { padding: 3px 7px; border-radius: 99px; background: #eff6ff; color: #2563eb; font-size: 9px; font-weight: 800; }
#dir-portal .dir-assignment-list, #dir-portal .dir-observation-list { display: flex; flex-direction: column; gap: 7px; }
#dir-portal .dir-assignment-list > div, #dir-portal .dir-observation-list > div { padding: 9px 10px; border: 1px solid #edf1f4; border-radius: 10px; background: #fafcfd; }
#dir-portal .dir-assignment-list b, #dir-portal .dir-assignment-list span { display: block; }
#dir-portal .dir-assignment-list b { color: #0f172a; font-size: 10px; }
#dir-portal .dir-assignment-list span { margin-top: 2px; color: #64748b; font-size: 9px; }
#dir-portal .dir-panel-note { padding: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; color: #64748b; font-size: 9.5px; line-height: 1.5; }
#dir-portal .dir-panel-action { margin-top: 16px; min-height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #0d5c2f; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; }
#dir-portal .dir-panel-back { margin-bottom: 12px; padding: 7px 10px; border: 1px solid #dbe3ea; border-radius: 9px; background: #fff; color: #334155; font: 700 9.5px 'Sora', sans-serif; cursor: pointer; }

/* Escuela y salones */
#dir-portal .dir-campus-banner { min-height: 82px; margin-bottom: 16px; padding: 15px 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #bfdbfe; border-radius: 17px; background: radial-gradient(circle at 15% 10%,rgba(255,255,255,.9),transparent 26%),linear-gradient(125deg,#eff6ff,#ecfdf5); }
#dir-portal .dir-campus-banner > div:first-child { flex: 1; }
#dir-portal .dir-campus-banner strong { color: #0f172a; font-size: 13px; }
#dir-portal .dir-campus-banner p { margin: 4px 0 0; color: #64748b; font-size: 10px; }
#dir-portal .dir-campus-summary { display: flex; gap: 8px; }
#dir-portal .dir-campus-summary > span { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.75); color: #64748b; font-size: 9px; }
#dir-portal .dir-campus-summary b { color: #0f172a; font-size: 13px; }
#dir-portal .dir-campus-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
#dir-portal .dir-campus-floor { min-width: 0; padding: 11px; border: 1px solid #dbe3ea; border-radius: 17px; background: linear-gradient(#fff,#f8fafc); }
#dir-portal .dir-campus-floor > header { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
#dir-portal .dir-campus-floor > header > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #0f172a; color: #fff; font: 800 11px 'Fraunces', serif; }
#dir-portal .dir-campus-floor > header strong, #dir-portal .dir-campus-floor > header small { display: block; }
#dir-portal .dir-campus-floor > header strong { color: #0f172a; font-size: 11px; }
#dir-portal .dir-campus-floor > header small { margin-top: 1px; color: #94a3b8; font-size: 8.5px; }
#dir-portal .dir-classroom-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
#dir-portal .dir-classroom { min-width: 0; position: relative; overflow: hidden; padding: 9px; border: 1px solid #dbe3ea; border-radius: 12px; background: #fff; text-align: left; cursor: pointer; transition: .18s ease; }
#dir-portal .dir-classroom:hover, #dir-portal .dir-classroom.active { transform: translateY(-2px); border-color: #3b82f6; box-shadow: 0 11px 25px rgba(30,64,175,.12); }
#dir-portal .dir-classroom-identity { display: flex; align-items: center; gap: 7px; min-width: 0; }
#dir-portal .dir-classroom-identity > span:last-child { min-width: 0; }
#dir-portal .dir-classroom-identity > span:last-child strong, #dir-portal .dir-classroom-identity > span:last-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dir-portal .dir-classroom-identity > span:last-child strong { color: #0f172a; font-size: 9.5px; }
#dir-portal .dir-classroom-identity > span:last-child small { margin-top: 1px; color: #94a3b8; font-size: 7px; }
#dir-portal .dir-classroom-door { width: 37px; height: 40px; flex: 0 0 37px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid #166534; border-bottom: 4px solid #166534; border-radius: 9px 9px 3px 3px; background: #dcfce7; color: #166534; }
#dir-portal .dir-classroom-door b { font: 800 10px 'Fraunces', serif; }
#dir-portal .dir-classroom-door small { font-size: 7px; text-transform: uppercase; letter-spacing: .5px; }
#dir-portal .dir-classroom-data { margin-top: 7px; padding-top: 7px; display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; border-top: 1px solid #edf1f4; }
#dir-portal .dir-classroom-data > span { min-width: 0; color: #64748b; font-size: 6.5px; }
#dir-portal .dir-classroom-data b { display: block; color: #0f172a; font-size: 9.5px; }
#dir-portal .dir-classroom-open { margin-top: 7px; display: flex; justify-content: space-between; color: #2563eb; font-size: 7.5px; font-weight: 800; }

#dir-portal .dir-group-detail-head { padding: 15px; display: flex; align-items: center; gap: 11px; border-radius: 14px; background: linear-gradient(135deg,#0f172a,#1e3a8a); color: #fff; }
#dir-portal .dir-group-detail-head h3 { color: #fff; }
#dir-portal .dir-group-detail-head small, #dir-portal .dir-group-detail-head p { color: #bfdbfe; }
#dir-portal .dir-group-emblem { width: 50px; height: 58px; display: grid; place-items: center; border: 2px solid #93c5fd; border-radius: 11px 11px 4px 4px; background: #dbeafe; color: #1e3a8a; font: 900 13px 'Fraunces', serif; }
#dir-portal .dir-group-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 11px; }
#dir-portal .dir-group-stats > div { padding: 9px 5px; border: 1px solid #edf1f4; border-radius: 10px; background: #f8fafc; text-align: center; }
#dir-portal .dir-group-stats b, #dir-portal .dir-group-stats small { display: block; }
#dir-portal .dir-group-stats b { color: #0f172a; font-size: 15px; }
#dir-portal .dir-group-stats small { margin-top: 2px; color: #94a3b8; font-size: 7px; }
#dir-portal .dir-teacher-list, #dir-portal .dir-group-students { display: flex; flex-direction: column; gap: 6px; }
#dir-portal .dir-teacher-list > div { padding: 8px; display: flex; align-items: center; gap: 8px; border: 1px solid #edf1f4; border-radius: 10px; }
#dir-portal .dir-teacher-list > div > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; background: var(--role-light); color: var(--role); font-size: 8px; font-weight: 900; }
#dir-portal .dir-teacher-list p { margin: 0; min-width: 0; }
#dir-portal .dir-teacher-list b, #dir-portal .dir-teacher-list small { display: block; }
#dir-portal .dir-teacher-list b { color: #0f172a; font-size: 9.5px; }
#dir-portal .dir-teacher-list small { margin-top: 2px; color: #64748b; font-size: 8px; }
#dir-portal .dir-group-students { max-height: 320px; overflow: auto; padding-right: 3px; }
#dir-portal .dir-group-students button, #dir-portal .dir-student-room-list button { width: 100%; padding: 8px; display: flex; align-items: center; gap: 8px; border: 1px solid #edf1f4; border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
#dir-portal .dir-group-students button:hover, #dir-portal .dir-student-room-list button:hover { border-color: #93c5fd; background: #f8fbff; }
#dir-portal .dir-student-initial { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #166534; font-size: 10px; font-weight: 900; text-transform: uppercase; }
#dir-portal .dir-group-students p, #dir-portal .dir-student-room-list p { min-width: 0; flex: 1; margin: 0; }
#dir-portal .dir-group-students p b, #dir-portal .dir-group-students p small, #dir-portal .dir-student-room-list p b, #dir-portal .dir-student-room-list p small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dir-portal .dir-group-students p b, #dir-portal .dir-student-room-list p b { color: #0f172a; font-size: 9px; }
#dir-portal .dir-group-students p small, #dir-portal .dir-student-room-list p small { margin-top: 2px; color: #94a3b8; font-size: 7.5px; }
#dir-portal .dir-group-students button > i { color: #94a3b8; font-size: 16px; font-style: normal; }
#dir-portal .dir-group-staff { margin-top: 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f8fafc; }
#dir-portal .dir-group-staff summary { padding: 10px 12px; color: #475569; font-size: 9.5px; font-weight: 800; cursor: pointer; list-style-position: inside; }
#dir-portal .dir-group-staff summary span { float: right; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: #e2e8f0; text-align: center; }
#dir-portal .dir-group-staff .dir-teacher-list, #dir-portal .dir-group-staff .dir-panel-note { margin: 0 10px 10px; }

/* Alumnos agrupados */
#dir-portal .dir-student-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; align-items: start; }
#dir-portal .dir-student-room { overflow: hidden; border: 1px solid #dbe3ea; border-radius: 16px; background: #fff; }
#dir-portal .dir-student-room.is-open { grid-column: 1/-1; border-color: #86efac; box-shadow: 0 10px 28px rgba(22,101,52,.08); }
#dir-portal .dir-student-room-toggle { width: 100%; padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 0; background: linear-gradient(90deg,#f0fdf4,#fff); text-align: left; cursor: pointer; }
#dir-portal .dir-student-room-toggle:hover { background: linear-gradient(90deg,#dcfce7,#f8fafc); }
#dir-portal .dir-student-room-badge { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #166534; color: #fff; font: 800 11px 'Fraunces', serif; }
#dir-portal .dir-student-room-toggle > div:nth-child(2) { min-width: 0; flex: 1; }
#dir-portal .dir-student-room-toggle strong, #dir-portal .dir-student-room-toggle small { display: block; }
#dir-portal .dir-student-room-toggle strong { color: #0f172a; font-size: 11px; }
#dir-portal .dir-student-room-toggle small { margin-top: 2px; color: #64748b; font-size: 8.5px; }
#dir-portal .dir-student-room-toggle > i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 16px; font-style: normal; font-weight: 700; }
#dir-portal .dir-student-room.is-open .dir-student-room-toggle > i { background: #dcfce7; color: #166534; }
#dir-portal .dir-student-room-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 10px; }
#dir-portal .dir-student-room-list button > i { color: #94a3b8; font-size: 16px; font-style: normal; }
#dir-portal .dir-score { color: #64748b !important; }
#dir-portal .dir-score b { color: inherit !important; }
#dir-portal .dir-score.is-good { color: #059669 !important; }
#dir-portal .dir-score.is-medium { color: #d97706 !important; }
#dir-portal .dir-score.is-risk { color: #dc2626 !important; }
#dir-portal .dir-score.is-empty { color: #94a3b8 !important; }
#dir-portal .dir-student-detail > header { padding: 14px; display: flex; align-items: center; gap: 10px; border-radius: 14px; background: linear-gradient(135deg,#eff6ff,#f0fdf4); border: 1px solid #dbeafe; }
#dir-portal .dir-student-detail > header > span { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 50%; background: #166534; color: #fff; font-size: 15px; font-weight: 900; }
#dir-portal .dir-student-detail > header > div:nth-child(2) { min-width: 0; flex: 1; }
#dir-portal .dir-student-detail > header small { color: #2563eb; font-size: 8px; font-weight: 800; }
#dir-portal .dir-subject-grades { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
#dir-portal .dir-subject-grades > div { padding: 10px; border: 1px solid #edf1f4; border-radius: 10px; background: #f8fafc; }
#dir-portal .dir-subject-grades span, #dir-portal .dir-subject-grades b, #dir-portal .dir-subject-grades small { display: block; }
#dir-portal .dir-subject-grades span { overflow: hidden; color: #334155; font-size: 8.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#dir-portal .dir-subject-grades b { margin: 5px 0 1px; font-size: 17px; }
#dir-portal .dir-subject-grades small { color: #94a3b8; font-size: 7.5px; }
#dir-portal .dir-observation-list span { color: #166534; font-size: 8px; font-weight: 800; text-transform: uppercase; }
#dir-portal .dir-observation-list p { margin: 4px 0; color: #334155; font-size: 9.5px; line-height: 1.45; }
#dir-portal .dir-observation-list small { color: #94a3b8; font-size: 7.5px; }

/* Expediente integral del alumno */
#dir-portal .dir-expediente-tabs { margin-top: 12px; display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
#dir-portal .dir-expediente-tabs button { flex: 1 0 auto; padding: 7px 8px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; color: #64748b; font: 700 8px 'Sora', sans-serif; cursor: pointer; }
#dir-portal .dir-expediente-tabs button span { margin-left: 3px; color: #94a3b8; }
#dir-portal .dir-expediente-tabs button.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
#dir-portal .dir-expediente-section { animation: dirExpedienteIn .16s ease; }
@keyframes dirExpedienteIn { from { opacity: .3; transform: translateY(3px); } }
#dir-portal .dir-expediente-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
#dir-portal .dir-expediente-kpis > div { padding: 10px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f8fafc; }
#dir-portal .dir-expediente-kpis small, #dir-portal .dir-expediente-kpis b { display: block; }
#dir-portal .dir-expediente-kpis small { color: #64748b; font-size: 7.5px; }
#dir-portal .dir-expediente-kpis b { margin-top: 4px; color: #0f172a; font-size: 13px; }
#dir-portal .dir-expediente-kpis .is-green { background: #f0fdf4; border-color: #bbf7d0; }
#dir-portal .dir-expediente-kpis .is-amber { background: #fffbeb; border-color: #fde68a; }
#dir-portal .dir-expediente-kpis .is-blue { background: #eff6ff; border-color: #bfdbfe; }
#dir-portal .dir-expediente-kpis .is-violet { background: #f5f3ff; border-color: #ddd6fe; }
#dir-portal .dir-expediente-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
#dir-portal .dir-expediente-facts > div { padding: 9px; border-radius: 9px; background: #f8fafc; }
#dir-portal .dir-expediente-facts small, #dir-portal .dir-expediente-facts b { display: block; }
#dir-portal .dir-expediente-facts small { color: #94a3b8; font-size: 7px; }
#dir-portal .dir-expediente-facts b { margin-top: 3px; overflow-wrap: anywhere; color: #334155; font-size: 8.5px; }
#dir-portal .dir-attendance-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 12px; }
#dir-portal .dir-attendance-summary > div { padding: 9px 4px; border: 1px solid #dbeafe; border-radius: 10px; background: #f8fafc; text-align: center; }
#dir-portal .dir-attendance-summary b, #dir-portal .dir-attendance-summary small { display: block; }
#dir-portal .dir-attendance-summary b { color: #0f172a; font-size: 14px; }
#dir-portal .dir-attendance-summary small { margin-top: 2px; color: #64748b; font-size: 7px; }
#dir-portal .dir-attendance-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow: auto; }
#dir-portal .dir-attendance-list > div { padding: 8px 9px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; border: 1px solid #edf1f4; border-radius: 9px; }
#dir-portal .dir-attendance-list time { color: #334155; font-size: 8.5px; font-weight: 700; }
#dir-portal .dir-attendance-list span { padding: 3px 7px; border-radius: 99px; font-size: 7.5px; font-weight: 800; }
#dir-portal .dir-attendance-list small { grid-column: 1/-1; color: #64748b; font-size: 7.5px; }
#dir-portal .dir-attendance-list .is-present { background: #dcfce7; color: #166534; }
#dir-portal .dir-attendance-list .is-late { background: #fef3c7; color: #92400e; }
#dir-portal .dir-attendance-list .is-excused { background: #dbeafe; color: #1d4ed8; }
#dir-portal .dir-attendance-list .is-absent { background: #fee2e2; color: #b91c1c; }
#dir-portal .dir-expediente-timeline { display: flex; flex-direction: column; }
#dir-portal .dir-expediente-timeline > div { position: relative; display: flex; gap: 9px; padding: 2px 0 13px; }
#dir-portal .dir-expediente-timeline > div::before { content: ''; width: 1px; position: absolute; left: 4px; top: 10px; bottom: 0; background: #dbe3ea; }
#dir-portal .dir-expediente-timeline > div:last-child::before { display: none; }
#dir-portal .dir-expediente-timeline i { width: 9px; height: 9px; z-index: 1; flex: 0 0 9px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 1px #93c5fd; }
#dir-portal .dir-expediente-timeline span { color: #2563eb; font-size: 7.5px; font-weight: 800; text-transform: uppercase; }
#dir-portal .dir-expediente-timeline p { margin: 3px 0; color: #334155; font-size: 9px; line-height: 1.45; }
#dir-portal .dir-expediente-timeline small { color: #94a3b8; font-size: 7.5px; }

@media (max-width: 1180px) {
  #dir-portal .dir-school-layout { grid-template-columns: minmax(0,1fr) 310px; }
  #dir-portal .dir-campus-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #dir-portal .dir-person-grid, #dir-portal .dir-student-room-list { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  #dir-portal .dir-school-kpis { grid-template-columns: repeat(2,1fr); }
  #dir-portal .dir-school-layout { grid-template-columns: 1fr; }
  #dir-portal .dir-school-panel { position: relative; max-height: none; min-height: 250px; }
  #dir-portal .dir-school-panel-empty { min-height: 245px; }
  #dir-portal .dir-campus-summary { display: none; }
  #dir-portal .dir-campus-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  #dir-portal .sec-header { align-items: stretch; }
  #dir-portal .sec-actions, #dir-portal .dir-campus-banner { align-items: stretch; flex-direction: column; }
  #dir-portal .dir-school-search { min-width: 0; width: 100%; }
  #dir-portal .dir-school-kpis { grid-template-columns: 1fr 1fr; }
  #dir-portal .dir-school-kpi { padding: 11px; }
  #dir-portal .dir-school-kpi small { font-size: 8px; }
  #dir-portal .dir-campus-grid, #dir-portal .dir-student-groups, #dir-portal .dir-person-grid, #dir-portal .dir-student-room-list { grid-template-columns: 1fr; }
  #dir-portal .dir-classroom-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Group cards need room for full names and readable figures at every width. */
#dir-portal .dir-groups-layout{grid-template-columns:minmax(0,1fr);gap:20px}
#dir-portal .dir-groups-layout .dir-campus-grid{grid-template-columns:1fr;gap:20px}
#dir-portal .dir-campus-floor{padding:18px;background:#fff}
#dir-portal .dir-campus-floor>header{margin-bottom:16px}
#dir-portal .dir-campus-floor>header strong{font-size:15px}
#dir-portal .dir-campus-floor>header small{font-size:12px;color:#64748b}
#dir-portal .dir-groups-layout .dir-classroom-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:12px}
#dir-portal .dir-classroom{padding:18px;border-radius:12px;background:#f8fafc}
#dir-portal .dir-classroom-identity>span:last-child strong{font-size:19px;font-weight:700;line-height:1.4;white-space:normal}
#dir-portal .dir-classroom-identity>span:last-child small{font-size:12px;color:#64748b;white-space:normal}
#dir-portal .dir-classroom-data{margin-top:14px;padding-top:12px;gap:12px}
#dir-portal .dir-classroom-data>span{font-size:11px}
#dir-portal .dir-classroom-data b{font-size:18px;margin-bottom:3px}
#dir-portal .dir-classroom-open{font-size:12px;margin-top:16px}
#dir-portal .dir-groups-layout .dir-school-panel{position:static;max-height:none;min-height:0}
#dir-portal .dir-groups-layout .dir-school-panel-empty{min-height:160px;padding:24px}
#dir-portal .dir-campus-banner strong{font-size:16px}
#dir-portal .dir-campus-banner p{font-size:12px;line-height:1.6}
#dir-portal .dir-campus-summary>span{font-size:12px;white-space:nowrap}
