/* Institutional palette. Print layouts retain their existing document colors. */
@media screen {
  :root {
    --ink: #152d48;
    --muted: #475d75;
    --line: #b8c9db;
    --canvas: #e7eef6;
    --green: #006b67;
    --green-dark: #00504d;
    --mint: #d1eee7;
    --shadow: 0 8px 24px rgb(20 46 78 / 9%);
  }
  body { background: var(--canvas); }
  .topbar { border-bottom: 3px solid #007b78; box-shadow: 0 2px 10px rgb(18 43 73 / 7%); }
  .account-name { color: #233f5e; font-weight: 700; }
  .sidebar { background: #102c4b; border-right-color: #102c4b; color: #fff; }
  .sidebar .brand { border-color: #36516e; }
  .sidebar .brand strong { color: #fff; }
  .sidebar .brand small, .sidebar-footnote { color: #c3d5e6; }
  .sidebar-footnote { border-color: #36516e; }
  .sidebar .status-dot { background: #4cdbc3; }
  .nav-group-label { color: #a9c5df; }
  .nav-link { color: #e0ebf7; font-size: 14px; }
  .nav-link:hover { color: #fff; background: #234564; }
  .nav-link.is-active { color: #fff; background: #006d70; box-shadow: inset 4px 0 #6ae0c9; }
  .nav-indicator { background: #91aec9; }
  .nav-link.is-active .nav-indicator { background: #8af4dd; }
  .welcome-row {
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid #153c64;
    border-radius: 18px;
    background: linear-gradient(115deg, #123154, #15536a);
    color: #fff;
    box-shadow: var(--shadow);
  }
  .welcome-row h1 { color: #fff; }
  .welcome-row .eyebrow { color: #8ff1de; }
  .welcome-row .muted { color: #dce9f6; }
  .welcome-row .button-quiet { color: #143958; background: #fff; border-color: #c2d5e4; }
  .role-chip, .state-active, .intro-note { color: #064f4b; background: #c8eee3; border-color: #79bfb1; }
  .overview-stat { background: #d6e5f8; border-color: #99b6d8; }
  .overview-stat:nth-child(2n) { background: #ccebe4; border-color: #89bdb2; }
  .overview-stat strong { color: #143f6e; }
  .overview-stat div > span { color: #324f6e; font-size: 12px; }
  .overview-icon { background: #174d7f; color: #fff; }
  .overview-stat:nth-child(2n) .overview-icon { background: #006b67; }
  .module-card { --module-accent: #185b9d; background: #e4eefb; border-color: #a5bfdc; border-top: 5px solid var(--module-accent); }
  .module-card:nth-child(4n + 2) { --module-accent: #006d65; background: #dcefe9; border-color: #9bc8ba; border-top-color: var(--module-accent); }
  .module-card:nth-child(4n + 3) { --module-accent: #966008; background: #fbefcf; border-color: #d8bf87; border-top-color: var(--module-accent); }
  .module-card:nth-child(4n + 4) { --module-accent: #65459b; background: #eee6f8; border-color: #c1acdb; border-top-color: var(--module-accent); }
  .module-card .card-icon { background: var(--module-accent); color: #fff; }
  .module-card h2 { color: #152d48; }
  .module-card p { color: #354e66; font-size: 14px; }
  .card-status { color: #374e65; font-size: 12px; font-weight: 650; }
  .module-card .text-link { color: #153f6e; text-decoration: underline; text-underline-offset: 3px; }
  .module-card:hover { box-shadow: 0 10px 28px rgb(20 46 78 / 15%); }
  .section-list-panel, .form-panel, .form-card { border-color: #acbfd4; border-top: 4px solid #1a5c87; background: #f7faff; }
  .section-panel-heading, .report-heading { padding-bottom: 14px; border-bottom: 1px solid #becfe0; }
  .section-list-panel h2 { color: #143d65; }
  .section-chip { background: #deeee9; border-color: #94bdb1; border-left: 4px solid #007468; }
  .section-chip span, .section-chip small { color: #365a53; }
  .teaching-card { background: #e0ebf8; border-color: #a7bdd6; border-left: 4px solid #24649e; }
  .teaching-card:nth-child(3n + 2) { background: #e9e4f5; border-color: #bfb0d8; border-left-color: #70509c; }
  .teaching-card:nth-child(3n + 3) { background: #dbeee8; border-color: #a0c5b9; border-left-color: #007365; }
  .teaching-card-heading small, .teaching-card > p, .teaching-card-footer .muted { color: #3d526a; }
  .button-primary { color: #fff; background: #006b67; border-color: #005b58; box-shadow: 0 3px 8px rgb(0 75 72 / 15%); }
  .button-primary:hover { background: #004d4a; }
  .button-quiet { color: #184873; background: #e0ebf7; border-color: #9cb6d1; }
  .button-quiet:hover { background: #cadcf0; border-color: #527ca5; }
  .text-link, .text-button { color: #005d64; }
  .text-link-muted { color: #526477; }
  .state-tag { color: #2f4e70; border-color: #9ab6d0; background: #e0ebf7; }
  .state-active { color: #064f4b; background: #c8eee3; border-color: #79bfb1; }
  .filter-row, .order-toolbar, .correction-reason { background: #dce7f4; border-color: #a6bed6; }
  .filter-row label, .form-field label, .setup-grid form label { color: #203f61; }
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea { border-color: #8aa7c3; }
  input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #1968b5; outline-offset: 3px; }
  .data-table:not(.report-table) th:not(.competency-col) { background: #173e65; color: #fff; }
  .data-table tbody tr:nth-child(even) { background: #eaf0f8; }
  .data-table tbody tr:hover { background: #d9e8f7; }
  .grade-table input:not(:disabled):not([readonly]) { border: 2px solid #819fbe; background: #fff; color: #112d4c; }
  .grade-table input[readonly], .grade-table input:disabled { color: #4b586a; background: #d8e0e9; }
  .notice { color: #094d43; background: #caeade; border: 1px solid #7fb59f; border-left: 5px solid #137b5f; }
  .form-error { padding: 12px; color: #8d1f28; background: #fce4e5; border: 1px solid #d7989c; border-radius: 8px; }
  .field-error { color: #9d2330; font-weight: 600; }
  .phase-banner { background: #fff0cb; border-color: #d5b068; }
  .phase-pill { color: #714409; background: #ffe5aa; border-color: #c99c46; }
  .login-intro { padding: clamp(24px, 4vw, 40px); border-radius: 24px; background: #123154; box-shadow: var(--shadow); }
  .login-intro h1 { color: #fff; }
  .login-intro .eyebrow { color: #8ff1de; }
  .login-intro p { color: #dce9f6; }
  .login-card { border-color: #9eb7d0; border-top: 5px solid #006b67; }
  .footer { color: #465d76; border-color: #b8c9db; }
  .mobile-navigation { background: #143555; border-color: #143555; color: #fff; }
  .mobile-navigation summary, .mobile-nav-group > span { color: #d3e6f8; }
  .mobile-nav-group a { color: #fff; }
  .mobile-nav-group a[aria-current="page"] { color: #fff; background: #006b67; }
  .app-ready .mobile-tabbar { background: #102c4b; border-color: #284866; }
  .mobile-tabbar a, .mobile-tabbar button { color: #e4edf8; }
  .mobile-tabbar a[aria-current="page"], .mobile-tabbar button[aria-expanded="true"] { color: #fff; background: #006b67; }
  .mobile-card-table tbody td::before { color: #3d526a; }
  .mobile-carousel-controls { color: #233f5e; }
  /* Directories use one shared color. Green is reserved for the signed-in user. */
  .browse-card, .assignment-card, .teacher-directory-card {
    background: #dfeaf7;
    border: 1px solid #9ab5d1;
    border-top: 4px solid #275d90;
    color: #152d48;
  }
  .browse-card:hover, .browse-card:focus-visible { background: #d0e1f3; border-color: #326a9e; }
  .browse-card-icon { background: #204f7e; color: #fff; }
  .browse-card-kicker { color: #294e74; }
  .browse-card p, .browse-card-meta { color: #3b526c; }
  .browse-card-action { color: #173f69; border-top-color: #a7bfd9; min-height: 44px; }
  .assignment-card .data-role-dot { background: #275d90; }
  .assignment-card .data-subject, .assignment-card .data-course, .assignment-card .data-year {
    color: #23496e; background: #edf4fc; border-color: #91b0ce;
  }
  .assignment-card .assignment-subject { color: #173f69; }
  .browse-card.is-self, .assignment-card.is-self, .teaching-card, .teaching-card:nth-child(n) {
    background: #c7ebd6; border-color: #6ba783; border-top: 4px solid #187343;
    border-left-color: #187343;
  }
  .browse-card.is-self:hover { background: #b6e1c8; }
  .is-self .browse-card-icon, .is-self .data-role-dot { background: #187343; color: #fff; }
  .self-label { display: inline-flex; align-self: flex-start; margin-bottom: 10px; padding: 6px 10px; border-radius: 7px; color: #fff; background: #17663e; font-size: 12px; font-weight: 800; }
  .is-self .browse-card-action, .teaching-card .text-link { color: #104c2d; border-top-color: #80b294; }
  .is-self .data-subject, .is-self .data-course, .is-self .data-year { color: #174a30; background: #e4f5e9; border-color: #73aa86; }
  .detail-summary { background: #d4e3f3; border-color: #8eafce; border-left: 5px solid #245d91; }
  .detail-summary h2 { color: #173c62; }
  .detail-summary p { color: #334e69; }
  .directory-heading { padding: 14px 18px; margin-bottom: 14px; border-left: 4px solid #286493; border-radius: 8px; background: #d7e5f4; }
  .directory-heading p { color: #3b526c; }
  .browse-switch a { color: #fff; background: #214f7c; border-color: #153f69; }
  .browse-switch a:hover, .browse-switch a:focus-visible { color: #fff; background: #163958; }
  .detail-back a { padding: 8px 12px; margin-bottom: 10px; border-radius: 8px; background: #d3e2f3; color: #173f69; border: 1px solid #93b1cf; }
  .empty-state { background: #e1ebf7; border: 1px solid #9db8d2; border-top: 4px solid #366c9c; }
  .empty-icon { color: #fff; background: #275d90; }
  .period-pills { color: #324c65; border-color: #a4b9d0; font-size: 12px; }
  .data-chip { font-size: 12px; }
  .mobile-carousel-controls .button, .order-actions button {
    min-width: 44px; min-height: 44px; background: #1c4c7b; color: #fff; border: 2px solid #123b63;
    font-size: 20px; font-weight: 850; box-shadow: 0 2px 5px rgb(20 46 78 / 15%);
  }
  .mobile-carousel-controls .button:hover:not(:disabled), .order-actions button:hover:not(:disabled) { background: #103354; }
  .mobile-carousel-controls .button:disabled, .order-actions button:disabled {
    opacity: 1; background: #d5dfe9; color: #57687b; border-color: #a9b9ca; box-shadow: none; cursor: not-allowed;
  }
  .mobile-carousel-picker select { border: 2px solid #4878a7; color: #173b61; background: #f5f9ff; font-weight: 750; }
  .mobile-carousel-controls [role="status"] { color: #24486d; font-weight: 800; }
  .gradebook-tools .button { color: #fff; background: #214f7c; border-color: #153f69; }
  .gradebook-tools [data-toggle-codes] { color: #173f69; background: #fff; border: 2px solid #6489b0; }
  .order-options > summary { padding: 12px; color: #fff; background: #275d90; border-radius: 9px; }
  .gradebook-cards .data-table tbody tr { background: #edf3fa; border-color: #91acc7; border-top: 4px solid #2d6598; }
  .gradebook-cards .data-table td.competency-col { border-width: 2px; border-color: #97aecd; }
  .gradebook-cards .data-table .student-name-cell { color: #173b61; }
  .save-summary { padding: 8px 12px; border-radius: 8px; color: #195333; background: #cdebd7; border: 1px solid #86b495; }
  .pagination a { background: #214f7c; color: #fff; border-color: #153f69; }
  .student-directory, .family-directory { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; }
  .student-directory th, .family-directory th { font-size: 12px; font-weight: 800; letter-spacing: .06em; padding-top: 16px; padding-bottom: 16px; }
  .student-directory td, .family-directory td { padding-top: 18px; padding-bottom: 18px; }
  .student-full-name { display: block; font-size: 15px; font-weight: 800; line-height: 1.45; letter-spacing: .01em; color: #153d65; }
  .student-section-badge { display: inline-flex; padding: 6px 10px; border-radius: 7px; color: #fff; background: #245985; font-size: 13px; white-space: nowrap; }
  .student-serial, .student-birth-date { font-variant-numeric: tabular-nums; font-weight: 650; color: #304d6b; }
  .student-detail { display: block; margin-top: 7px; font-size: 12px; color: #465d75; }
  .student-detail .contact-field-label { display: inline; margin-right: 5px; }
  .student-account-pending { color: #704707; background: #fff0c9; border-color: #c5a45a; }
  .family-directory .student-identity-cell { min-width: 225px; }
  .family-contact-block { display: grid; align-content: start; gap: 5px; min-width: 125px; }
  .contact-field-label { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #4e6177; }
  .family-contact-block .contact-field-label:not(:first-child) { margin-top: 8px; }
  .contact-email { color: #164c80; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
  .contact-phone { color: #07583f; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .contact-missing { color: #657183; font-size: 12px; font-style: italic; }
  .contact-source-note { margin-top: 5px; padding: 5px 7px; border-radius: 5px; color: #685021; background: #fff0cc; font-size: 12px; overflow-wrap: anywhere; }
  .family-directory td { vertical-align: top; }
  .gradebook-form tr[hidden] { display: none !important; }
  .mobile-carousel-controls[hidden], .mobile-carousel-picker[hidden] { display: none !important; }
  .gradebook-search { flex-wrap: wrap; align-items: center; }
  .gradebook-search label { min-width: min(100%, 240px); }
  .search-result-count { color: #24486d; font-weight: 750; font-size: 13px; }
  .student-directory .action-row .text-link { padding: 8px 10px; border: 1px solid #8aa8c7; border-radius: 7px; background: #d9e7f6; color: #173f69; }
  .student-directory .action-row .text-button { padding: 8px 10px; border: 1px solid #c59c9c; border-radius: 7px; background: #fae6e5; color: #852e32; }
  .student-directory tr.is-withdrawn td, .gradebook-cards .data-table tbody tr.is-withdrawn td { background: #dce1e7; color: #526172; border-color: #aeb7c2; }
  .student-directory tr.is-withdrawn .student-full-name, .gradebook-cards tr.is-withdrawn .student-name-cell { color: #4f5e6f; }
  .student-directory td[data-label="Acciones"] > a { display: inline-flex; margin: 4px 6px 4px 0; }
  .external-school-badge { display: block; color: #65430a; background: #fff0cc; border: 1px solid #c9ac6d; padding: 6px 8px; border-radius: 6px; font-size: 12px; }
  .external-school-options { margin: 18px 0; padding: 16px; border: 2px solid #9cb7d1; border-radius: 12px; background: #e6eff9; }
  .external-school-options > summary { cursor: pointer; color: #19466f; font-weight: 800; }
  .external-school-fields { padding-top: 18px; }
  .external-grade-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; padding: 14px; border: 1px solid #a2b9d0; border-radius: 10px; background: #f7faff; }
  .external-grade-row p { margin: 0; display: grid; gap: 6px; min-width: 0; }
  .external-grade-row select, .external-grade-row input { min-width: 0; max-width: 100%; }
  .external-grade-row legend { color: #19466f; font-weight: 750; }
  .form-panel input[type="checkbox"], .form-field input[type="checkbox"] { width: 22px; min-height: 22px; accent-color: #006b67; }
  @media (max-width: 740px) {
    .student-directory .student-full-name, .family-directory .student-full-name { font-size: 16px; }
    .family-directory .student-identity-cell { min-width: 0; }
    .family-directory .family-contact-block { width: 100%; min-width: 0; }
    .family-directory td::before, .student-directory td::before { font-size: 11px; font-weight: 800; }
  }
}

/* Clear student identification and identical score bands on entry and reload. */
.grade-table td.student-name-cell {text-align:center!important;color:#111!important;font-size:1rem!important;font-weight:750!important;line-height:1.5;}
.grade-table input[data-grade-score] {font-size:1.1rem!important;font-weight:750!important;text-align:center;}
.grade-table input.score-low {color:#b4232c!important;}
.grade-table input.score-high {color:#16803d!important;}
.grade-table input.score-normal {color:#000!important;}
.staff-name {font-size:1.05rem;color:#111;font-weight:750;}
.staff-contact {display:block;line-height:1.7;overflow-wrap:anywhere;}
@media(max-width:700px){.grade-table td.student-name-cell{font-size:1.1rem!important;}.gradebook-tools{flex-wrap:wrap;gap:.7rem;}}

/* Staff directory: readable contact cards on every screen. */
.staff-search label { flex: 1; min-width: min(100%, 280px); }
.staff-results { margin: 20px 0 14px; color: #294661; font-size: 16px; font-weight: 700; }
.staff-directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.staff-profile { min-width: 0; overflow: hidden; background: #fff; border: 1px solid #9fb7cf; border-top: 5px solid #087f83; border-radius: 16px; box-shadow: 0 5px 18px #153d6310; }
.staff-profile-heading { padding: 22px 24px 18px; background: #eef4fb; border-bottom: 1px solid #c5d4e4; }
.staff-department { display: inline-block; padding: 5px 10px; border-radius: 6px; background: #d1e8e6; color: #145653; font-size: 13px; font-weight: 800; line-height: 1.4; }
.staff-profile h2 { margin: 14px 0 8px; color: #111827; font-family: inherit; font-size: 20px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.staff-job { margin: 0; color: #183f67; font-size: 16px; font-weight: 700; line-height: 1.5; }
.staff-details { display: grid; gap: 14px; margin: 0; padding: 20px 24px; }
.staff-contact-item dt { margin-bottom: 5px; color: #40566d; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.staff-contact-item dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.staff-profile .staff-email { display: inline-block; padding: 3px 0; color: #134f87; font-size: 16px; font-weight: 650; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.staff-phone-block { padding: 12px 15px; background: #e4f3ee; border: 1px solid #b0d3c5; border-radius: 10px; }
.staff-phone-block dt { color: #285a48; }
.staff-phone { color: #124b37; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.staff-unavailable { color: #526172; font-size: 16px; }
.staff-profile-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 24px; border-top: 1px solid #d4dfeb; background: #f7f9fc; }
.staff-sex { color: #405267; font-size: 14px; }
.staff-sex strong { color: #233b53; }
.staff-profile a:focus-visible { outline: 3px solid #087f83; outline-offset: 4px; }
@media(max-width:900px) { .staff-directory-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
@media(max-width:480px) { .staff-profile-heading { padding: 18px; } .staff-details { padding: 18px; } .staff-profile-footer { padding: 14px 18px; } .staff-profile h2 { font-size: 19px; } .staff-search { flex-wrap: wrap; } }

/* Action colors retain their meaning across gradebooks and student management. */
.action-icon { flex: 0 0 20px; vertical-align: middle; }
.button[class*="action-"] { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 11px 15px; font-size: 14px; font-weight: 750; line-height: 1.35; text-decoration: none; border: 1px solid transparent; border-radius: 10px; box-shadow: 0 2px 5px #102a4314; }
.button.action-export, .button.action-activate { color: #fff; background: #166534; border-color: #14532d; }
.button.action-import { color: #fff; background: #6b21a8; border-color: #581c87; }
.button.action-history { color: #fff; background: #475569; border-color: #334155; }
.button.action-code { color: #334155; background: #fff; border: 2px solid #94a3b8; }
.button.action-list { color: #334155; background: #e2e8f0; border-color: #94a3b8; }
.button.action-transfer { color: #713f12; background: #fef0c7; border: 2px solid #bc822b; }
.button.action-edit { color: #fff; background: #086b72; border-color: #06525a; }
.button.action-withdraw { color: #fff; background: #b4232c; border-color: #921b23; }
.button[class*="action-"]:hover { filter: brightness(.91); }
.button[class*="action-"]:focus-visible { outline: 3px solid #0f172a; outline-offset: 3px; }
.student-directory td[data-label="Acciones"] > .button { margin: 5px 6px 5px 0; }
.student-directory .action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.student-directory .action-row form { margin: 0; }
.order-options > summary .action-icon { margin-right: 8px; }
@media(max-width:740px) { .gradebook-tools .button[class*="action-"] { flex: 1 1 140px; } .student-directory td[data-label="Acciones"] .button { width: 100%; } .student-directory .action-row, .student-directory .action-row form { width: 100%; } }
@media(max-width:740px) {
  .student-directory td[data-label="Acciones"] { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .student-directory td[data-label="Acciones"]::before { display: block; width: 100%; }
  .student-directory td[data-label="Acciones"] > .button { margin: 0; }
  .student-directory td[data-label="Acciones"] .action-row { display: grid; grid-template-columns: minmax(0,1fr); margin: 0; }
}

/* The gradebook link covers its entire card; the admin configuration stays separate. */
.assignment-card { position: relative; }
.assignment-card .browse-card-action::after { content: ""; position: absolute; inset: 0; border-radius: inherit; cursor: pointer; }
.assignment-card .assignment-actions > .text-link { position: relative; z-index: 2; }
.assignment-card:has(.browse-card-action:focus-visible) { outline: 3px solid #087f83; outline-offset: 4px; }
.assignment-card:hover { box-shadow: 0 5px 18px #153d6330; }
.bulletin-format-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.bulletin-format-form label { display: grid; gap: 7px; color: #203f5d; font-size: 14px; font-weight: 750; }
.bulletin-format-form select { min-height: 44px; max-width: 100%; padding: 10px; border: 1px solid #8ba7c1; border-radius: 8px; background: #fff; color: #142c44; font: inherit; }
@media(max-width:740px) { .bulletin-format-form, .bulletin-format-form label, .bulletin-format-form button { width: 100%; } }
