/* ATTENDANCE PAGE — Enhanced v2 */

.att-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (min-width: 576px) {
    .att-stats-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 359.98px) {
    .att-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.att-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--card-pad-xs);
    border-radius: 5px;
    background: rgba(var(--tint-rgb),.04);
    border: 1px solid rgba(var(--tint-rgb),.08);
    text-align: center;
    min-height: 76px;
}

.att-stat-card.att-stat-skeleton {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}
.att-stat-card.att-stat-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(var(--accent), .16), transparent);
    animation: skel-shimmer 1.6s ease-in-out infinite;
}
.att-stat-card.att-stat-skeleton .stat-value,
.att-stat-card.att-stat-skeleton .stat-percent {
    opacity: .35;
}
@media (prefers-reduced-motion: reduce) {
    .att-stat-card.att-stat-skeleton::after { animation: none; display: none; }
}
html[data-motion="reduced"] .att-stat-card.att-stat-skeleton::after { animation: none; display: none; }

.att-stat-card .stat-value {
    font-weight: 800;
    font-size: 1.4rem;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 3px;
}

.att-stat-card .stat-label {
    font-size: .6rem;
    color: var(--text-faint);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 3px;
    line-height: 1.2;
}

.att-stat-card .stat-percent {
    font-size: .68rem;
    color: var(--text-soft);
    font-family: var(--font-mono);
}

.att-stat-card.present .stat-value {
    color: #34d399;
}

.att-stat-card.present-online .stat-value {
    color: #06b6d4;
}

.att-stat-card.late .stat-value {
    color: var(--warning);
}

.att-stat-card.excused .stat-value {
    color: #60a5fa;
}

.att-stat-card.absent .stat-value {
    color: #fb7185;
}

.att-stat-card.noclasses .stat-value {
    color: #8b5cf6;
}

/* Log Form */

.att-attendance-top-row {
    align-items: flex-start !important;
}

.att-attendance-top-row > .att-overall-rate-column {
    align-self: flex-start;
}

.att-overall-rate-card {
    align-self: flex-start;
    height: auto;
}

@media (min-width: 768px) {
    .att-log-form {
        height: 460px;
        display: flex;
        flex-direction: column;
    }

    .att-log-form > .row.g-2 {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .att-log-form > .row.g-2 > .col-12 {
        flex: 0 0 auto;
    }

    .att-log-form > .row.g-2 > .att-subject-list-column {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .att-log-form .att-subject-list {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .att-log-form .att-subject-list-heading {
        flex: 0 0 auto;
    }

    .att-log-form .att-subject-rows {
        flex: 1 1 0;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        align-content: start;
    }
}

.att-form-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 4px;
    display: block;
}

.att-online-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 31px;
    padding: 0 4px;
}

.att-online-toggle label {
    font-size: .84rem;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    color: var(--text);
}

.att-log-form .att-subject-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0;
}

.att-log-form .att-subject-rows {
    display: grid;
    gap: 7px;
    margin-top: 6px;
    max-height: min(340px, 50vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.att-log-form .att-subject-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(var(--tint-rgb),.02);
}

.att-log-form .att-subject-select {
    display: flex;
    align-items: center;
    flex: 1 1 160px;
    gap: 8px;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.att-log-form .att-subject-check {
    flex-shrink: 0;
    margin: 0;
}

.att-log-form .att-subject-info {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    line-height: 1.25;
}

.att-log-form .att-subject-code {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-log-form .att-subject-meta {
    display: block;
    overflow: hidden;
    color: var(--text-faint);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-log-form .att-subject-description,
.att-log-form .att-subject-time {
    display: inline;
}

.att-log-form .att-subject-meta.has-description .att-subject-time::before {
    content: " · ";
}

.att-log-form .att-subject-controls {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}

.att-log-form .att-subject-row > .att-subject-controls > .att-status-select {
    flex: 0 0 118px;
    width: 118px;
    min-width: 0;
}

.att-log-form .att-subject-row .att-status-select-trigger {
    height: 33px;
    padding: 0 10px;
    font-size: .8125rem;
}

.att-log-form .att-subject-empty {
    padding: 10px 0;
    font-size: .78rem;
}

.att-log-form .att-subject-mode-toggle {
    width: auto;
    min-width: 0;
    height: 33px;
    min-height: 33px;
    padding: 0 8px;
    gap: 6px;
    font-size: .8125rem;
    white-space: nowrap;
}

@media (max-width: 479.98px) {
    .att-log-form .att-subject-controls {
        flex: 1 0 100%;
        justify-content: flex-end;
        margin-left: 0;
    }
}

@media (max-width: 359.98px) {
    .att-log-form .att-subject-list-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Absence Limit Rows */

.att-absence-row {
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    margin-bottom: 8px;
    transition: border-color .2s;
}

.att-absence-row:last-child {
    margin-bottom: 0;
}

.att-absence-row.att-absence-reached {
    border-color: rgba(251,113,133,.35);
    background: rgba(251,113,133,.04);
}

.att-absence-row.att-absence-near {
    border-color: rgba(180,83,9,.3);
    background: rgba(180,83,9,.04);
}

.att-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.att-limit-badge.danger {
    background: rgba(251,113,133,.15);
    color: #fb7185;
}

.att-limit-badge.warn {
    background: rgba(180,83,9,.15);
    color: var(--warning);
}

/* Per-Subject Breakdown */

.att-subject-breakdown-card {
    padding: var(--card-pad-xs);
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.02);
    margin-bottom: 8px;
    transition: border-color .18s;
}

.att-subject-breakdown-card:last-child {
    margin-bottom: 0;
}

.att-subject-breakdown-card:hover {
    border-color: rgba(var(--accent),.2);
}

.att-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
    min-width: 0;
}

.att-breakdown-code {
    font-weight: 700;
    font-size: .84rem;
    white-space: nowrap;
}

.att-breakdown-rate {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: .9rem;
    flex-shrink: 0;
}

.att-breakdown-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.att-bd-stat {
    text-align: center;
    padding: 4px 2px;
    border-radius: 4px;
    background: rgba(var(--tint-rgb),.03);
}

.att-bd-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .88rem;
    line-height: 1;
}

.att-bd-lbl {
    font-size: .58rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-top: 2px;
    line-height: 1.2;
}

.att-bd-stat.present .att-bd-val {
    color: #34d399;
}

.att-bd-stat.late .att-bd-val {
    color: var(--warning);
}

.att-bd-stat.excused .att-bd-val {
    color: #60a5fa;
}

.att-bd-stat.absent .att-bd-val {
    color: #fb7185;
}

.att-bd-stat.noclasses .att-bd-val {
    color: #8b5cf6;
}

.att-online-sub {
    display: block;
    font-size: .55rem;
    color: #06b6d4;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 359.98px) {
    .att-breakdown-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Attendance Log */

.att-log-header {
    display: grid;
    grid-template-columns: 8px 72px 1fr 90px 20px 28px;
    gap: 6px;
    align-items: center;
    padding: 6px 10px;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.att-log-row {
    display: grid;
    grid-template-columns: 8px 72px 1fr 90px 20px 28px;
    gap: 6px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: .76rem;
    transition: background .15s, border-color .15s;
    margin-bottom: 4px;
}

.att-log-row:hover {
    background: rgba(var(--tint-rgb),.04);
    border-color: rgba(var(--accent),.2);
}

.att-log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.att-log-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .7rem;
    white-space: nowrap;
}

.att-log-subject {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-log-status {
    display: flex;
    align-items: center;
}

.att-log-note {
    color: var(--text-faint);
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.att-log-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    border-radius: 4px;
    font-size: .7rem;
    transition: all .15s;
    padding: 0;
    flex-shrink: 0;
}

.att-log-delete:hover {
    color: #fb7185;
    background: rgba(251,113,133,.1);
}

/* Status Badges */

.att-status-badge {
    font-weight: 700;
    font-size: .63rem;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.att-status-badge.present {
    background: rgba(52,211,153,.15);
    color: #34d399;
    border: 1px solid rgba(52,211,153,.3);
}

.att-status-badge.late {
    background: rgba(180,83,9,.15);
    color: var(--warning);
    border: 1px solid rgba(180,83,9,.3);
}

.att-status-badge.absent {
    background: rgba(251,113,133,.15);
    color: #fb7185;
    border: 1px solid rgba(251,113,133,.3);
}

.att-status-badge.excused {
    background: rgba(96,165,250,.15);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,.3);
}

.att-status-badge.noclasses {
    background: rgba(139,92,246,.15);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,.3);
}

/* Online chip inside status badge */

.att-online-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(6,182,212,.2);
    color: #06b6d4;
    border-radius: 4px;
    font-size: .58rem;
    font-weight: 700;
    padding: 1px 5px;
    margin-left: 3px;
    letter-spacing: .02em;
}

@media (max-width: 575.98px) {
    .att-log-header,
    .att-log-row {
        grid-template-columns: 8px 62px 1fr 80px 16px 26px;
        gap: 4px;
        font-size: .7rem;
    }
    .att-log-date {
        font-size: .64rem;
    }
    .att-status-badge {
        font-size: .58rem;
        padding: 2px 5px;
    }
}

@media (max-width: 359.98px) {
    .att-log-header,
    .att-log-row {
        grid-template-columns: 6px 58px 1fr 74px 14px 24px;
        gap: 3px;
        font-size: .66rem;
        padding: 5px 8px;
    }
}

/* ATTENDANCE PAGE — v3 Refinements */

.att-online-pill {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.att-online-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.att-online-pill-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 31px;
    padding: 0 10px;
    border-radius: var(--radius, 10px);
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.04);
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-soft);
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
}

.att-online-pill-inner i {
    font-size: .82rem;
    transition: color .18s;
}

.att-online-check:checked ~ .att-online-pill-inner {
    background: rgba(6,182,212,.14);
    border-color: rgba(6,182,212,.5);
    color: #06b6d4;
}

.att-online-check:checked ~ .att-online-pill-inner i {
    color: #06b6d4;
}

.att-online-pill:hover .att-online-pill-inner {
    border-color: rgba(6,182,212,.35);
    background: rgba(6,182,212,.07);
}

/* Absence Limit — old rules cleared; new rules in patch section below */

.al-modal-intro {
    font-size: .82rem;
    color: var(--text-faint);
    margin-bottom: 16px;
    line-height: 1.5;
}

.al-modal-row {
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.02);
    margin-bottom: 10px;
    transition: border-color .18s;
}

.al-modal-row:last-child {
    margin-bottom: 0;
}

.al-modal-row.al-reached {
    border-color: rgba(251,113,133,.35);
    background: rgba(251,113,133,.04);
}

.al-modal-row.al-near {
    border-color: rgba(180,83,9,.3);
    background: rgba(180,83,9,.04);
}

.al-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.al-code {
    font-weight: 700;
    font-size: .9rem;
}

.al-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.al-status-badge.danger {
    background: rgba(251,113,133,.15);
    color: #fb7185;
    border: 1px solid rgba(251,113,133,.25);
}

.al-status-badge.warn {
    background: rgba(180,83,9,.15);
    color: var(--warning);
    border: 1px solid rgba(180,83,9,.25);
}

.al-status-badge.ok {
    background: rgba(52,211,153,.10);
    color: #34d399;
    border: 1px solid rgba(52,211,153,.2);
}

.al-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.al-stat {
    text-align: center;
}

.al-stat-val {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1;
}

.al-stat-lbl {
    font-size: .65rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    margin-top: 2px;
}

.al-limit-input {
    max-width: 70px;
    text-align: center;
}

.al-save-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Attendance Log — Card Style */

.att-log-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    margin-bottom: 5px;
    transition: background .14s, border-color .14s;
}

.att-log-card:last-child {
    margin-bottom: 0;
}

.att-log-card:hover {
    background: rgba(var(--tint-rgb),.03);
    border-color: rgba(var(--accent),.18);
}

.att-log-card-main {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}

.att-log-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.att-log-card-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.att-log-card-row1 {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.att-log-card-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .72rem;
    color: var(--text-soft);
    white-space: nowrap;
    flex-shrink: 0;
}

.att-log-card-subject {
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-log-card-row2 {
    display: flex;
    align-items: center;
    gap: 5px;
}

.att-log-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.att-action-btn {
    width: var(--icon-btn-size-sm);
    height: var(--icon-btn-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--tint-rgb),.05);
    border: 1px solid var(--border);
    color: var(--text-soft);
    cursor: pointer;
    border-radius: var(--btn-radius-sm);
    font-size: var(--icon-size-sm);
    transition: all .15s;
    padding: 0;
    flex-shrink: 0;
}

.att-notes-btn {
    color: rgb(var(--accent));
    background: rgba(var(--accent),.08);
    border-color: rgba(var(--accent),.2);
}

.att-notes-btn:hover {
    background: rgba(var(--accent),.18);
    border-color: rgba(var(--accent),.4);
}

.att-delete-btn:hover {
    color: #fb7185;
    background: rgba(251,113,133,.12);
    border-color: rgba(251,113,133,.3);
}

.att-notes-btn-empty {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-block;
}

/* Notes Modal */

.att-note-content {
    font-size: .9rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    color: var(--text);
    margin-bottom: 10px;
}

.att-note-meta {
    font-size: .72rem;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

/* Remove old log header/row rules that conflict */

.att-log-header {
    display: none;
}

@media (max-width: 575.98px) {
    /* Grade card */
    .grade-card-top {
        grid-template-columns: minmax(0,1fr) auto auto;
        gap: 6px;
        padding: 7px 8px 6px;
    }
    .grade-card-code {
        font-size: .8rem;
    }
    .grade-card-pct {
        font-size: .86rem;
    }
    .grade-card-gwa {
        font-size: .6rem;
    }
    .btn-icon-xs {
        width: 24px !important;
        height: 24px !important;
        font-size: .66rem !important;
    }
    /* GWA calc header stacks on mobile */
    .gwa-calc-header-top {
        flex-direction: row;
        align-items: flex-start;
    }
    .gwa-calc-header-btns {
        align-self: flex-end;
    }
    /* Absence limit summary */
    .att-limit-summary-left {
        min-width: 70px;
    }
    /* Log card: slightly tighter on small screens */
    .att-log-card {
        padding: 7px 8px;
        gap: 8px;
    }
    .att-log-card-date {
        font-size: .67rem;
    }
    .att-log-card-subject {
        font-size: .78rem;
    }
    .att-action-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 359.98px) {
    .grade-card-top {
        padding: 6px 7px 5px;
        gap: 4px;
    }
    .grade-card-code {
        font-size: .76rem;
    }
    .grade-card-pct {
        font-size: .8rem;
    }
    .att-log-card {
        gap: 6px;
        padding: 6px 7px;
    }
    .att-limit-summary-left {
        min-width: 60px;
    }
    .al-limit-input {
        max-width: 58px;
    }
}

/* Absence limit modal inline label */

.al-limit-label {
    margin-bottom: 0;
    white-space: nowrap;
}

/* ATTENDANCE — v4 Refinements (override earlier rules) */

.att-online-pill {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    margin: 0;
    width: 100%;
    height: 100%;
}
.att-online-pill-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 31px;
    padding: 0 10px;
    border-radius: var(--radius, 10px);
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.04);
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-soft);
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
    white-space: nowrap;
}

/* Hover: subtle only — must not look selected */

.att-online-pill:hover .att-online-pill-inner {
    border-color: rgba(var(--tint-rgb),.2);
    background: rgba(var(--tint-rgb),.07);
    color: var(--text);
}

/* Active/checked state — this is the selected look */

.att-online-check:checked ~ .att-online-pill-inner {
    background: rgba(6,182,212,.15);
    border-color: rgba(6,182,212,.55);
    color: #06b6d4;
}
/* Attendance Log: horizontal row layout */

.att-log-empty {
    font-size: .84rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 0;
}

.att-log-empty i {
    font-size: 1.6rem;
    opacity: .25;
}

.att-log-row {
    display: grid;
    grid-template-columns: 14px 88px minmax(60px,1fr) minmax(80px,auto) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 6px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    font-size: .8rem;
    transition: background .12s;
}

.att-log-row:last-child {
    border-bottom: none;
}

.att-log-row:hover {
    background: rgba(var(--tint-rgb),.03);
}

.att-log-header-row {
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--border);
}

.att-log-header-row:hover {
    background: transparent;
}

.att-log-col-dot {
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-log-dot-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
}

.att-log-col-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .72rem;
    color: var(--text-soft);
    white-space: nowrap;
}

.att-log-col-subject {
    font-weight: 700;
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-log-col-status {
    display: flex;
    align-items: center;
}

.att-log-col-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.att-action-placeholder {
    width: 30px;
    height: 30px;
    display: inline-block;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .att-log-row {
        grid-template-columns: 10px 80px minmax(48px,1fr) auto auto;
        gap: 7px;
        padding: 6px 4px;
    }
    .att-log-col-date {
        font-size: .67rem;
    }
    .att-log-col-subject {
        font-size: .74rem;
    }
    .att-status-badge {
        font-size: .58rem;
        padding: 2px 5px;
    }
    .att-online-chip {
        font-size: .54rem;
        padding: 1px 4px;
    }
}

@media (max-width: 399.98px) {
    .att-log-row {
        grid-template-columns: 8px 72px minmax(40px,1fr) auto auto;
        gap: 5px;
        font-size: .72rem;
    }
    .att-log-col-date {
        font-size: .63rem;
    }
}

@media (max-width: 575.98px) {
    .grade-card-top {
        grid-template-columns: minmax(0,1fr) auto auto;
        gap: 6px;
        padding: 6px 8px 5px;
    }
    .grade-card-code {
        font-size: .8rem;
    }
    .grade-card-pct {
        font-size: .86rem;
    }
    .btn-icon-xs {
        width: 24px !important;
        height: 24px !important;
        font-size: .65rem !important;
    }
    .tg-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 359.98px) {
    .grade-card-top {
        padding: 5px 7px 4px;
        gap: 4px;
    }
    .grade-card-code {
        font-size: .75rem;
    }
    .grade-card-pct {
        font-size: .8rem;
    }
}

.att-log-card,
.att-log-card-main,
.att-log-card-dot,
.att-log-card-body,
.att-log-card-row1,
.att-log-card-row2,
.att-log-card-actions,
.att-log-card-date,
.att-log-card-subject,
.att-log-header {
    display: revert;
}

.att-log-header {
    display: none !important;
}

/* STUDENT PLANNER — PATCH v5 */

.tg-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

@media (min-width: 576px) {
    .tg-form-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Remove the old tg-form-action col that was beside inputs */

.tg-form-action {
    display: none !important;
}

.tg-calc-btn {
    margin-top: 2px;
    padding: 9px 0;
    font-size: .88rem;
    font-weight: 700;
    border-radius: var(--radius, 10px);
}

/* 2. Online control — match height of sibling form fields */

.att-online-pill {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.att-online-pill-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: calc(1.5em + 0.5rem + 2px);
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.04);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-soft);
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
    white-space: nowrap;
}

/* Hover — subtle, clearly different from active */

.att-online-pill:hover .att-online-pill-inner {
    border-color: rgba(var(--tint-rgb),.22);
    background: rgba(var(--tint-rgb),.07);
    color: var(--text);
}

/* Checked/selected — clearly distinct cyan highlight */

.att-online-check:checked ~ .att-online-pill-inner {
    background: rgba(6,182,212,.16);
    border-color: rgba(6,182,212,.6);
    color: #06b6d4;
    font-weight: 700;
}
/* 3. Attendance Log redesign */

.att-log-count-label {
    font-size: .68rem;
    color: var(--text-faint);
    text-align: right;
    padding: 0 4px 6px;
    letter-spacing: .02em;
}

/* Grid columns: */

.att-log-row {
    display: grid;
    grid-template-columns: 14px 76px minmax(54px, 1fr) minmax(90px, auto) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 6px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(var(--tint-rgb),.07);
    background: transparent;
    font-size: .78rem;
    transition: background .12s;
    margin-bottom: 0;
}

/* Header row */

.att-log-header-row {
    font-size: .6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}
/* Date column */

.att-log-col-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .7rem;
    color: var(--text-soft);
    white-space: nowrap;
}

/* Status column — centered badge */

.att-log-col-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Actions column — right-aligned, spaced from status */

.att-log-col-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-left: 6px;
}

.att-log-show-more {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}

.att-log-show-more-btn {
    font-size: .78rem;
    gap: 4px;
}

.att-log-more-count {
    color: var(--text-faint);
    font-size: .72rem;
}

@media (max-width: 575.98px) {
    .att-log-row {
        grid-template-columns: 10px 68px minmax(44px, 1fr) auto auto;
        gap: 7px;
        padding: 6px 4px;
        font-size: .72rem;
    }
    .att-log-col-date {
        font-size: .64rem;
    }
    .att-log-col-subject {
        font-size: .72rem;
    }
    .att-status-badge {
        font-size: .56rem;
        padding: 2px 5px;
    }
    .att-online-chip {
        font-size: .52rem;
        padding: 1px 4px;
        margin-left: 2px;
    }
    .att-action-btn {
        width: 26px;
        height: 26px;
        font-size: .68rem;
    }
}

@media (max-width: 399.98px) {
    .att-log-row {
        grid-template-columns: 8px 60px minmax(38px, 1fr) auto auto;
        gap: 5px;
        padding: 5px 3px;
        font-size: .68rem;
    }
    .att-log-col-date {
        font-size: .6rem;
    }
    .att-log-col-subject {
        font-size: .68rem;
    }
    .att-status-badge {
        font-size: .52rem;
        padding: 2px 4px;
    }
}

@media (max-width: 359.98px) {
    .att-log-row {
        grid-template-columns: 6px 56px minmax(32px, 1fr) auto auto;
        gap: 4px;
        padding: 5px 2px;
    }
    .att-log-col-date {
        font-size: .56rem;
    }
}

.att-action-placeholder {
    display: none !important;
}

/* PATCH v5.1 — Three targeted fixes */

.att-log-col-status {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Fix 2: Count label in header row — no top padding, inline style */

.att-log-count-label {
    font-size: .68rem;
    color: var(--text-faint);
    letter-spacing: .02em;
    white-space: nowrap;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.att-online-pill-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 0.25rem 0.5rem;
    min-height: calc(1.5em + 0.5rem + 2px);
    line-height: 1.5;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.04);
    color: var(--text-soft);
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.col-6.col-sm-3:has(> .att-online-pill),
.col-6:has(> .att-online-pill) {
    display: flex;
    flex-direction: column;
}

/* Online col wrapper — ensures pill stretches to fill label+input height */

.att-online-col {
    display: flex;
    flex-direction: column;
}

.att-online-col .att-online-pill {
    flex: 1;
    align-items: stretch;
}

.att-online-col .att-online-pill-inner {
    flex: 1;
    height: calc(1.5em + 0.5rem + 2px);
    min-height: calc(1.5em + 0.5rem + 2px);
}

.att-log-row .att-log-col-status,
.att-log-header-row .att-log-col-status {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* ONLINE PILL: match Bootstrap form-select-sm height exactly */

.att-online-col {
    display: flex !important;
    flex-direction: column !important;
}

.att-online-col .att-online-pill {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: stretch !important;
    width: 100% !important;
    cursor: pointer;
    margin: 0;
}

.att-online-col .att-online-pill-inner,
.att-online-pill-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    height: 31px !important;
    min-height: 31px !important;
    border-radius: 4px !important;
    border: 1px solid var(--border) !important;
    background: rgba(var(--tint-rgb),.04) !important;
    color: var(--text-soft) !important;
    transition: background .18s, border-color .18s, color .18s !important;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box !important;
}

.att-online-pill:hover .att-online-pill-inner {
    border-color: rgba(var(--tint-rgb),.22) !important;
    background: rgba(var(--tint-rgb),.07) !important;
    color: var(--text) !important;
}

.att-online-check:checked ~ .att-online-pill-inner {
    background: rgba(6,182,212,.16) !important;
    border-color: rgba(6,182,212,.6) !important;
    color: #06b6d4 !important;
    font-weight: 700 !important;
}

.att-online-check:checked ~ .att-online-pill-inner i {
    color: #06b6d4 !important;
}

/* PATCH v5.3 — FINAL HEIGHT FIX */

.att-online-pill-inner {
    font-size: .9rem !important;
    height: calc(1.5 * 0.9rem + 0.5rem + 2px) !important;
    min-height: calc(1.5 * 0.9rem + 0.5rem + 2px) !important;
}

/* PATCH v5.4 — Online toggle as native form-select-sm label */

.att-online-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    user-select: none !important;
    font-weight: 600 !important;
    color: var(--text-soft) !important;
    background-image: none !important;
    padding-right: 0.5rem !important;
    text-align: center !important;
    transition: background .18s, border-color .18s, color .18s !important;
}

.att-online-toggle-btn .att-online-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Hover — subtle */

.att-online-toggle-btn:hover {
    border-color: rgba(var(--tint-rgb),.25) !important;
    background-color: rgba(var(--tint-rgb),.07) !important;
    color: var(--text) !important;
}

/* Active/checked — use JS to add class since CSS :has() may not apply to label */

.att-online-toggle-btn.is-online {
    background-color: rgba(6,182,212,.16) !important;
    border-color: rgba(6,182,212,.6) !important;
    color: #06b6d4 !important;
    font-weight: 700 !important;
}

.att-online-toggle-btn.is-online .att-online-icon {
    color: #06b6d4;
}

.att-online-pill,
.att-online-pill-inner,
.att-online-col {
    all: unset;
}

/* PATCH v6 — Attendance Log as HTML table (replaces all grid CSS) */

.att-log-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Column widths — fixed so header and data always align */

.att-log-table .att-tbl-dot {
    width: 25px;
}

.att-log-table .att-tbl-date {
    width: 100px;
}

.att-log-table .att-tbl-course {
    width: 120px;
}

.att-log-table .att-tbl-status {
    width: 120px;
}

.att-log-table .att-tbl-actions {
    width: 80px;
}

/* Header */

.att-tbl-head th {
    font-size: .6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    padding: 4px 6px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.att-tbl-head .att-tbl-actions {
    text-align: right;
}

/* Data rows */

.att-tbl-row td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(var(--tint-rgb),.06);
    vertical-align: middle;
    font-size: .78rem;
}

.att-tbl-row:last-child td {
    border-bottom: none;
}

.att-tbl-row:hover td {
    background: rgba(var(--tint-rgb),.03);
}

/* Dot cell */

.att-tbl-row .att-tbl-dot {
    padding-left: 5px;
    padding-right: 10px;
}

.att-log-dot-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

/* Date */

.att-tbl-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .7rem;
    color: var(--text-soft);
    white-space: nowrap;
}

/* Course */

.att-tbl-course {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status — left-aligned, badge starts at left edge of cell */

.att-tbl-status {
    text-align: left;
}

/* Actions — right-aligned buttons */

.att-tbl-actions {
    text-align: right;
    white-space: nowrap;
}

.att-tbl-actions .att-action-btn {
    display: inline-flex;
}

@media (max-width: 575.98px) {
    .att-log-table .att-tbl-dot {
        width: 15px;
    }
    .att-log-table .att-tbl-date {
        width: 80px;
    }
    .att-log-table .att-tbl-course {
        width: 90px;
    }
    .att-log-table .att-tbl-status {
        width: 100px;
    }
    .att-log-table .att-tbl-actions {
        width: 70px;
    }
    .att-tbl-row td {
        padding: 7px 4px;
        font-size: .72rem;
    }
    .att-tbl-date {
        font-size: .65rem;
    }
    .att-tbl-course {
        font-size: .72rem;
    }
    .att-status-badge {
        font-size: .56rem;
        padding: 2px 5px;
    }
    .att-online-chip {
        font-size: .52rem;
        padding: 1px 4px;
        margin-left: 2px;
    }
    .att-action-btn {
        width: 26px;
        height: 26px;
        font-size: .68rem;
    }
}

@media (max-width: 399.98px) {
    .att-log-table .att-tbl-dot {
        width: 10px;
    }
    .att-log-table .att-tbl-date {
        width: 40px;
    }
    .att-log-table .att-tbl-status {
        width: 78px;
    }
    .att-log-table .att-tbl-actions {
        width: 54px;
    }
    .att-tbl-row td {
        padding: 6px 3px;
        font-size: .68rem;
    }
    .att-tbl-date {
        font-size: .6rem;
    }
    .att-status-badge {
        font-size: .52rem;
        padding: 2px 4px;
    }
    .att-action-btn {
        width: 24px;
        height: 24px;
        font-size: .64rem;
    }
}

@media (max-width: 359.98px) {
    .att-log-table .att-tbl-status {
        width: 70px;
    }
    .att-log-table .att-tbl-actions {
        width: 48px;
    }
    .att-tbl-date {
        font-size: .56rem;
    }
}

/* TASKS v2 — Recurring, Bulk Actions, Grouping, Score/Remarks */

.tk-repeat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .68rem;
    font-weight: 700;
    color: rgb(var(--accent));
    background: rgba(var(--accent), .13);
    border: 1px solid rgba(var(--accent), .28);
    border-radius: 6px;
    padding: 1px 7px;
    letter-spacing: .02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.tk-repeat-badge i {
    font-size: .7rem;
}

/* Repeat hint in modal */

.tk-repeat-hint {
    font-size: .74rem;
    color: var(--text-soft);
    margin-top: 4px;
    min-height: 1em;
}

/* Bulk selection (see updated styles at end of file) */

.tk-select-all-bar {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 4px 0 2px;
}

.tk-select-all-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: .78rem;
    color: var(--text-soft);
    font-weight: 600;
    user-select: none;
    margin-bottom: 0;
}

.tk-select-all-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Group select-all button */

.tk-group-select-all {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-faint);
    font-size: .8rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: .15s;
    display: flex;
    align-items: center;
}

.tk-group-select-all:hover {
    color: rgb(var(--accent));
    background: rgba(var(--accent), .08);
}

/* Bulk action toolbar */

.tk-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--accent), .14);
    border: 1px solid rgba(var(--accent), .3);
    border-radius: 5px;
    padding: 8px 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tk-bulk-count {
    font-size: .8rem;
    font-weight: 700;
    color: rgb(var(--accent));
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.tk-bulk-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.tk-bulk-actions .btn {
    font-size: .76rem;
    height: 28px;
    padding: 0 9px;
}

/* Subject grouping */

.tk-group-subject .tk-group-heading {
    gap: 7px;
}

.tk-group-heading-sub {
    font-size: .78rem;
}

.tk-sub-color-dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.tk-group-sub-name {
    font-weight: 700;
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Score & Remarks */

.tk-score-section {
    background: var(--surface-2);
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tk-score-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .8rem;
}

.tk-score-k {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    min-width: 56px;
    padding-top: 1px;
}

.tk-score-v {
    color: var(--text-soft);
    word-break: break-word;
    min-width: 0;
    font-weight: 600;
}

.tk-remarks-v {
    font-weight: 400;
    font-style: italic;
}

/* Group sort panel extra col (Group By) */

.tk-pop-section-label.mt-2 {
    margin-top: 10px !important;
}

@media (max-width: 575.98px) {
    .tk-bulk-toolbar {
        padding: 6px 10px;
        gap: 6px;
    }
    .tk-bulk-actions {
        gap: 4px;
    }
    .tk-bulk-actions .btn {
        font-size: .7rem;
        height: 26px;
        padding: 0 7px;
    }
    .tk-bulk-count {
        font-size: .76rem;
    }
    .tk-select-all-bar {
        padding: 2px 0;
    }
    .tk-group-sub-name {
        font-size: .74rem;
    }
}

@media (max-width: 399.98px) {
    .tk-bulk-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .tk-bulk-actions {
        margin-left: 0;
    }
}

/* ATTENDANCE v4 — Heatmap, Mode Toggle, Bulk Attendance, */

.att-skel-val {
    color: var(--text-faint) !important;
    opacity: .55;
    animation: att-skel-pulse 1.8s ease-in-out infinite;
}

@keyframes att-skel-pulse {
    0%,
    100% {
        opacity: .55;
    }
    50% {
        opacity: .25;
    }
}

@media (prefers-reduced-motion: reduce) {
    .att-skel-val {
        animation: none !important;
    }
}

/* Overall Rate header with export buttons */

.att-overall-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.att-overall-header .section-title {
    margin-bottom: 0;
}

/* On very narrow screens keep title + buttons on one row; shrink buttons instead of wrapping */

.att-overall-header {
    flex-wrap: nowrap;
}

.att-overall-header .section-title {
    min-width: 0;
}

@media (max-width: 399.98px) {
    .att-overall-header .att-export-group {
        gap: 3px;
    }
    .att-overall-header .att-export-group .btn {
        padding: 4px 8px;
        font-size: .72rem;
    }
    .att-overall-header .att-export-label {
        font-size: .72rem;
    }
}

/* Export group */

.att-export-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.att-export-label {
    font-size: .76rem;
}

.att-log-form-header {
    margin-bottom: 12px;
}

.att-log-form .att-date-bulk-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.att-log-form .att-date-field {
    flex: 1 1 0;
    min-width: 180px;
}

.att-bulk-panel {
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border-radius: 4px;
}

.att-bulk-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.att-bulk-label {
    display: block;
    color: var(--text-faint);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.att-bulk-status {
    flex: 0 0 160px;
    width: 160px;
    min-width: 140px;
    height: 33px;
    padding: 0 24px 0 10px;
    font-size: .8125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.att-bulk-apply {
    min-height: 36px;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .att-log-form-header {
        margin-bottom: 10px;
    }
    .att-log-form .att-date-bulk-row {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .att-log-form .att-date-field {
        flex: 1 1 0;
        min-width: 0;
    }
    .att-log-form .att-bulk-panel {
        flex: 0 0 auto;
        width: auto;
    }
    .att-log-form .att-bulk-controls > .att-status-select {
        flex: 0 0 126px;
        width: 126px;
        min-width: 120px;
    }
    .att-log-form .att-bulk-controls > .att-status-select .att-status-select-trigger {
        padding-right: 8px;
        padding-left: 8px;
        font-size: .75rem;
    }
    .att-log-form .att-bulk-apply {
        padding-right: 8px;
        padding-left: 8px;
    }
}

.att-status-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.att-status-select > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.att-status-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 33px;
    padding: 0 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--input-radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .8125rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.att-status-select-trigger::after {
    content: "";
    flex: 0 0 auto;
    width: .45em;
    height: .45em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    opacity: .65;
    transform: translateY(-2px) rotate(45deg);
}

.att-status-select-trigger:hover,
.att-status-select-trigger:focus-visible,
.att-status-select-trigger[aria-expanded="true"] {
    border-color: rgba(var(--accent), .45);
    outline: none;
}

.att-status-select-trigger:focus-visible {
    box-shadow: var(--focus-ring);
}

.att-status-select-menu {
    position: fixed;
    z-index: var(--layer-popover);
    display: grid;
    gap: 2px;
    max-width: calc(100vw - 16px);
    max-height: min(240px, calc(100vh - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.att-status-select-menu[hidden] {
    display: none;
}

.att-status-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .8125rem;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.att-status-select-option:hover,
.att-status-select-option:focus-visible {
    background: var(--surface-2);
    outline: none;
}

.att-status-select-option.is-selected {
    background: rgba(var(--accent), .1);
    color: rgb(var(--accent));
}

.att-status-select-option.is-selected::after {
    content: "\2713";
    color: rgb(var(--accent));
}

.att-status-select-option.is-placeholder {
    color: var(--text-faint);
}

.att-status-select-option:disabled {
    cursor: default;
}

.att-bulk-controls > .att-status-select {
    flex: 0 0 160px;
    width: 160px;
    min-width: 140px;
}

.att-log-form .att-subject-row > .att-status-select {
    width: 118px;
    min-width: 0;
}

/* Mode Toggle Switch */

.att-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(var(--tint-rgb),.06);
    color: var(--text-soft);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .18s, border-color .18s, color .18s;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

/* Only highlight on hover when the toggle is already ON */

.att-mode-toggle.is-online:hover {
    border-color: rgba(6,182,212,.75);
    background: rgba(6,182,212,.22);
}

.att-mode-toggle.is-online {
    background: rgba(6,182,212,.15);
    border-color: rgba(6,182,212,.55);
    color: #06b6d4;
}

.att-mode-track {
    width: 28px;
    height: 16px;
    border-radius: 4px;
    background: rgba(var(--tint-rgb),.15);
    position: relative;
    flex-shrink: 0;
    transition: background .2s;
}

.att-mode-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-soft);
    transition: transform .2s, background .2s;
}

.att-mode-toggle.is-online .att-mode-track {
    background: rgba(6,182,212,.45);
}

.att-mode-toggle.is-online .att-mode-thumb {
    transform: translateX(12px);
    background: #06b6d4;
}

.att-mode-label {
    font-size: .8rem;
    font-weight: 600;
    min-width: 40px;
    text-align: left;
}

.att-hidden-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .att-mode-toggle,
    .att-mode-track,
    .att-mode-thumb {
        transition: none !important;
    }
}

/* Consecutive Absence Alerts */

.att-consec-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.att-consec-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 4px;
    background: rgba(180,83,9,.08);
    border: 1px solid rgba(180,83,9,.28);
    animation: att-consec-in .25s ease;
}

@keyframes att-consec-in {
    from {
        opacity: 0;
        transform: none;
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .att-consec-alert {
        animation: none !important;
    }
}

.att-consec-icon {
    color: var(--warning);
    font-size: .9rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.att-consec-body {
    flex: 1;
    min-width: 0;
}

.att-consec-title {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--warning);
    margin-bottom: 2px;
}

.att-consec-msg {
    font-size: .8rem;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.att-consec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Heatmap */

.att-heatmap-wrap {
    width: 100%;
    min-width: 0;
}

.att-heatmap-filter {
    max-width: 150px;
    font-size: .75rem;
}

@media (max-width: 399.98px) {
    .att-heatmap-filter {
        max-width: 120px;
        font-size: .7rem;
    }
}

.att-heatmap-grid-wrap {
    --hm-cell: 20px;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 4px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.att-heatmap-day-labels {
    display: grid;
    grid-template-rows: 16px repeat(7, var(--hm-cell));
    gap: 4px;
    flex-shrink: 0;
    align-self: start;
}

.att-heatmap-month-spacer {
    height: 16px;
}

.att-heatmap-day-lbl {
    width: 14px;
    height: var(--hm-cell);
    font-size: .54rem;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.att-heatmap-week-viewport {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.att-heatmap-months,
.att-heatmap-weeks {
    display: grid;
    grid-template-columns: repeat(var(--hm-week-count), var(--hm-cell));
    column-gap: 4px;
}

.att-heatmap-months {
    height: 16px;
    margin-bottom: 4px;
}

.att-heatmap-month-label {
    min-width: 0;
    overflow: visible;
    color: var(--text-faint);
    font-size: .62rem;
    line-height: 16px;
    white-space: nowrap;
}

.att-heatmap-col {
    display: grid;
    grid-template-rows: repeat(7, var(--hm-cell));
    gap: 4px;
    min-width: 0;
}

.att-hm-cell {
    display: block;
    width: var(--hm-cell);
    height: var(--hm-cell);
    border-radius: 3px;
    cursor: pointer;
    transition: transform .1s, opacity .1s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.att-hm-cell:focus-visible {
    outline: 2px solid rgb(var(--accent));
    outline-offset: 1px;
}

.att-hm-cell:hover,
.att-hm-cell:focus {
    transform: scale(1.3);
    z-index: 10;
    position: relative;
}

.att-hm-empty {
    background: color-mix(in srgb, var(--text) 5%, var(--surface-2));
}

.att-hm-dimmed {
    opacity: .32;
    cursor: default;
    pointer-events: none;
}

.att-hm-today {
    outline: 1.5px solid rgb(var(--accent));
    outline-offset: 1px;
}

.att-hm-empty:hover,
.att-hm-dimmed:hover {
    transform: none;
}

.att-hm-none {
    background: var(--hm-none-bg, rgba(var(--tint-rgb),.07));
}

/* Legend "No record" swatch: gray picked from the reference cell color (rgb 27,28,30) */
.att-hm-legend-cell.att-hm-none:not(.att-hm-today) {
    background: #1b1c1e !important;
    opacity: 1 !important;
}

.att-hm-present {
    background: rgba(52,211,153,.65);
}

.att-hm-late {
    background: rgba(180,83,9,.65);
}

.att-hm-excused {
    background: rgba(96,165,250,.65);
}

.att-hm-absent {
    background: rgba(251,113,133,.65);
}

.att-hm-noclasses {
    background: rgba(139,92,246,.35);
}

@media (prefers-reduced-motion: reduce) {
    .att-hm-cell {
        transition: none !important;
    }
    .att-hm-cell:hover,
    .att-hm-cell:focus {
        transform: none !important;
    }
}

/* Heatmap empty state */

.att-heatmap-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-faint);
    font-size: .82rem;
}

.att-heatmap-empty i {
    font-size: 1.8rem;
    opacity: .2;
    display: block;
    margin-bottom: 8px;
}

.att-heatmap-empty-sub {
    font-size: .74rem;
    margin-top: 4px;
    opacity: .7;
}

/* Heatmap Legend */

.att-heatmap-legend {
    margin-top: 10px;
}

.att-hm-legend-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.att-hm-legend-label {
    font-size: .62rem;
    color: var(--text-faint);
    font-weight: 600;
}

.att-hm-legend-cells {
    display: flex;
    gap: 3px;
    align-items: center;
}

.att-hm-legend-cell {
    cursor: default;
    width: 12px !important;
    height: 12px !important;
}

.att-hm-legend-cell:hover {
    transform: none !important;
}

.att-hm-legend-items {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 0;
}

.att-hm-li {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: .64rem;
    color: var(--text-faint);
    white-space: nowrap;
}

.att-hm-li-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Heatmap Tooltip */

.att-hm-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .75rem;
    pointer-events: none;
    max-width: 220px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity .12s;
}

.att-hm-tt-date {
    font-weight: 700;
    font-size: .72rem;
    color: var(--text);
    margin-bottom: 3px;
}

.att-hm-tt-subject {
    color: var(--text-soft);
    font-size: .7rem;
}

.att-hm-tt-entry {
    display: flex;
    gap: 4px;
    margin-bottom: 2px;
}

.att-hm-tt-status {
    font-weight: 700;
    font-size: .72rem;
    margin-bottom: 2px;
}

.att-hm-tt-present {
    color: #34d399;
}

.att-hm-tt-late {
    color: var(--warning);
}

.att-hm-tt-excused {
    color: #60a5fa;
}

.att-hm-tt-absent {
    color: #fb7185;
}

.att-hm-tt-noclasses {
    color: #a78bfa;
}

.att-hm-tt-mode {
    color: var(--text-faint);
    font-size: .68rem;
    margin-bottom: 2px;
}

.att-hm-tt-notes {
    color: var(--text-faint);
    font-size: .67rem;
    margin-top: 3px;
    border-top: 1px solid rgba(var(--tint-rgb),.08);
    padding-top: 3px;
}

/* Absence Limit Summary — single row */

.att-limit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    margin-bottom: 8px;
    transition: border-color .2s;
    min-width: 0;
}

.att-limit-row:last-child {
    margin-bottom: 0;
}

.att-limit-row.att-absence-reached {
    border-color: rgba(251,113,133,.35);
    background: rgba(251,113,133,.04);
}

.att-limit-row.att-absence-near {
    border-color: rgba(180,83,9,.3);
    background: rgba(180,83,9,.04);
}

.att-limit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.att-limit-code {
    font-weight: 700;
    font-size: .8rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The bar track — takes up all remaining space */

.att-limit-bar-track {
    flex: 1;
    min-width: 30px;
    height: 6px;
    border-radius: 4px;
    background: rgba(var(--tint-rgb),.12);
    overflow: hidden;
}

.att-limit-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
}

.att-limit-count {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .74rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.att-limit-remain {
    font-size: .65rem;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--text-faint);
}

/* Per-subject breakdown — absence bar & consec warning */

.att-breakdown-desc {
    font-size: .68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-rate-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.att-bd-limit-row {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(var(--tint-rgb),.07);
}

.att-bd-limit-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
}

.att-bd-limit-label {
    font-size: .64rem;
    color: var(--text-faint);
    font-weight: 600;
}

.att-bd-limit-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .72rem;
}

.att-bd-limit-remain {
    font-size: .62rem;
    margin-left: auto;
    white-space: nowrap;
}

.att-bd-limit-bar {
    height: 4px;
    border-radius: 3px;
}

.att-bd-consec-warn {
    margin-top: 6px;
    font-size: .7rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

/* Rate bar color via JS */

.att-rate-bar {
    transition: width .5s ease, background .3s ease;
}

/* Online chip (legacy, keep compatible) */

.att-online-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(6,182,212,.15);
    color: #06b6d4;
    border: 1px solid rgba(6,182,212,.3);
    border-radius: 4px;
    font-size: .58rem;
    font-weight: 700;
    padding: 1px 5px;
    margin-left: 4px;
    letter-spacing: .02em;
    vertical-align: middle;
    white-space: nowrap;
}

.att-online-toggle-btn,
.att-online-pill,
.att-online-pill-inner,
.att-online-col,
.att-online-check {
    display: none !important;
}

/* Log Attendance: Mode switch matches the neighbouring inputs (Subject / Date / Status) */
.att-mode-toggle {
    height: var(--input-height);
    min-height: var(--input-height);
    border-radius: var(--input-radius);
    background: var(--surface-2);
    font-size: .9rem;
}

.att-mode-toggle .att-mode-track {
    background: var(--border);
}
/* Heatmap subject filter: icon + same size as the Configure button (btn-sm) */
.att-heatmap-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.att-heatmap-filter-wrap .att-heatmap-filter-icon {
    position: absolute;
    left: 10px;
    font-size: var(--icon-size-sm);
    color: var(--text-faint);
    pointer-events: none;
    z-index: 1;
}

.att-heatmap-filter-wrap .att-heatmap-filter {
    height: var(--btn-height-sm);
    min-height: var(--btn-height-sm);
    max-width: 160px;
    padding: 0 1.75rem 0 2rem;
    font-size: var(--btn-font-size-sm);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--btn-radius-sm) !important;
}

@media (max-width: 399.98px) {
    .att-heatmap-filter-wrap .att-heatmap-filter {
        max-width: 140px;
        font-size: var(--btn-font-size-sm);
    }
}

/* Absence-limit modal: input same height as the Save button */
.al-modal-row .al-limit-input {
    height: var(--btn-height-sm);
    min-height: var(--btn-height-sm);
    width: 64px;
    max-width: 64px;
    padding: 0 .5rem;
    font-size: var(--btn-font-size-sm);
    line-height: 1;
    border-radius: var(--btn-radius-sm) !important;
    text-align: center;
}

.al-modal-row .al-save-btn {
    height: var(--btn-height-sm);
}

/* Attendance log table: content-sized columns, course column absorbs the spare space, */
.att-log-table {
    table-layout: auto;
    width: 100%;
}

.att-log-table .att-tbl-dot {
    width: 1%;
    padding-right: 4px;
}

.att-log-table .att-tbl-date,
.att-log-table .att-tbl-status,
.att-log-table .att-tbl-actions {
    width: 1%;
    white-space: nowrap;
}

.att-log-table .att-tbl-course {
    width: auto;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-tbl-head th,
.att-tbl-row td {
    padding-left: 12px;
    padding-right: 12px;
}

.att-tbl-head .att-tbl-dot,
.att-tbl-row .att-tbl-dot {
    padding-left: 6px;
    padding-right: 0;
}

.att-tbl-head .att-tbl-actions,
.att-tbl-row .att-tbl-actions {
    text-align: right;
    padding-right: 4px;
}

@media (max-width: 575.98px) {
    .att-tbl-head th,
    .att-tbl-row td {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Heatmap subject filter: left-aligned dropdown button + popup list */
.att-heatmap-filter-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.att-heatmap-filter-btn {
    gap: 0;
    max-width: 100%;
    justify-content: flex-start;
}

.att-heatmap-filter-btn #heatmapFilterLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-heatmap-caret {
    font-size: .65rem;
    opacity: .7;
}

.att-heatmap-menu {
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    background-color: var(--elevated) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow);
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1050;
    --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-link-active-color: var(--text);
}

.att-heatmap-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
}

.att-heatmap-menu .att-heatmap-option,
.att-heatmap-menu .att-heatmap-option:hover,
.att-heatmap-menu .att-heatmap-option:focus,
.att-heatmap-menu .att-heatmap-option.active {
    color: var(--text) !important;
}

.att-heatmap-menu .att-heatmap-option:hover,
.att-heatmap-menu .att-heatmap-option:focus {
    background: rgba(var(--accent), .08) !important;
}

.att-heatmap-menu .att-heatmap-option.active {
    background: rgba(var(--accent), .14) !important;
}

.att-heatmap-option + .att-heatmap-option {
    margin-top: 2px;
}

.att-heatmap-option-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 0 3px;
}

.att-heatmap-option-icon {
    font-size: .95rem;
    color: var(--text-faint);
    flex-shrink: 0;
}

.att-heatmap-option-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-heatmap-option-check {
    visibility: hidden;
    color: rgb(var(--accent));
}

.att-heatmap-option.active .att-heatmap-option-check {
    visibility: visible;
}

/* Keep the open menu above the cards below the heatmap (glass cards create stacking contexts) */
.glass:has(.att-heatmap-menu.show) {
    position: relative;
    z-index: 30;
}

/* Attendance log: course column no longer hogs the width */
.att-log-table .att-tbl-course {
    width: 1%;
    max-width: 150px;
}

.att-log-table .att-tbl-date {
    width: 1%;
}

.att-log-table .att-tbl-status,
.att-log-table .att-tbl-actions {
    width: auto;
}

.att-log-table .att-tbl-actions {
    text-align: right;
}

/* Heatmap filter on the right, with breathing room between icon, text and caret */
.att-heatmap-filter-row {
    justify-content: flex-end;
}

.att-heatmap-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.att-heatmap-filter-btn > i {
    margin: 0 !important;
}

.att-heatmap-menu {
    right: 0;
    left: auto;
}

/* Attendance log: date column is compact, Course / Status / Actions share the rest equally */
.att-log-table {
    table-layout: fixed;
}

.att-log-table .att-tbl-dot {
    width: 28px;
}

.att-log-table .att-tbl-date {
    width: 76px;
}

.att-log-table .att-tbl-course,
.att-log-table .att-tbl-status,
.att-log-table .att-tbl-actions {
    width: auto;
    max-width: none;
}

.att-log-table .att-tbl-course {
    text-align: left;
}

.att-log-table .att-tbl-status {
    text-align: center;
}

@media (max-width: 575.98px) {
    .att-log-table .att-tbl-dot {
        width: 20px;
    }
    .att-log-table .att-tbl-date {
        width: 64px;
    }
}

/* Heatmap header: title left, filter right on the same row */
.att-heatmap-head {
    flex-wrap: nowrap;
    margin-bottom: 12px !important;
}

.att-heatmap-head .section-title {
    min-width: 0;
}

.att-heatmap-head .att-heatmap-dropdown {
    flex-shrink: 0;
}

@media (hover: none) {
    .att-hm-cell:hover,
    .att-hm-cell:focus {
        transform: none;
    }
}

/* Mixed-status day: pie-style cell */
.att-hm-mixed-dot {
    background: conic-gradient(rgba(251,113,133,.8) 0 33%, rgba(96,165,250,.8) 33% 66%, rgba(52,211,153,.75) 66% 100%);
    border-radius: 2px;
}

/* Heatmap polish: room for outlines/scrollbar, tidy legend */
.att-heatmap-week-viewport {
    padding: 2px 2px 8px;
    scrollbar-width: thin;
}

.att-heatmap-legend {
    margin-top: 12px;
}

.att-hm-legend-wrap,
.att-hm-legend-items {
    gap: 8px 12px;
}

.att-hm-li {
    gap: 5px;
    font-size: .68rem;
}

.att-hm-li-dot {
    width: 10px;
    height: 10px;
}

.att-hm-legend-cell {
    width: 10px !important;
    height: 10px !important;
    max-width: none !important;
    border-radius: 2px;
    outline-offset: 1px;
}

@media (max-width: 575.98px) {
    .att-hm-legend-wrap {
        display: block;
    }
    .att-hm-legend-items {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px 6px;
    }
    .att-hm-li {
        min-width: 0;
        font-size: .64rem;
        gap: 4px;
    }
}

@media (max-width: 575.98px) {
    .att-hm-legend-items {
        grid-template-columns: repeat(4, max-content);
        justify-content: center;
        column-gap: 14px;
    }
}

@media (max-width: 359.98px) {
    .att-hm-legend-items {
        column-gap: 8px;
    }
}

@media (max-width: 575.98px) {
    .att-hm-legend-items {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        justify-content: stretch;
        column-gap: 6px;
    }
    .att-hm-li {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .att-hm-legend-items {
        grid-template-columns: repeat(4, max-content);
        justify-content: space-between;
        column-gap: 8px;
        padding: 0 4px;
    }
    .att-hm-li {
        justify-content: flex-start;
    }
}
/* Log Attendance: Date / Bulk status / Apply */

.att-log-form .att-date-bulk-row {
    align-items: flex-end;
}

/* Date input: same color + height as bulk status, text never clipped */
.att-log-form #attDate {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    height: var(--input-height);
    min-height: var(--input-height);
    padding: 0 10px;
    font-size: .8125rem;
    line-height: normal;
    background: var(--surface) !important;
    box-sizing: border-box;
}

.att-log-form #attDate::-webkit-date-and-time-value {
    text-align: left;
    margin: 0;
    min-height: 1.3em;
    line-height: 1.3;
}

.att-log-form #attDate::-webkit-datetime-edit,
.att-log-form #attDate::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.att-log-form #attDate::-webkit-calendar-picker-indicator {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0 0 0 6px;
    position: static;
    opacity: 1;
    padding: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

/* Icon follows right after the date text and always stays visible; only the text shrinks */
.att-log-form #attDate::-webkit-datetime-edit {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.att-log-form .att-bulk-controls > .att-status-select .att-status-select-trigger,
.att-log-form .att-bulk-status {
    height: var(--input-height);
    min-height: var(--input-height);
}

.att-log-form .att-bulk-controls .att-bulk-apply {
    height: var(--input-height);
    min-height: var(--input-height);
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.att-log-form .att-bulk-controls {
    align-items: flex-end;
}

.att-edit-error {
  font-size: .8rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  color: #fb7185;
  background: rgba(251, 113, 133, .12);
  border: 1px solid rgba(251, 113, 133, .35);
}
.att-edit-btn:hover { color: rgb(var(--accent, 36, 87, 214)); }

@media (max-width: 479.98px) {
    .att-log-form #attDate {
        font-size: .75rem;
        padding: 0 10px 0 8px;
    }
    .att-log-form #attDate::-webkit-calendar-picker-indicator {
        width: 13px;
        height: 13px;
        margin-left: 4px;
    }
    .att-log-form .att-bulk-controls {
        gap: 4px;
    }
    .att-log-form .att-bulk-controls > .att-status-select {
        flex: 0 0 104px;
        width: 104px;
        min-width: 0;
    }
    .att-log-form .att-bulk-controls > .att-status-select .att-status-select-trigger {
        padding-left: 8px;
        padding-right: 8px;
        font-size: .75rem;
    }
    .att-log-form .att-bulk-apply {
        padding-left: 10px;
        padding-right: 10px;
        font-size: .75rem;
    }
}

@media (max-width: 359.98px) {
    .att-log-form #attDate {
        font-size: .7rem;
        padding: 0 8px 0 6px;
    }
    .att-log-form .att-bulk-controls > .att-status-select {
        flex-basis: 94px;
        width: 94px;
    }
}