body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
    background: #f5f7fb;
    color: #222;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
}

/* =========================================
   Header
========================================= */
.site-header {
    background: #123a70;
    color: #fff;
    padding: 14px 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: auto;
}

.site-header h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
}

.global-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.global-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.hamburger-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.hamburger-button span {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
    transition: 0.25s ease;
}

.hamburger-button span:nth-child(1) {
    top: 13px;
}

.hamburger-button span:nth-child(2) {
    top: 21px;
}

.hamburger-button span:nth-child(3) {
    top: 29px;
}

.hamburger-button.is-open span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

.hamburger-button.is-open span:nth-child(2) {
    opacity: 0;
}

.hamburger-button.is-open span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

main.wrap {
    padding-bottom: 30px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card.soft {
    background: #f8fbff;
    box-shadow: none;
    border: 1px solid #d9e7f8;
}

.card.narrow {
    max-width: 520px;
    margin: 40px auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.page-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-row {
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="date"],
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ccd4e0;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #123a70;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    min-height: 44px;
}

.button-link.secondary,
button.secondary {
    background: #6c7b92;
}

.button-link.danger,
button.danger {
    background: #b42318;
}

.button-link.small,
button.small {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 13px;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert.error {
    background: #ffe7e7;
    color: #9f1f1f;
}

.alert.success {
    background: #e7f8ea;
    color: #1b6e2f;
}

.muted {
    color: #5f6f86;
    font-size: 14px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 220px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e4e9f0;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.data-table th {
    background: #f0f5fb;
    white-space: nowrap;
}

.pagination {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eef3f9;
    color: #123a70;
    text-decoration: none;
    font-size: 14px;
}

.pagination a.active {
    background: #123a70;
    color: #fff;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.menu-card {
    display: block;
    background: #f7fbff;
    border: 1px solid #d9e7f8;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: #123a70;
}

.menu-card strong {
    display: block;
    margin-bottom: 8px;
}

.menu-card span {
    color: #5f6f86;
    font-size: 14px;
}

.menu-card.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.result-summary {
    padding-left: 18px;
}

.support-staff-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.support-staff-row input[type="text"] {
    flex: 1;
}

.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: #eef3f9;
    color: #123a70;
    font-weight: 700;
}

.status-tab span {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    background: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.status-tab.active {
    background: #123a70;
    color: #fff;
}

.status-tab.active span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

.inline-form input[type="text"] {
    width: 180px;
    padding: 8px 10px;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.status-card {
    background: #f7fbff;
    border: 1px solid #d9e7f8;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.status-card strong {
    display: block;
    margin-bottom: 8px;
    color: #123a70;
    font-size: 14px;
}

.status-card span {
    font-size: 28px;
    font-weight: 700;
}

.scan-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    margin-bottom: 20px;
}

.reader-box {
    width: 100%;
    min-height: 280px;
    border: 2px dashed #c7d5e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 14px;
}

.scan-result-box {
    min-height: 140px;
    border-radius: 12px;
    padding: 16px;
    background: #eef3f9;
    margin-top: 16px;
}

.scan-result-box.success {
    background: #e7f8ea;
    color: #1b6e2f;
}

.scan-result-box.warning {
    background: #fff4d6;
    color: #8a5a00;
}

.scan-result-box.error {
    background: #ffe7e7;
    color: #9f1f1f;
}

.scan-student-info {
    margin-top: 12px;
    line-height: 1.8;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.scan-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9999;
}

.scan-popup-overlay.show {
    display: flex;
}

.scan-popup-box {
    width: min(92vw, 420px);
    border-radius: 18px;
    padding: 22px 20px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
    text-align: center;
}

.scan-popup-box.success {
    background: #e7f8ea;
    color: #1b6e2f;
}

.scan-popup-box.error {
    background: #ffe7e7;
    color: #9f1f1f;
}

.scan-popup-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
}

.scan-popup-message {
    font-size: 18px;
    line-height: 1.5;
}

.event-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.event-badge.upcoming {
    background: #e7f2ff;
    color: #1357a6;
}

.event-badge.today {
    background: #fff4d6;
    color: #8a5a00;
}

.event-badge.closed {
    background: #eceff3;
    color: #5f6f86;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #d9e7f8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.count-link {
    display: inline-block;
    min-width: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f9;
    color: #123a70;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
}

.count-link.present {
    background: #e7f8ea;
    color: #1b6e2f;
}

.count-link.absent {
    background: #ffe7e7;
    color: #9f1f1f;
}

.count-link.pending {
    background: #fff4d6;
    color: #8a5a00;
}

.today-highlight {
    border: 2px solid #ffd76a;
    background: #fff9e8;
}

/* タブレット */
@media (max-width: 900px) {
    .wrap {
        width: min(100%, calc(100% - 20px));
    }

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

    .scan-layout {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 720px;
    }
}

/* スマホ */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 0;
    }

    .header-inner {
        display: block;
    }

    .header-brand {
        width: 100%;
    }

    .site-header h1 {
        font-size: 20px;
    }

    .hamburger-button {
        display: inline-block;
    }

    .global-nav {
        display: none;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .global-nav.is-open {
        display: flex;
    }

    .global-nav a {
        width: 100%;
        display: block;
        text-align: center;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions,
    .button-stack {
        flex-direction: column;
        align-items: stretch;
    }

    .button-link,
    button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input[type="text"] {
        min-width: 0;
    }

    .support-staff-row {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form input[type="text"] {
        width: 100%;
    }

    .status-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .status-tab {
        justify-content: space-between;
    }

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

    .reader-box {
        min-height: 240px;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-card-list {
        display: grid;
        gap: 12px;
    }

    .mobile-data-card {
        border: 1px solid #d9e7f8;
        background: #fff;
        border-radius: 12px;
        padding: 14px;
    }

    .mobile-data-card h3,
    .mobile-data-card h4 {
        margin: 0 0 10px;
        font-size: 16px;
        color: #123a70;
    }

    .mobile-data-row {
        display: grid;
        grid-template-columns: 92px 1fr;
        gap: 8px;
        padding: 6px 0;
        border-bottom: 1px solid #edf2f7;
        font-size: 14px;
    }

    .mobile-data-row:last-child {
        border-bottom: 0;
    }

    .mobile-data-row strong {
        color: #4b5f79;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .scan-popup-box {
        width: min(94vw, 360px);
        padding: 20px 16px;
        border-radius: 16px;
    }

    .scan-popup-title {
        font-size: 22px;
    }

    .scan-popup-message {
        font-size: 16px;
    }
}

/* 小さいスマホ */
@media (max-width: 480px) {
    .wrap {
        width: min(100%, calc(100% - 16px));
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .status-card span {
        font-size: 24px;
    }

    .reader-box {
        min-height: 220px;
    }

    .page-head h2 {
        font-size: 20px;
    }
}
/* =========================================
   Dashboard UI improvement
========================================= */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    background: linear-gradient(135deg, #123a70 0%, #1f5ca8 100%);
    color: #fff;
    border: 0;
}

.dashboard-hero-main h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #fff;
}

.dashboard-hero-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dashboard-hero-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.8;
}

.dashboard-hero-side {
    display: grid;
    gap: 12px;
}

.dashboard-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.dashboard-mini-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 22px;
}

.dashboard-mini-card strong {
    display: block;
    color: #fff;
    margin-bottom: 2px;
}

.dashboard-mini-card span {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

.dashboard-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-section-title {
    margin: 0 0 6px;
    font-size: 22px;
    color: #123a70;
}

.dashboard-today-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.dashboard-today-card {
    border: 1px solid #d9e7f8;
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(18, 58, 112, 0.08);
}

.dashboard-today-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-today-header h4 {
    margin: 6px 0 0;
    font-size: 20px;
    color: #123a70;
    line-height: 1.4;
}

.dashboard-card-chip {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff4d6;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #e8f1ff;
    font-size: 26px;
    flex-shrink: 0;
}

.dashboard-info-list {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-info-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
}

.dashboard-info-item:last-child {
    border-bottom: 0;
}

.dashboard-info-item .label {
    color: #5f6f86;
    font-weight: 700;
    font-size: 13px;
}

.dashboard-info-item .value {
    color: #223548;
    font-size: 14px;
}

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

.dashboard-count-card {
    display: block;
    text-decoration: none;
    border-radius: 14px;
    padding: 14px 12px;
    border: 1px solid #d9e7f8;
    background: #f7fbff;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-count-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(18, 58, 112, 0.08);
}

.dashboard-count-card.neutral {
    background: #eef3f9;
    color: #123a70;
}

.dashboard-count-card.present {
    background: #e7f8ea;
    color: #1b6e2f;
}

.dashboard-count-card.absent {
    background: #ffe7e7;
    color: #9f1f1f;
}

.dashboard-count-card.pending {
    background: #fff4d6;
    color: #8a5a00;
}

.dashboard-count-card .count-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.dashboard-count-card .count-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-card-actions {
    margin-top: 8px;
}

.dashboard-empty-state {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px dashed #c8d7ea;
    border-radius: 14px;
    background: #f8fbff;
}

.dashboard-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eaf2ff;
    font-size: 28px;
    flex-shrink: 0;
}

.dashboard-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.dashboard-menu-card {
    display: grid;
    grid-template-columns: 60px 1fr 20px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: #123a70;
    background: #fff;
    border: 1px solid #d9e7f8;
    box-shadow: 0 8px 18px rgba(18, 58, 112, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(18, 58, 112, 0.10);
}

.dashboard-menu-card.students {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.dashboard-menu-card.events {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.dashboard-menu-card.attendance {
    background: linear-gradient(180deg, #ffffff 0%, #f7fff8 100%);
}

.dashboard-menu-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: #eaf2ff;
}

.dashboard-menu-body strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
    color: #123a70;
}

.dashboard-menu-body span {
    display: block;
    color: #5f6f86;
    font-size: 14px;
    line-height: 1.6;
}

.dashboard-menu-arrow {
    font-size: 28px;
    color: #8aa3c6;
    text-align: right;
}

.status-card.clickable {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.status-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(18, 58, 112, 0.08);
}

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

@media (max-width: 768px) {
    .dashboard-hero {
        padding: 18px 16px;
    }

    .dashboard-hero-main h2 {
        font-size: 24px;
    }

    .dashboard-section-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .dashboard-menu-card {
        grid-template-columns: 52px 1fr 16px;
        gap: 12px;
        padding: 16px;
    }

    .dashboard-menu-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
        border-radius: 16px;
    }

    .dashboard-menu-body strong {
        font-size: 17px;
    }
}

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

    .dashboard-info-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dashboard-empty-state {
        align-items: flex-start;
    }
}
/* =========================================
   Dashboard UI improvement
========================================= */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    background: linear-gradient(135deg, #123a70 0%, #1f5ca8 100%);
    color: #fff;
    border: 0;
}

.dashboard-hero-main h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #fff;
}

.dashboard-hero-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dashboard-hero-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.8;
}

.dashboard-hero-side {
    display: grid;
    gap: 12px;
}

.dashboard-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.dashboard-mini-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 22px;
}

.dashboard-mini-card strong {
    display: block;
    color: #fff;
    margin-bottom: 2px;
}

.dashboard-mini-card span {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

.dashboard-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-section-title {
    margin: 0 0 6px;
    font-size: 22px;
    color: #123a70;
}

.dashboard-today-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.dashboard-today-card {
    border: 1px solid #d9e7f8;
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(18, 58, 112, 0.08);
}

.dashboard-today-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-today-header h4 {
    margin: 6px 0 0;
    font-size: 20px;
    color: #123a70;
    line-height: 1.4;
}

.dashboard-card-chip {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff4d6;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #e8f1ff;
    font-size: 26px;
    flex-shrink: 0;
}

.dashboard-info-list {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-info-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
}

.dashboard-info-item:last-child {
    border-bottom: 0;
}

.dashboard-info-item .label {
    color: #5f6f86;
    font-weight: 700;
    font-size: 13px;
}

.dashboard-info-item .value {
    color: #223548;
    font-size: 14px;
}

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

.dashboard-count-card {
    display: block;
    text-decoration: none;
    border-radius: 14px;
    padding: 14px 12px;
    border: 1px solid #d9e7f8;
    background: #f7fbff;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-count-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(18, 58, 112, 0.08);
}

.dashboard-count-card.neutral {
    background: #eef3f9;
    color: #123a70;
}

.dashboard-count-card.present {
    background: #e7f8ea;
    color: #1b6e2f;
}

.dashboard-count-card.absent {
    background: #ffe7e7;
    color: #9f1f1f;
}

.dashboard-count-card.pending {
    background: #fff4d6;
    color: #8a5a00;
}

.dashboard-count-card .count-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.dashboard-count-card .count-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-card-actions {
    margin-top: 8px;
}

.dashboard-empty-state {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px dashed #c8d7ea;
    border-radius: 14px;
    background: #f8fbff;
}

.dashboard-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eaf2ff;
    font-size: 28px;
    flex-shrink: 0;
}

.dashboard-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.dashboard-menu-card {
    display: grid;
    grid-template-columns: 60px 1fr 20px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: #123a70;
    background: #fff;
    border: 1px solid #d9e7f8;
    box-shadow: 0 8px 18px rgba(18, 58, 112, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(18, 58, 112, 0.10);
}

.dashboard-menu-card.students {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.dashboard-menu-card.events {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.dashboard-menu-card.attendance {
    background: linear-gradient(180deg, #ffffff 0%, #f7fff8 100%);
}

.dashboard-menu-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: #eaf2ff;
}

.dashboard-menu-body strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
    color: #123a70;
}

.dashboard-menu-body span {
    display: block;
    color: #5f6f86;
    font-size: 14px;
    line-height: 1.6;
}

.dashboard-menu-arrow {
    font-size: 28px;
    color: #8aa3c6;
    text-align: right;
}

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

@media (max-width: 768px) {
    .dashboard-hero {
        padding: 18px 16px;
    }

    .dashboard-hero-main h2 {
        font-size: 24px;
    }

    .dashboard-section-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .dashboard-menu-card {
        grid-template-columns: 52px 1fr 16px;
        gap: 12px;
        padding: 16px;
    }

    .dashboard-menu-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
        border-radius: 16px;
    }

    .dashboard-menu-body strong {
        font-size: 17px;
    }
}

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

    .dashboard-info-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dashboard-empty-state {
        align-items: flex-start;
    }
}
/* =========================================
   Event compact cards
========================================= */
.event-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.event-card-compact {
    background: #fff;
    border: 1px solid #d9e7f8;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 18px rgba(18, 58, 112, 0.06);
}

.event-card-top {
    margin-bottom: 10px;
}

.event-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.event-card-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
    color: #123a70;
}

.event-card-date {
    font-size: 15px;
    font-weight: 700;
    color: #223548;
}

.event-card-date-sep {
    margin: 0 6px;
    color: #8aa3c6;
}

.event-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 14px;
}

.event-meta-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f9;
    color: #123a70;
    font-size: 12px;
    font-weight: 700;
}

.event-meta-text {
    font-size: 13px;
    color: #5f6f86;
}

.event-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 768px) {
    .event-card-grid {
        grid-template-columns: 1fr;
    }

    .event-card-title {
        font-size: 18px;
    }

    .event-card-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .event-card-actions .button-link {
        width: 100%;
    }
    /* =========================================
   Scan camera improvement
========================================= */
.reader-box {
    position: relative;
    min-height: 340px;
    background: #000;
}

.reader-box::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72%, 300px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.14);
    pointer-events: none;
}

#reader video {
    object-fit: cover !important;
}

@media (max-width: 768px) {
    .reader-box {
        min-height: 300px;
    }

    .reader-box::after {
        width: min(76%, 260px);
    }
}
.scan-help-text {
    margin: 10px 0 14px;
    font-size: 14px;
    color: #4b5f79;
    line-height: 1.7;
}

.reader-box {
    position: relative;
    min-height: 340px;
    background: #000;
}

.reader-box::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72%, 300px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.14);
    pointer-events: none;
}

#reader video {
    object-fit: cover !important;
}

@media (max-width: 768px) {
    .reader-box {
        min-height: 300px;
    }

    .reader-box::after {
        width: min(76%, 260px);
    }

    .scan-help-text {
        font-size: 13px;
    }
}
}