/* assets/css/style.css */

:root {
    --app-font-family: 'Prompt', 'Noto Sans Thai', Tahoma, Arial, sans-serif;
    --bs-font-sans-serif: var(--app-font-family);
    --bs-body-font-family: var(--app-font-family);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--app-font-family);
}

html {
    background: #0f3f8f;
}

body {
    color: #12233f;
    background:
        linear-gradient(180deg, #eff6ff 0%, #f8fbff 48%, #ffffff 100%);
}

button,
input,
optgroup,
select,
textarea,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.modal,
.tooltip,
.popover,
.dataTables_wrapper,
table.dataTable {
    font-family: var(--app-font-family);
}

body,
body *:not(i):not(.bi):not(.fa):not(.fas):not(.far):not(.fab) {
    font-family: var(--app-font-family) !important;
}

.app-shell {
    position: relative;
    align-items: stretch;
}

.app-sidebar-backdrop {
    position: fixed;
    inset: 76px 0 0 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 1035;
}

.sidebar {
    min-height: 100vh;
}

.nav-link {
    color: #1e3a5f;
    border-radius: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 0.95rem;
    font-weight: 600;
}

.nav-link:hover {
    background: #e0f2fe;
}

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

.nav-link-icon {
    width: 1.4rem;
    text-align: center;
    flex: 0 0 auto;
}

.content {
    min-height: 100vh;
    background: transparent;
}

.card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.08);
}

.table,
table.dataTable {
    --bs-table-bg: #ffffff;
}

.table thead th,
.table > thead > tr > th,
.table > :not(caption) > thead > tr > th,
table.dataTable thead th,
table.dataTable thead td,
table.dataTable.table thead th,
table.dataTable.table thead td {
    background: #5c6475 !important;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    border-color: #d7dde5 !important;
    vertical-align: middle;
}

.table.ledger-table thead th,
.table.ledger-table > thead > tr > th,
.table.ledger-table > :not(caption) > thead > tr > th {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #000000 !important;
}

.table thead th.sorting,
.table thead th.sorting_asc,
.table thead th.sorting_desc,
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    color: #ffffff !important;
}

.table tbody td,
table.dataTable tbody td {
    vertical-align: top;
}

.table-export-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.table-export-toolbar .btn {
    min-width: 72px;
    font-weight: 700;
}

.app-navbar {
    position: relative;
    background: linear-gradient(90deg, #0f3f8f 0%, #1d4ed8 48%, #0ea5e9 100%);
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
    box-shadow: none !important;
}

.app-navbar::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #082f70;
}

.app-navbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-navbar-start {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.app-sidebar-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.app-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.app-sidebar-toggle:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.app-sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: none;
}

.app-brand-logo img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-brand-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.82);
}

.app-navbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.app-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0.55rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.app-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.app-user-avatar svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.app-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.app-user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.98rem;
}

.app-user-role {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 52px;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.app-logout-link:hover {
    color: #0f3f8f;
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 16px 28px rgba(30, 64, 175, 0.24);
}

.app-sidebar {
    width: 290px;
    min-height: calc(100vh - 76px);
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    flex: 0 0 290px;
    transition: width 0.25s ease, flex-basis 0.25s ease, margin-left 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
}

.app-sidebar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.15rem 1.25rem 0.75rem;
    border-bottom: 1px solid #dbeafe;
}

.app-sidebar-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.app-sidebar-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e3a8a;
}

.app-sidebar-subtitle {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.3;
}

.app-content {
    width: 100%;
    min-width: 0;
    transition: padding 0.25s ease;
}

body.sidebar-collapsed .app-sidebar {
    width: 0;
    flex-basis: 0;
    margin-left: -1px;
    opacity: 0;
}

body.sidebar-collapsed .app-sidebar-header,
body.sidebar-collapsed .app-sidebar .nav {
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .app-sidebar-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.sidebar-collapsed .app-sidebar-toggle span:nth-child(2) {
    opacity: 0;
}

body.sidebar-collapsed .app-sidebar-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.dashboard-shell {
    display: grid;
    gap: 1.5rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 52%, #e0f2fe 100%);
    border: 1px solid #dbeafe;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 20px 55px rgba(30, 64, 175, 0.08);
}

.dashboard-kicker {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    margin-bottom: 1rem;
}

.dashboard-hero h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 0.9rem;
}

.dashboard-hero p {
    color: #52677f;
    font-size: 1.05rem;
    max-width: 720px;
}

.dashboard-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.dashboard-pill {
    padding: 0.62rem 0.9rem;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
    color: #1e3a5f;
    font-weight: 600;
}

.dashboard-hero-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-logo-card {
    width: 100%;
    max-width: 340px;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 24px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 20px 45px rgba(30, 64, 175, 0.09);
}

.dashboard-logo-card img {
    width: min(100%, 220px);
    height: auto;
    object-fit: contain;
}

.dashboard-logo-text {
    display: grid;
    gap: 0.25rem;
    margin-top: 1rem;
    color: #1e3a5f;
}

.dashboard-logo-text strong {
    font-size: 0.98rem;
}

.dashboard-logo-text span {
    font-size: 0.86rem;
    color: #64748b;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow: 0 12px 28px rgba(30, 64, 175, 0.06);
}

.dashboard-card-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.dashboard-card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.dashboard-card h3 {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.6rem;
}

.dashboard-card p {
    color: #64748b;
    margin: 0;
}

.dashboard-v2 {
    display: grid;
    gap: 1.15rem;
}

.dashboard-v2-hero {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 14px 34px rgba(30, 64, 175, 0.08);
}

.dashboard-v2-kicker {
    color: #2563eb;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.dashboard-v2-hero h1 {
    color: #1e3a8a;
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.dashboard-v2-hero p {
    color: #64748b;
    margin: 0;
}

.dashboard-v2-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(104px, 1fr));
    gap: 0.75rem;
    min-width: min(480px, 100%);
}

.dashboard-v2-hero-metrics div,
.dashboard-stat-card,
.dashboard-panel,
.dashboard-split-item,
.dashboard-recommend-item {
    border: 1px solid #dbeafe;
    background: #ffffff;
}

.dashboard-v2-hero-metrics div {
    border-radius: 14px;
    padding: 0.85rem;
}

.dashboard-v2-hero-metrics span,
.dashboard-stat-label,
.dashboard-split-item span {
    display: block;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.dashboard-v2-hero-metrics strong {
    display: block;
    color: #0f3f8f;
    font-size: 1.65rem;
    line-height: 1.1;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.dashboard-stat-card {
    display: grid;
    gap: 0.35rem;
    min-height: 126px;
    border-radius: 16px;
    padding: 1rem;
    color: #12233f;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(30, 64, 175, 0.06);
}

.dashboard-stat-card:hover,
.dashboard-recommend-item:hover {
    color: #12233f;
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(30, 64, 175, 0.1);
}

.dashboard-stat-card strong {
    color: #1e3a8a;
    font-size: 2rem;
    line-height: 1;
}

.dashboard-stat-card small {
    color: #64748b;
    line-height: 1.45;
}

.dashboard-stat-card-primary {
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
}

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    gap: 0.9rem;
}

.dashboard-chart-panel {
    min-height: 360px;
}

.dashboard-donut-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 1.1rem;
}

.dashboard-donut-split {
    display: grid;
    gap: 1rem;
}

.dashboard-donut-card {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem;
    background: #f8fafc;
}

.dashboard-donut-card-full {
    min-height: 270px;
}

.dashboard-donut-card h3 {
    color: #102a5f;
    font-size: 0.98rem;
    font-weight: 900;
    margin: 0 0 0.65rem;
}

.dashboard-donut {
    width: 220px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--donut);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 14px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-donut-card .dashboard-donut {
    width: 170px;
}

.dashboard-donut-card .dashboard-donut > div {
    width: 98px;
}

.dashboard-donut-card .dashboard-donut strong {
    font-size: 1.65rem;
}

.dashboard-donut > div {
    width: 126px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    align-content: center;
    background: #ffffff;
    box-shadow: 0 0 0 1px #e2e8f0;
}

.dashboard-donut strong {
    color: #102a5f;
    font-size: 2rem;
    line-height: 1;
}

.dashboard-donut span {
    color: #64748b;
    font-weight: 800;
}

.dashboard-chart-legend {
    display: grid;
    gap: 0.65rem;
}

.dashboard-chart-legend-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.dashboard-chart-legend-row:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.dashboard-chart-dot,
.dashboard-grade-key b,
.dashboard-grade-counts b {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.dashboard-chart-legend-row strong {
    color: #12233f;
    min-width: 0;
}

.dashboard-chart-legend-row em {
    color: #102a5f;
    font-style: normal;
    font-weight: 900;
}

.dashboard-chart-legend-row small {
    color: #64748b;
    font-weight: 800;
}

.dashboard-grade-bars {
    display: grid;
    gap: 0.75rem;
}

.dashboard-grade-row {
    display: grid;
    grid-template-columns: 76px minmax(140px, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-grade-label strong,
.dashboard-grade-label span {
    display: block;
}

.dashboard-grade-label strong {
    color: #102a5f;
    font-size: 1rem;
}

.dashboard-grade-label span {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
}

.dashboard-grade-track {
    width: max(18%, var(--bar-scale));
    min-width: 96px;
    height: 24px;
    display: flex;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.dashboard-grade-track span {
    min-width: 0;
    height: 100%;
}

.dashboard-grade-track span:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.dashboard-grade-track span:last-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

.dashboard-grade-track .is-borrowed,
.dashboard-grade-key .is-borrowed,
.dashboard-grade-counts .is-borrowed {
    background: #16a34a;
}

.dashboard-grade-track .is-returned,
.dashboard-grade-key .is-returned,
.dashboard-grade-counts .is-returned {
    background: #2563eb;
}

.dashboard-grade-track .is-never,
.dashboard-grade-key .is-never,
.dashboard-grade-counts .is-never {
    background: #94a3b8;
}

.dashboard-grade-counts,
.dashboard-grade-key {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-grade-counts span,
.dashboard-grade-key span {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.dashboard-grade-key {
    justify-content: flex-end;
    margin-top: 0.8rem;
}

.dashboard-panel {
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: 0 10px 24px rgba(30, 64, 175, 0.06);
}

.dashboard-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-panel-head h2 {
    color: #1e3a8a;
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.2rem;
}

.dashboard-panel-head p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.dashboard-split-item {
    min-height: 116px;
    border-radius: 14px;
    padding: 1rem;
}

.dashboard-split-item strong {
    display: block;
    color: #1e3a8a;
    font-size: 2.15rem;
    line-height: 1.05;
    margin: 0.35rem 0;
}

.dashboard-split-item small {
    color: #64748b;
}

.dashboard-split-item.borrowed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.dashboard-split-item.borrowed strong {
    color: #15803d;
}

.dashboard-split-item.muted {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dashboard-check-summary-panel {
    display: grid;
    gap: 0.95rem;
}

.dashboard-check-filter {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto;
    gap: 0.8rem;
    align-items: end;
}

.dashboard-check-filter .form-label {
    color: #475569;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dashboard-check-filter-actions {
    display: flex;
    gap: 0.5rem;
}

.dashboard-check-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.dashboard-check-summary-card {
    min-height: 118px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    padding: 1rem;
}

.dashboard-check-summary-card span,
.dashboard-check-summary-card small {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.dashboard-check-summary-card strong {
    display: block;
    color: #1e3a8a;
    font-size: 2.25rem;
    line-height: 1;
    margin: 0.35rem 0;
}

.dashboard-check-summary-card.checked {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.dashboard-check-summary-card.checked strong {
    color: #15803d;
}

.dashboard-check-summary-card.unchecked {
    background: #fffbeb;
    border-color: #fde68a;
}

.dashboard-check-summary-card.unchecked strong {
    color: #b45309;
}

.dashboard-ipad-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.dashboard-panel:has(> .dashboard-ipad-status-grid) {
    display: none;
}

.dashboard-ipad-status-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    padding: 1rem;
}

.dashboard-ipad-status-card span,
.dashboard-ipad-status-card small {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.dashboard-ipad-status-card strong {
    display: block;
    color: #1e3a8a;
    font-size: 2.2rem;
    line-height: 1;
    margin: 0.35rem 0;
}

.dashboard-ipad-status-card dl {
    display: grid;
    gap: 0.5rem;
    min-width: 160px;
    margin: 0;
}

.dashboard-ipad-status-card dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-ipad-status-card dt {
    color: #64748b;
    font-weight: 700;
}

.dashboard-ipad-status-card dd {
    font-weight: 800;
    margin: 0;
}

.dashboard-ipad-status-card .status-borrowed {
    color: #15803d;
}

.dashboard-ipad-status-card .status-available {
    color: #1e40af;
}

.dashboard-ipad-status-link {
    text-decoration: none;
}

.dashboard-ipad-status-link:hover {
    text-decoration: underline;
}

.dashboard-student-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.dashboard-student-group-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    padding: 1rem;
}

.dashboard-student-group-card span,
.dashboard-student-group-card small {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.dashboard-student-group-card strong {
    display: block;
    color: #1e3a8a;
    font-size: 2.2rem;
    line-height: 1;
    margin: 0.35rem 0;
}

.dashboard-student-group-card dl {
    display: grid;
    gap: 0.45rem;
    min-width: 180px;
    margin: 0;
}

.dashboard-student-group-card dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-student-group-card dt {
    color: #64748b;
    font-weight: 700;
}

.dashboard-student-group-card dd {
    color: #0f3f8f;
    font-weight: 800;
    margin: 0;
}

.dashboard-student-level-table td,
.dashboard-student-level-table th {
    vertical-align: middle;
}

.dashboard-student-count-link {
    display: inline-flex;
    min-width: 34px;
    justify-content: flex-end;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-student-count-link:hover {
    text-decoration: underline;
}

.dashboard-mini-table th {
    white-space: nowrap;
}

.dashboard-recommend-list {
    display: grid;
    gap: 0.75rem;
}

.dashboard-recommend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: #12233f;
}

.dashboard-recommend-item strong,
.dashboard-recommend-item small {
    display: block;
}

.dashboard-recommend-item strong {
    font-size: 0.96rem;
    margin-bottom: 0.2rem;
}

.dashboard-recommend-item small {
    color: #64748b;
    line-height: 1.35;
}

.dashboard-recommend-item em {
    min-width: 48px;
    text-align: right;
    color: #1e3a8a;
    font-size: 1.6rem;
    font-style: normal;
    font-weight: 800;
}

.dashboard-recommend-item.tone-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.dashboard-recommend-item.tone-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.dashboard-recommend-item.tone-info {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.dashboard-recommend-item.tone-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.dashboard-recommend-item.tone-secondary {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.dashboard-mobile-list {
    display: none;
}

.dashboard-mobile-data-card {
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    padding: 0.9rem;
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.06);
}

.dashboard-mobile-data-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #eff6ff;
}

.dashboard-mobile-data-head strong {
    color: #1e3a8a;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-mobile-data-head span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: right;
    word-break: break-word;
}

.dashboard-mobile-data-card dl {
    display: grid;
    gap: 0.55rem;
    margin: 0.75rem 0 0;
}

.dashboard-mobile-data-card dl div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-mobile-data-card dt {
    color: #64748b;
    font-weight: 700;
}

.dashboard-mobile-data-card dd {
    margin: 0;
    color: #102a5f;
    font-weight: 900;
    text-align: right;
    word-break: break-word;
}

.dashboard-mobile-empty {
    padding: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    color: #64748b;
    font-weight: 700;
    text-align: center;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, #0f3f8f 0%, #1d4ed8 48%, #0ea5e9 100%);
    color: #102336;
}

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

.login-panel {
    width: 100%;
    max-width: 1140px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.login-hero {
    background: linear-gradient(180deg, #1e40af 0%, #0ea5e9 100%);
    color: #fff;
    padding: 44px 40px;
    position: relative;
}

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

.login-badge img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.login-seal-wrap {
    margin: 1.5rem 0 1rem;
}

.login-seal-main {
    width: min(100%, 220px);
    background: #fff;
    border-radius: 24px;
    padding: 0.75rem;
    box-shadow: 0 22px 45px rgba(30, 64, 175, 0.18);
}

.login-hero h1 {
    font-size: clamp(1.85rem, 3vw, 3rem);
    line-height: 1.15;
    margin: 0 0 14px;
    font-weight: 800;
}

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

.login-points {
    margin-top: 28px;
    display: grid;
    gap: 14px;
}

.login-point {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.88);
}

.login-point .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #bfdbfe;
    box-shadow: 0 0 0 6px rgba(191, 219, 254, 0.18);
    flex: 0 0 auto;
}

.login-form-wrap {
    padding: 48px 40px;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.login-form-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 1rem;
}

.login-form-brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.login-card-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.login-card-subtitle {
    color: #5c7287;
}

.login-label {
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.login-input {
    height: 52px;
    border-radius: 16px;
    border: 1px solid #d7e2ea;
    padding: 0 16px;
    background: #fff;
}

.login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.btn-login {
    height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.login-note {
    font-size: 0.92rem;
    color: #70879a;
    margin-top: 18px;
}

@media (max-width: 1199.98px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .dashboard-v2-hero {
        display: grid;
    }

    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-chart-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-check-filter,
    .dashboard-ipad-status-grid,
    .dashboard-student-group-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-check-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 250px;
        flex-basis: 250px;
    }

    .login-hero,
    .login-form-wrap {
        padding: 32px 24px;
    }

    .app-brand-subtitle {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .app-shell {
        display: block !important;
    }

    .app-sidebar {
        position: fixed;
        top: 76px;
        left: 0;
        bottom: 0;
        z-index: 1040;
        width: min(300px, calc(100vw - 24px));
        flex-basis: auto;
        box-shadow: 0 24px 50px rgba(30, 64, 175, 0.18);
    }

    body.mobile-sidebar-open .app-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-sidebar-open {
        overflow: hidden;
    }

    body.sidebar-collapsed .app-sidebar {
        margin-left: 0;
        transform: translateX(-100%);
        opacity: 1;
    }

    .app-navbar {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .app-navbar-inner {
        min-height: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        align-items: stretch;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .app-navbar-start {
        width: 100%;
        gap: 0.7rem;
    }

    .app-sidebar-toggle {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        flex: 0 0 44px;
    }

    .app-brand {
        gap: 10px;
        min-width: 0;
        flex: 1 1 auto;
    }

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

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

    .app-brand-text {
        min-width: 0;
    }

    .app-brand-subtitle {
        display: none;
    }

    .app-navbar-user {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.6rem;
        align-items: stretch;
    }

    .app-user-chip {
        min-width: 0;
        min-height: 46px;
        padding: 0.45rem 0.75rem;
        border-radius: 16px;
    }

    .app-user-avatar {
        width: 40px;
        height: 40px;
    }

    .app-user-avatar svg {
        width: 20px;
        height: 20px;
    }

    .app-user-name {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-user-role {
        font-size: 0.7rem;
        letter-spacing: 0.05em;
    }

    .app-logout-link {
        min-height: 46px;
        padding: 0.72rem 0.9rem;
        border-radius: 14px;
        white-space: nowrap;
    }

    .content {
        padding: 1rem !important;
    }

    .app-brand-title {
        font-size: 1rem;
    }

    .dashboard-v2-hero,
    .dashboard-panel {
        border-radius: 16px;
        padding: 1rem;
    }

    .dashboard-v2 {
        gap: 0.9rem;
    }

    .dashboard-v2-hero {
        gap: 0.9rem;
    }

    .dashboard-v2-hero h1 {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .dashboard-v2-hero p {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .dashboard-v2-hero-metrics div {
        min-height: 76px;
        padding: 0.75rem;
    }

    .dashboard-v2-hero-metrics strong {
        font-size: 1.45rem;
    }

    .dashboard-v2-hero-metrics,
    .dashboard-stat-grid,
    .dashboard-split-grid,
    .dashboard-check-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-grid,
    .dashboard-donut-card,
    .dashboard-donut-card-full,
    .dashboard-donut-split,
    .dashboard-check-filter,
    .dashboard-ipad-status-grid,
    .dashboard-student-group-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-panel {
        min-height: auto;
    }

    .dashboard-donut-card,
    .dashboard-donut-card-full {
        min-height: auto;
        justify-items: stretch;
    }

    .dashboard-donut,
    .dashboard-donut-card .dashboard-donut {
        width: min(190px, 66vw);
        justify-self: center;
    }

    .dashboard-donut > div,
    .dashboard-donut-card .dashboard-donut > div {
        width: min(108px, 38vw);
    }

    .dashboard-chart-legend-row {
        grid-template-columns: 12px minmax(0, 1fr) auto;
        min-height: 44px;
    }

    .dashboard-chart-legend-row small {
        grid-column: 2 / 4;
        padding-left: 0;
    }

    .dashboard-check-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-donut-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .dashboard-donut-card {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .dashboard-chart-legend {
        width: 100%;
    }

    .dashboard-grade-row {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .dashboard-grade-counts {
        grid-column: 2;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .dashboard-grade-key {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .dashboard-panel-head {
        display: grid;
        gap: 0.75rem;
    }

    .dashboard-panel-head .btn {
        width: 100%;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-weight: 700;
    }

    .dashboard-stat-card,
    .dashboard-split-item {
        min-height: auto;
    }

    .dashboard-stat-card {
        padding: 0.9rem;
    }

    .dashboard-stat-card strong,
    .dashboard-split-item strong,
    .dashboard-check-summary-card strong,
    .dashboard-ipad-status-card strong,
    .dashboard-student-group-card strong {
        font-size: 1.75rem;
    }

    .dashboard-ipad-status-card,
    .dashboard-student-group-card {
        display: grid;
        gap: 0.85rem;
    }

    .dashboard-ipad-status-card dl,
    .dashboard-student-group-card dl {
        min-width: 0;
    }

    .dashboard-ipad-status-card dl div,
    .dashboard-student-group-card dl div {
        gap: 0.75rem;
    }

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

    .dashboard-mobile-table-wrap {
        display: none;
    }

    .dashboard-mobile-list {
        display: grid;
        gap: 0.75rem;
        margin-top: 0.9rem;
    }

    .dashboard-actions .btn {
        flex: 1 1 100%;
        min-height: 44px;
        border-radius: 12px;
        font-weight: 700;
    }

    .dashboard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }
}


.app-logout-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex: 0 0 auto;
}
