/* =============================================================================================
 * New design attendance page (#ndAttendance, src/View/NdAttendanceView.js).
 * Only exists when School.newDesign is on; everything is scoped to .nda-page / .nda-drawer.
 * ============================================================================================= */
body.newdesign-home .nda-page { background: #F6F7FA !important; }
body.newdesign-home .nda-page .mainContent {
    background: transparent !important;
    padding: 0 !important;
    max-width: none !important;
}
.nda-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    color: #20252D;
}
.nda-wrap button { font-family: inherit; cursor: pointer; }
.nda-title { font-size: 26px; font-weight: 500; margin: 0 0 16px 0; color: #20252D; text-shadow: none; }

/* tabs + tools on the right */
.nda-tabbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #E2E4E9;
    margin-bottom: 16px;
}
.nda-tabs { display: flex; gap: 24px; }
.nda-tab {
    background: none; border: none; padding: 8px 0 12px; margin: 0;
    font-size: 15px; font-weight: 500; color: #6B7381;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nda-tab.active { color: #20252D; border-bottom-color: #2563D7; }
.nda-tools { display: flex; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.nda-tool {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    background: #fff; border: 1px solid #E2E4E9; border-radius: 8px;
    font-size: 14px; font-weight: 500; color: #20252D;
}
.nda-tool:hover { background: #F6F7FA; }
.nda-tool svg { color: #2563D7; flex: none; }
.nda-tool.nda-icon-only { padding: 0 9px; }

/* filter bar */
.nda-filters {
    display: flex; gap: 12px; align-items: center;
    background: #fff; border: 1px solid #E2E4E9; border-radius: 16px;
    padding: 16px 20px; margin-bottom: 16px;
}
.nda-search, .nda-date {
    display: flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 12px;
    border: 1px solid #E2E4E9; border-radius: 8px; background: #fff;
    box-sizing: border-box; position: relative;
}
.nda-search { flex: 2 1 220px; }
.nda-search input {
    border: none !important; outline: none; flex: 1; min-width: 0;
    font-size: 14px; background: transparent; box-shadow: none !important; padding: 0; margin: 0;
}
.nda-select {
    flex: 1 1 160px; height: 40px; padding: 0 12px;
    border: 1px solid #E2E4E9; border-radius: 8px; background: #fff;
    font-size: 14px; color: #20252D; box-sizing: border-box;
}
.nda-date { flex: 1 1 150px; cursor: pointer; font-size: 14px; }
.nda-date input[type=date] {
    position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
    cursor: pointer; border: none; margin: 0; padding: 0;
}
.nda-date input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.nda-filter-btn, .nda-chips { display: none; }

/* status cards */
.nda-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.nda-stat {
    display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px;
    align-items: center; text-align: left;
    background: #fff; border: 1px solid #E2E4E9; border-radius: 16px; padding: 16px 20px; margin: 0;
}
.nda-stat.active { border-color: #2563D7; box-shadow: 0 0 0 1px #2563D7 inset; }
.nda-stat-icon {
    grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.nda-stat-num { font-size: 22px; font-weight: 500; line-height: 28px; }
.nda-stat-label { font-size: 14px; color: #6B7381; }
.nda-stat-notreported .nda-stat-icon { background: #FDE7DA; }
.nda-stat-in .nda-stat-icon { background: #DCFCE7; color: #16A34A; }
.nda-stat-out .nda-stat-icon { background: #DBEAFE; color: #2563D7; }
.nda-stat-absent .nda-stat-icon { background: #E5E7EB; color: #525966; }

/* grid */
.nda-grid { background: #fff; border: 1px solid #E2E4E9; border-radius: 16px; overflow: hidden; }
.nda-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) minmax(170px, 1.2fr) minmax(140px, 1.2fr) 60px minmax(220px, 1.4fr) 44px;
    align-items: center; gap: 12px;
    padding: 12px 20px; min-height: 72px; box-sizing: border-box;
    border-bottom: 1px solid #F0F1F4;
}
.nda-row:last-child { border-bottom: none; }
.nda-head { min-height: 44px; background: #EEF3FD; font-size: 14px; color: #525966; font-weight: 500; }
.nda-classes .nda-row { grid-template-columns: minmax(180px, 2fr) repeat(8, minmax(70px, 1fr)); }
.nda-class-row { cursor: pointer; }
.nda-class-row:hover { background: #FAFBFC; }
.nda-warn { color: #DC2626; font-weight: 600; }
.nda-cell { min-width: 0; font-size: 14px; }
.nda-person { display: flex; align-items: center; gap: 12px; }
.nda-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nda-audit { color: #525966; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nda-actions { display: flex; gap: 8px; justify-content: flex-end; }
.nda-more { display: flex; justify-content: flex-end; }
.nda-empty { padding: 32px 20px; text-align: center; color: #6B7381; font-size: 14px; }

.nda-avatar {
    position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 16px;
}
.nda-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nda-avatar.avatar-a { background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%); }
.nda-avatar.avatar-b { background: linear-gradient(135deg, #F97316 0%, #EA580C 100%); }
.nda-avatar.avatar-c { background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%); }
.nda-avatar.avatar-d { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }

.nda-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.nda-notreported { background: #FDE2D3; color: #C2410C; }
.nda-in { background: #D1FAE5; color: #047857; }
.nda-out { background: #DBEAFE; color: #1D4ED8; }
.nda-absent { background: #E5E7EB; color: #374151; }
.nda-vhc-tag { display: inline-block; margin-left: 6px; font-size: 12px; color: #2563D7; font-weight: 500; }

.nda-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px; margin: 0; border-radius: 8px; font-size: 14px; font-weight: 500;
    border: 1px solid #E2E4E9; background: #fff; color: #20252D; white-space: nowrap;
}
.nda-btn-primary { background: #2563D7; border-color: #2563D7; color: #fff; }
.nda-btn-primary:hover { background: #1D4ED8; }
.nda-btn-outline { border-color: #2563D7; color: #2563D7; }
.nda-btn-secondary:hover, .nda-btn-outline:hover { background: #F6F7FA; }
.nda-note, .nda-dots {
    background: none; border: none; padding: 6px; margin: 0; border-radius: 8px; color: #A0A5B1;
    display: inline-flex; align-items: center; justify-content: center;
}
.nda-note.has-note { color: #2563D7; }
.nda-note:hover, .nda-dots:hover { background: #F6F7FA; }

/* row menu */
.nda-menu {
    position: absolute; z-index: 1100; min-width: 220px;
    background: #fff; border: 1px solid #E2E4E9; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12); padding: 6px; font-family: 'Inter', sans-serif;
}
.nda-menu button {
    display: block; width: 100%; text-align: left; background: none; border: none; margin: 0;
    padding: 10px 12px; border-radius: 8px; font-size: 14px; color: #20252D; cursor: pointer;
}
.nda-menu button:hover { background: #F6F7FA; }

/* dialogs opened from this page */
.nda-dlg p { margin: 0 0 8px 0; }
.nda-dlg input, .nda-dlg textarea {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid #E2E4E9; border-radius: 8px; font-size: 14px;
}

/* drawer contents */
.nda-drawer .form-input { box-sizing: border-box; }
.nda-radios { display: flex; flex-direction: column; gap: 4px; }
.nda-radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.nda-radio.active { background: #E5ECFB; }
.nda-radio input { margin: 0; accent-color: #2563D7; }
.nda-h-month { display: flex; align-items: center; justify-content: space-between; font-weight: 500; }
.nda-h-month button {
    width: 36px; height: 36px; border: 1px solid #E2E4E9; border-radius: 8px; background: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.nda-h-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nda-h-table th { text-align: left; color: #6B7381; font-weight: 500; padding: 8px; border-bottom: 1px solid #E2E4E9; }
.nda-h-table td { padding: 8px; border-bottom: 1px solid #F0F1F4; }
.nda-h-table tbody tr { cursor: pointer; }
.nda-h-table tbody tr:hover { background: #F6F7FA; }
.nda-h-table tr.nda-weekend td { color: #A0A5B1; }
.nda-h-table tr.nda-future { opacity: 0.45; cursor: default; }
.nda-h-table tr.nda-current td { background: #EEF3FD; font-weight: 600; }
.nda-qr-list { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.nda-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border: 1px solid #E2E4E9; border-radius: 12px; width: 100%; box-sizing: border-box; }
.nda-qr-name { font-weight: 600; }
.nda-qr-code img, .nda-qr-code canvas { display: block; margin: 0 auto; }
.nda-qr-print { flex: none !important; padding: 0 20px !important; }
.nda-v-list { display: flex; flex-direction: column; }
.nda-v-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0F1F4; }
.nda-v-row .nda-name { flex: 1; }
.nda-v-tg {
    height: 32px; min-width: 52px; border: 1px solid #E2E4E9; border-radius: 8px; background: #fff;
    font-size: 13px; font-weight: 600; color: #525966; cursor: pointer;
}
.nda-v-tg.on { background: #2563D7; border-color: #2563D7; color: #fff; }

/* ---------------- phones: cards like the mobile mockup ---------------- */
@media (max-width: 768px) {
    .nda-wrap { padding: 16px; }
    .nda-tools { width: 100%; padding-bottom: 12px; }
    .nda-tool span { display: none; }
    .nda-tool { padding: 0 10px; }
    .nda-tabbar { flex-direction: column-reverse; align-items: stretch; }
    .nda-filters { padding: 0; background: none; border: none; margin-bottom: 10px; }
    .nda-filters .nda-select, .nda-filters .nda-date { display: none; }
    .nda-filter-btn {
        display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; margin: 0;
        border: 1px solid #E2E4E9; border-radius: 8px; background: #fff; font-size: 14px; color: #525966;
    }
    .nda-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
    .nda-chip { background: #E2E4E9; border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 500; }
    .nda-stats { display: flex; overflow-x: auto; gap: 8px; margin: 0 -16px 12px; padding: 0 16px; }
    .nda-stat { flex: none; display: flex; gap: 6px; padding: 6px 10px; border-radius: 8px; }
    .nda-stat-icon { width: auto; height: auto; background: none !important; }
    .nda-stat-icon svg { width: 16px; height: 16px; }
    .nda-stat-num { order: 3; font-size: 14px; font-weight: 600; line-height: 20px; }
    .nda-stat-label { font-size: 13px; }
    .nda-stat-label:after { content: ':'; }
    .nda-grid { border-radius: 0; border-left: none; border-right: none; margin: 0 -16px; }
    .nda-head { display: none !important; }
    .nda-row {
        grid-template-columns: 40px 1fr auto auto;
        grid-template-areas: "av name note more" "av status note more" "act act act act";
        column-gap: 12px; row-gap: 6px; padding: 16px; align-items: start;
    }
    .nda-person { display: contents; }
    .nda-person .nda-avatar { grid-area: av; }
    .nda-person .nda-name { grid-area: name; align-self: end; font-size: 16px; }
    .nda-status { grid-area: status; }
    .nda-audit { display: none; }
    .nda-notes { grid-area: note; }
    .nda-notes .nda-note:not(.has-note) { display: none; }
    .nda-more { grid-area: more; }
    .nda-actions { grid-area: act; justify-content: stretch; margin-top: 8px; }
    .nda-actions:empty { display: none; }
    .nda-actions .nda-btn { flex: 1; height: 36px; }
    .nda-classes .nda-row { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: none; }
    .nda-classes .nda-person { display: flex; grid-column: 1 / -1; }
    .nda-classes .nda-cell[data-label]:before { content: attr(data-label) ": "; color: #6B7381; }
}

/* ---------------------------------------------------------------------------------------------
 * Hardening: some global rule paints plain <button>s in the school colour (green) with white text.
 * Every button on this page restates its own colours with !important so only the primary actions
 * (Check In, Apply) use the brand blue and everything else stays white.
 * --------------------------------------------------------------------------------------------- */
.nda-wrap button, .nda-drawer button, .nda-menu button, .nda-cal button, .nda-qr-page button {
    text-shadow: none !important;
    box-shadow: none !important;
    min-height: 0;
}
.nda-tab, .nda-tab:hover, .nda-tab:focus {
    background: transparent !important; border: none !important; border-bottom: 2px solid transparent !important;
    border-radius: 0 !important; color: #6B7381 !important; width: auto !important;
}
.nda-tab.active, .nda-tab.active:hover { color: #20252D !important; border-bottom-color: #2563D7 !important; }
.nda-tool, .nda-filter-btn, .nda-date {
    background: #fff !important; border: 1px solid #E2E4E9 !important; color: #20252D !important;
}
.nda-tool:hover, .nda-filter-btn:hover, .nda-date:hover { background: #F6F7FA !important; color: #20252D !important; }
.nda-tool svg { color: #2563D7 !important; }
.nda-stat, .nda-stat:hover {
    background: #fff !important; border: 1px solid #E2E4E9 !important; color: #20252D !important; border-radius: 16px !important;
}
.nda-stat:hover { border-color: #C9CDD6 !important; }
.nda-stat.active { border-color: #2563D7 !important; box-shadow: 0 0 0 1px #2563D7 inset !important; }
.nda-stat-label { color: #6B7381 !important; }
.nda-btn, .nda-btn-secondary { background: #fff !important; border: 1px solid #E2E4E9 !important; color: #20252D !important; }
.nda-btn-secondary:hover { background: #F6F7FA !important; }
.nda-btn-primary, .nda-btn-primary:hover { background: #2563D7 !important; border-color: #2563D7 !important; color: #fff !important; }
.nda-btn-primary:hover { background: #1D4ED8 !important; }
.nda-btn-outline { background: #fff !important; border-color: #2563D7 !important; color: #2563D7 !important; }
.nda-btn-outline:hover { background: #EEF3FD !important; }
.nda-note, .nda-dots, .nda-note:hover, .nda-dots:hover { background: transparent !important; border: none !important; color: #A0A5B1 !important; }
.nda-note:hover, .nda-dots:hover { background: #F6F7FA !important; }
.nda-note.has-note { color: #2563D7 !important; }
.nda-menu button, .nda-menu button:hover { background: transparent !important; border: none !important; color: #20252D !important; }
.nda-menu button:hover { background: #F6F7FA !important; }
.nda-drawer .close-drawer-btn, .nda-drawer .close-drawer-btn:hover { background: transparent !important; border: none !important; }
.nda-drawer .close-drawer-btn:hover { background: #F6F7FA !important; }
.nda-drawer .btn-secondary { background: #fff !important; border: 1px solid #E2E4E9 !important; color: #20252D !important; }
.nda-drawer .btn-primary { background: #2563D7 !important; border: 1px solid #2563D7 !important; color: #fff !important; }
.nda-h-month button, .nda-h-month button:hover {
    display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important;
    background: #fff !important; border: 1px solid #E2E4E9 !important; color: #20252D !important;
}
.nda-h-month button:hover { background: #F6F7FA !important; }
.nda-v-tg { background: #fff !important; border: 1px solid #E2E4E9 !important; color: #525966 !important; }
.nda-v-tg.on { background: #2563D7 !important; border-color: #2563D7 !important; color: #fff !important; }

/* search + date boxes: icon and text on one centred line */
.nda-search, .nda-date {
    display: flex !important; flex-direction: row !important; align-items: center !important; gap: 8px;
    height: 40px !important; margin: 0 !important; padding: 0 12px !important; box-sizing: border-box;
    font-size: 14px !important; line-height: 20px !important; font-weight: 400 !important; text-align: left;
}
.nda-search svg, .nda-date svg { flex: none; display: block; }
.nda-date span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nda-search input { height: 38px !important; line-height: 20px !important; font-size: 14px !important; }
.nda-drawer .nda-f-date {
    display: flex !important; align-items: center; gap: 8px; text-align: left;
    background: #fff !important; color: #20252D !important; cursor: pointer;
}

/* calendar popover */
.nda-cal {
    position: absolute; z-index: 1300; width: 300px; box-sizing: border-box; padding: 14px;
    background: #fff; border: 1px solid #E2E4E9; border-radius: 14px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16); font-family: 'Inter', sans-serif; color: #20252D;
}
.nda-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.nda-cal-nav, .nda-cal-nav:hover {
    width: 32px; height: 32px; padding: 0 !important; margin: 0; border-radius: 8px !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    background: #fff !important; border: 1px solid #E2E4E9 !important; cursor: pointer;
}
.nda-cal-nav:hover { background: #F6F7FA !important; }
.nda-cal-week, .nda-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.nda-cal-week span { font-size: 12px; color: #6B7381; font-weight: 500; padding: 4px 0; }
.nda-cal-day, .nda-cal-day:hover {
    height: 36px; padding: 0 !important; margin: 0; border-radius: 8px !important; cursor: pointer;
    background: transparent !important; border: 1px solid transparent !important; color: #20252D !important;
    font-size: 14px; font-weight: 400;
}
.nda-cal-day:hover { background: #F6F7FA !important; }
.nda-cal-day.today { border-color: #2563D7 !important; color: #2563D7 !important; font-weight: 600; }
.nda-cal-day.sel, .nda-cal-day.sel:hover { background: #2563D7 !important; border-color: #2563D7 !important; color: #fff !important; font-weight: 600; }
.nda-cal-foot { display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid #F0F1F4; }
.nda-cal-today, .nda-cal-today:hover {
    background: transparent !important; border: none !important; color: #2563D7 !important;
    font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 10px !important; border-radius: 8px !important;
}
.nda-cal-today:hover { background: #EEF3FD !important; }

/* full-page QR (tablet kiosk) */
body.nda-qr-open { overflow: hidden; }
.nda-qr-page {
    position: fixed; inset: 0; z-index: 1200; overflow-y: auto;
    background: #F6F7FA; font-family: 'Inter', sans-serif; color: #20252D;
    padding: 20px 24px 40px; box-sizing: border-box;
}
.nda-qr-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; }
.nda-qr-top h2 { flex: 1; margin: 0; font-size: 24px; font-weight: 500; text-shadow: none; }
.nda-qr-top .nda-select { flex: 0 1 260px; }
.nda-qr-close, .nda-qr-close:hover {
    width: 40px; height: 40px; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center;
    background: #fff !important; border: 1px solid #E2E4E9 !important; border-radius: 10px !important; cursor: pointer;
}
.nda-qr-page .nda-tool { height: 40px; }
.nda-qr-page .nda-qr-list { margin-top: 24px; }
.nda-qr-page .nda-qr-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.nda-qr-page .nda-qr {
    width: auto; background: #fff; border: 1px solid #E2E4E9; border-radius: 20px; padding: 24px 32px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.nda-qr-page .nda-qr-name { font-size: 22px; font-weight: 600; }
.nda-qr-page:fullscreen .nda-qr-close, .nda-qr-page:fullscreen .nda-qr-class { display: none !important; }
@media (max-width: 768px) {
    .nda-qr-page { padding: 16px; }
    .nda-qr-top .nda-select { flex: 1 1 100%; order: 3; }
    .nda-qr-page .nda-qr { padding: 16px; }
}
@media (max-width: 768px) {
    .nda-filters .nda-date { display: none !important; }
    .nda-stat, .nda-stat:hover { border-radius: 8px !important; }
}
/* Filter sheet status radios: a global label rule drops the flex gap - restate it and space the dot */
.nda-drawer .nda-radio { display: flex !important; align-items: center !important; gap: 12px !important; }
.nda-drawer .nda-radio input[type=radio] { margin: 0 4px 0 0 !important; flex: none; width: 18px; height: 18px; }
/* Actions column: two equal button slots in every row, so a single action (e.g. Check In after
   check-out) lines up under the first button of the two-button rows */
@media (min-width: 769px) {
    .nda-row .nda-actions { display: grid; grid-template-columns: repeat(2, minmax(108px, 1fr)); gap: 8px; justify-content: stretch; }
    .nda-row .nda-actions .nda-btn { width: 100%; padding: 0 10px; }
    .nda-head .nda-actions { display: block; text-align: left; }
}
/* "Not scheduled" in place of the action buttons (class screen rule) */
.nda-notsched { grid-column: 1 / -1; color: #6B7381; font: 500 13px 'Inter', sans-serif; padding: 6px 0; }
