.staff-book-panel {
    display: block;
}

.staff-book-plan-share__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.staff-book-plan-share__fields {
    flex: 1 1 16rem;
}

.staff-book-plan-share__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--app-text-muted, #1e293b);
    margin-bottom: 0.35rem;
}

.staff-book-plan-share__inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
}

.staff-book-plan-share__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.staff-book-view-tabs {
    margin-bottom: 0.75rem;
}

.staff-book-section-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.staff-book-calendar-toolbar__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.75rem;
}

.staff-book-calendar-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.staff-book-calendar-toolbar__plan-row {
    margin-bottom: 0.65rem;
}

.staff-book-calendar-toolbar__hint {
    line-height: 1.4;
}

.staff-book-pnl-modal__kpi-row.home-kpi-row {
    margin-bottom: 0;
}

.staff-book-pnl-modal .module-kpi-strip {
    margin-bottom: 0;
}

.staff-plan-email-preview {
    max-height: 12rem;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    padding: 0.65rem 0.75rem;
    white-space: pre-wrap;
}

.staff-plan-email-preview--html {
    white-space: normal;
    max-height: 16rem;
}

.staff-plan-email-preview--html table {
    width: 100%;
    font-size: 0.8125rem;
}

.staff-book-toolbar {
    padding: 0;
}

.staff-book-kpi-loading {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--brand-card-border, #cbd5e1);
    border-radius: 0.55rem;
    background: #fff;
}

.staff-book-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.staff-book-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.staff-book-month-input {
    min-width: 9.5rem;
}

.staff-schedule-filters-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.staff-schedule-filters-row__left,
.staff-schedule-filters-row__right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.staff-schedule-filters-row__right {
    margin-left: auto;
    justify-content: flex-end;
    gap: 0.55rem;
}

.staff-book-collapse-summary {
    align-self: center;
    white-space: nowrap;
    padding: 0.15rem 0.35rem;
    border-radius: 0.3rem;
    background: rgba(148, 163, 184, 0.12);
}

.staff-book-card-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Alternating staff cards — same stripe pattern as student directory lists (#fff / mint) */
.staff-book-card-grid > .staff-book-card {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.staff-book-card-grid > .staff-book-card:nth-of-type(odd):not(.staff-book-card--collapsed) {
    background: #fff;
    box-shadow: none;
}

.staff-book-card-grid > .staff-book-card:nth-of-type(even):not(.staff-book-card--collapsed) {
    background: var(--app-row-stripe-mint, #b7dcc8);
    box-shadow: none;
}

.staff-book-card-grid > .staff-book-card:hover:not(.staff-book-card--collapsed) {
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.staff-book-card {
    border: 1px solid var(--brand-card-border, #cbd5e1);
    border-radius: 0.55rem;
    padding: 0.65rem 0.75rem;
}

.staff-book-card--horizontal {
    position: relative;
    display: block;
}

.staff-book-card__summary {
    display: none;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0.15rem 0.1rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.staff-book-card--collapsed .staff-book-card__summary {
    display: flex;
}

.staff-book-card__summary:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.06);
    border-radius: 0.35rem;
}

.staff-book-card__summary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.staff-book-card__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--app-text-muted, #1e293b);
    flex-shrink: 0;
}

.staff-book-card--collapsed .staff-book-card__index {
    color: #166534;
}

.staff-book-card__name .staff-book-card__index {
    margin-right: 0.35rem;
}

.staff-book-card__summary-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-sidebar-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

.staff-book-card__summary-sep {
    color: var(--app-text-muted-soft, #334155);
    font-size: 0.75rem;
}

.staff-book-card__summary-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: #15803d;
    letter-spacing: normal;
    text-transform: none;
}

.staff-book-card__summary-badge {
    display: none;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.staff-book-card--collapsed .staff-book-card__summary-badge--collapsed {
    display: inline-block;
    color: #166534;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(134, 239, 172, 0.8);
}

.staff-book-card__summary-icon {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid #86efac;
    border-radius: 0.3rem;
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.staff-book-card__body {
    display: grid;
    grid-template-columns: minmax(9rem, 11rem) minmax(6rem, auto) minmax(0, 1fr);
    gap: 0.65rem 0.85rem;
    align-items: start;
    overflow: hidden;
    max-height: 20rem;
    opacity: 1;
    padding-right: 1.75rem;
    transition: max-height 0.35s ease, opacity 0.28s ease, margin-top 0.28s ease;
}

.staff-book-card--collapsed {
    padding: 0.45rem 0.65rem;
    border-color: #86efac;
    background: rgba(34, 197, 94, 0.04);
}

.staff-book-card--scheduled-expanded {
    border-color: #cbd5e1;
}

.staff-book-card--collapsed .staff-book-card__body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.staff-book-card__collapse-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.45rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.3rem;
    background: #fff;
    color: var(--app-text-muted, #1e293b);
    padding: 0;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
}

.staff-book-card__collapse-btn:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.staff-book-card__collapse-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.staff-book-card__identity-col {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.staff-book-card__default-col {
    min-width: 0;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.75rem;
}

.staff-book-card__week-col {
    min-width: 0;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.75rem;
}

.staff-book-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.staff-book-card__body .staff-book-week-grid-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.staff-book-card__stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.35rem;
    margin-top: 0.15rem;
}

.staff-book-card__stat-pill {
    font-size: 0.5625rem;
    line-height: 1.2;
    color: var(--app-text-muted, #1e293b);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.12rem 0.3rem;
    white-space: nowrap;
}

.staff-book-card__stat-pill strong {
    font-weight: 600;
    color: #334155;
}

.staff-book-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.65rem;
}

.staff-book-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-sidebar-text, #0f172a);
}

.staff-book-card__meta {
    font-size: 0.6875rem;
    line-height: 1.3;
}

.staff-book-card__stats {
    display: flex;
    gap: 0.85rem;
    margin-left: auto;
}

.staff-book-card__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.staff-book-card__stat-label {
    font-size: 0.625rem;
    line-height: 1.2;
    color: var(--bs-secondary-color, #1e293b);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.staff-book-card__stat-value {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.staff-book-card__days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr));
    gap: 0.35rem;
}

.staff-book-card__days--row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.staff-book-day-chip--compact {
    min-height: 1.75rem;
    min-width: 2.35rem;
    width: auto;
    padding: 0.2rem 0.35rem;
}

.staff-book-day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.staff-book-day-chip.staff-book-day-pill {
    flex-direction: row;
    gap: 0;
    min-height: 1.65rem;
    min-width: 2.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    width: auto;
}

.staff-book-day-pill.is-on,
.staff-book-day-chip.staff-book-day-pill.is-on {
    border-color: #bae6fd;
    background: #e0f2fe;
    color: #0369a1;
}

.staff-book-card__default-col .staff-book-day-pill.is-on,
.staff-book-card__default-col .staff-book-day-chip.staff-book-day-pill.is-on {
    background: #e0f2fe;
    border-color: #38bdf8;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.55);
    color: #075985;
}

.staff-book-day-pill.is-off,
.staff-book-day-chip.staff-book-day-pill.is-off {
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: var(--app-text-muted-soft, #334155);
}

.staff-book-day-pill.is-holiday {
    border-color: #fde68a;
    background: #fef3c7;
    color: #92400e;
}

.staff-book-day-chip.staff-book-day-pill:hover:not(:disabled).is-on,
.staff-book-day-chip.staff-book-day-pill:focus-visible:not(:disabled).is-on {
    border-color: #7dd3fc;
    background: #dbeafe;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
}

.staff-book-card__default-col .staff-book-day-chip.staff-book-day-pill:hover:not(:disabled).is-on,
.staff-book-card__default-col .staff-book-day-chip.staff-book-day-pill:focus-visible:not(:disabled).is-on {
    border-color: #0ea5e9;
    background: #bae6fd;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.55), 0 0 0 2px rgba(14, 165, 233, 0.12);
    color: #0c4a6e;
}

.staff-book-day-chip.staff-book-day-pill:hover:not(:disabled).is-off,
.staff-book-day-chip.staff-book-day-pill:focus-visible:not(:disabled).is-off {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: var(--app-text-muted, #1e293b);
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.1);
}

.staff-book-week-grid__day-head {
    min-width: 4.25rem;
    vertical-align: bottom;
    padding: 0.35rem 0.2rem !important;
}

.staff-book-week-grid__day-head.is-scheduled {
    background: #ecfdf5;
    box-shadow: inset 0 -2px 0 #86efac;
}

.staff-book-week-grid__cell.is-scheduled {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.65);
}

.staff-book-week-grid__cell.is-exception.is-scheduled {
    background: linear-gradient(135deg, #ecfdf5 0%, #fef9c3 100%);
    box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.5);
}

.staff-book-card__section {
    margin-bottom: 0;
}

.staff-book-card__section-label {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--app-text-muted, #1e293b);
    margin-bottom: 0.3rem;
}

.staff-book-week-grid-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.staff-book-week-grid {
    font-size: 0.625rem;
}

.staff-book-week-grid--horizontal {
    table-layout: fixed;
    width: 100%;
    min-width: 22rem;
}

.staff-book-week-grid__row-label {
    width: 2.25rem;
    min-width: 2.25rem;
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--app-text-muted, #1e293b);
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.2rem 0.35rem !important;
}

.staff-book-week-grid__cell {
    vertical-align: middle;
    padding: 0.2rem 0.15rem !important;
}

.staff-book-week-grid__time-input {
    min-width: 0;
    width: 100%;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    font-size: 0.625rem;
}

.staff-book-week-grid__day-col {
    min-width: 4.5rem;
    vertical-align: middle;
}

.staff-book-week-grid__check-col {
    width: 2.75rem;
    vertical-align: middle;
}

.staff-book-week-grid__time-col {
    min-width: 5.5rem;
    vertical-align: middle;
}

.staff-book-week-grid__day-name {
    font-weight: 600;
}

.staff-book-week-grid__holiday-badge {
    display: block;
    font-size: 0.5625rem;
    color: #b45309;
    line-height: 1.2;
}

.staff-book-week-grid__row.is-exception,
.staff-book-week-grid__cell.is-exception {
    background: rgba(251, 191, 36, 0.08);
}

.staff-book-week-grid__row.is-holiday,
.staff-book-week-grid__cell.is-holiday,
.staff-book-week-grid__day-head.is-holiday {
    opacity: 0.65;
}

.staff-book-day-chip.is-saving {
    opacity: 0.6;
    pointer-events: none;
}

.staff-book-card__mode-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.55rem;
}

.staff-book-card__mode-toggle {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    overflow: hidden;
    background: #f8fafc;
}

.staff-book-card__mode-btn {
    border: 0;
    background: transparent;
    color: var(--app-text-muted, #1e293b);
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}

.staff-book-card__mode-btn.is-active {
    background: #fff;
    color: var(--brand-sidebar-text, #0f172a);
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.staff-book-card__mode-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.staff-book-card__week-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.staff-book-card__week-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.3rem;
    background: #fff;
    color: var(--app-text-muted, #1e293b);
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.staff-book-card__week-nav-btn:hover:not(:disabled) {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.staff-book-card__week-nav-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.staff-book-card__week-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--app-text-muted, #1e293b);
    white-space: nowrap;
}

.staff-book-card__reset-week {
    font-size: 0.625rem;
    text-decoration: none;
}

.staff-book-day-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-height: 3rem;
    padding: 0.3rem 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    background: #f8fafc;
    color: var(--app-text-muted, #1e293b);
    text-align: center;
    appearance: none;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.staff-book-day-chip:hover:not(:disabled),
.staff-book-day-chip:focus-visible:not(:disabled) {
    border-color: #7dd3fc;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
}

.staff-book-day-chip:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.staff-book-day-modal .staff-avail-times {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.staff-book-day-modal__toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.staff-book-day-chip.is-on:not(.staff-book-day-pill) {
    border-color: #86efac;
    background: rgba(34, 197, 94, 0.08);
    color: #166534;
}

.staff-book-day-chip.is-week-exception {
    box-shadow: inset 0 0 0 1px #fbbf24;
}

.staff-book-day-chip__label {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.1;
}

.staff-book-day-chip__time {
    font-size: 0.5625rem;
    line-height: 1.15;
    white-space: nowrap;
}

.staff-book-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.staff-book-card__hint {
    flex: 1 1 12rem;
    font-size: 0.625rem;
    line-height: 1.35;
}

.staff-book-card__schedule-btn {
    flex-shrink: 0;
}

.staff-book-card__stat-caption {
    font-size: 0.5625rem;
    line-height: 1.2;
    color: var(--bs-secondary-color, #1e293b);
}

@media (max-width: 991.98px) {
    .staff-book-card__body {
        grid-template-columns: 1fr;
    }

    .staff-book-card__default-col,
    .staff-book-card__week-col {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid #e2e8f0;
        padding-top: 0.55rem;
    }
}

@media (max-width: 575.98px) {
    .staff-book-card__stats {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .staff-book-card__stat {
        align-items: flex-start;
    }
}
