/* Roster day-column shift cards and shift-type badge controls. */

.roster-shift-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--app-border-alpha-70);
    border-radius: 0.65rem;
    background: var(--app-surface);
    background-clip: padding-box;
    overflow: hidden;
}

article.roster-shift-card:not(.roster-shift-card-create) {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--app-surface-2) 88%, var(--app-white)),
        color-mix(in srgb, var(--app-surface) 92%, var(--app-white))
    );
    border-color: var(--app-border-strong);
    box-shadow:
        0 0.45rem 0.95rem color-mix(in srgb, var(--app-bg) 74%, transparent),
        0 0 0 1px var(--app-white-alpha-03);
}

.roster-shift-card-fields {
    display: grid;
    grid-template-columns: minmax(5.75rem, 0.9fr) minmax(6.5rem, 1.35fr) minmax(5.75rem, auto);
    border-radius: calc(0.65rem - 1px);
    background: inherit;
    color: inherit;
    overflow: hidden;
    isolation: isolate;
}

.roster-shift-card-fields.has-end-times {
    grid-template-columns: repeat(2, minmax(5.1rem, 1fr));
}

.roster-shift-card-field {
    min-width: 0;
    border-left: 1px solid var(--app-border-alpha-70);
    background: inherit;
    color: inherit;
}

.roster-shift-card-field:first-child {
    border-left: 0;
}

.roster-shift-card-fields.has-end-times .roster-shift-card-field {
    border-top: 1px solid var(--app-border-alpha-70);
}

.roster-shift-card-fields.has-end-times .roster-shift-card-field:nth-child(-n + 2) {
    border-top: 0;
}

.roster-shift-card-fields.has-end-times .roster-shift-card-field:nth-child(odd) {
    border-left: 0;
}

.roster-shift-card-fields.has-end-times .roster-shift-card-staff {
    grid-column: 1 / 2;
    border-left: 0;
}

.roster-shift-card-fields.has-end-times .roster-shift-card-code {
    grid-column: 2 / 3;
}

.roster-shift-card-code {
    position: relative;
}

.roster-shift-card[data-roster-shift-colour^="palette-"]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border: 3px solid var(--roster-shift-type-colour);
    border-radius: calc(0.65rem - 1px);
}

.roster-shift-card .slot-cell-static,
.roster-shift-card .roster-shift-type-badge-label {
    height: 2.15rem;
    min-height: 2.15rem;
    background-color: transparent !important;
    color: inherit !important;
    font-size: var(--roster-text-sm);
}

.roster-shift-card-time .slot-cell-static {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.roster-shift-card.roster-shift-launcher {
    cursor: pointer;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.roster-shift-card-create {
    color: var(--app-muted);
}

.roster-shift-create-plus-card .roster-shift-create-plus {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.roster-shift-card.roster-shift-launcher:hover,
.roster-shift-card.roster-shift-launcher:focus-visible,
.roster-shift-card.roster-shift-launcher.is-roster-shift-group-highlighted {
    border-color: var(--app-accent-border-strong);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--app-surface-2) 86%, var(--app-accent) 14%),
        color-mix(in srgb, var(--app-surface) 88%, var(--app-accent) 12%)
    ) !important;
    box-shadow: 0 0 0 2px var(--app-accent-softer), 0 0.6rem 1.2rem var(--app-shadow-md-raw);
    transform: translateY(-1px);
}

.roster-shift-card.roster-shift-launcher:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
}

.roster-shift-card .is-roster-shift-publish-required .slot-cell-static,
.roster-shift-card .is-shift-type-required .roster-shift-type-badge {
    color: var(--app-warning-conflict-text) !important;
    font-weight: 800;
}

.roster-shift-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding-inline: 0.45rem;
    background: transparent !important;
    text-align: center;
    text-align-last: center;
}

.roster-shift-type-badge-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    min-height: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    line-height: 1.1;
}

.roster-shift-type-badge.is-empty {
    color: var(--app-muted) !important;
}

.roster-shift-type-badge.is-required {
    color: var(--app-warning-conflict-text) !important;
}

.roster-shift-card-code:has(.roster-shift-type-badge.is-required)::before {
    content: "!";
    position: absolute;
    top: 0.2rem;
    right: 0.25rem;
    z-index: 3;
    width: 0.78rem;
    height: 0.78rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-warning) 78%, var(--app-surface));
    color: var(--app-panel-bg);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 0.78rem;
    text-align: center;
}

.roster-shift-card-empty,
.roster-shift-card-closed {
    min-height: calc(var(--roster-row-height) + 1.9rem);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    background: color-mix(in srgb, var(--roster-empty) 82%, transparent);
    border-color: color-mix(in srgb, var(--app-border-alpha-70) 58%, transparent);
    box-shadow: none;
    opacity: 0.72;
}

.roster-shift-card-empty.roster-shift-create-plus-card {
    min-height: 2.15rem;
    color: var(--bs-success);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--app-success-soft) 42%, var(--app-surface-2)),
        color-mix(in srgb, var(--app-success-soft) 30%, var(--app-surface))
    );
    border-color: var(--app-success-border);
    box-shadow:
        0 0.38rem 0.8rem color-mix(in srgb, var(--app-bg) 76%, transparent),
        inset 0 0 0 1px var(--app-white-alpha-03);
    opacity: 1;
}

.roster-grid-frame[data-roster-end-times="true"] .roster-shift-card-empty.roster-shift-create-plus-card {
    min-height: 4.3rem;
}
