:root {
  --blue: #428bca;
  --menu-blue: #0087c7;
  --table-blue: #20a0d5;
  --green: #77b300;
  --red: #a40000;
  --line: #d9d9d9;
  --text: #222;
  --muted: #666;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

a {
  color: #2b78d6;
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app-shell > *,
.header-inner > *,
.brand > div,
.login-content > *,
.login-brand > div {
  min-width: 0;
}

.siga-header {
  border-top: 5px solid #111;
  border-bottom: 4px solid var(--red);
  background: var(--blue);
  color: #fff;
}

.header-inner {
  display: flex;
  width: 1140px;
  max-width: calc(100% - 32px);
  min-height: 98px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 12px;
}

.header-data {
  min-width: 500px;
  color: #fff;
  font-size: 13px;
}

.header-data div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  margin: 3px 0;
}

.header-data b {
  text-align: right;
}

.nav {
  border-bottom: 1px solid var(--green);
  background: #fff;
}

.nav-inner {
  display: flex;
  width: 1140px;
  max-width: calc(100% - 32px);
  height: 51px;
  margin: 0 auto;
  align-items: stretch;
}

.nav a,
.nav-group > button {
  display: flex;
  min-width: 64px;
  height: 51px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  background: #fff;
  color: #555;
  cursor: pointer;
  font: inherit;
}

.nav a.active,
.nav-group.active > button,
.nav a:hover,
.nav-group > button:hover {
  background: var(--menu-blue);
  color: #fff;
}

.nav-group {
  position: relative;
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.submenu {
  position: absolute;
  top: 51px;
  left: 0;
  z-index: 30;
  display: none;
  min-width: 200px;
  border: 1px solid #cfcfcf;
  background: #fff;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
}

.submenu::before {
  position: absolute;
  top: -7px;
  left: 14px;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
  border-left: 7px solid transparent;
  content: "";
}

.submenu a {
  justify-content: flex-start;
  width: 100%;
  height: 27px;
  padding: 0 14px;
  color: #111;
  font-size: 13px;
}

.submenu a:hover {
  background: var(--menu-blue);
  color: #fff;
}

.nav-group:hover .submenu,
.nav-group.open .submenu {
  display: block;
}

.mobile-nav-bar,
.menu-toggle {
  display: none;
}

.container {
  width: 1140px;
  max-width: calc(100% - 32px);
  margin: 50px auto 34px;
  flex: 1;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 400;
}

h2 {
  margin: 18px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

h3,
p {
  margin-top: 0;
}

.siga-footer {
  min-height: 62px;
  padding: 22px 16px;
  border-bottom: 2px solid #2a2020;
  background: #f3f3f3;
  color: #666;
  text-align: center;
  font-size: 13px;
}

.quick-grid {
  display: none;
}

.content-grid {
  display: block;
}

.stack {
  display: grid;
  gap: 10px;
}

.card,
.notice,
.siga-alert {
  margin-bottom: 20px;
  padding: 14px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.card {
  border-color: #faebcc;
  background: #fcf8e3;
}

.card h3 {
  margin-bottom: 6px;
  color: #2b78d6;
  font-size: 18px;
  font-weight: 400;
}

.tag {
  display: none;
}

.notice {
  border-color: #d6e9c6;
  background: #dff0d8;
  color: #2d6b1f;
}

.notice.warning {
  border-color: #ebccd1;
  background: #f2dede;
  color: #a94442;
}

.notice.info {
  border-color: #faebcc;
  background: #fcf8e3;
  color: #8a6d3b;
}

.notice.success {
  border-color: #d6e9c6;
  background: #dff0d8;
  color: #2d6b1f;
}

.siga-alert.danger {
  border-color: #ebccd1;
  background: #f2dede;
  color: #a94442;
}

.siga-link-line {
  margin: 18px 0;
  padding-left: 24px;
  font-size: 18px;
}

.siga-link-line strong {
  color: #111;
  font-size: 13px;
}

.inline-form,
.search-form,
.stats {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.inline-form label,
.search-form label {
  font-weight: 700;
}

input,
select,
button {
  min-height: 28px;
  border: 1px solid #ccc;
  border-radius: 0;
  padding: 4px 8px;
  background: #fff;
  font: inherit;
}

select {
  height: 34px;
}

.search-form input {
  width: 470px;
  max-width: 70vw;
}

.search-form button,
.report-button,
.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.report-button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 5px 10px;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 7px 9px;
  border-right: 1px solid #d6d6d6;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  background: var(--table-blue);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

tbody tr:nth-child(even) {
  background: #f1f1f1;
}

tbody tr:nth-child(odd) {
  background: #fff;
}

td:last-child,
th:last-child {
  border-right: 0;
}

.table-empty {
  height: 38px;
  color: #111;
  text-align: right;
}

.schedule-table {
  table-layout: fixed;
}

.schedule-table th:first-child,
.schedule-table th:nth-child(2),
.schedule-table td:first-child,
.schedule-table td:nth-child(2) {
  width: 86px;
  text-align: center;
}

.schedule-table td {
  height: 76px;
  padding: 0;
  text-align: center;
  vertical-align: stretch;
}

.schedule-table td:first-child,
.schedule-table td:nth-child(2) {
  padding: 7px 6px;
  color: #333;
  font-size: 11px;
  vertical-align: middle;
}

.schedule-course {
  display: flex;
  width: 100%;
  min-height: 76px;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 8px 6px;
  color: #fff;
  text-align: center;
  line-height: 1.18;
}

.schedule-course strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.schedule-course span {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.schedule-color-1 {
  background: #00b200;
}

.schedule-color-2 {
  background: #9bb32f;
}

.schedule-color-3 {
  background: #a000a8;
}

.schedule-color-4 {
  background: #ffc000;
}

.schedule-color-5 {
  background: #603bbb;
}

.schedule-color-6 {
  background: #e8a10b;
}

.schedule-color-7 {
  background: #bc1745;
}

.schedule-color-8 {
  background: #2f5597;
}

.muted-error {
  color: #b32b2b;
  font-weight: 700;
}

.stats {
  color: #666;
  font-size: 12px;
  font-weight: 700;
}

.boletin-toolbar {
  margin-bottom: 0;
}

.boletin-toolbar select {
  width: 102px;
  height: 39px;
}

.boletin-toolbar .report-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 14px;
}

.boletin-wrap {
  border-color: #d7d7d7;
}

.boletin-table {
  min-width: 1160px;
}

.boletin-table th {
  height: 31px;
  padding: 6px 8px;
  font-size: 13px;
}

.boletin-table td {
  height: 58px;
  padding: 8px 9px;
  font-size: 14px;
  text-align: center;
}

.boletin-table td:nth-child(2) {
  width: 300px;
  text-align: left;
  line-height: 1.6;
}

.boletin-table td:nth-child(6) {
  width: 220px;
  text-align: left;
}

.boletin-table td:nth-child(9),
.boletin-table td:nth-child(11) {
  line-height: 1.65;
}

.boletin-table a {
  color: #2b82d9;
}

.boletin-summary td {
  height: 36px;
  color: #666;
  font-weight: 700;
  text-align: center;
}

.boletin-summary td:first-child {
  text-align: center;
}

.boletin-status td {
  height: 42px;
  background: #fff;
  text-align: right;
  font-size: 14px;
}

.historial-report {
  margin-bottom: -46px;
}

.history-section {
  margin-bottom: 10px;
}

.history-section h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
}

.history-wrap {
  border-color: #d7d7d7;
}

.history-table {
  min-width: 980px;
}

.history-summary td {
  height: 30px;
  padding: 6px 8px;
  background: #f2f2f2;
  border-bottom: 1px solid #fff;
  text-align: right;
  font-size: 12px;
}

.history-summary td:nth-child(even) {
  text-align: center;
  background: #fff;
}

.history-grades th {
  height: 27px;
  padding: 6px;
  font-size: 12px;
}

.history-grades td {
  height: 28px;
  padding: 6px 8px;
  text-align: center;
  font-size: 12px;
}

.history-grades td:nth-child(2) {
  width: 520px;
  text-align: left;
}

.cycle-section {
  margin-bottom: 0;
}

.cycle-section h2 {
  display: table;
  margin: 10px auto 8px;
  color: #777;
  font-size: 14px;
}

.cycle-section h2::before {
  margin-right: 8px;
  color: #777;
  content: "◂";
}

.status {
  display: inline-block;
  min-width: 72px;
  padding: 2px 7px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.status.ok {
  background: #dff0d8;
  color: #2d6b1f;
}

.status.pending {
  background: #fcf8e3;
  color: #8a6d3b;
}

.status.danger {
  background: #f2dede;
  color: #a94442;
}

.tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0;
  padding: 5px 12px 12px;
  border: 1px solid #ddd;
}

.tab-buttons {
  display: flex;
  align-items: end;
  gap: 0;
}

.tab-buttons button {
  min-height: 37px;
  border: 1px solid #ccc;
  border-bottom: 0;
  background: #fafafa;
  color: #666;
  cursor: pointer;
}

.tab-buttons button.active {
  border-color: var(--green);
  background: #fff;
  color: #666;
}

.tab-panel {
  display: none;
  min-width: 0;
  padding: 6px 0;
  border: 1px solid var(--green);
}

.tab-panel.active {
  display: block;
}

.panel-title {
  margin: 0 12px 8px;
  padding: 5px;
  background: var(--green);
  color: #fff;
  text-align: center;
  font-size: 16px;
}

.panel-observation {
  margin: 0 0 10px 14px;
  font-weight: 700;
}

.metric-grid {
  display: block;
  margin-bottom: 22px;
}

.metric-grid article {
  display: grid;
  grid-template-columns: 1fr 140px;
  padding: 9px 4px;
  border-bottom: 1px solid #ddd;
}

.metric-grid span {
  color: #111;
}

.metric-grid strong {
  font-size: 14px;
  font-weight: 400;
}

.student-name-line {
  margin: 24px 0 12px;
  color: #17689d;
  text-align: center;
  font-size: 18px;
  font-weight: 400;
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #ebccd1;
  background: #f2dede;
  color: #a94442;
}

.login-page {
  min-height: 100vh;
  background: #fff;
}

.login-header {
  border-top: 4px solid #111;
  border-bottom: 5px solid var(--red);
  background: var(--blue);
  color: #fff;
}

.login-header-inner {
  display: flex;
  width: 1380px;
  max-width: calc(100% - 80px);
  min-height: 130px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.login-brand strong {
  display: block;
  font-size: 29px;
  font-weight: 400;
  letter-spacing: 0;
}

.login-brand small {
  display: block;
  margin-top: 14px;
  font-size: 14px;
}

.login-status {
  align-self: flex-start;
  margin-top: 34px;
  font-size: 17px;
}

.login-content {
  display: grid;
  width: 1200px;
  max-width: calc(100% - 64px);
  margin: 18px auto 70px;
  grid-template-columns: 604px 1fr;
  gap: 38px;
  align-items: start;
}

.login-carousel {
  position: relative;
  width: 604px;
  height: 372px;
  overflow: hidden;
  background: #eee;
}

.login-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.login-carousel img.active {
  opacity: 1;
}

.carousel-dots {
  position: absolute;
  right: 265px;
  bottom: 43px;
  display: flex;
  gap: 5px;
}

.carousel-dots button {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.carousel-dots button.active {
  background: #fff;
}

.login-form-area h1 {
  margin: 2px 0 0;
  font-size: 27px;
  font-weight: 400;
}

.login-rule {
  height: 1px;
  margin: 0 0 34px;
  background: #ddd;
}

.login-warning {
  margin: 0 0 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.siga-login-form {
  display: grid;
  gap: 30px;
}

.siga-login-form label,
.captcha-row {
  display: grid;
  grid-template-columns: 190px 390px;
  align-items: center;
  gap: 8px;
}

.siga-login-form label span,
.captcha-row > span {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
}

.siga-login-form input,
.siga-login-form select {
  width: 390px;
  height: 38px;
  border: 1px solid #bbb;
  padding: 6px 12px;
  font-size: 16px;
}

.siga-login-form input {
  background: #e8f0fe;
}

.fake-captcha {
  display: grid;
  width: 377px;
  height: 94px;
  grid-template-columns: 40px 1fr 72px;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px 16px;
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  background: #fafafa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.captcha-check {
  width: 33px;
  height: 33px;
  border: 2px solid #555;
  background: #fff;
}

.fake-captcha strong {
  display: block;
  font-size: 18px;
  font-weight: 400;
}

.fake-captcha small {
  display: block;
  margin-top: 8px;
  color: #666;
  font-size: 10px;
  line-height: 1.1;
}

.captcha-logo {
  color: #597edb;
  text-align: center;
  font-size: 34px;
  line-height: 1;
}

.captcha-logo small {
  margin-top: 4px;
  color: #555;
  font-size: 11px;
}

.forgot-link {
  margin-top: -16px;
  margin-left: 198px;
  font-size: 17px;
}

.login-button {
  width: 133px;
  height: 42px;
  margin-left: 198px;
  border: 0;
  background: #0878bd;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.login-footer {
  margin-top: auto;
}

.admin-page {
  min-height: 100vh;
  background: #f4f6f9;
  color: #1f2937;
}

.admin-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 28px;
  border-top: 4px solid #111;
  border-bottom: 4px solid var(--red);
  background: var(--blue);
  color: #fff;
}

.admin-header strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
}

.admin-header span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.admin-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-header a {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto 42px;
}

.admin-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d7d7d7;
}

.admin-title h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 500;
}

.admin-title p {
  margin: 0;
  color: #667085;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-card {
  display: grid;
  gap: 12px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #d7d7d7;
  background: #fff;
  color: #1f2937;
}

.admin-card:hover {
  border-color: var(--menu-blue);
}

.admin-card span {
  font-weight: 700;
}

.admin-card strong {
  align-self: end;
  color: var(--menu-blue);
  font-size: 34px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
}

.admin-sidebar {
  display: grid;
  align-content: start;
  border: 1px solid #d7d7d7;
  background: #fff;
}

.admin-sidebar a {
  padding: 11px 13px;
  border-bottom: 1px solid #e6e6e6;
  color: #333;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: var(--menu-blue);
  color: #fff;
}

.admin-primary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 0;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #d7d7d7;
  background: #fff;
}

.admin-table {
  min-width: 860px;
}

.admin-table th {
  height: 34px;
  background: var(--table-blue);
  color: #fff;
  text-align: center;
}

.admin-table td {
  min-height: 36px;
  padding: 8px;
  font-size: 13px;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.admin-actions form {
  display: inline;
}

.admin-actions button {
  min-height: 28px;
  border: 1px solid #c0392b;
  background: #fff;
  color: #c0392b;
  cursor: pointer;
}

.admin-form-shell {
  width: min(760px, calc(100% - 32px));
}

.admin-form {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid #d7d7d7;
  background: #fff;
}

.admin-form label {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 12px;
}

.admin-form label > span {
  text-align: right;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cfcfcf;
  padding: 7px 9px;
}

.admin-form textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-form .checkbox-row input {
  width: auto;
  min-height: auto;
  justify-self: start;
}

.admin-help {
  margin: -8px 0 0 202px;
  color: #667085;
  font-size: 12px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.admin-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d6e9c6;
  background: #dff0d8;
  color: #2d6b1f;
}

.admin-message.error {
  border-color: #ebccd1;
  background: #f2dede;
  color: #a94442;
}

@media (max-width: 1100px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

  .brand {
    white-space: normal;
  }

  .brand strong {
    font-size: 21px;
  }

  .header-data {
    min-width: 0;
    width: 100%;
  }

  .header-data div {
    grid-template-columns: 130px 1fr;
  }

  .header-data span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-nav-bar {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: flex-end;
    padding: 9px 15px;
    border-bottom: 1px solid #ddd;
    background: #fff;
  }

  .menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
  }

  .menu-icon {
    width: 22px;
    height: 2px;
    background: #888;
    box-shadow: 0 -6px #888, 0 6px #888;
  }

  .nav {
    display: none;
  }

  .nav.open {
    display: block;
  }

  .nav-inner {
    width: 100%;
    max-width: none;
    height: auto;
    flex-direction: column;
    padding: 8px 0;
  }

  .nav a,
  .nav-group > button {
    justify-content: flex-start;
    width: 100%;
    height: auto;
    min-height: 40px;
    padding: 10px 15px;
  }

  .submenu,
  .nav-group:hover .submenu {
    position: static;
    display: none;
    min-width: 0;
    border: 0;
    box-shadow: none;
  }

  .nav-group.open .submenu {
    display: block;
    padding: 6px 0 10px;
  }

  .nav-group.open > button {
    background: #e7e7e7;
    color: #555;
  }

  .submenu a {
    min-height: 30px;
    padding: 6px 25px;
    color: #666;
    font-size: 14px;
  }

  .submenu::before {
    display: none;
  }

  .page-title,
  .inline-form,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid article {
    grid-template-columns: 1fr;
  }

  .tab-buttons {
    flex-wrap: wrap;
  }

  .tab-buttons button {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 44px;
  }

  .login-header-inner {
    max-width: calc(100% - 28px);
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .login-brand img {
    width: 82px;
    height: 82px;
  }

  .login-brand strong {
    font-size: 22px;
  }

  .login-status {
    margin-top: 0;
  }

  .login-content {
    max-width: calc(100% - 28px);
    grid-template-columns: minmax(0, 1fr);
  }

  .login-carousel {
    width: 100%;
    height: auto;
    aspect-ratio: 604 / 372;
  }

  .carousel-dots {
    right: 50%;
    bottom: 22px;
    transform: translateX(50%);
  }

  .siga-login-form label,
  .captcha-row {
    grid-template-columns: 1fr;
  }

  .siga-login-form label span,
  .captcha-row > span {
    text-align: left;
  }

  .siga-login-form input,
  .siga-login-form select,
  .fake-captcha {
    width: 100%;
  }

  .forgot-link,
  .login-button {
    margin-left: 0;
  }

  .admin-header,
  .admin-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-grid,
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-form label {
    grid-template-columns: 1fr;
  }

  .admin-form label > span {
    text-align: left;
  }

  .admin-help {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .siga-header {
    border-top: 0;
  }

  .header-inner {
    width: 100%;
    max-width: calc(100% - 30px);
    gap: 2px;
    padding: 10px 0 20px;
  }

  .brand,
  .login-brand {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 26px;
  }

  .brand strong,
  .login-brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.12;
  }

  .brand small {
    margin-top: 14px;
    font-size: 14px;
  }

  .header-data {
    font-size: 14px;
    line-height: 1.45;
  }

  .header-data div {
    display: block;
    margin: 0;
  }

  .header-data b,
  .header-data div > span {
    display: block;
    text-align: left;
  }

  .container,
  .container.boletin-container {
    width: calc(100% - 30px);
    max-width: calc(100% - 30px);
    margin-top: 48px;
  }

  .page-title {
    align-items: flex-start;
  }

  .inline-form,
  .search-form,
  .stats {
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .inline-form {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 8px;
  }

  .report-button {
    max-width: 100%;
  }

  .search-form input {
    width: 100%;
    max-width: 100%;
  }

  .table-wrap {
    min-width: 0;
    overscroll-behavior-x: contain;
  }

  .login-header-inner {
    gap: 12px;
  }

  .login-status {
    font-size: 14px;
  }

  .login-content {
    gap: 24px;
    margin-bottom: 35px;
  }

  .login-warning br {
    display: none;
  }

  .siga-login-form {
    gap: 20px;
  }

  .siga-login-form label,
  .captcha-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .siga-login-form input,
  .siga-login-form select,
  .login-button {
    min-height: 44px;
  }

  .fake-captcha {
    grid-template-columns: 28px minmax(0, 1fr) 58px;
    gap: 8px;
    padding: 10px;
  }

  .captcha-check {
    width: 26px;
    height: 26px;
  }

  .fake-captcha strong {
    font-size: 16px;
  }
}

.home-announcement h2 { margin: 0 0 8px; font-size: 16px; }
.home-announcement p { margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }

.boletin-container { width: calc(100% - 54px); max-width: none; }
.boletin-table th { font-size: 12px; }
.boletin-table td { font-size: 12px; height: 44px; }
@media print {
  .siga-header, .nav, .mobile-nav-bar, .menu-toggle, .siga-footer, .boletin-toolbar .report-button { display: none; }
  .boletin-container { width: 100%; margin: 0; }
  .boletin-wrap { overflow: visible; }
  .boletin-table { min-width: 0; width: 100%; }
  .boletin-table td, .boletin-table th { font-size: 8px; padding: 4px; }
}

.plan-table th:first-child, .plan-table td:first-child { width: 6%; }
.plan-table th:last-child, .plan-table td:last-child { width: 16px; }
.plan-table td { text-align: center; }
.plan-table td:nth-child(3) { text-align: left; width: 40%; }
.plan-table .cycle-section { background: #fff; }
.plan-table .plan-empty { text-align: center; padding: 24px; color: #666; }
@media print {
  .plan-container { width: 100%; max-width: none; margin: 0; }
  .plan-container .report-button { display: none; }
  .plan-container .table-wrap { overflow: visible; }
  .plan-table { min-width: 0; }
}

.report-update { margin: 12px 0 8px; }
.remaining-courses { margin-bottom: 20px; }
.remaining-courses p { margin-bottom: 8px; }
.remaining-courses td:first-child, .remaining-courses td:last-child { text-align: center; }

/* Horario: una fila por tramo, con altura suficiente para nombres y aulas. */
.schedule-wrap { overflow-x: auto; overflow-y: visible; }
.schedule-table th, .schedule-table td,
.schedule-table th:first-child, .schedule-table th:nth-child(2),
.schedule-table td:first-child, .schedule-table td:nth-child(2) { width: 12.5%; }
.schedule-table th { height: 25px; padding: 4px; font-size: 11px; }
.schedule-table td { height: 90px; padding: 0; vertical-align: middle; }
.schedule-table .schedule-course {
  position: static; min-height: 90px; height: 100%; padding: 10px 6px;
  gap: 4px; line-height: 1.55; overflow-wrap: anywhere;
}
.schedule-table .schedule-course strong { font-size: 10px; font-weight: 700; }
.schedule-table .schedule-course span { font-size: 10px; }

.grade-details { min-width: 150px; margin-top: 5px; }
.grade-details summary { cursor: pointer; color: #2b82d9; }
.grade-result { margin-top: 7px; padding: 9px; border: 1px solid; text-align: left; line-height: 1.5; }
.grade-result strong, .grade-result span { display: block; }
.grade-result.approved { color: #246329; background: #e5f3e5; border-color: #b7d9b9; }
.grade-result.failed { color: #a32626; background: #fae7e7; border-color: #e4b5b5; }
.grade-result.neutral { color: #505760; background: #eeeeef; border-color: #c7cbd0; }

@media print {
  .history-section { break-inside: avoid; }
  .container > .search-form, .page-title .report-button { display: none; }
  .history-wrap { overflow: visible; }
  .history-table { min-width: 0; }
}
