.app-header { gap: 18px; }
.app-header > .brand { flex: 0 0 auto; }
.app-header .header-account { min-width: 0; flex: 1; justify-content: flex-end; gap: 14px; }
.app-nav { min-width: 0; display: flex; flex: 1; justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.app-nav a { padding: 8px 10px; border-radius: 5px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.app-nav a:hover, .app-nav a:focus-visible, .app-nav a.is-active { background: #edf2fb; color: var(--green-dark); }
.app-header .header-account form { flex: 0 0 auto; margin: 0; }
.app-header .account-name { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header .icon-button { flex: 0 0 auto; cursor: pointer; }
.app-header .icon-button:hover { border-color: var(--green); color: var(--green-dark); }
.page-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.content-section > h2 { margin: 0 0 16px; }
.content-section .section-heading h2 { margin-bottom: 0; }
.form-grid .form-control, .content-section .form-control, .login-form .form-control { width: 100%; }
.form-grid .form-grid-wide { grid-column: 1 / -1; }
.form-help { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.form-action-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.form-action-row .btn { min-height: 42px; padding: 10px 16px; background: var(--green); color: #fff; }
.form-action-row .btn:hover { background: var(--green-dark); color: #fff; }
.btn-outline-danger { border: 1px solid #e4b7b1; background: #fff; color: #a14338; }
.btn-outline-danger:hover { background: #fff1ef; color: #87372e; }
.form-grid fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 4px; }
.form-grid fieldset legend { float: none; width: auto; margin: 0; padding: 0 5px; color: #43534c; font-size: 13px; font-weight: 700; }
.checkbox-option { display: inline-flex !important; align-items: center; gap: 8px; margin: 5px 16px 5px 0 !important; }
.checkbox-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.table-scroll { width: 100%; }
.app-table { min-width: 640px; }
.app-table td { vertical-align: middle; }
.dt-container { color: var(--ink); font-size: 13px; }
.dt-container .dt-layout-row { gap: 12px; }
.dt-container .dt-search input { margin-left: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.dt-container .dt-paging button.dt-paging-button { min-width: 34px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink) !important; }
.dt-container .dt-paging button.dt-paging-button.current { border-color: var(--green); background: var(--green); color: #fff !important; }
.dt-container .dt-paging button.dt-paging-button:hover:not(.disabled) { border-color: var(--green); background: #edf2fb; color: var(--green-dark) !important; }
.dt-container .dt-processing { border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); box-shadow: 0 4px 16px #202c421a; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.table-actions form { margin: 0; }
.table-actions .btn { padding: 7px 10px; font-size: 12px; }
.qr-thumbnail { width: 112px; height: 112px; display: block; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.qr-url { display: inline-block; max-width: 230px; overflow-wrap: anywhere; }
.stats-row-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.account-dialog { width: min(520px, calc(100% - 32px)); max-width: 520px; max-height: min(90vh, 760px); padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px #101a2d40; }
.account-dialog::backdrop { background: #101a2db3; backdrop-filter: blur(2px); }
.account-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.account-dialog-heading h2 { margin: 6px 0 0; font-size: 22px; }
.account-dialog-heading .icon-button { flex: 0 0 auto; cursor: pointer; }
.account-dialog-summary { display: flex; align-items: center; gap: 10px; margin: 18px 0 22px; }
.account-status { color: var(--muted); font-size: 12px; }
.account-editor-form { display: grid; gap: 16px; }
.account-editor-field label { display: block; margin: 0 0 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.account-editor-field label span, .account-editor-field small { color: var(--muted); font-size: 11px; font-weight: 400; }
.account-editor-field small { display: block; margin-top: 5px; }
.account-editor-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 3px; }
.account-status-form { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.account-status-form .form-help { margin: 0; }
.account-status-form [hidden] { display: none; }
.visit-time-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #f8f9fc; }
.visit-time-field { min-width: 220px; flex: 1; }
.visit-time-field label { display: block; margin: 0 0 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.visit-time-field .form-control { min-height: 40px; }
.visit-time-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.export-dialog-help { margin: 14px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.stat-panel-link { color: inherit; text-decoration: none; }
.stat-panel-link:hover { color: var(--green-dark); }
.guest-shell { width: min(760px, 100%); margin: 0 auto; }
.guest-intro { margin-bottom: 20px; padding: 23px 25px; border-radius: 7px; background: #edf2fb; }
.guest-intro .eyebrow { margin-bottom: 7px; }
.guest-intro h1 { margin: 0 0 7px; color: var(--ink); font-size: 28px; }
.guest-intro p { margin: 0; color: var(--muted); }
.guest-card { padding: 25px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.guest-card .form-grid { grid-template-columns: 1fr; }
.guest-card #bagian-umum, .guest-card #bagian-murid { display: grid; gap: 13px; }
.guest-card #bagian-umum[hidden], .guest-card #bagian-murid[hidden] { display: none; }
.guest-field { margin: 0; }
.guest-student-name-label { margin-top: 13px; }
.guest-student-name { background: #f7f9f7; }
.guest-purpose { min-height: 120px; }
.guest-login-link { color: var(--muted); font-size: 12px; font-weight: 700; }
.guest-login-link:hover { color: var(--green); }
.guest-card .form-grid label { display: block; margin-bottom: 7px; color: #43534c; font-size: 13px; font-weight: 700; }
.guest-card .form-grid .btn { min-height: 42px; padding: 9px 14px; background: var(--green); color: #fff; }
.guest-card .form-grid .btn:hover { background: var(--green-dark); }
.lookup-row { display: flex; gap: 8px; }
.lookup-row .form-control { min-width: 0; flex: 1; }
.lookup-row .btn { flex: 0 0 auto; }
.login-page { background: #101a2d; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .94fr) minmax(380px, 1.06fr); }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 36px; overflow: hidden; background: #263d68; color: #fff; }
.login-aside::after { position: absolute; right: -110px; bottom: 85px; width: 360px; height: 360px; border: 1px solid #ffffff19; border-radius: 50%; box-shadow: 0 0 0 42px #ffffff0a, 0 0 0 92px #ffffff08; content: ""; }
.brand-light, .brand-light:hover { position: relative; z-index: 1; color: #fff; }
.brand-light .brand-accent { color: #c1d0f0; }
.brand-light small { color: #c1cde3; }
.aside-copy { position: relative; z-index: 1; max-width: 470px; padding: 70px 0; }
.aside-copy .eyebrow { color: #c1d0f0; }
.aside-copy h1 { margin: 18px 0; color: #fff; font-family: Georgia, serif; font-size: clamp(38px, 4.5vw, 60px); font-weight: 400; line-height: 1.08; }
.aside-copy p { max-width: 390px; color: #d3dced; font-size: 16px; line-height: 1.6; }
.aside-stamp { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 13px; font-weight: 700; }
.aside-stamp > i { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #8195bd; border-radius: 50%; color: #c1d0f0; }
.aside-stamp small { display: block; margin-top: 4px; color: #c1cde3; font-size: 11px; font-weight: 400; }
.login-form-wrap { display: flex; justify-content: center; align-items: center; padding: 35px; background: #101a2d; }
.login-form { width: min(574px, 100%); padding: 36px; border: 1px solid #303d52; border-radius: 24px; background: #111a2b; color: #e9eef5; }
.login-form h2 { margin: 9px 0 3px; color: #f2f5fa; font-size: 27px; font-weight: 700; }
.login-form > .eyebrow, .login-form label { color: #a6bcf0; }
.login-form .muted, .login-footnote { color: #9aa8bd; }
.login-form [hidden] { display: none !important; }
.login-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 35px; padding: 8px; border: 1px solid #303d52; border-radius: 23px; background: #1d283b; }
.login-tab { min-width: 0; min-height: 54px; display: flex; justify-content: center; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 17px; background: transparent; color: #9aa8bd; font: inherit; font-size: 14px; font-weight: 700; text-align: center; cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.login-tab:hover, .login-tab:focus-visible { color: #fff; }
.login-tab:focus-visible { outline: 2px solid #c1d0f0; outline-offset: 2px; }
.login-tab-student.is-active, .login-tab-staff.is-active { background: #5279c2; color: #fff; }
.login-tab-student:not(.is-active):hover, .login-tab-staff:not(.is-active):hover { background: #5279c226; color: #c1d0f0; }
.login-form .notice { margin-bottom: 18px; }
.login-field { margin: 17px 0; }
.login-field label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 700; }
.login-input { position: relative; }
.login-input > i { position: absolute; top: 50%; left: 17px; z-index: 1; color: #7897d4; transform: translateY(-50%); }
.login-form .login-input .form-control { height: 52px; padding: 12px 16px 12px 48px; border: 1px solid #35435a; border-radius: 12px; background: #1d283b; color: #edf2f8; }
.login-form .login-input .form-control:focus { border-color: #6688d0; box-shadow: 0 0 0 3px #6688d030; }
.login-form .login-select { margin: 17px 0; }
.login-form .login-select label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 700; }
.login-form .login-select .form-control { border-color: #35435a; background-color: #1d283b; color: #edf2f8; }
.login-submit { width: 100%; min-height: 48px; margin-top: 5px; border: 0; border-radius: 5px; background: #5279c2; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.login-submit:hover { background: #3e62a5; }
.login-footnote { margin: 18px 0 0; font-size: 12px; text-align: center; }
.notice-error, .notice-success { padding: 12px 15px; border-radius: 4px; }
.import-result { margin-top: 18px; padding: 14px; border-radius: 4px; background: #f6f8f6; font-size: 13px; }
.import-result > strong { color: var(--green-dark); }
.import-result > span { margin-left: 14px; color: #a45732; }
.import-result ul { margin: 10px 0 0; padding-left: 20px; color: #815b4a; }
@media (max-width: 900px) {
    .stats-row-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-header { flex-wrap: wrap; gap: 6px 12px; height: auto; min-height: 62px; padding: 8px 18px; }
    .app-header > .brand { min-height: 42px; }
    .app-header .header-account { display: contents; }
    .app-nav { order: 3; width: 100%; flex: 0 0 100%; justify-content: flex-start; overflow-x: auto; padding: 2px 0 5px; scrollbar-width: thin; }
    .app-nav a { flex: 0 0 auto; }
    .app-header .account-name { max-width: min(38vw, 190px); margin-left: auto; text-align: right; }
    .app-header .header-account form { order: 2; }
}
@media (max-width: 760px) {
    .two-panel-grid { grid-template-columns: 1fr; gap: 0; }
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { min-height: 270px; padding: 24px; }
    .aside-copy { padding: 30px 0; }
    .aside-copy h1 { font-size: 40px; }
    .aside-copy p, .aside-stamp { display: none; }
    .login-form-wrap { padding: 26px 18px; }
    .login-form { padding: 28px 22px; border-radius: 20px; }
    .app-header { height: auto; min-height: 62px; align-items: flex-start; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
    .app-header .header-account { align-items: flex-end; flex-direction: row; gap: 7px; }
    .app-nav { gap: 3px; }
    .app-nav a { padding: 7px 9px; font-size: 11px; }
    .app-header .account-name { display: none; }
    .app-content { width: min(100% - 28px, 600px); padding-top: 27px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 23px; }
    .page-heading h1 { font-size: 27px; }
    .page-heading-actions { width: 100%; }
    .page-heading-actions .btn { flex: 1; text-align: center; }
    .content-section { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; gap: 13px; }
    .form-grid .form-grid-wide { grid-column: auto; }
    .form-action-row .btn { width: 100%; }
    .guest-card { padding: 18px; }
    .account-dialog { padding: 21px 18px; }
    .account-editor-actions .btn { flex: 1; }
    .login-tabs { gap: 3px; margin-bottom: 28px; padding: 6px; }
    .login-tab { min-height: 48px; gap: 5px; padding: 6px 4px; font-size: 12px; }
}
