/*
 * Shared directory list row tones (student / attendance look).
 * Opt-in: add .directory-row-tones on the list/table, and
 * .directory-row--active | --inactive | --break | --scheduled | --walkin on each row.
 * Supports subgrid articles, table rows, and centre hours day rows.
 */

.directory-row-tones {
    --directory-row-hover: #fde68a;
    --directory-row-active-a: #ffffff;
    --directory-row-active-b: #c5e6d6;
    --directory-row-break-a: #fff7e6;
    --directory-row-break-b: #fde68a;
    --directory-row-inactive-a: #f1f5f9;
    --directory-row-inactive-b: #cbd5e1;
    --directory-row-scheduled-a: #ffffff;
    --directory-row-scheduled-b: #c5e6d6;
    --directory-row-walkin-a: #fff7e6;
    --directory-row-walkin-b: #fde68a;
}

/* --- Subgrid articles --- */
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--active,
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--inactive,
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--break,
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--scheduled,
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--walkin {
    transition: background-color 0.15s ease;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--active:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(odd),
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--scheduled:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(odd) {
    background: var(--directory-row-active-a) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--active:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(even),
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--scheduled:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(even) {
    background: var(--directory-row-active-b) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--break:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(odd),
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--walkin:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(odd) {
    background: var(--directory-row-break-a) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--break:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(even),
.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--walkin:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(even) {
    background: var(--directory-row-break-b) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--inactive:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(odd) {
    background: var(--directory-row-inactive-a) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article.directory-row--inactive:not(.student-card-row--total):not(.attendance-checkout-overdue-blink):nth-of-type(even) {
    background: var(--directory-row-inactive-b) !important;
}

.directory-list-panel .directory-card-subgrid-list.directory-row-tones > article:is(.directory-row--active, .directory-row--inactive, .directory-row--break, .directory-row--scheduled, .directory-row--walkin):not(.student-card-row--total):hover:not(.attendance-off-allocated-day):not(.attendance-on-allocated-day):not(.attendance-checkout-overdue-blink) {
    background: var(--directory-row-hover) !important;
    box-shadow: none !important;
}

/* --- Table body rows (e.g. invoicing) --- */
.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--active:nth-of-type(odd) > *,
.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--scheduled:nth-of-type(odd) > * {
    background-color: var(--directory-row-active-a) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--active:nth-of-type(even) > *,
.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--scheduled:nth-of-type(even) > * {
    background-color: var(--directory-row-active-b) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--break:nth-of-type(odd) > *,
.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--walkin:nth-of-type(odd) > * {
    background-color: var(--directory-row-break-a) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--break:nth-of-type(even) > *,
.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--walkin:nth-of-type(even) > * {
    background-color: var(--directory-row-break-b) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--inactive:nth-of-type(odd) > * {
    background-color: var(--directory-row-inactive-a) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr.directory-row--inactive:nth-of-type(even) > * {
    background-color: var(--directory-row-inactive-b) !important;
}

.directory-list-panel table.directory-row-tones > tbody > tr:is(.directory-row--active, .directory-row--inactive, .directory-row--break, .directory-row--scheduled, .directory-row--walkin):hover > * {
    background-color: var(--directory-row-hover) !important;
}

/* --- Centre operating-hours day rows (solid by open/closed; header is also a div) --- */
.directory-list-panel .directory-row-tones > .centre-hours-day-row.directory-row--active {
    background: var(--directory-row-active-b) !important;
    transition: background-color 0.15s ease;
}

.directory-list-panel .directory-row-tones > .centre-hours-day-row.directory-row--inactive {
    background: var(--directory-row-inactive-b) !important;
    transition: background-color 0.15s ease;
}

.directory-list-panel .directory-row-tones > .centre-hours-day-row:is(.directory-row--active, .directory-row--inactive):hover {
    background: var(--directory-row-hover) !important;
}
