:root {
    --ipad-primary: #1d4ed8;
    --ipad-primary-dark: #1e3a8a;
    --ipad-primary-light: #38bdf8;
    --ipad-accent: #0ea5e9;
    --ipad-ink: #12233f;
    --ipad-muted: #64748b;
    --ipad-soft: #eff6ff;
    --ipad-line: #dbeafe;
}

body {
    font-family: var(--app-font-family);
    color: var(--ipad-ink);
}

.app-navbar {
    background: linear-gradient(90deg, #0f3f8f 0%, #1d4ed8 48%, #0ea5e9 100%);
}

.app-sidebar-title {
    color: var(--ipad-primary-dark);
}

.app-brand-title {
    color: #ffffff;
}

.app-sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--ipad-primary-light), var(--ipad-primary), var(--ipad-primary-dark));
    color: #fff;
}

.btn-primary {
    background-color: var(--ipad-primary);
    border-color: var(--ipad-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ipad-primary-dark);
    border-color: var(--ipad-primary-dark);
}

.btn-success {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

.btn-success:hover,
.btn-success:focus {
    background-color: #0284c7;
    border-color: #0284c7;
}

.btn-warning {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #bfdbfe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.badge.bg-success,
.badge.bg-warning {
    background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
    color: #ffffff !important;
}

.badge.damage-level-major {
    background: #ffc107 !important;
    color: #212529 !important;
}

.repair-action-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.repair-action-buttons form {
    display: inline-flex;
    margin: 0;
}

.alert-success {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #075985;
}

.alert-warning,
.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .16);
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, #e0f2fe 0%, #f8fbff 48%, #dbeafe 100%);
}

.login-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.login-panel {
    width: min(1080px, 100%);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
}

.login-hero {
    position: relative;
    padding: 48px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(14, 116, 144, .98), rgba(30, 64, 175, .92)),
        url("../img/sritani-logo.png") center 70% / 58% no-repeat;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    font-weight: 700;
}

.login-badge img,
.login-form-brand img,
.app-brand-logo img,
.app-sidebar-logo {
    object-fit: contain;
}

.login-badge img {
    width: 30px;
    height: 30px;
}

.login-seal-wrap {
    display: flex;
    justify-content: center;
    margin: 32px 0 24px;
}

.login-seal-main {
    width: 160px;
    height: 160px;
    object-fit: contain;
    padding: 18px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 40px rgba(30, 64, 175, .28);
}

.login-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.login-hero p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 17px;
}

.login-form-wrap {
    padding: 48px;
    background: #fff;
}

.login-form-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.login-form-brand img {
    width: 52px;
    height: 52px;
    padding: 8px;
    border-radius: 14px;
    background: var(--ipad-soft);
}

.app-brand-logo img {
    width: 42px;
    height: 42px;
}

.app-sidebar-logo {
    width: 52px;
    height: 52px;
}

.login-card-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--ipad-primary-dark);
}

.login-card-subtitle,
.login-note {
    color: var(--ipad-muted);
}

.login-label {
    font-weight: 700;
}

.login-input {
    min-height: 46px;
    border-radius: 10px;
}

.btn-login {
    min-height: 48px;
    border-radius: 10px;
    font-weight: 700;
}

.login-note {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.card {
    border-radius: 12px;
    border-color: var(--ipad-line);
}

.table {
    background: #fff;
}

body[data-role="viewer"] form[method="post"] button:not([type="button"]),
body[data-role="viewer"] form[method="post"] input[type="submit"],
body[data-role="viewer"] form[method="post"] .btn-success,
body[data-role="viewer"] form[method="post"] .btn-danger {
    display: none !important;
}

@media (max-width: 991px) {
    .login-hero,
    .login-form-wrap {
        padding: 34px 26px;
    }

    .login-seal-main {
        width: 118px;
        height: 118px;
    }
}

body .navbar.app-navbar,
body .app-navbar {
    background: linear-gradient(90deg, #0f3f8f 0%, #1d4ed8 48%, #0ea5e9 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .18) !important;
}

body .app-brand-title,
body .app-brand-subtitle,
body .app-navbar-user,
body .app-user-name,
body .app-user-role {
    color: #ffffff !important;
}

body .app-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%) !important;
}

body .app-sidebar .nav-link.active,
body .nav-link.active {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 55%, #1e3a8a 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22) !important;
}

body .app-logout-link {
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%) !important;
    color: #1e3a8a !important;
    box-shadow: 0 12px 24px rgba(30, 64, 175, .18) !important;
}

.dt-container {
    color: var(--ipad-ink);
}

.dt-container .dt-search input,
.dt-container .dt-length select {
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    min-height: 38px;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    border-color: var(--ipad-primary);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .14);
}

.dt-container .page-link {
    color: var(--ipad-primary);
}

.dt-container .active > .page-link,
.dt-container .page-link.active {
    background-color: var(--ipad-primary);
    border-color: var(--ipad-primary);
    color: #ffffff;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background-color: var(--ipad-primary);
    border-color: #ffffff;
}

.classroom-loans-cards {
    display: none;
}

.checks-cards {
    display: none;
}

.activity-log-cards {
    display: none;
}

.activity-log-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.activity-log-table th,
.activity-log-table td {
    vertical-align: top;
}

.activity-log-card {
    border: 1px solid var(--ipad-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 64, 175, .08);
    padding: 14px;
}

.activity-log-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eff6ff;
}

.activity-log-card-head strong,
.activity-log-card-head span {
    display: block;
}

.activity-log-card-head strong {
    color: var(--ipad-primary-dark);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.3;
}

.activity-log-card-head span,
.activity-log-card-head time {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.activity-log-card-head time {
    flex: 0 0 auto;
    text-align: right;
}

.activity-log-card dl {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
}

.activity-log-card dl div {
    display: grid;
    gap: 2px;
}

.activity-log-card dt {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 800;
}

.activity-log-card dd {
    margin: 0;
    color: var(--ipad-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.activity-log-empty {
    padding: 18px;
    border: 1px solid var(--ipad-line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ipad-muted);
    text-align: center;
    font-weight: 700;
}

.app-content table.table {
    max-width: 100%;
}

.app-content .table-responsive {
    width: 100%;
}

.app-content .form-label {
    font-weight: 700;
}

.app-content textarea.form-control {
    resize: vertical;
}

.app-content .btn {
    white-space: normal;
}

.checks-table-wrap {
    margin-bottom: 16px;
}

.checks-summary-wrap {
    margin-bottom: 16px;
}

.checks-summary-toggle {
    min-height: 42px;
    border-radius: 10px;
    font-weight: 700;
}

.checks-summary-form {
    display: grid;
    gap: 12px;
}

.checks-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.checks-summary-month-select {
    width: 160px;
    min-height: 40px;
    border-radius: 10px;
}

.checks-summary-actions .btn {
    min-height: 40px;
    border-radius: 10px;
    font-weight: 700;
}

.checks-summary-table {
    min-width: 1180px;
}

.checks-summary-table th,
.checks-summary-table td {
    white-space: nowrap;
}

.checks-summary-table th:nth-child(n+6),
.checks-summary-table td:nth-child(n+6) {
    min-width: 68px;
    text-align: center;
}

.checks-summary-table td:nth-child(3) {
    min-width: 180px;
}

.checks-summary-table td.is-active-month,
.checks-summary-table th.is-active-month {
    background: #eff6ff;
}

.checks-summary-check {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

.checks-summary-check .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checks-summary-check .form-check-input:disabled {
    cursor: not-allowed;
}

.checks-summary-check.is-existing .form-check-input:disabled {
    opacity: 1;
}

.checks-summary-check.is-locked {
    opacity: 0.45;
}

.checks-summary-edit-link {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 2px 7px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.checks-summary-edit-link:hover,
.checks-summary-edit-link:focus {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.checks-summary-status-select {
    width: 88px;
    min-height: 30px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 12px;
}

.checks-accessories-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    min-width: 320px;
}

.checks-date-grid,
.checks-card-date-grid {
    display: grid;
    gap: 6px;
}

.checks-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.checks-history-btn {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.checks-history-btn:hover,
.checks-history-btn:focus {
    background: #dbeafe;
    color: #1e3a8a;
}

.checks-history-list-locked {
    margin-top: 10px;
}

.checks-history-edit-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.checks-history-edit-link:hover,
.checks-history-edit-link:focus {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.checks-edit-btn {
    --bs-btn-bg: #f59e0b;
    --bs-btn-border-color: #f59e0b;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #d97706;
    --bs-btn-hover-border-color: #d97706;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-focus-shadow-rgb: 245, 158, 11;
    --bs-btn-active-bg: #b45309;
    --bs-btn-active-border-color: #b45309;
    --bs-btn-active-color: #ffffff;
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.22);
}

.btn.checks-edit-btn,
a.btn.checks-edit-btn,
button.btn.checks-edit-btn {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

.checks-edit-btn:hover,
.checks-edit-btn:focus,
.btn.checks-edit-btn:hover,
.btn.checks-edit-btn:focus {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}

.checks-card-form {
    display: grid;
    gap: 10px;
}

.checks-card-form .form-label {
    margin: 0;
    color: var(--ipad-muted);
    font-size: 13px;
    font-weight: 700;
}

.checks-card-form .form-control,
.checks-card-form .form-select {
    min-height: 44px;
    border-radius: 12px;
}

.checks-view-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.checks-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.checks-history-actions form {
    margin: 0;
}

.classroom-loans-header h3 {
    margin: 0;
}

.classroom-student-card {
    border: 1px solid var(--ipad-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 64, 175, .08);
    padding: 14px;
}

.classroom-student-card + .classroom-student-card {
    margin-top: 12px;
}

.classroom-student-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.classroom-student-code {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
}

.classroom-student-name {
    color: var(--ipad-ink);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.classroom-mobile-detail {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    border-top: 1px solid #eff6ff;
}

.classroom-mobile-detail span {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 700;
}

.classroom-mobile-detail strong {
    color: var(--ipad-ink);
    font-size: 15px;
}

.classroom-mobile-detail small {
    color: var(--ipad-muted);
}

.classroom-ipad-detail {
    margin: 8px 0 2px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #f8fbff;
}

.classroom-ipad-detail span {
    color: #1d4ed8;
    font-size: 12px;
}

.classroom-ipad-detail strong {
    color: var(--ipad-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
}

.classroom-ipad-detail small {
    color: #1d4ed8;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
    word-break: break-word;
}

.classroom-mobile-borrow-form {
    display: grid;
    gap: 10px;
}

.classroom-mobile-borrow-form .form-label {
    margin: 0;
    color: var(--ipad-muted);
    font-size: 13px;
    font-weight: 700;
}

.classroom-mobile-borrow-form .form-control {
    min-height: 46px;
    border-radius: 12px;
}

.classroom-mobile-borrow-form textarea.form-control {
    min-height: 72px;
    resize: vertical;
}

.classroom-loans-table textarea.form-control {
    min-height: 62px;
    resize: vertical;
}

.classroom-room-combobox {
    position: relative;
}

.classroom-room-combobox .form-control {
    min-height: 48px;
    border-radius: 12px;
}

.classroom-room-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--ipad-line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.classroom-room-combobox.is-open .classroom-room-options {
    display: grid;
    gap: 4px;
}

.classroom-room-options.is-empty::after {
    content: "ไม่พบห้องเรียน";
    display: block;
    padding: 10px 12px;
    color: var(--ipad-muted);
    font-size: 14px;
}

.classroom-room-option {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ipad-ink);
    text-align: left;
}

.classroom-room-option:hover,
.classroom-room-option:focus,
.classroom-room-option.is-selected {
    background: var(--ipad-soft);
    color: var(--ipad-primary-dark);
}

.classroom-mobile-accessories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.classroom-mobile-accessories .form-check {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 10px 9px 34px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.classroom-mobile-accessories .form-check-input {
    margin-left: -22px;
    margin-top: 0;
    flex: 0 0 auto;
}

.classroom-mobile-accessories .form-check-label {
    color: #1e3a5f;
    font-size: 13px;
    line-height: 1.25;
}

.classroom-history {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #dbeafe;
}

.classroom-history-title {
    margin-bottom: 8px;
    color: var(--ipad-primary-dark);
    font-size: 14px;
    font-weight: 800;
}

.classroom-history-list {
    display: grid;
    gap: 8px;
}

.classroom-history-item {
    padding: 9px 10px;
    border: 1px solid #e0f2fe;
    border-radius: 12px;
    background: #f8fbff;
}

.classroom-history-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.classroom-history-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.classroom-history-borrow {
    background: #dbeafe;
    color: #1d4ed8;
}

.classroom-history-return {
    background: #dcfce7;
    color: #166534;
}

.classroom-history-edit {
    background: #fef3c7;
    color: #92400e;
}

.classroom-history-not_borrowing,
.classroom-history-clear_not_borrowing {
    background: #e5e7eb;
    color: #374151;
}

.classroom-history-date {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.classroom-history-detail,
.classroom-history-note,
.classroom-history-empty {
    margin-top: 5px;
    color: var(--ipad-muted);
    font-size: 12px;
    line-height: 1.35;
}

.classroom-history-note {
    color: #334155;
}

.repairs-mobile-cards {
    display: none;
}

.repairs-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.repairs-table th,
.repairs-table td {
    vertical-align: top;
}

.repair-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.repair-form textarea.form-control {
    min-height: 104px;
    resize: vertical;
}

.repair-mobile-card {
    border: 1px solid var(--ipad-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 64, 175, .08);
    padding: 14px;
}

.repair-mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eff6ff;
}

.repair-mobile-id {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 800;
}

.repair-mobile-asset {
    color: var(--ipad-primary-dark);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
    word-break: break-word;
}

.repair-mobile-serial {
    color: var(--ipad-muted);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.repair-mobile-badges {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.repair-mobile-badges .badge {
    max-width: 100%;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
}

.repair-mobile-detail-grid {
    display: grid;
    gap: 10px;
    padding: 12px 0;
}

.repair-mobile-detail,
.repair-mobile-problem {
    display: grid;
    gap: 2px;
}

.repair-mobile-detail span,
.repair-mobile-problem span {
    color: var(--ipad-muted);
    font-size: 12px;
    font-weight: 800;
}

.repair-mobile-detail strong,
.repair-mobile-problem p {
    margin: 0;
    color: var(--ipad-ink);
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

.repair-mobile-detail small {
    color: var(--ipad-muted);
    font-size: 12px;
}

.repair-mobile-problem {
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.repair-mobile-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.repair-mobile-images .img-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.repair-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.repair-mobile-actions form {
    display: contents;
}

.repair-mobile-actions .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    white-space: normal;
}

.repair-mobile-empty {
    padding: 18px;
    border: 1px solid var(--ipad-line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ipad-muted);
    text-align: center;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3,
    .app-content .card-body > .d-flex.justify-content-between.align-items-center.mb-3,
    .app-content .alert.d-flex.justify-content-between.align-items-center {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch !important;
    }

    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h1,
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h2,
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h3,
    .app-content .card-body > .d-flex.justify-content-between.align-items-center.mb-3 h1,
    .app-content .card-body > .d-flex.justify-content-between.align-items-center.mb-3 h2,
    .app-content .card-body > .d-flex.justify-content-between.align-items-center.mb-3 h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
        line-height: 1.25;
    }

    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 .btn,
    .app-content .card-body > .d-flex.justify-content-between.align-items-center.mb-3 .btn,
    .app-content .alert.d-flex.justify-content-between.align-items-center .btn {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-weight: 700;
    }

    .app-content .card {
        border-radius: 14px;
    }

    .app-content .card-body {
        padding: 14px;
    }

    .app-content .row {
        --bs-gutter-x: 0.75rem;
    }

    .app-content .row > [class*="col-md-"],
    .app-content .row > [class*="col-lg-"],
    .app-content .row > [class*="col-xl-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .app-content .form-control,
    .app-content .form-select,
    .app-content .btn {
        min-height: 46px;
        border-radius: 12px;
    }

    .app-content textarea.form-control {
        min-height: 104px;
    }

    .app-content .form-check {
        min-height: 42px;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
        padding: 9px 10px 9px 36px;
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: #f8fbff;
    }

    .app-content .form-check-input {
        margin-left: -24px;
        margin-top: 0;
        flex: 0 0 auto;
    }

    .app-content .form-check-label {
        line-height: 1.3;
    }

    .app-content form > .btn,
    .app-content form > a.btn,
    .app-content .card-body > .btn,
    .app-content .card-body > a.btn {
        width: 100%;
        margin-top: 6px;
    }

    .app-content form.d-inline,
    .app-content form.d-inline .btn,
    .app-content .table form.d-inline,
    .app-content .table form.d-inline .btn {
        width: 100%;
        display: block !important;
    }

    .app-content .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-content table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-content table.table th,
    .app-content table.table td {
        white-space: nowrap;
        vertical-align: top;
    }

    .app-content table.table td.small,
    .app-content table.table td .small {
        white-space: normal;
    }

    .app-content .card-body > h4,
    .app-content .card-body > h5 {
        line-height: 1.3;
        word-break: break-word;
    }

    .app-content .card-body > .mb-3 div,
    .app-content .card-body > p,
    .app-content .alert {
        overflow-wrap: anywhere;
    }

    .app-content .btn-group,
    .app-content .d-flex.gap-2,
    .app-content .d-flex.gap-1 {
        flex-wrap: wrap;
    }

    .repair-page-header {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch !important;
    }

    .repair-page-header h3,
    .repair-form-header h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
    }

    .repair-page-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .repair-page-actions .btn {
        width: 100%;
        min-height: 44px;
        border-radius: 12px;
        font-weight: 700;
    }

    .repairs-table-wrap {
        display: none;
    }

    .repairs-mobile-cards {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    .repair-mobile-card {
        padding: 13px;
    }

    .repair-mobile-card-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .repair-mobile-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .repair-mobile-actions {
        grid-template-columns: 1fr;
    }

    .repair-form-page {
        margin: -2px -4px 0;
    }

    .repair-form .row {
        gap: 0;
    }

    .repair-form .col-md-2,
    .repair-form .col-md-3,
    .repair-form .col-md-4 {
        width: 100%;
        margin-bottom: 12px !important;
    }

    .repair-form .form-control,
    .repair-form .form-select,
    .repair-form .btn {
        min-height: 46px;
        border-radius: 12px;
    }

    .repair-form textarea.form-control {
        min-height: 118px;
    }

    .repair-form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .repair-form-actions .btn {
        width: 100%;
        font-weight: 700;
    }

    .loan-filter-card .card-body {
        padding: 14px;
    }

    .activity-log-header {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch !important;
    }

    .activity-log-header h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
    }

    .activity-log-header .btn {
        width: 100%;
        min-height: 44px;
        border-radius: 12px;
        font-weight: 700;
    }

    .activity-log-filter .card-body {
        padding: 14px;
    }

    .activity-log-filter .row {
        gap: 0;
    }

    .activity-log-filter .col-md-2 {
        width: 100%;
        margin-bottom: 10px !important;
    }

    .activity-log-filter .form-control,
    .activity-log-filter .form-select,
    .activity-log-filter .btn {
        min-height: 46px;
        border-radius: 12px;
    }

    .activity-log-table-wrap {
        display: none;
    }

    .activity-log-cards {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    .activity-log-card-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .activity-log-card-head time {
        text-align: left;
    }

    .loan-filter-card .col-md-4,
    .loan-filter-card .col-md-3,
    .loan-filter-card .col-md-2 {
        margin-bottom: 10px !important;
    }

    .loan-filter-card .form-select,
    .loan-filter-card .form-control,
    .loan-filter-card .btn {
        min-height: 46px;
        border-radius: 12px;
    }

    .classroom-loans-page {
        margin: -2px -4px 0;
    }

    .classroom-loans-header {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch !important;
    }

    .classroom-loans-header h3 {
        font-size: 22px;
        font-weight: 800;
    }

    .classroom-loans-header .btn {
        width: 100%;
        min-height: 44px;
        border-radius: 12px;
    }

    .classroom-room-picker {
        border-radius: 14px;
    }

    .classroom-room-picker .card-body {
        padding: 14px;
    }

    .classroom-room-picker .row {
        gap: 10px;
    }

    .classroom-room-picker .col-md-6,
    .classroom-room-picker .col-md-2 {
        width: 100%;
        margin: 0 !important;
    }

    .classroom-room-picker .form-select,
    .classroom-room-picker .form-control,
    .classroom-room-picker .btn {
        min-height: 46px;
        border-radius: 12px;
    }

    .classroom-loans-table {
        display: none;
    }

    .classroom-loans-cards {
        display: grid;
        gap: 12px;
    }

    .checks-table-wrap {
        display: none;
    }

    .checks-cards {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    .checks-view-header {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch !important;
    }

    .checks-view-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .checks-view-actions .btn {
        width: 100%;
        min-height: 44px;
        border-radius: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 {
        gap: 16px;
        flex-wrap: wrap;
    }

    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h1,
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h2,
    .app-content > .d-flex.justify-content-between.align-items-center.mb-3 h3 {
        font-size: 26px;
        font-weight: 800;
    }

    .app-content .form-control,
    .app-content .form-select,
    .app-content .btn {
        min-height: 42px;
        border-radius: 10px;
    }

    .app-content .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .activity-log-header {
        gap: 16px;
    }

    .activity-log-header h3 {
        font-size: 26px;
        font-weight: 800;
    }

    .activity-log-filter .col-md-2 {
        width: 33.333333%;
    }

    .activity-log-filter .form-control,
    .activity-log-filter .form-select,
    .activity-log-filter .btn {
        min-height: 44px;
        border-radius: 12px;
    }

    .activity-log-table-wrap {
        display: none;
    }

    .activity-log-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 16px;
    }

    .repair-page-header {
        gap: 16px;
    }

    .repair-page-header h3,
    .repair-form-header h3 {
        font-size: 26px;
        font-weight: 800;
    }

    .repair-page-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .repair-page-actions .btn,
    .repair-form .form-control,
    .repair-form .form-select,
    .repair-form .btn {
        min-height: 44px;
        border-radius: 12px;
    }

    .repairs-table-wrap {
        display: none;
    }

    .repairs-mobile-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 16px;
    }

    .classroom-loans-header {
        gap: 16px;
    }

    .classroom-loans-header h3 {
        font-size: 26px;
        font-weight: 800;
    }

    .classroom-room-picker .card-body {
        padding: 18px;
    }

    .classroom-room-picker .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 180px;
        gap: 14px;
        align-items: end;
    }

    .checks-room-picker .row {
        grid-template-columns: minmax(0, 1.4fr) 170px 170px 150px;
    }

    .classroom-room-picker .col-md-6,
    .classroom-room-picker .col-md-2 {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0 !important;
    }

    .classroom-room-picker .form-select,
    .classroom-room-picker .form-control,
    .classroom-room-picker .btn {
        min-height: 48px;
        border-radius: 12px;
    }

    .classroom-loans-table {
        display: none;
    }

    .classroom-loans-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .checks-table-wrap {
        display: none;
    }

    .checks-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 16px;
    }

    .classroom-student-card + .classroom-student-card {
        margin-top: 0;
    }

    .classroom-mobile-accessories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .repair-mobile-actions {
        grid-template-columns: 1fr;
    }

    .classroom-mobile-accessories {
        grid-template-columns: 1fr;
    }
}
