/* Capa visual transversal: solo interfaz autenticada, sin afectar impresiones. */
@media screen {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) {
    --polish-blue: #093d7a;
    --polish-blue-dark: #072d5b;
    --polish-ink: #172f50;
    --polish-line: #dbe4ef;
    --polish-page: #f4f7fb;
    background: var(--polish-page) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar {
    background: linear-gradient(105deg, var(--polish-blue-dark), var(--polish-blue)) !important;
    box-shadow: 0 3px 14px rgba(15, 42, 78, .20) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .brand-copy small,
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .platform-developer-credit { opacity: .78; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .actions button {
    border: 1px solid rgba(255,255,255,.18) !important;
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
    transition: background .18s ease, transform .18s ease, border-color .18s ease !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .actions button:hover,
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .actions button:focus-visible {
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(255,255,255,.42) !important;
    transform: translateY(-1px);
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain { background: var(--polish-page) !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card, .table-wrap, .course-context) {
    border-color: var(--polish-line) !important;
    box-shadow: 0 2px 8px rgba(15, 42, 78, .055) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card) { border-radius: 14px !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(button, .btn, .btn-primary, .btn-secondary, .action-save, .action-button) {
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(button, .btn, .btn-primary, .btn-secondary, .action-save, .action-button):hover { transform: translateY(-1px); }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.btn-primary, .action-save) { box-shadow: 0 3px 8px rgba(180, 126, 0, .18) !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    border-color: #cbd7e6 !important;
    border-radius: 9px !important;
    background: #fff !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(input, select, textarea):focus {
    border-color: #2775c8 !important;
    outline: 3px solid rgba(39, 117, 200, .14) !important;
    outline-offset: 0;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) thead th {
    background: #edf3f9 !important;
    color: var(--polish-ink) !important;
    border-bottom-color: #cbd7e6 !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) tbody tr { transition: background .16s ease; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) tbody tr:hover td { background: #f5f9fd !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) :focus-visible { outline: 3px solid rgba(255, 210, 74, .95) !important; outline-offset: 2px !important; }
}
@media screen and (max-width: 1100px) { html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .platform-developer-credit { display: none !important; } }
@media screen and (max-width: 640px) { html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card) { border-radius: 11px !important; } }

/* Credito institucional discreto y legible. */
html body.is-login:not(.is-authenticated) .login-form .login-platform-watermark.nuvez-creator-credit span,
html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .platform-developer-credit {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html body.is-login:not(.is-authenticated) .login-form .login-platform-watermark.nuvez-creator-credit span {
  font-size: clamp(.68rem, 2.6vw, .76rem) !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
}

html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) .topbar .platform-developer-credit {
  font-size: .72rem !important;
  font-weight: 650 !important;
}

/* Organización Windows 12: tarjetas modulares, rejillas limpias y tablas ligeras. */
@media screen {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain {
    background: radial-gradient(circle at 100% 0%, rgba(139, 192, 255, .16), transparent 31rem), linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.grid, .grid-modulos, .modern-tile-grid, .unified-module-grid, .teacher-dash-grid, .layout-insight-grid, .head-teacher-content-grid) { gap: 16px !important; align-items: stretch; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card, .table-wrap, .course-context) {
    background: rgba(255, 255, 255, .88) !important;
    border: 1px solid rgba(184, 202, 222, .72) !important;
    box-shadow: 0 8px 24px rgba(35, 66, 105, .075), inset 0 1px 0 rgba(255,255,255,.9) !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card) { overflow: hidden; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.card, .panel, .section-panel, .list-card):has(.list-card-head) { padding-top: 0 !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .list-card-head {
    min-height: 62px; margin-inline: -1px !important; padding: 14px 18px !important;
    background: linear-gradient(110deg, rgba(248, 251, 255, .96), rgba(238, 246, 255, .84)) !important;
    border-bottom: 1px solid rgba(203, 215, 230, .78) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .list-card-head :is(h2, h3, h4) { color: #133a6b !important; letter-spacing: -.015em; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .list-card-head small { color: #647b97 !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .metric {
    position: relative; isolation: isolate; min-height: 116px; padding: 18px !important;
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(242,248,255,.88)) !important;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .metric::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 4px 0 0 4px; background: var(--primary, #1976d2); opacity: .88; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .table-wrap { overflow: auto !important; border-radius: 12px !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) { border-collapse: separate !important; border-spacing: 0 !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) :is(th, td) { padding: 12px 14px !important; border-bottom: 1px solid #e6edf5 !important; vertical-align: middle; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) thead th {
    position: sticky; top: 0; z-index: 2; background: #edf5fe !important; color: #234d80 !important;
    font-size: .78rem !important; font-weight: 750 !important; letter-spacing: .025em; text-transform: uppercase;
  }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) tbody tr:nth-child(even) td { background: rgba(248, 251, 255, .76); }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(table:not(.report-table), .data-table) tbody tr:hover td { background: #eaf4ff !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .form-grid { gap: 16px !important; }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .form-grid > label,
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain .form-grid fieldset { padding: 12px !important; border: 1px solid #e0e9f3; border-radius: 12px; background: rgba(250, 252, 255, .78); }
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.empty-state, .no-results) { padding: 28px 20px !important; border: 1px dashed #b7cbe1 !important; border-radius: 12px !important; background: rgba(245, 250, 255, .72) !important; }
}
/* Distribución adaptable: aprovecha el ancho disponible sin reducir la legibilidad. */
@media screen and (min-width: 1181px) {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #module-inicio .main-menu-flat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.form-grid, .filter-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media screen and (min-width: 1500px) {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #module-inicio .main-menu-flat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.grid.four, .dashboard-grid, .teacher-dash-grid, .portal-metrics, .utp-kpi-grid, .utp-summary-kpis) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media screen and (min-width: 900px) and (max-width: 1180px) {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #module-inicio .main-menu-flat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #appMain :is(.form-grid, .filter-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media screen and (min-width: 641px) and (max-width: 899px) {
  html body.is-authenticated:not(.guardian-portal-only):not(.report-print-body) #module-inicio .main-menu-flat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
