.portal-body { min-height: 100vh; color: var(--graphite); background: #f4f1eb; }
.portal-topbar { position: sticky; z-index: 1000; top: 0; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 10px max(24px, calc((100vw - 1240px) / 2)); color: var(--white); background: rgba(16,18,22,.98); border-bottom: 1px solid rgba(255,255,255,.08); }
.portal-brand { display: flex; align-items: center; gap: 11px; }
.portal-brand img { width: 50px; height: 50px; object-fit: contain; border-radius: 50%; background: var(--white); }
.portal-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.portal-brand strong { font-size: 13px; letter-spacing: .04em; }
.portal-brand small { margin-top: 4px; color: var(--gold-2); font-size: 8px; letter-spacing: .18em; font-weight: 800; }
.portal-topbar nav { display: flex; align-items: center; gap: 6px; }
.portal-topbar nav a, .portal-topbar nav button, .portal-nav-group > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px; border: 0; border-radius: 9px; color: rgba(255,255,255,.72); background: transparent; font-size: 11px; font-weight: 800; }
.portal-topbar nav a:hover, .portal-topbar nav button:hover, .portal-nav-group > summary:hover, .portal-nav-group[open] > summary { color: var(--white); background: rgba(255,255,255,.08); }
.portal-topbar nav form { margin: 0; }
.portal-nav-group { position: relative; }
.portal-nav-group > summary { cursor: pointer; list-style: none; user-select: none; }
.portal-nav-group > summary::-webkit-details-marker { display: none; }
.portal-nav-chevron { margin-left: 2px; font-size: 8px; transition: transform .18s ease; }
.portal-nav-group[open] .portal-nav-chevron { transform: rotate(180deg); }
.portal-nav-submenu { position: absolute; z-index: 1010; top: calc(100% + 8px); left: 0; min-width: 185px; display: grid; gap: 4px; padding: 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: #171a1f; box-shadow: 0 18px 45px rgba(0,0,0,.32); }
.portal-nav-submenu::before { content: ''; position: absolute; left: 18px; top: -5px; width: 10px; height: 10px; transform: rotate(45deg); border-left: 1px solid rgba(255,255,255,.11); border-top: 1px solid rgba(255,255,255,.11); background: #171a1f; }
.portal-topbar .portal-nav-submenu a { width: 100%; justify-content: flex-start; color: rgba(255,255,255,.8); }
.portal-main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 62px 0 90px; }
.portal-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin-bottom: 32px; }
.portal-heading h1 { margin: 9px 0 5px; color: var(--ink); font: 48px/1.08 'DM Serif Display', serif; font-weight: 400; }
.portal-heading p { margin: 0; color: var(--slate); }
.portal-user-chip { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 8px 25px rgba(16,18,22,.05); }
.portal-user-chip > i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--gold-2); background: var(--ink); }
.portal-user-chip small, .portal-user-chip strong { display: block; line-height: 1.35; }
.portal-user-chip small { color: var(--slate); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.portal-user-chip strong { color: var(--ink); font-size: 11px; }
.portal-alert { margin: 0 0 22px; padding: 14px 16px; border-radius: 11px; font-size: 12px; font-weight: 700; }
.portal-alert.info { color: #245d73; background: #e5f4fb; border: 1px solid #b9deed; }
.portal-alert.success { color: #1f6c45; background: #e6f6ec; border: 1px solid #b9dfc7; }
.portal-alert.warning { color: #7a531d; background: #fff4df; border: 1px solid #ead2a9; }
.portal-alert.error { color: #96372d; background: #fff0ee; border: 1px solid #ebc2bd; }
.portal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.portal-stats.admin-stats { grid-template-columns: repeat(4, 1fr); }
.portal-stats > div { position: relative; min-height: 135px; display: flex; justify-content: flex-end; flex-direction: column; overflow: hidden; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 10px 32px rgba(16,18,22,.045); }
.portal-stats > div > span { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: #8a5520; background: #f7ead4; }
.portal-stats small { color: var(--slate); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.portal-stats strong { margin-top: 4px; color: var(--ink); font: 25px 'DM Serif Display', serif; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; align-items: start; }
.admin-detail-grid { grid-template-columns: .9fr 1.1fr; }
.portal-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 12px 38px rgba(16,18,22,.045); }
.portal-card.narrow { max-width: 650px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.card-heading h2 { margin: 6px 0 0; color: var(--ink); font: 29px/1.15 'DM Serif Display', serif; }
.card-heading p { margin: 6px 0 0; color: var(--slate); font-size: 11px; }
.completion-badge, .table-status { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; border-radius: 20px; color: #8d5a20; background: #fff1d9; font-size: 9px; font-weight: 900; white-space: nowrap; }
.completion-badge.complete, .table-status.complete { color: #1d6e43; background: #e3f6eb; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--slate); font-size: 10px; font-weight: 700; }
.detail-list dd { margin: 0; color: var(--ink); font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.document-status-list, .admin-document-list { display: grid; gap: 8px; }
.document-status-list > div, .admin-document-list > div { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 10px; border-radius: 11px; background: var(--ivory); }
.document-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; color: var(--slate); background: #e6e1d8; }
.document-icon.uploaded { color: var(--white); background: var(--wa-dark); }
.document-status-list strong, .document-status-list small, .admin-document-list strong, .admin-document-list small { display: block; line-height: 1.4; }
.document-status-list strong, .admin-document-list strong { color: var(--ink); font-size: 10px; }
.document-status-list small, .admin-document-list small { color: var(--slate); font-size: 8px; overflow-wrap: anywhere; }
.admin-document-list > div > div:nth-child(2) { min-width: 0; flex: 1; }
.admin-document-list a { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 7px; color: #754617; background: #f3dfbe; font-size: 8px; font-weight: 900; }
.document-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.admin-document-list a.document-view-link { color: #225f86; background: #e3f2fa; }
.document-modal[hidden] { display: none; }
.document-modal { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; padding: 24px; }
.document-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 24, .7); backdrop-filter: blur(3px); }
.document-modal-dialog { position: relative; z-index: 1; width: min(960px, 100%); height: min(82vh, 780px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border-radius: 16px; background: var(--white); box-shadow: 0 28px 70px rgba(0, 0, 0, .35); }
.document-modal-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.document-modal-dialog h2 { margin: 4px 0 0; color: var(--ink); font: 23px/1.2 'DM Serif Display', serif; }
.document-modal-close { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--white); font-size: 16px; }
.document-modal-close:hover { color: #fff; background: var(--ink); }
.document-modal iframe { width: 100%; height: 100%; border: 0; background: #eef1f5; }
.document-modal.image-preview .document-modal-dialog { width: min(900px, 100%); }
.document-modal.image-preview iframe { background: #eef1f5; }
.upload-card { margin-top: 22px; }
.dashboard-upload-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.dashboard-upload-form label { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--ivory); }
.dashboard-upload-form input { padding: 9px; background: var(--white); font-size: 10px; }
.dashboard-upload-form small { display: block; margin-top: 6px; color: var(--slate); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-upload-form .button { align-self: end; }
.portal-form { display: grid; gap: 16px; }
.portal-form label { font-size: 12px; }
.portal-form .button { justify-self: start; }
.empty-state { padding-block: 65px; text-align: center; }
.empty-state > i { color: var(--gold); font-size: 44px; }
.empty-state h2 { color: var(--ink); }
.empty-state p { color: var(--slate); }
.table-heading { align-items: flex-end; }
.table-tools { display: flex; align-items: center; gap: 10px; }
.table-tools .button { min-height: 42px; white-space: nowrap; }
.table-search { position: relative; width: min(330px, 100%); }
.table-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate); }
.table-search input { margin: 0; padding-left: 38px; }
.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th { padding: 12px; color: var(--slate); border-bottom: 1px solid var(--line); font-size: 8px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.portal-table td { padding: 15px 12px; border-bottom: 1px solid var(--line); color: var(--graphite); font-size: 10px; }
.portal-table td strong, .portal-table td small { display: block; }
.portal-table td strong { color: var(--ink); font-size: 11px; }
.portal-table td small { color: var(--slate); font-size: 8px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.table-actions form { margin: 0; }
.table-action { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 9px; color: #87531d; background: #fff1d9; font-weight: 900; cursor: pointer; }
.table-action:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(16,18,22,.12); }
.table-action.view { color: #225f86; background: #e3f2fa; }
.table-action.edit { color: #7a531d; background: #fff1d9; }
.table-action.delete { color: #a43b34; background: #fff0ee; }
.admin-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-edit-form .full-width { grid-column: 1 / -1; }
.admin-edit-form small { display: block; margin-top: 5px; color: var(--slate); font-size: 10px; }
.admin-document-fields { margin: 4px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--ivory); }
.admin-document-fields legend { padding: 0 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
.admin-document-fields legend i { margin-right: 5px; color: #8d5a20; }
.admin-document-fields > p { margin: 0 0 13px; color: var(--slate); font-size: 11px; line-height: 1.55; }
.admin-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.admin-document-grid label { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.admin-document-grid input { margin-top: 7px; padding: 7px; font-size: 10px; }
.admin-document-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.empty-table { padding: 35px !important; color: var(--slate) !important; text-align: center; }
.portal-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: #87531d; font-size: 10px; font-weight: 900; }
.account-status { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 20px; color: #1f6c45; background: #e3f6eb; font-size: 9px; font-weight: 900; }
.account-status.inactive { color: #96372d; background: #fff0ee; }
.system-stats { grid-template-columns: repeat(3, 1fr); }
.teacher-table { min-width: 1050px; }
.teacher-editor-form { gap: 20px; }
.teacher-editor-form > .portal-alert { margin-bottom: 0; }
.teacher-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.teacher-form-grid label { color: var(--ink); font-size: 12px; font-weight: 750; }
.teacher-form-grid input, .teacher-form-grid select, .teacher-form-grid textarea { margin-top: 7px; }
.teacher-form-grid label > small { display: block; margin-top: 6px; color: var(--slate); font-size: 10px; font-weight: 500; }
.teacher-form-grid .full-width { grid-column: 1 / -1; }
.teacher-active-toggle { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--ivory); cursor: pointer; }
.teacher-active-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #23834f; }
.teacher-active-toggle span { color: #1f6c45; }
.report-filter-card { margin-bottom: 22px; }
.report-filter-form { display: grid; grid-template-columns: 1.1fr 1fr 1fr auto; align-items: end; gap: 14px; }
.report-filter-form label { font-size: 12px; font-weight: 700; }
.report-filter-form input, .report-filter-form select { margin-top: 7px; }
.report-filter-actions, .report-export-actions { display: flex; align-items: center; gap: 9px; }
.report-official-header { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; padding: 22px 28px; border-bottom: 4px double #9b713e; }
.report-official-header img { width: 78px; height: 78px; object-fit: contain; }
.report-official-header div { flex: 1; text-align: center; }
.report-official-header strong, .report-official-header span { display: block; color: var(--ink); }
.report-official-header strong { font-size: 23px; letter-spacing: .02em; }
.report-official-header span { margin-top: 2px; color: #87531d; font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.report-official-header p, .report-official-header small { margin: 5px 0 0; color: var(--slate); font-size: 11px; }
.report-stats { grid-template-columns: repeat(4, 1fr); }
.report-heading { align-items: flex-end; }
.report-heading h2 { font-size: 21px; }
.report-pdf-button { color: #fff; background: #a83232; }
.report-excel-button { color: #fff; background: #217346; }
.report-pdf-button:hover, .report-excel-button:hover { color: #fff; filter: brightness(.92); }
.subject-card { margin-bottom: 22px; }
.subject-form { display: flex; align-items: end; gap: 12px; }
.subject-form label { flex: 1; color: var(--ink); font-size: 12px; font-weight: 800; }
.subject-form input { margin-top: 7px; }
.subject-list { display: grid; gap: 8px; }
.subject-list > div { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 13px; border-radius: 10px; background: var(--ivory); }
.subject-list > div > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #87531d; background: #fff1d9; font-size: 10px; font-weight: 900; }
.subject-list strong { color: var(--ink); font-size: 13px; }
.subject-list-actions { display: flex; gap: 7px; margin-left: auto; }
.subject-list-actions form { margin: 0; }
.subject-edit-dialog { width: min(520px, 100%); }
.teacher-assignment-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.teacher-assignment-panel legend { padding: 0 8px; font-weight: 700; }
.teacher-assignment-panel p { color: var(--slate); font-size: 13px; }
.teacher-assignment-panel section { padding: 14px 0; border-top: 1px solid var(--line); }
.teacher-assignment-panel h3 { font-family: inherit; font-size: 14px; line-height: 1.4; font-weight: 700; }
.teacher-assignment-options { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.teacher-assignment-options label { display: flex; align-items: center; gap: 8px; }
.teacher-assignment-options input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.subject-edit-form { gap: 18px; }
.subject-edit-form .form-actions { justify-content: flex-end; margin-top: 0; }
.grades-page { max-width: 1240px; }
.grade-filter-card { margin-bottom: 24px; background: linear-gradient(120deg, #fff 0%, #fbf4e9 100%); }
.grade-filter-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 16px; }
.grade-filter-form label { color: var(--ink); font-size: 12px; font-weight: 800; }
.grade-filter-form select { margin-top: 7px; }
.grade-column-card { margin-bottom: 24px; background: linear-gradient(120deg, #fff 0%, #f8f4ec 100%); }
.grade-section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; color: var(--ink); }
.grade-section-title > i { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: #8b5723; background: #f5e7d0; }
.grade-section-title strong, .grade-section-title small { display: block; }
.grade-section-title strong { font-size: 16px; }
.grade-section-title small { margin-top: 2px; color: var(--slate); font-size: 11px; }
.grade-column-create { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.grade-column-list { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 17px; }
.grade-column-chip { display: inline-flex; align-items: center; min-height: 43px; padding: 0 7px 0 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 3px 10px rgba(16,18,22,.05); }
.grade-column-chip strong { margin-right: 9px; color: var(--ink); font-size: 12px; }
.grade-column-chip form { display: inline-flex; margin: 0; }
.grade-column-chip button { display: grid; place-items: center; width: 29px; height: 29px; border: 0; border-radius: 7px; color: #9a642b; background: transparent; font-size: 11px; }
.grade-column-chip button:hover { color: #fff; background: #a46a2c; }
.grade-column-chip form:last-child button { color: #a43b34; }
.grade-column-chip form:last-child button:hover { color: #fff; background: #a43b34; }
.grade-column-empty { width: 100%; margin: 0; color: var(--slate); font-size: 11px; }
.grade-student-list { display: grid; gap: 16px; }
.grade-student-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(115deg, #fff 0%, #f7f3ec 100%); box-shadow: 0 10px 30px rgba(16,18,22,.045); }
.grade-student-card > header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.grade-student-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.grade-student-name > span { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 50%; color: #8a5520; background: #f4e4ca; font-size: 11px; font-weight: 900; }
.grade-student-name strong, .grade-student-name small { display: block; }
.grade-student-name strong { color: var(--ink); font-size: 15px; text-transform: uppercase; }
.grade-student-name small { margin-top: 3px; color: var(--slate); font-size: 10px; }
.grade-average { flex: 0 0 auto; text-align: right; }
.grade-average small { display: block; color: var(--slate); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.grade-average strong { display: block; margin-top: 2px; color: #23834f; font-size: 25px; line-height: 1; }
.grade-score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 190px)); gap: 14px; padding: 20px 24px 24px; }
.grade-score-grid label span { display: block; margin-bottom: 7px; color: var(--slate); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.grade-score-grid input { text-align: center; font-size: 14px; font-weight: 800; }
.grade-save-bar { position: sticky; z-index: 20; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 14px 16px; border: 1px solid #d6cab7; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 12px 35px rgba(16,18,22,.13); backdrop-filter: blur(8px); }
.grade-save-bar span { color: var(--slate); font-size: 11px; }
.grade-save-bar span i { margin-right: 6px; color: #9a642b; }
.grade-empty-state { display: grid; justify-items: center; gap: 8px; padding-block: 50px; color: var(--slate); text-align: center; }
.grade-empty-state > i { margin-bottom: 5px; color: #b78546; font-size: 34px; }
.grade-empty-state strong { color: var(--ink); font-size: 16px; }
.grade-empty-state p { margin: 0; font-size: 12px; }
.report-card-filter { margin-bottom: 24px; background: linear-gradient(120deg, #fff 0%, #fbf4e9 100%); }
.report-card-filter form { display: flex; align-items: end; gap: 12px; }
.report-card-filter label { min-width: min(520px, 100%); color: var(--ink); font-size: 12px; font-weight: 800; }
.report-card-filter select { margin-top: 7px; }
.report-card-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); align-items: start; gap: 20px; }
.ranking-card { min-width: 0; }
.ranking-table { min-width: 590px; }
.ranking-number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--slate); background: var(--ivory); font-size: 12px; font-weight: 900; }
.ranking-number.top { color: #80501d; background: #f5e5ca; box-shadow: inset 0 0 0 1px #e7c99b; }
.ranking-average { color: #23834f !important; font-size: 17px !important; }
.report-card-config { position: sticky; top: 96px; }
.report-card-form { gap: 14px; }
.report-card-form label { color: var(--ink); font-size: 12px; font-weight: 750; }
.report-card-form input, .report-card-form select { margin-top: 7px; }
.report-card-form .button { width: 100%; justify-self: stretch; margin-top: 5px; }
.journal-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, #fff 0%, #fbf3e6 100%); }
.journal-summary > div { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 11px; }
.journal-summary > div > span { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: #89551f; background: #f3e3ca; }
.journal-summary small { color: var(--slate); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.journal-summary strong { color: var(--ink); font-size: 20px; }
.journal-summary p { margin: 0; color: var(--slate); font-size: 11px; }
.journal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.journal-card { overflow: hidden; padding: 0; }
.journal-card > header { display: flex; align-items: center; gap: 14px; padding: 19px 21px; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, #fff 0%, #f7f1e7 100%); }
.journal-date { width: 52px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; align-content: center; border-radius: 12px; color: #fff; background: var(--ink); }
.journal-date span { font-size: 19px; font-weight: 850; line-height: 1; }
.journal-date small { margin-top: 4px; color: var(--gold-2); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.journal-identity { min-width: 0; }
.journal-identity h2 { margin: 3px 0 4px; color: var(--ink); font-size: 18px; line-height: 1.25; }
.journal-identity > small { color: var(--slate); font-size: 10px; }
.journal-identity > small i { margin-right: 4px; }
.journal-content { padding: 20px 21px; }
.journal-content > strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.journal-content p { margin: 0; color: var(--graphite); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.journal-content em { color: var(--slate); }
.journal-photos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 0 21px 21px; }
.journal-photos button { aspect-ratio: 1; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #ece8e1; cursor: zoom-in; }
.journal-photos img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.journal-photos button:hover img { transform: scale(1.06); }
.journal-print-form { display: grid; gap: 15px; }
.journal-print-form > label, .journal-print-form > div label { color: var(--ink); font-size: 12px; font-weight: 800; }
.journal-print-form select, .journal-print-form input { margin-top: 7px; }
.journal-print-form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.journal-print-form .button { justify-self: start; margin-top: 4px; }
.journal-photo-modal .document-modal-dialog { width: min(980px, 100%); }
.journal-photo-modal .document-preview { min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 18px; background: #edf0f2; }
.journal-photo-modal .document-preview img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.attendance-date-form { display: flex; align-items: end; gap: 12px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.attendance-date-form label { min-width: 220px; color: var(--ink); font-size: 12px; font-weight: 800; }
.attendance-date-form input { margin-top: 7px; }
.attendance-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.attendance-tools > strong { color: var(--ink); font-size: 14px; }
.attendance-all { display: inline-flex; align-items: center; gap: 8px; color: #1f6c45; font-size: 12px; font-weight: 800; cursor: pointer; }
.attendance-all input { width: 17px; height: 17px; accent-color: #23834f; }
.attendance-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.attendance-row { display: grid; grid-template-columns: 42px minmax(180px, 1fr) auto; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.attendance-row:last-child { border-bottom: 0; }
.attendance-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #87531d; background: #fff1d9; font-size: 11px; font-weight: 900; }
.attendance-student strong, .attendance-student small { display: block; }
.attendance-student strong { color: var(--ink); font-size: 13px; }
.attendance-student small { margin-top: 2px; color: var(--slate); font-size: 10px; }
.attendance-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.attendance-status { cursor: pointer; }
.attendance-status input { position: absolute; opacity: 0; pointer-events: none; }
.attendance-status span { display: inline-flex; min-width: 61px; justify-content: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--slate); background: var(--ivory); font-size: 10px; font-weight: 800; }
.attendance-status input:checked + span { color: #fff; border-color: #23834f; background: #23834f; }
.attendance-status.sakit input:checked + span { border-color: #bf7c19; background: #bf7c19; }
.attendance-status.izin input:checked + span { border-color: #296d9c; background: #296d9c; }
.attendance-status.alpa input:checked + span { border-color: #a43b34; background: #a43b34; }
.attendance-form .form-actions { margin-top: 20px; }
.attendance-journal { display: grid; gap: 20px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.attendance-journal > label { color: var(--ink); font-size: 13px; font-weight: 800; }
.attendance-journal .attendance-subject-field { max-width: 440px; }
.attendance-journal .attendance-subject-field select { margin-top: 8px; }
.attendance-journal textarea { min-height: 125px; margin-top: 8px; resize: vertical; }
.attendance-documentation > div:first-child { display: grid; gap: 3px; margin-bottom: 12px; }
.attendance-documentation strong { color: var(--ink); font-size: 13px; }
.attendance-documentation small { color: var(--slate); font-size: 11px; }
.activity-photo-grid { display: flex; flex-wrap: wrap; gap: 11px; }
.activity-photo, .activity-photo-add { width: 112px; height: 112px; margin: 0; overflow: hidden; border-radius: 12px; }
.activity-photo { position: relative; border: 1px solid var(--line); background: var(--ivory); }
.activity-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.activity-photo-add { display: grid; place-items: center; border: 1px dashed #af936d; color: #87531d; background: #fff8ec; font-size: 23px; cursor: pointer; }
.activity-photo-add[hidden] { display: none; }
.activity-photo-add:hover { border-color: #87531d; background: #fff1d9; }
.activity-photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.activity-photo-remove { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 27px; height: 27px; border: 0; border-radius: 50%; color: #fff; background: rgba(25, 27, 30, .82); opacity: 0; transform: scale(.85); transition: opacity .18s, transform .18s; }
.activity-photo:hover .activity-photo-remove, .activity-photo:focus-within .activity-photo-remove { opacity: 1; transform: scale(1); }
.attendance-export-modal[hidden] { display: none; }
.attendance-export-modal { position: fixed; z-index: 2100; inset: 0; display: grid; place-items: center; padding: 20px; }
.attendance-export-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 24, .68); backdrop-filter: blur(3px); }
.attendance-export-dialog { position: relative; width: min(560px, 100%); padding: 25px; border-radius: 16px; background: var(--white); box-shadow: 0 28px 70px rgba(0,0,0,.35); }
.attendance-export-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.attendance-export-dialog h2 { margin: 4px 0 0; color: var(--ink); font: 27px/1.2 'DM Serif Display', serif; }
.attendance-export-dialog header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--white); }
.attendance-export-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.attendance-export-form label { color: var(--ink); font-size: 12px; font-weight: 800; }
.attendance-export-form input { margin-top: 7px; }
.attendance-export-actions { display: flex; grid-column: 1 / -1; gap: 10px; margin-top: 5px; }
.report-table { min-width: 1350px; }
.report-table td { vertical-align: top; }
.article-editor-form textarea { min-height: 260px; resize: vertical; }
.article-form-preview { display: block; width: min(100%, 440px); max-height: 250px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; }
.article-social-actions { display: flex; gap: 7px; }
.article-social { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; color: #fff; font-size: 13px; }
.article-social.wa { background: #20ae62; }
.article-social.facebook { background: #1877f2; }
.article-social.x { background: #1d2024; }
.article-social:hover { color: #fff; filter: brightness(.9); transform: translateY(-1px); }

.class-heading-actions { display: flex; align-items: center; gap: 10px; }
.class-status, .academic-status { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; padding: 7px 11px; border-radius: 999px; color: #1f6c45; background: #e3f6eb; font-size: 10px; font-weight: 900; }
.class-status.completed { color: #646b73; background: #edf0f2; }
.academic-status.graduated { color: #75501d; background: #fff0cf; }
.academic-status.unassigned { color: #8d5a20; background: #fff1d9; }
.academic-status.inactive { color: #963b35; background: #fde9e7; }
.class-candidate-card { margin-top: 22px; }
.class-select-all { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 13px; color: var(--ink); font-size: 12px; font-weight: 800; }
.class-select-all input, .class-student-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: #87531d; }
.class-student-table { min-width: 900px; }
.class-student-table th:first-child, .class-student-table td:first-child { width: 38px; text-align: center; }
.class-bulk-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 16px; margin-top: 20px; }
.class-bulk-actions > section { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); }
.class-bulk-actions h3 { margin: 0 0 13px; color: var(--ink); font-size: 15px; }
.class-bulk-actions label { display: block; margin-bottom: 11px; color: var(--slate); font-size: 11px; font-weight: 800; }
.class-bulk-actions select, .class-bulk-actions input { margin-top: 6px; background: var(--white); }
.graduation-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.class-graduate-button { color: #fff; background: #87531d; }
.table-action.restore { color: #1f6c45; background: #e3f6eb; }
.attendance-date-form select { margin-top: 7px; }
.attendance-date-form label:first-child { min-width: 310px; }
.attendance-empty { display: grid; justify-items: center; gap: 8px; padding: 45px 20px; color: var(--slate); text-align: center; }
.attendance-empty i { color: #b78546; font-size: 34px; }
.attendance-empty strong { color: var(--ink); font-size: 16px; }
.attendance-empty p { max-width: 520px; margin: 0; font-size: 12px; }

/* Tipografi portal admin mengikuti gaya aplikasi Gudang Harta. */
.portal-admin { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; }
.portal-admin .portal-heading h1 { font-family: inherit; font-size: clamp(30px, 3vw, 38px); line-height: 1.15; font-weight: 750; letter-spacing: -.035em; }
.portal-admin .portal-heading p { font-size: 14px; }
.portal-admin .portal-stats strong { font-family: inherit; font-size: 27px; font-weight: 750; letter-spacing: -.025em; }
.portal-admin .portal-stats small { font-size: 11px; }
.portal-admin .card-heading h2 { font-family: inherit; font-size: 24px; line-height: 1.2; font-weight: 750; letter-spacing: -.025em; }
.portal-admin .card-heading p { font-size: 13px; }
.portal-admin .portal-user-chip small { font-size: 10px; }
.portal-admin .portal-user-chip strong { font-size: 13px; }
.portal-admin .portal-alert { font-size: 13px; }
.portal-admin .portal-topbar nav a,
.portal-admin .portal-topbar nav button,
.portal-admin .portal-nav-group > summary { font-size: 13px; }
.portal-admin .detail-list dt { font-size: 12px; }
.portal-admin .detail-list dd { font-size: 13px; }
.portal-admin .admin-document-list strong { font-size: 12px; }
.portal-admin .admin-document-list small { font-size: 11px; }
.portal-admin .admin-document-list a { font-size: 11px; }
.portal-admin .document-modal-dialog h2 { font-family: inherit; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.portal-admin .portal-table th { font-size: 11px; }
.portal-admin .portal-table td { font-size: 13px; }
.portal-admin .portal-table td strong { font-size: 14px; }
.portal-admin .portal-table td small { font-size: 11px; }
.portal-admin .table-action { font-size: 13px; }
.portal-admin .portal-back { font-size: 12px; }
.portal-admin .account-status,
.portal-admin .completion-badge,
.portal-admin .table-status { font-size: 11px; }

/* Dashboard ringkasan akademik */
.dashboard-overview { display: grid; gap: 22px; }
.dashboard-welcome { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; padding: 30px 32px; border-radius: 18px; color: #fff; background: linear-gradient(125deg, #172a2a 0%, #21443d 62%, #8c5b28 140%); box-shadow: 0 18px 45px rgba(20, 43, 40, .17); }
.dashboard-welcome::after { content: ''; position: absolute; right: -70px; top: -105px; width: 260px; height: 260px; border: 45px solid rgba(255,255,255,.055); border-radius: 50%; }
.dashboard-welcome > * { position: relative; z-index: 1; }
.dashboard-welcome .eyebrow { color: #e8c899; }
.dashboard-welcome h1 { margin: 7px 0; color: #fff; font-family: inherit; font-size: clamp(28px, 3vw, 38px); font-weight: 760; letter-spacing: -.035em; }
.dashboard-welcome p { margin: 0; color: rgba(255,255,255,.72); font-size: 13px; }
.dashboard-quick-actions { display: flex; gap: 9px; }
.dashboard-quick-actions a { display: grid; justify-items: center; gap: 7px; min-width: 92px; padding: 13px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(7px); font-size: 10px; font-weight: 800; transition: .2s ease; }
.dashboard-quick-actions a i { color: #efc98f; font-size: 18px; }
.dashboard-quick-actions a:hover { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.15); transform: translateY(-2px); }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.dashboard-kpi { display: flex; align-items: center; gap: 15px; min-height: 126px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: 0 8px 24px rgba(24, 36, 42, .055); }
.dashboard-kpi > span { display: grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; border-radius: 13px; font-size: 19px; }
.dashboard-kpi div { min-width: 0; }
.dashboard-kpi small, .dashboard-kpi strong, .dashboard-kpi em { display: block; }
.dashboard-kpi small { color: var(--slate); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.dashboard-kpi strong { margin: 2px 0 1px; color: var(--ink); font-size: 27px; font-weight: 780; letter-spacing: -.04em; }
.dashboard-kpi em { overflow: hidden; color: #7b8288; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.kpi-students > span { color: #236647; background: #e1f4e9; }
.kpi-classes > span { color: #315e91; background: #e7f0fb; }
.kpi-attendance > span { color: #8e5b1f; background: #fff0d9; }
.kpi-subjects > span { color: #704d91; background: #f0e8f8; }
.dashboard-chart-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; }
.dashboard-chart-card, .dashboard-bottom-grid > .portal-card { margin: 0; }
.dashboard-chart-card > header, .dashboard-bottom-grid article > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.dashboard-chart-card h2, .dashboard-bottom-grid h2 { margin: 4px 0 0; color: var(--ink); font-family: inherit; font-size: 19px; font-weight: 760; letter-spacing: -.025em; }
.dashboard-chart-card header > a, .dashboard-bottom-grid header > a { color: #87531d; font-size: 10px; font-weight: 800; }
.program-chart { display: grid; gap: 20px; }
.program-chart-row { display: grid; grid-template-columns: 92px 1fr 38px; align-items: center; gap: 12px; }
.program-chart-row > div:first-child strong, .program-chart-row > div:first-child span { display: block; }
.program-chart-row strong { color: var(--ink); font-size: 12px; }
.program-chart-row span { margin-top: 2px; color: var(--slate); font-size: 9px; }
.program-chart-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf0ef; }
.program-chart-track i { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b57935, #e0b069); }
.program-chart-row:nth-child(2) .program-chart-track i { background: linear-gradient(90deg, #285f52, #4f9a84); }
.program-chart-row:nth-child(3) .program-chart-track i { background: linear-gradient(90deg, #365f8b, #6d9dcc); }
.program-chart-row > b { color: var(--ink); font-size: 11px; text-align: right; }
.dashboard-chart-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--slate); font-size: 9px; font-weight: 800; }
.dashboard-chart-badge i { color: #36a36a; font-size: 7px; }
.weekly-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 10px; min-height: 205px; padding: 7px 4px 0; border-bottom: 1px solid var(--line); }
.weekly-chart-column { display: grid; grid-template-rows: 20px 145px 25px; align-items: end; justify-items: center; height: 100%; }
.weekly-chart-value { color: var(--slate); font-size: 9px; font-weight: 800; }
.weekly-chart-track { position: relative; width: min(32px, 72%); height: 138px; overflow: hidden; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #f2f4f3, #e8ecea); }
.weekly-chart-track i { position: absolute; right: 0; bottom: 0; left: 0; display: block; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #53b47e, #278b59); transition: height .35s ease; }
.weekly-chart-column small { align-self: center; color: var(--slate); font-size: 9px; font-weight: 800; }
.dashboard-bottom-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.attendance-status-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attendance-status-summary > div { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--ivory); }
.attendance-status-summary > div > i { font-size: 17px; }
.attendance-status-summary span small, .attendance-status-summary span strong { display: block; }
.attendance-status-summary span small { color: var(--slate); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.attendance-status-summary span strong { margin-top: 1px; color: var(--ink); font-size: 18px; }
.attendance-status-summary .hadir > i { color: #278b59; }
.attendance-status-summary .sakit > i { color: #c17a20; }
.attendance-status-summary .izin > i { color: #3576a8; }
.attendance-status-summary .alpa > i { color: #b94c44; }
.dashboard-class-list { display: grid; gap: 8px; }
.dashboard-class-list > a { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; border-radius: 10px; color: inherit; background: var(--ivory); transition: .18s ease; }
.dashboard-class-list > a:hover { background: #f5eee4; transform: translateX(2px); }
.dashboard-class-list span strong, .dashboard-class-list span small, .dashboard-class-list > a > b small { display: block; }
.dashboard-class-list span strong { color: var(--ink); font-size: 11px; }
.dashboard-class-list span small { margin-top: 2px; color: var(--slate); font-size: 9px; }
.dashboard-class-list > a > b { min-width: 45px; color: #87531d; font-size: 16px; text-align: right; }
.dashboard-class-list > a > b small { color: var(--slate); font-size: 8px; font-weight: 700; }
.dashboard-empty { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 90px; color: var(--slate); font-size: 11px; }
.dashboard-empty i { color: #b78546; font-size: 22px; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: .95fr 1.05fr; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 45px clamp(35px, 6vw, 85px); color: var(--white); background: radial-gradient(circle at 80% 10%, rgba(217,173,108,.17), transparent 28%), linear-gradient(145deg, var(--ink), #172124); }
.login-brand-panel::after { content: ''; position: absolute; width: 420px; height: 420px; right: -220px; bottom: -210px; border: 1px solid rgba(217,173,108,.2); border-radius: 50%; box-shadow: 0 0 0 70px rgba(217,173,108,.03), 0 0 0 140px rgba(217,173,108,.015); }
.login-brand-panel > a { position: relative; z-index: 2; color: rgba(255,255,255,.55); font-size: 10px; font-weight: 800; }
.login-brand-panel > div { position: relative; z-index: 2; margin: auto 0; }
.login-brand-panel img { width: 86px; height: 86px; margin-bottom: 28px; border-radius: 50%; background: var(--white); }
.login-brand-panel h1 { max-width: 600px; margin: 15px 0; font: clamp(48px, 5.5vw, 72px)/1.03 'DM Serif Display', serif; font-weight: 400; }
.login-brand-panel p { max-width: 530px; color: rgba(255,255,255,.58); }
.login-form-panel { display: grid; place-items: center; padding: 45px 25px; background: var(--ivory); }
.login-form { width: min(520px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.login-form h2 { margin: 12px 0 6px; color: var(--ink); font: 40px 'DM Serif Display', serif; }
.login-form > p { margin: 0 0 22px; color: var(--slate); font-size: 12px; }
.login-form > label { margin: 16px 0; font-size: 12px; }
.login-form > small { display: block; margin-top: 13px; color: var(--slate); font-size: 9px; text-align: center; }
.login-role { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 20px; }
.login-role label { cursor: pointer; }
.login-role input { position: absolute; opacity: 0; pointer-events: none; }
.login-role span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 55px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--slate); background: var(--ivory); }
.login-role input:checked + span { color: var(--ink); border-color: var(--gold); background: #fff7e9; box-shadow: 0 0 0 2px rgba(217,173,108,.14); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.toggle-password { position: absolute; right: 8px; top: 14px; width: 36px; height: 36px; border: 0; color: var(--slate); background: transparent; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 520px; }
  .portal-heading { align-items: flex-start; flex-direction: column; }
  .portal-stats, .portal-stats.admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-edit-form { grid-template-columns: 1fr; }
  .admin-edit-form .full-width { grid-column: auto; }
  .teacher-form-grid { grid-template-columns: 1fr; }
  .teacher-form-grid .full-width { grid-column: auto; }
  .admin-document-grid { grid-template-columns: 1fr; }
  .table-tools { width: 100%; flex-wrap: wrap; }
  .table-tools .table-search { flex: 1 1 240px; }
  .portal-grid, .admin-detail-grid { grid-template-columns: 1fr; }
  .report-filter-form { grid-template-columns: 1fr 1fr; }
  .subject-form { align-items: stretch; flex-direction: column; }
  .grade-filter-form { grid-template-columns: 1fr 1fr; }
  .grade-filter-form .button { grid-column: 1 / -1; justify-self: start; }
  .report-card-layout { grid-template-columns: 1fr; }
  .report-card-config { position: static; }
  .journal-list { grid-template-columns: 1fr; }
  .class-bulk-actions { grid-template-columns: 1fr; }
  .attendance-row { grid-template-columns: 38px 1fr; }
  .attendance-options { grid-column: 2; justify-content: flex-start; }
  .report-filter-actions { align-self: end; }
  .report-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-welcome { align-items: flex-start; flex-direction: column; }
  .dashboard-kpis { grid-template-columns: 1fr 1fr; }
  .dashboard-chart-grid, .dashboard-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .portal-topbar { position: static; align-items: flex-start; flex-direction: column; padding: 13px 18px; }
  .portal-topbar nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
  .portal-topbar nav a, .portal-topbar nav button, .portal-nav-group > summary { padding-inline: 8px; white-space: nowrap; }
  .portal-nav-submenu { left: 0; min-width: 170px; }
  .portal-main { width: min(100% - 26px, 1240px); padding-top: 38px; }
  .document-actions { width: 100%; justify-content: flex-end; }
  .admin-document-list > div { flex-wrap: wrap; }
  .document-modal { padding: 12px; }
  .document-modal-dialog { height: min(86vh, 780px); }
  .table-actions { justify-content: flex-start; }
  .portal-heading h1 { font-size: 39px; }
  .portal-stats, .portal-stats.admin-stats { grid-template-columns: 1fr; }
  .portal-stats.system-stats { grid-template-columns: 1fr; }
  .portal-card { padding: 20px 16px; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .dashboard-upload-form { grid-template-columns: 1fr; }
  .table-heading { align-items: flex-start; flex-direction: column; }
  .report-filter-form { grid-template-columns: 1fr; }
  .attendance-date-form, .attendance-tools { align-items: flex-start; flex-direction: column; }
  .attendance-date-form label { width: 100%; min-width: 0; }
  .class-heading-actions { width: 100%; flex-wrap: wrap; }
  .graduation-fields { grid-template-columns: 1fr; }
  .attendance-row { grid-template-columns: 32px 1fr; padding: 13px; gap: 10px; }
  .attendance-options { grid-column: 1 / -1; justify-content: flex-start; }
  .attendance-status { flex: 1 1 calc(50% - 7px); }
  .attendance-status span { width: 100%; }
  .attendance-export-form { grid-template-columns: 1fr; }
  .activity-photo, .activity-photo-add { width: 94px; height: 94px; }
  .grade-filter-form, .grade-column-create { grid-template-columns: 1fr; }
  .grade-filter-form .button { grid-column: auto; width: 100%; }
  .grade-column-create .button { width: 100%; }
  .grade-student-card > header { align-items: flex-start; padding: 16px; }
  .grade-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .grade-save-bar { align-items: stretch; flex-direction: column; }
  .grade-save-bar .button { width: 100%; }
  .report-card-filter form { align-items: stretch; flex-direction: column; }
  .report-card-filter label, .report-card-filter .button { width: 100%; min-width: 0; }
  .journal-summary { align-items: flex-start; flex-direction: column; }
  .journal-print-form > div { grid-template-columns: 1fr; }
  .journal-print-form .button { width: 100%; }
  .attendance-export-actions { grid-column: auto; flex-wrap: wrap; }
  .attendance-export-actions .button { flex: 1 1 auto; }
  .report-filter-actions, .report-export-actions { width: 100%; flex-wrap: wrap; }
  .report-filter-actions .button, .report-export-actions .button { flex: 1 1 auto; }
  .report-official-header { align-items: center; flex-direction: column; padding-inline: 16px; }
  .report-official-header strong { font-size: 18px; }
  .article-social-actions { min-width: 110px; }
  .login-brand-panel { min-height: 440px; padding: 30px 22px; }
  .login-brand-panel h1 { font-size: 46px; }
  .login-form-panel { padding: 25px 14px; }
  .login-form { padding: 28px 20px; }
  .login-role { grid-template-columns: 1fr; }
  .dashboard-welcome { padding: 24px 20px; }
  .dashboard-quick-actions { width: 100%; }
  .dashboard-quick-actions a { flex: 1; min-width: 0; }
  .dashboard-kpis { grid-template-columns: 1fr; }
  .dashboard-kpi { min-height: 108px; }
  .program-chart-row { grid-template-columns: 76px 1fr 34px; gap: 8px; }
  .weekly-chart { gap: 4px; }
  .weekly-chart-track { width: min(25px, 75%); }
}
.student-name,
#participant-table td:first-child strong,
.class-student-table td:nth-child(3) strong,
.grade-student-name strong,
.ranking-table td:nth-child(2) strong,
.teacher-table td:first-child strong,
.teacher-student-table td:first-child { text-transform: uppercase; }
