.app-scheduler {
    --app-scheduler-border: #3a3e49;
    --app-scheduler-panel: #1f222b;
    --app-scheduler-panel-alt: #292d38;
    --app-scheduler-text: var(--text-color, #f3f4f6);
    position: relative;
    overflow: hidden;
    min-height: var(--app-scheduler-height, 750px);
    border: 1px solid var(--app-scheduler-border);
    border-radius: .45rem;
    background: var(--app-scheduler-panel);
    color: var(--app-scheduler-text);
    box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.app-scheduler-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    min-height: 3.6rem;
    padding: .55rem .7rem;
    border-bottom: 1px solid var(--app-scheduler-border);
    background: var(--app-scheduler-panel-alt);
}

.app-scheduler-navigation,
.app-scheduler-tools { display: flex; align-items: center; gap: .4rem; }
.app-scheduler-tools { justify-content: flex-end; }
.app-scheduler-title { margin: 0; font-size: 1.08rem; font-weight: 650; text-align: center; text-transform: capitalize; }
.app-scheduler-button { display: inline-flex; align-items: center; gap: .35rem; border-color: #505663; background: #343946; color: inherit; }
.app-scheduler-button:hover,
.app-scheduler-button:focus-visible { border-color: #777e8d; background: #414754; color: #fff; }
.app-scheduler-month-picker { width: 9.7rem; border-color: #505663; background-color: #20242d; color: inherit; color-scheme: dark; }

.app-scheduler-scroll {
    overflow: auto;
    max-height: calc(var(--app-scheduler-height, 750px) - 3.6rem);
    scrollbar-color: #555b68 #222630;
}

.app-scheduler-canvas { min-width: 54rem; }
.app-scheduler-header {
    position: sticky;
    z-index: 6;
    top: 0;
    display: grid;
    grid-template-columns: repeat(var(--app-scheduler-groups, 1), minmax(54rem, 1fr));
    border-bottom: 1px solid var(--app-scheduler-border);
    background: #252934;
}

.app-scheduler-resource-header + .app-scheduler-resource-header,
.app-scheduler-resource-week + .app-scheduler-resource-week { border-left: 3px solid #626977; }
.app-scheduler-resource-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.2rem;
    border-bottom: 1px solid var(--app-scheduler-border);
    background: #303542;
    font-weight: 650;
}
.app-scheduler-resource-title i { width: .75rem; height: .75rem; border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / 25%); }
.app-scheduler-weekdays,
.app-scheduler-resource-week { display: grid; grid-template-columns: repeat(7, minmax(7.7rem, 1fr)); }
.app-scheduler-weekdays > div { padding: .55rem .4rem; color: #c8cbd2; font-size: .8rem; font-weight: 650; text-align: center; text-transform: uppercase; }

.app-scheduler-weeks { min-height: calc(var(--app-scheduler-height, 750px) - 7rem); }
.app-scheduler-week {
    display: grid;
    grid-template-columns: repeat(var(--app-scheduler-groups, 1), minmax(54rem, 1fr));
    min-height: 7.1rem;
    border-bottom: 1px solid var(--app-scheduler-border);
}
.app-scheduler-day {
    min-width: 0;
    min-height: 7.1rem;
    padding: .3rem;
    border-right: 1px solid var(--app-scheduler-border);
    background: #20232c;
    outline: none;
    transition: background-color .12s, box-shadow .12s;
}
.app-scheduler-day:last-child { border-right: 0; }
.app-scheduler-day:focus-visible { position: relative; z-index: 2; box-shadow: inset 0 0 0 2px #79b9cb; }
.app-scheduler-day.is-outside { background: #191c23; color: #7f8490; }
.app-scheduler-day.is-today { box-shadow: inset 0 0 0 2px #dca54a; }
.app-scheduler-day.is-drop-target { background: #2c4650; box-shadow: inset 0 0 0 2px #6bc3d7; }
.app-scheduler-day-number { display: flex; justify-content: flex-end; min-height: 1.45rem; color: #c7cad2; font-size: .76rem; font-weight: 650; }
.app-scheduler-day.is-today .app-scheduler-day-number time { display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 50%; background: #dca54a; color: #17191f; }
.app-scheduler-day.is-outside .app-scheduler-day-number { color: #777c87; }
.app-scheduler-events { display: grid; gap: .25rem; }
.app-scheduler-no-events { visibility: hidden; height: 0; overflow: hidden; }

.app-scheduler-event {
    --app-scheduler-event-color: var(--app-scheduler-resource-color, #55a7b8);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .35rem;
    width: 100%;
    min-width: 0;
    padding: .25rem .38rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--app-scheduler-event-color) 72%, #fff 12%);
    border-left-width: .3rem;
    border-radius: .24rem;
    background: color-mix(in srgb, var(--app-scheduler-event-color) 72%, #20242d);
    color: #fff;
    cursor: pointer;
    font-size: .72rem;
    line-height: 1.2;
    text-align: left;
    box-shadow: 0 1px 2px rgb(0 0 0 / 28%);
}
.app-scheduler-event time { color: rgb(255 255 255 / 80%); font-variant-numeric: tabular-nums; }
.app-scheduler-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-scheduler-event:hover,
.app-scheduler-event:focus-visible { z-index: 2; filter: brightness(1.15); outline: 2px solid #fff; outline-offset: 1px; }
.app-scheduler-event.is-dragging { opacity: .45; }
.app-scheduler-event.status-0 { --app-scheduler-event-color: #b18416; }
.app-scheduler-event.status-1 { --app-scheduler-event-color: #16869a; }
.app-scheduler-event.status-2 { --app-scheduler-event-color: #24833a; }
.app-scheduler-event.status-3 { --app-scheduler-event-color: #b52f3c; }
.app-scheduler-event.status-4 { --app-scheduler-event-color: #646b72; }

.app-scheduler-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-scheduler.is-loading::after {
    content: "";
    position: absolute;
    z-index: 20;
    inset: 3.6rem 0 0;
    background: rgb(20 22 29 / 52%);
    cursor: wait;
}

.app-scheduler-dialog-backdrop {
    position: fixed;
    z-index: 1080;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgb(0 0 0 / 62%);
}
.app-scheduler-dialog {
    width: min(38rem, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid #4b5160;
    border-radius: .48rem;
    background: #252934;
    color: #f3f4f6;
    box-shadow: 0 18px 54px rgb(0 0 0 / 55%);
}
.app-scheduler-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid #444a57; }
.app-scheduler-dialog-header h3 { margin: 0; font-size: 1.08rem; }
.app-scheduler-dialog-header .app-scheduler-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-scheduler-dialog-body { display: grid; gap: .9rem; padding: 1rem; }
.app-scheduler-event-details { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .25rem .8rem; margin: 0; padding: .65rem .75rem; border-radius: .3rem; background: #1d2028; font-size: .84rem; }
.app-scheduler-event-details dt { color: #aeb3be; font-weight: 500; }
.app-scheduler-event-details dd { margin: 0; overflow-wrap: anywhere; }
.app-scheduler-editor-field { display: grid; gap: .25rem; }
.app-scheduler-editor-field .form-label { margin: 0; }
.app-scheduler-editor-field .form-control { border-color: #505663; background: #1d2028; color: #f3f4f6; color-scheme: dark; }
.app-scheduler-editor-error { min-height: 1.2rem; color: #ff9aa4; white-space: pre-line; }
.app-scheduler-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid #444a57; }

@media (max-width: 760px) {
    .app-scheduler-toolbar { grid-template-columns: 1fr auto; }
    .app-scheduler-title { grid-column: 1 / -1; grid-row: 1; }
    .app-scheduler-navigation { grid-row: 2; }
    .app-scheduler-tools { grid-row: 2; }
    .app-scheduler-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .app-scheduler-month-picker { width: 8.8rem; }
}
