:root {
    --primary: #A85D6A;
    --primary-hover: #8F4D59;
    --secondary: #10B981;
    --secondary-hover: #059669;
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --warning: #F59E0B;
    --background: #fbf7f8;
    --text-main: #342c2f;
    --text-muted: #756a6e;
    --glass-bg: rgba(255, 252, 253, 0.82);
    --glass-border: rgba(255, 255, 255, 0.74);
    --glass-shadow: 0 10px 30px rgba(112, 63, 74, 0.10);
}

/* Monthly work/holiday count settings */
.monthly-count-settings { display: grid; gap: 8px; width: 100%; }
.monthly-count-row { display: grid; grid-template-columns: minmax(140px,1.4fr) minmax(80px,.7fr) minmax(130px,1fr) minmax(110px,.8fr) auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--border-light); border-radius: 10px; background: rgba(255,255,255,.65); }
.monthly-count-row small { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 11px; }
.monthly-count-person { align-self: center; }
.monthly-count-person small { margin: 3px 0 0; }
.monthly-count-row input { width: 100px; }
.monthly-count-result { align-self: center; }
.monthly-count-result strong { margin-right: 5px; }
.monthly-count-badge { display: inline-block; width: fit-content; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: #fde7ec; color: #8f4d59; font-size: 10px; font-weight: 700; }
.monthly-count-badge.is-change { background: #fef3c7; color: #92400e; }
.monthly-count-actions { display: flex; gap: 6px; align-items: center; }
.monthly-count-actions .btn { padding: 7px 9px; font-size: 12px; }
.monthly-count-help { width: 100%; margin-top: 8px; font-size: 12px; line-height: 1.6; }
.monthly-manual-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.monthly-manual-day { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 6px; padding: 7px; border: 1px solid var(--border-light); border-radius: 8px; }
@media (max-width: 760px) {
    .monthly-count-row { grid-template-columns: 1fr 1fr; align-items: end; }
    .monthly-count-person, .monthly-count-actions { grid-column: 1 / -1; }
    .monthly-count-actions { flex-wrap: wrap; }
    .monthly-manual-grid { grid-template-columns: 1fr; }
}

.initial-setup-checklist {
    overflow: hidden;
    border: 1px solid rgba(168, 93, 106, .2);
    border-left: 5px solid var(--primary);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 5px 18px rgba(168, 93, 106, .08);
}

.initial-setup-checklist.is-complete { border-left-color: var(--secondary); }
.initial-setup-checklist > summary {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) minmax(120px, 240px);
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
}
.initial-setup-checklist > summary::-webkit-details-marker { display: none; }
.initial-setup-summary-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: rgba(168, 93, 106, .12);
    color: var(--primary);
}
.initial-setup-checklist.is-complete .initial-setup-summary-icon { background: rgba(16, 185, 129, .13); color: #047857; }
.initial-setup-checklist summary strong,
.initial-setup-checklist summary small { display: block; }
.initial-setup-checklist summary small { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.initial-setup-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.initial-setup-progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }
.initial-setup-checklist.is-complete .initial-setup-progress i { background: var(--secondary); }
.initial-setup-items { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0 14px 14px; }
.initial-setup-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 11px;
    border: 1px solid #ead8dc;
    border-radius: 11px;
    background: #fff;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}
.initial-setup-item:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(168, 93, 106, .1); }
.initial-setup-item.is-pending { border-color: rgba(245, 158, 11, .45); background: #fffbeb; }
.initial-setup-number { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #fde7ec; color: #8f4d59; font-size: 12px; font-weight: 800; }
.initial-setup-item.is-complete .initial-setup-number { background: #d1fae5; color: #047857; }
.initial-setup-item-text { min-width: 0; }
.initial-setup-item-text strong, .initial-setup-item-text small { display: block; }
.initial-setup-item-text strong { font-size: 13px; }
.initial-setup-item-text small { margin-top: 4px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.initial-setup-action { grid-column: 1 / -1; justify-self: end; color: var(--primary); font-size: 11px; font-weight: 700; }
.initial-setup-note { margin: 0 14px 14px; padding: 9px 11px; border-radius: 8px; background: #fff1f4; color: #475569; font-size: 11px; line-height: 1.5; }
.setup-section-focus { animation: setup-section-focus 1.8s ease; }
@keyframes setup-section-focus {
    0%, 45% { box-shadow: 0 0 0 4px rgba(168, 93, 106, .28), var(--glass-shadow); }
    100% { box-shadow: var(--glass-shadow); }
}

.master-settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(238, 242, 255, .78);
}
.master-settings-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
}
.master-settings-tabs button > i { color: var(--text-muted); font-size: 17px; }
.master-settings-tabs button span { text-align: left; }
.master-settings-tabs button strong, .master-settings-tabs button small { display: block; }
.master-settings-tabs button small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.master-settings-tabs button.active { border-color: rgba(168, 93, 106, .24); background: #fff; color: var(--primary); box-shadow: 0 3px 10px rgba(168, 93, 106, .1); }
.master-settings-tabs button.active > i { color: var(--primary); }
.master-settings-intro {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(236, 253, 245, .72);
}
.master-settings-intro.is-advanced { border-color: rgba(168, 93, 106, .2); background: rgba(238, 242, 255, .72); }
.master-settings-intro > i { color: #047857; }
.master-settings-intro.is-advanced > i { color: var(--primary); }
.master-settings-intro strong, .master-settings-intro small { display: block; }
.master-settings-intro small { margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.master-settings-grid.is-basic .master-setting-advanced,
.master-settings-grid.is-advanced .master-setting-basic { display: none; }

@media (max-width: 1050px) {
    .initial-setup-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .initial-setup-checklist > summary { grid-template-columns: auto 1fr; padding: 12px; }
    .initial-setup-progress { grid-column: 1 / -1; }
    .initial-setup-items { grid-template-columns: 1fr; padding: 0 10px 10px; }
    .initial-setup-item { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    .initial-setup-action { grid-column: auto; align-self: center; white-space: nowrap; }
    .initial-setup-note { margin: 0 10px 10px; }
    .master-settings-tabs { gap: 5px; padding: 4px; }
    .master-settings-tabs button { min-height: 52px; padding: 7px 8px; font-size: 12px; }
    .master-settings-tabs button > i { font-size: 14px; }
    .master-settings-intro { align-items: flex-start; padding: 10px; }
}

.training-period-list {
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(168, 93, 106, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
}

.training-period-list-title { font-weight: 700; margin-bottom: 8px; }
.training-period-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border-top: 1px solid rgba(100, 116, 139, .14); }
.training-period-card:first-of-type { border-top: 0; }
.training-period-card strong, .training-period-card span, .training-period-card small { display: block; }
.training-period-card span { margin-top: 2px; }
.training-period-card small { color: var(--text-muted); margin-top: 3px; }
.training-period-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.training-period-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.training-holiday-mode { display: grid; gap: 8px; margin: 14px 0; padding: 12px; border: 1px solid rgba(100, 116, 139, .25); border-radius: 10px; }
.training-holiday-mode legend { padding: 0 6px; font-weight: 700; }
.training-holiday-days { display: flex; flex-wrap: wrap; gap: 7px; max-height: 150px; overflow-y: auto; padding: 8px; border: 1px solid rgba(100, 116, 139, .2); border-radius: 9px; }
.training-holiday-days label { min-width: 62px; padding: 5px 7px; border-radius: 7px; background: rgba(255,255,255,.8); }
.training-period-note { margin-top: 12px; padding: 10px; border-radius: 9px; background: rgba(14, 165, 233, .08); font-size: 12px; line-height: 1.6; }

.holiday-work-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 12px 0; }
.holiday-work-controls label { display: grid; gap: 5px; font-weight: 700; }
.holiday-work-controls select { min-width: 140px; }
.holiday-work-exception-toggle { display: flex !important; align-items: center; padding: 9px 12px; border: 1px solid rgba(245, 158, 11, .35); border-radius: 9px; background: rgba(245, 158, 11, .08); }
.holiday-work-exception-toggle.is-strong { border-color: rgba(239, 68, 68, .4); background: rgba(254, 242, 242, .9); color: #991b1b; }
.holiday-work-maximum { display: grid; gap: 5px; min-width: 210px; padding: 9px 12px; border: 1px solid rgba(239, 68, 68, .4); border-radius: 9px; background: rgba(254, 242, 242, .9); color: #991b1b; font-weight: 700; }
.holiday-work-maximum .form-control { min-width: 180px; }
.holiday-work-candidate-list { display: grid; gap: 10px; margin-top: 14px; max-height: min(52vh, 540px); overflow-y: auto; padding-right: 4px; }
.holiday-work-candidate { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px; border: 1px solid rgba(16, 185, 129, .28); border-left: 4px solid var(--secondary); border-radius: 11px; background: rgba(236, 253, 245, .72); }
.holiday-work-candidate.has-exception { border-color: rgba(245, 158, 11, .35); border-left-color: var(--warning); background: rgba(255, 251, 235, .8); }
.holiday-work-candidate.has-strong-exception { border-color: rgba(239, 68, 68, .38); border-left-color: #ef4444; background: rgba(254, 242, 242, .9); }
.holiday-work-candidate-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.holiday-work-candidate-title span { padding: 2px 7px; border-radius: 999px; background: rgba(16, 185, 129, .13); color: #047857; font-size: 11px; font-weight: 700; }
.holiday-work-candidate p { margin: 6px 0; line-height: 1.5; }
.holiday-work-candidate small { color: var(--text-muted); }
.holiday-work-warning { margin-top: 7px; color: #92400e; font-size: 11px; }
.night-change-volume-warning { padding: 10px 12px; border: 1px solid #fdba74; border-radius: 9px; background: #fff7ed; font-size: 12px; line-height: 1.5; }
.holiday-work-summary { display: flex; align-items: center; justify-content: space-between; border-left: 4px solid var(--warning); }
.holiday-work-summary p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.schedule-adjustment-summary { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 14px 16px; border-left: 4px solid var(--warning); }
.schedule-adjustment-summary.is-night { border-left-color: #6366f1; background: rgba(238, 242, 255, .8); }
.schedule-adjustment-summary.is-holiday { border-left-color: var(--warning); }
.schedule-adjustment-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: rgba(245, 158, 11, .14); color: #b45309; }
.schedule-adjustment-summary.is-night .schedule-adjustment-icon { background: rgba(99, 102, 241, .14); color: #8f4d59; }
.schedule-adjustment-summary strong { display: block; line-height: 1.35; }
.schedule-adjustment-summary p { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin: 5px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.schedule-adjustment-count, .schedule-adjustment-exception { padding: 2px 7px; border-radius: 999px; background: rgba(99, 102, 241, .1); color: #8f4d59; font-weight: 700; }
.schedule-adjustment-summary.is-holiday .schedule-adjustment-count { background: rgba(245, 158, 11, .13); color: #92400e; }
.night-adjustment-candidate-list { display: grid; gap: 10px; margin-top: 14px; max-height: min(52vh, 540px); overflow-y: auto; }
.night-candidate-group-title { margin: 8px 2px 0; padding: 7px 10px; border-radius: 8px; background: rgba(168, 93, 106, .08); font-size: .95rem; }
.night-adjustment-candidate { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px; border: 1px solid rgba(168, 93, 106, .25); border-left: 4px solid var(--primary); border-radius: 11px; background: rgba(238, 242, 255, .72); }
.night-adjustment-candidate.has-exception { border-color: rgba(245, 158, 11, .4); border-left-color: var(--warning); background: rgba(255, 251, 235, .82); }
.night-adjustment-candidate p { margin: 6px 0; line-height: 1.5; }
.night-proposal-score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.night-proposal-score > div { padding: 12px; border-radius: 10px; background: rgba(238, 242, 255, .75); text-align: center; }
.night-proposal-score small, .night-proposal-score strong { display: block; }
.night-proposal-score strong { margin-top: 4px; font-size: 17px; }
.night-proposal-changes { max-height: 320px; margin-top: 12px; }

@media (max-width: 700px) {
    .training-period-form-grid { grid-template-columns: 1fr; }
    .training-period-card { align-items: flex-start; flex-direction: column; }
    .training-period-actions { width: 100%; }
    .training-period-actions .btn { flex: 1; }
    .holiday-work-candidate { align-items: stretch; flex-direction: column; }
    .holiday-work-candidate > .btn { width: 100%; }
    .night-adjustment-candidate { align-items: stretch; flex-direction: column; }
    .night-adjustment-candidate > .btn { width: 100%; }
    .night-proposal-score { grid-template-columns: 1fr; }
}

.shift-time-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0;
    padding: 14px;
    border: 1px solid rgba(168, 93, 106, 0.18);
    border-radius: 12px;
    background: rgba(238, 242, 255, 0.55);
}

.shift-time-settings .form-group { margin: 0; }
.shift-time-help { grid-column: 1 / -1; line-height: 1.55; }

.time-band-report {
    max-height: min(72vh, 760px);
    overflow-y: auto;
    padding: 0 4px 8px;
}

.time-band-report > p { line-height: 1.65; }
.time-band-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
    padding: 5px;
    border-radius: 12px;
    background: #fff1f4;
}

.time-band-tabs button {
    flex: 1 1 120px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
}

.time-band-tabs button.active {
    border-color: rgba(168, 93, 106, .25);
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 7px rgba(168, 93, 106, .12);
}

.time-band-view { display: none; }
.time-band-view.active { display: block; }
.time-band-view .time-band-day[hidden],
.time-band-view tr[hidden] { display: none !important; }
.time-band-subfilters {
    display: flex;
    gap: 7px;
    margin: 10px 0 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.time-band-subfilters button {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 7px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.time-band-subfilters button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.time-band-day {
    margin-top: 10px;
    border: 1px solid #ead8dc;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.time-band-day summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    background: #f8fafc;
}

.time-band-day .table-container { margin: 0; border-radius: 0; }
.time-band-day table { min-width: 420px; font-size: 13px; }
.time-band-day tr.is-shortage td { background: #fff1f2; color: #b91c1c; font-weight: 700; }
.time-band-warning, .time-band-note { margin: 10px 12px; padding: 9px 11px; border-radius: 8px; font-size: 13px; }
.time-band-warning { background: #fff7ed; color: #9a3412; }
.time-band-note { background: #eff6ff; color: #1e3a8a; }
.time-band-proposal-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}
.time-band-proposal-action small { color: var(--text-muted); }

.overtime-suggestion-list {
    display: grid;
    gap: 12px;
    max-height: min(65vh, 680px);
    overflow-y: auto;
    padding: 4px;
}
.overtime-suggestion {
    border: 1px solid #ead8dc;
    border-left: 5px solid var(--warning);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.overtime-suggestion-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #fff7ed;
}
.overtime-suggestion-head span { color: #9a3412; font-weight: 700; }
.overtime-candidate-list { display: grid; }
.overtime-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid #eef2f7;
}
.overtime-candidate > div { display: grid; gap: 3px; }
.overtime-candidate span, .overtime-candidate small { color: var(--text-muted); }
.overtime-candidate-actions { display: flex !important; grid-template-columns: 1fr; gap: 6px !important; min-width: 150px; }
.overtime-time-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.overtime-time-editor .form-group { margin: 0; }
.overtime-candidate.is-warning { background: #fffbeb; }
.overtime-candidate.is-strong { background: #fff1f2; }
.overtime-candidate.is-warning small { color: #92400e; font-weight: 700; }
.overtime-candidate.is-strong small { color: #b91c1c; font-weight: 700; }
.overtime-purpose-note {
    display: grid;
    gap: 3px;
    margin: 10px 0 16px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13px;
}
.overtime-purpose-note.is-staffing { border-color: #86efac; background: #f0fdf4; color: #166534; }
.overtime-purpose-note.is-other { background: #f8fafc; color: #475569; }
.overtime-purpose-badge {
    display: inline-block;
    width: fit-content;
    margin-bottom: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.overtime-purpose-badge.is-staffing { background: #dcfce7; color: #166534; }
.overtime-purpose-badge.is-other { background: #e2e8f0; color: #475569; }

@media (max-width: 640px) {
    .shift-time-settings { grid-template-columns: 1fr; padding: 10px; }
    .shift-time-help { grid-column: 1; }
    .time-band-report { max-height: 76vh; }
    .time-band-proposal-action, .overtime-suggestion-head, .overtime-candidate { align-items: stretch; flex-direction: column; }
    .time-band-proposal-action .btn, .overtime-candidate .btn { width: 100%; }
    .overtime-candidate-actions, .overtime-time-editor { grid-template-columns: 1fr; width: 100%; }
}

/* Companion staffing rules */
.companion-rule-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.companion-rule-list {
    display: grid;
    gap: 10px;
    max-height: min(58vh, 560px);
    overflow-y: auto;
    padding-right: 4px;
}

.companion-rule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    background: #fff;
}

.companion-rule-card.is-inactive {
    border-left-color: #94a3b8;
    background: #f8fafc;
    opacity: .76;
}

.companion-rule-main {
    min-width: 0;
}

.companion-rule-main p {
    margin: 5px 0;
}

.companion-rule-main small {
    color: var(--text-muted);
}

.companion-rule-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.badge-muted {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
}

.companion-candidates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 230px;
    overflow-y: auto;
    padding: 9px;
    border: 1px solid #ead8dc;
    border-radius: 10px;
    background: #f8fafc;
}

.companion-candidate {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
}

.companion-candidate small {
    grid-column: 2;
    color: #dc2626;
    font-size: 10px;
}

.companion-candidate.is-disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.companion-rule-help {
    margin: 8px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff1f4;
    color: #475569;
    font-size: 12px;
}

.companion-rule-help p {
    margin: 3px 0;
}

.companion-active-option {
    display: flex;
    align-items: center;
}

.help-icon-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
}

.staffing-rule-guide {
    margin: 0 0 20px;
    border: 1px solid #efc4cd;
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    overflow: hidden;
}

.staffing-rule-guide summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    color: #78434d;
    cursor: pointer;
    list-style: none;
}

.staffing-rule-guide summary::-webkit-details-marker { display: none; }
.staffing-rule-guide summary span { display: grid; gap: 2px; }
.staffing-rule-guide summary small { color: var(--text-muted); font-weight: 500; }

.staffing-rule-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 12px;
}

.staffing-rule-guide-grid > div {
    position: relative;
    padding: 13px 13px 13px 45px;
    border: 1px solid #fde7ec;
    border-radius: 10px;
    background: #fff;
}

.staffing-rule-guide-grid p { margin: 4px 0; font-size: 13px; }
.staffing-rule-guide-grid small { color: var(--text-muted); }
.staffing-rule-step {
    position: absolute;
    left: 12px;
    top: 12px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    font-weight: 800;
}

.staffing-rule-guide-note {
    margin: 0;
    padding: 10px 16px;
    background: #fff1f4;
    color: #475569;
    font-size: 12px;
}

.reduced-staffing-panel { padding: 24px; }
.reduced-staffing-summary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 16px 0; padding: 14px; border-radius: 11px; background: #fff1f4; text-align: center; }
.reduced-staffing-summary small, .reduced-staffing-summary strong { display: block; }
.reduced-staffing-summary strong { margin-top: 3px; color: var(--primary); font-size: 18px; }
.reduced-staffing-summary > i { color: #64748b; }
.reduced-staffing-count { width: 90px; }
.reduced-staffing-warning { margin-top: 14px; padding: 12px; border: 1px solid #fbbf24; border-radius: 9px; background: #fffbeb; color: #92400e; line-height: 1.5; }
.reduced-staffing-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.reduced-overtime-entries { display: grid; gap: 6px; min-width: 260px; }
.reduced-overtime-entry { display: grid; grid-template-columns: 75px 105px auto; align-items: end; gap: 6px; padding: 7px; border: 1px solid #dbeafe; border-radius: 8px; background: #eff6ff; }
.reduced-overtime-entry label { display: grid; gap: 2px; font-size: 11px; font-weight: 700; }
.reduced-overtime-entry .form-control { min-width: 0; padding: 7px; }
.reduced-overtime-add { margin-top: 6px; }
@media (max-width: 700px) {
    .reduced-overtime-entries { min-width: 220px; }
    .reduced-overtime-entry { grid-template-columns: 65px 95px auto; }
}

.rule-setting-preview {
    margin: 8px 0 16px;
    padding: 13px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    line-height: 1.6;
}

.rule-setting-preview p { margin: 4px 0 0; }
.rule-setting-preview small { color: var(--text-muted); }
.rule-setting-preview.is-warning { border-color: #f59e0b; background: #fffbeb; }
.rule-setting-warning { color: #b45309; font-weight: 700; }
.rule-setting-advice { color: #0369a1; }

.rule-help-content { display: grid; gap: 13px; line-height: 1.7; }
.rule-help-lead,
.rule-help-example,
.rule-help-caution { padding: 13px 14px; border-radius: 10px; }
.rule-help-lead { background: #fff1f4; }
.rule-help-example { border: 1px solid #a7f3d0; background: #ecfdf5; }
.rule-help-example span { color: #047857; font-size: 12px; font-weight: 800; }
.rule-help-caution { border: 1px solid #fde68a; background: #fffbeb; }
.rule-help-content p { margin: 4px 0 0; }
.rule-help-list { margin: 0; padding-left: 24px; }
.rule-help-list li + li { margin-top: 5px; }
.rule-help-actions { position: sticky; bottom: 0; padding-top: 12px; background: #fff; }

.standardized-help-content > section {
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.standardized-help-content > section > span {
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.standardized-help-content .rule-help-lead {
    border-color: #efc4cd;
    background: #fff1f4;
}

.standardized-help-content .rule-help-example {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.standardized-help-content .rule-help-caution {
    border-color: #fde68a;
    background: #fffbeb;
}

.standardized-help-content .rule-help-caution .rule-help-list {
    margin-top: 7px;
}

@media (max-width: 720px) {
    .companion-rule-card {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .companion-rule-actions .btn,
    .companion-rule-toolbar .btn {
        flex: 1;
    }

    .companion-rule-toolbar,
    .companion-rule-actions {
        width: 100%;
    }

    .companion-rule-grid,
    .companion-candidates {
        grid-template-columns: 1fr;
    }

    .staffing-rule-guide-grid {
        grid-template-columns: 1fr;
    }

    .staffing-rule-guide summary {
        padding: 11px 12px;
    }

    .staffing-rule-guide summary small {
        font-size: 10px;
    }

    .rule-help-content {
        font-size: 13px;
    }
}

/* Current schedule inspection and overtime records */
.schedule-overtime-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    bottom: auto;
    transform: translateX(-50%);
    /* Keep the badge above the shift itself, but below request markers and modals. */
    z-index: 3;
    max-width: calc(100% - 34px);
    padding: 1px 3px;
    border: 1px solid #f97316;
    border-radius: 5px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 8px;
    font-weight: 800;
    line-height: 12px;
    cursor: pointer;
}

.schedule-overtime-add {
    position: absolute;
    top: 2px;
    left: 50%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    transform: translateX(-50%);
    padding: 1px 3px;
    border: 1px solid #fdba74;
    border-radius: 5px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 8px;
    line-height: 12px;
    cursor: pointer;
    opacity: 0;
}

.shift-cell-container:hover .schedule-overtime-add,
.schedule-overtime-add:focus-visible { opacity: 1; }

.schedule-training-badge {
    position: absolute;
    left: 2px;
    top: 50%;
    bottom: auto;
    z-index: 8;
    transform: translateY(-50%);
    border: 1px solid #0ea5e9;
    border-radius: 4px;
    background: #ecfeff;
    color: #0369a1;
    font-size: 8px;
    font-weight: 800;
    line-height: 11px;
    padding: 0 2px;
    cursor: pointer;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    writing-mode: horizontal-tb;
    box-sizing: border-box;
}

.schedule-training-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    overflow: hidden;
    text-align: center;
    line-height: 8px;
}

.schedule-training-badge span {
    display: block;
    font-size: 7px;
    line-height: 8px;
}

.schedule-main-table .shift-cell-container.has-training-annotation .shift-select {
    padding-left: 18px;
}

.shift-cell-container .shift-select.shift-short-long {
    font-size: 10px;
    letter-spacing: -0.5px;
}

.shift-cell-container .shift-select.shift-short-extra-long {
    font-size: 8px;
    letter-spacing: -1px;
}

.schedule-main-table .shift-cell-container.has-training-annotation .shift-select.shift-short-long {
    font-size: 7px;
    letter-spacing: -1px;
}

@media (max-width: 720px) {
    .schedule-training-badge {
        left: 18%;
        right: 18%;
        top: auto;
        bottom: 1px;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 3px;
        min-height: 3px;
        padding: 0;
        border: 0;
        border-radius: 2px;
        background: #0ea5e9;
        color: transparent;
        overflow: hidden;
        transform: none;
    }
    .schedule-training-badge span { display: none; }
    .schedule-main-table .shift-cell-container.has-training-annotation .shift-select { padding-left: 2px; }
}

.schedule-inspection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-left: 4px solid #0ea5e9;
}

.schedule-inspection-summary p { margin-top: 5px; font-size: 13px; }
.previous-consecutive-source { margin: 0; width: min(100%, 390px); }
.previous-consecutive-source .form-control { width: 100%; }
.previous-consecutive-source small { display: block; margin-top: 4px; }
.night-target-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.night-target-guidance { margin-top: 10px; font-size: 11px; line-height: 1.6; }
.schedule-inspection-summary.is-stale { border-left-color: #f59e0b; background: #fffbeb; }
.inspection-list { display: grid; gap: 10px; max-height: 58vh; overflow-y: auto; margin-top: 14px; padding: 2px; }
.inspection-filter-tabs {
    display: flex;
    gap: 7px;
    margin-top: 14px;
    padding-bottom: 3px;
    overflow-x: auto;
}
.inspection-filter-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    cursor: pointer;
}
.inspection-filter-tabs button span { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #e2e8f0; font-size: 11px; text-align: center; }
.inspection-filter-tabs button.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.inspection-filter-tabs button.active span { background: rgba(255,255,255,.22); }
.inspection-overtime-create { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 12px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; }
.inspection-overtime-create[hidden] { display: none; }
.inspection-overtime-create small { color: #9a3412; }
.inspection-related-overtime { display: grid; gap: 6px; margin-top: 9px; padding: 9px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; }
.inspection-related-overtime > b { color: #1e3a8a; font-size: 12px; }
.inspection-related-overtime-row { display: grid; grid-template-columns: auto minmax(90px, 1fr) minmax(120px, auto) auto; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; background: #fff; font-size: 12px; }
.inspection-related-overtime-row .btn { padding: 5px 8px; font-size: 11px; }
.inspection-overtime-status { padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.inspection-overtime-status.is-provisional { background: #fef3c7; color: #b45309; }
.inspection-overtime-status.is-confirmed { background: #d1fae5; color: #047857; }
@media (max-width: 700px) {
    .inspection-related-overtime-row { grid-template-columns: auto 1fr auto; }
    .inspection-related-overtime-row > span:nth-of-type(2) { grid-column: 2 / 4; }
    .inspection-related-overtime-row .btn { grid-column: 3; grid-row: 1; }
}
.inspection-issue { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; border: 1px solid #fbbf24; border-left: 5px solid #f59e0b; border-radius: 10px; background: #fffbeb; }
.inspection-issue[hidden], .inspection-filter-empty[hidden] { display: none !important; }
.inspection-issue.is-major { border-color: #fca5a5; border-left-color: #ef4444; background: #fef2f2; }
.inspection-issue.is-handled { border-left-color: #10b981; background: #ecfdf5; }
.inspection-issue.is-handled .inspection-severity-label { background: #d1fae5; color: #047857; }
.inspection-approval-notice { margin: 12px 0; padding: 12px 14px; border: 1px solid #86efac; border-radius: 10px; background: #f0fdf4; color: #166534; }
.inspection-approval-notice p { margin: 5px 0 0; font-size: 13px; }
.schedule-count-cell.is-approved { box-shadow: inset 0 0 0 3px #10b981; }
.schedule-count-approved { position: absolute; top: 1px; right: 2px; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: #059669; color: #fff; font-size: 9px; line-height: 1; }
.schedule-count-cell .schedule-direct-count { display: inline; }
.schedule-support-count { display: inline-flex; align-items: center; justify-content: center; margin-left: 2px; padding: 1px 3px; border: 1px solid #14b8a6; border-radius: 4px; background: #f0fdfa; color: #0f766e; font-size: 9px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.schedule-count-cell.is-support-covered { box-shadow: inset 0 0 0 2px #14b8a6; }
.inspection-issue.is-response-pending { border-left-color: #f59e0b; background: #fffbeb; }
.inspection-issue.is-response-review { border-left-color: #f97316; background: #fff7ed; }
.inspection-issue-main { width: 100%; min-width: 0; overflow-wrap: break-word; }
.inspection-label-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inspection-category-label, .inspection-severity-label { display: inline-flex; width: fit-content; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.inspection-category-label.is-staffing { background: #dbeafe; color: #1d4ed8; }
.inspection-category-label.is-timeband { background: #ede9fe; color: #6d28d9; }
.inspection-category-label.is-overtime { background: #e0f2fe; color: #0369a1; }
.inspection-category-label.is-rules { background: #d1fae5; color: #047857; }
.inspection-category-label.is-other { background: #e2e8f0; color: #475569; }
.inspection-severity-label { background: #fef3c7; color: #b45309; }
.inspection-issue.is-major .inspection-severity-label { background: #fee2e2; color: #b91c1c; }
.inspection-issue strong { display: block; margin: 3px 0; }
.inspection-issue p { font-size: 13px; }
.inspection-issue > div > span { font-size: 11px; font-weight: 800; color: #b45309; }
.inspection-issue.is-major > div > span { color: #b91c1c; }
.inspection-issue-actions { display: flex; width: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(148, 163, 184, .28); }
.inspection-issue-actions .btn { padding: 7px 9px; font-size: 12px; }
.inspection-action-target { margin-bottom: 12px; padding: 12px 14px; border-left: 4px solid #ef4444; border-radius: 9px; background: #fef2f2; }
.inspection-action-target p { margin: 5px 0 0; font-size: 13px; }
.inspection-action-groups { display: grid; gap: 10px; }
.inspection-action-groups section { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; border: 1px solid rgba(148, 163, 184, .3); border-radius: 10px; background: rgba(248, 250, 252, .8); }
.inspection-action-groups section.is-lower-priority { border-style: dashed; background: rgba(248, 250, 252, .55); }
.inspection-action-groups section > div:first-child { min-width: 0; }
.inspection-action-groups section > .btn {
    flex: 0 0 150px;
    width: 150px;
    min-height: 58px;
    padding: 10px 12px;
    line-height: 1.35;
    text-align: center;
}
.inspection-action-groups b, .inspection-action-groups small { display: block; }
.inspection-action-groups small { margin-top: 4px; color: var(--text-muted); line-height: 1.45; }
.inspection-action-buttons { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.holiday-work-candidate > .btn {
    flex: 0 0 150px;
    width: 150px;
    min-height: 48px;
    padding: 9px 12px;
    line-height: 1.35;
    text-align: center;
}
.holiday-work-modal .schedule-version-buttons .btn {
    min-width: 150px;
    min-height: 44px;
}
.glass-modal.inspection-modal { width: min(94vw, 860px); max-width: 860px; }
.inspection-filter-empty { padding: 22px; border: 1px dashed #cbd5e1; border-radius: 10px; color: var(--text-muted); text-align: center; }
.shortage-response-target { margin-bottom: 14px; padding: 12px; border-radius: 9px; background: #f8fafc; border: 1px solid #e2e8f0; }
.shortage-response-target p { margin-top: 4px; font-size: 13px; }
.shortage-response-list { display: grid; gap: 7px; margin-top: 10px; }
.shortage-response-item { padding: 9px; border: 1px solid #fbbf24; border-radius: 8px; background: rgba(255,255,255,.7); }
.shortage-response-item.resolved { border-color: #6ee7b7; }
.shortage-response-item.needs-review { border-color: #fb923c; }
.shortage-response-item > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.shortage-response-item span { font-size: 11px; font-weight: 800; color: #b45309; }
.shortage-response-item.resolved span { color: #047857; }
.shortage-response-item p { margin-top: 4px; font-size: 12px; }
.shortage-response-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 7px; }
.shortage-response-actions button { padding: 4px 7px; border: 1px solid #cbd5e1; border-radius: 5px; background: white; cursor: pointer; font-size: 11px; }
.shortage-response-actions button.is-danger { color: #dc2626; border-color: #fecaca; }
.inspection-empty, .inspection-stale-message, .final-confirmation-warning { padding: 14px; border-radius: 10px; background: #f0fdf4; }
.inspection-stale-message, .final-confirmation-warning { background: #fff7ed; color: #9a3412; }
.final-confirmation-warning ul { margin: 8px 0 0 20px; }
.final-confirmation-check { display: block; margin-top: 15px; padding: 12px; border: 1px solid #fdba74; border-radius: 8px; }
.first-edition-restore-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 14px; border: 1px solid #efc4cd; border-radius: 10px; background: #fff1f4; }
.first-edition-restore-summary span { color: var(--primary); font-weight: 800; }
.first-edition-removal-warning { padding: 14px; border: 1px solid #fca5a5; border-radius: 10px; background: #fef2f2; color: #991b1b; line-height: 1.55; }
.first-edition-removal-warning ul { margin: 8px 0 8px 22px; }
.first-edition-removal-warning.is-final { margin-bottom: 16px; border-width: 2px; }
.schedule-inspection-focus { outline: 4px solid #f97316 !important; outline-offset: -4px; animation: inspection-focus-pulse .7s ease-in-out 3; }
@keyframes inspection-focus-pulse { 50% { outline-color: #fde047; } }
.overtime-target { margin-bottom: 14px; padding: 10px; border-radius: 8px; background: #fff7ed; font-weight: 700; }
.overtime-hours-row { display: flex; align-items: center; gap: 12px; }
.overtime-hours-row .form-control { flex: 1; }
.overtime-record { padding: 14px; margin-bottom: 10px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; }
.overtime-record > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
tr.is-warning td { background: #fffbeb; }
tr.is-strong td { background: #fef2f2; color: #b91c1c; font-weight: 700; }

@media (max-width: 760px) {
    .night-target-actions { align-items: stretch; flex-direction: column; }
    .night-target-actions .btn { width: 100%; }
    .overtime-column-toggle { display: none !important; }
    .schedule-overtime-badge { top: 2px; left: 50%; bottom: auto; transform: translateX(-50%); width: 7px; height: 7px; min-width: 7px; padding: 0; border: 0; border-radius: 50%; background: #f97316; color: transparent; overflow: hidden; }
    .schedule-overtime-add { width: 9px; height: 9px; min-width: 9px; padding: 0; border-radius: 50%; color: transparent; overflow: hidden; opacity: .55; }
    .schedule-overtime-add i { display: none; }
    .inspection-issue, .schedule-inspection-summary { align-items: stretch; flex-direction: column; }
    .inspection-issue-actions .btn { flex: 1 1 calc(50% - 6px); }
    .inspection-issue-actions { flex-wrap: wrap; }
    .inspection-action-groups section { align-items: stretch; flex-direction: column; }
    .inspection-action-groups section > .btn, .inspection-action-buttons .btn { width: 100%; }
    .inspection-action-groups section > .btn, .holiday-work-candidate > .btn {
        flex-basis: auto;
        width: 100%;
    }
    .holiday-work-modal .schedule-version-buttons .btn {
        width: 100%;
        min-width: 0;
    }
    .inspection-action-buttons { display: grid; width: 100%; }
    .shortage-response-item > div:first-child { align-items: flex-start; flex-direction: column; }
}

.work-rule-employee-settings {
    padding: 10px 12px;
    border: 1px solid rgba(168, 93, 106, 0.18);
    border-radius: 8px;
    background: rgba(168, 93, 106, 0.05);
}

.work-rule-employee-settings small {
    display: block;
    margin-top: 4px;
}

.work-rule-item {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #ead8dc;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.52);
}

.work-rule-item-head {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 0.9fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 7px;
}

.work-rule-item-head label {
    margin: 0;
}

.work-rule-source {
    min-width: 0;
}

.staffing-count-settings {
    padding: 12px;
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 8px;
    background: rgba(224, 242, 254, 0.4);
}

.staffing-count-settings > small {
    display: block;
    margin: 4px 0 9px;
}

.staffing-count-option,
.staffing-count-settings > label {
    display: block;
    margin-top: 7px;
    font-weight: 500;
}

.staffing-count-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.staffing-count-badge {
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 600px) {
    .work-rule-item-head {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

#modal-container.employee-edit-modal {
    width: min(96vw, 980px);
    max-width: 980px;
    max-height: 94vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.employee-edit-modal > .modal-header {
    margin: 0;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.employee-edit-modal > .employee-template-picker {
    margin: 12px 20px 0;
}

.employee-edit-scroll {
    min-height: 0;
    flex: 1 1 auto;
    padding: 18px 20px 28px;
    overflow-x: hidden;
    overflow-y: auto;
}

.employee-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    width: 100%;
    min-width: 0;
}

.employee-edit-column {
    min-width: 0;
}

.employee-settings-section-heading {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #fff1f4;
}

.employee-settings-section-heading.is-exception {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.employee-settings-section-heading > div,
.employee-settings-preview-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.employee-settings-section-heading i {
    width: 20px;
    color: var(--primary);
    text-align: center;
}

.employee-settings-section-heading.is-exception i { color: #b45309; }
.employee-settings-section-heading span,
.employee-settings-preview-title span { display: flex; flex-direction: column; gap: 1px; }
.employee-settings-section-heading strong { font-size: 15px; }
.employee-settings-section-heading small,
.employee-settings-preview-title small { color: var(--text-muted); font-size: 10px; font-weight: 500; }

.employee-setting-intro {
    margin: -3px 2px 10px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
}

.employee-workplace-settings {
    margin: 10px 0 14px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.employee-workplace-settings .form-group:last-child { margin-bottom: 0; }

.employee-workplace-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.employee-workplace-badge.is-unset { background: #fef3c7; color: #92400e; }
.employee-workplace-support { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; }

.employee-edit-column .grid-cols-2 {
    min-width: 0;
}

.employee-form-accordion {
    margin: 12px 0;
    border: 1px solid #ead8dc;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.8);
    overflow: hidden;
}

.employee-form-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.employee-form-accordion > summary::-webkit-details-marker { display: none; }
.employee-form-accordion > summary::after { content: '›'; margin-left: auto; font-size: 20px; transform: rotate(90deg); transition: transform .15s ease; }
.employee-form-accordion[open] > summary::after { transform: rotate(-90deg); }
.employee-form-accordion > summary small { color: var(--text-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.employee-accordion-content { padding: 0 12px 14px; }
.employee-detail-settings > summary { background: #f8fafc; }

.employee-settings-preview {
    margin-top: 18px;
    padding: 15px 16px;
    border: 1px solid #efc4cd;
    border-radius: 12px;
    background: #fffafb;
}

.employee-settings-preview-title {
    margin-bottom: 10px;
    color: #78434d;
}

.employee-settings-preview-title > i { font-size: 18px; }
.employee-settings-preview-title strong { font-size: 14px; }
#employee-settings-preview-text { display: grid; gap: 4px; color: #334155; font-size: 12px; line-height: 1.55; }

.employee-settings-warning,
.employee-settings-valid {
    margin-top: 11px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
}

.employee-settings-warning { border: 1px solid #fbbf24; background: #fffbeb; color: #92400e; }
.employee-settings-warning ul { margin: 5px 0 0 18px; }
.employee-settings-valid { border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857; font-weight: 700; }

.workplace-master-toggle {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #ead8dc;
    border-radius: 9px;
    background: #f8fafc;
    cursor: pointer;
}

.workplace-master-toggle input { margin-top: 3px; }
.workplace-master-toggle span { display: flex; flex-direction: column; gap: 2px; }
.workplace-master-toggle small { color: var(--text-muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.workplace-settings-fields { margin-top: 12px; padding: 12px; border-radius: 10px; background: #eff6ff; }
.workplace-settings-fields .workplace-master-toggle { margin-bottom: 12px; background: #fff; }

.employee-taboo-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 9px 0;
}

.employee-taboo-tab {
    padding: 8px 4px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.employee-taboo-tab.is-active { border-color: var(--primary); background: #fff1f4; color: var(--primary); }
.employee-taboo-panel { display: none; }
.employee-taboo-panel.is-active { display: block; }
.employee-taboo-list { max-height: 210px; padding: 9px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.employee-taboo-search { margin-top: 4px; }

.employee-edit-actions {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.97);
}

@media (max-width: 760px) {
    #modal-container.employee-edit-modal { width: calc(100vw - 16px); max-height: 96vh; border-radius: 12px; }
    .employee-edit-modal > .modal-header { padding: 13px 14px; }
    .employee-edit-modal > .employee-template-picker { margin: 8px 10px 0; }
    .employee-edit-scroll { padding: 12px 10px 24px; }
    .employee-edit-grid { grid-template-columns: 1fr; gap: 8px; }
    .employee-edit-column .grid-cols-2 { grid-template-columns: 1fr; gap: 0; }
    .employee-edit-actions { flex-wrap: wrap; padding: 9px 10px; }
    .employee-edit-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 9px 7px; font-size: 12px; }
    .employee-edit-actions .btn-primary { flex-basis: 100%; order: -1; }
    .employee-form-accordion > summary { align-items: flex-start; flex-wrap: wrap; padding: 11px; }
    .employee-taboo-tabs { grid-template-columns: repeat(2, 1fr); }
    .employee-settings-preview { margin-top: 10px; padding: 12px; }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #fffdfd 0%, #fbecef 44%, #f2dce1 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 24px;
}

.glass-panel {
    background: rgba(255, 252, 253, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
}

.generation-log-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.generation-log-summary.has-review {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.generation-log-summary.is-clear {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.generation-log-group {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
}

.generation-log-group > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}

.generation-log-group.is-review > summary {
    color: #c2410c;
    background: #fffaf5;
}

.generation-log-group.is-night > summary {
    color: #8f4d59;
    background: #fffafb;
}

.generation-log-group.is-technical > summary {
    color: #64748b;
    background: #f8fafc;
}

.generation-log-group[open] > summary {
    border-bottom: 1px solid #e2e8f0;
}

.generation-log-group-body {
    padding: 8px 12px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
}

.generation-log-group-body p {
    margin: 0 0 6px;
    color: var(--text-muted);
}

.generation-log-group-body ul {
    margin: 0;
    padding-left: 20px;
}

/* Views */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Login View */
#login-view {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    margin-bottom: 24px;
}

.kokorote-login-logo {
    width: min(100%, 350px);
    height: 100px;
    margin: 0 auto 22px;
}

.kokorote-login-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.instance-identity-panel {
    display: grid;
    gap: 5px;
    margin: -10px 0 18px;
    padding: 10px 12px;
    border: 1px solid #efc4cd;
    border-radius: 10px;
    background: #fff1f4;
    text-align: left;
}

.instance-identity-panel span { color: var(--text-muted); font-size: 10px; }
.instance-identity-panel strong { color: #78434d; font-size: 15px; }

.logo i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.login-mode-title,
.login-mode-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #78434d;
}

.login-mode-title strong,
.login-mode-heading strong { font-size: 20px; }
.login-mode-title small,
.login-mode-heading small { color: var(--text-muted); font-size: 12px; font-weight: 500; }

.login-mode-heading {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #efc4cd;
    border-radius: 12px;
    background: #fff5f7;
    text-align: left;
}

.login-mode-heading i { font-size: 20px; }
.login-mode-heading div { display: grid; gap: 3px; }
.login-identity-field { width: 100%; margin-bottom: 0; }
.login-identity-field .form-control { height: 48px; background: white; }
.login-submit-button { width: 100%; height: 48px; margin-top: 2px; font-size: 16px; }

.login-mode-switch {
    align-self: center;
    border: 0;
    background: transparent;
    color: #80545d;
    padding: 7px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.login-mode-switch:hover { color: var(--primary); text-decoration: underline; }
.login-mode-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.admin-recovery-link { margin-top:-8px; color:#9a5261; }
.admin-recovery-panel { margin-top:0; }
.admin-recovery-panel .password-change-icon { color:var(--primary); font-size:30px; text-align:center; }

/* Main Layout */
#main-view {
    min-height: 100vh;
}

.glass-sidebar {
    width: 260px;
    background: rgba(255, 250, 251, 0.88);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.kokorote-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #843f4d;
    font-size: 21px;
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.kokorote-sidebar-brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    object-fit: cover;
}

.kokorote-sidebar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-instance-name {
    overflow: hidden;
    color: #78434d;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workplace-view-switch,
.staffing-workplace-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(168, 93, 106, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.workplace-view-switch button {
    border: 1px solid #efc4cd;
    border-radius: 999px;
    padding: 8px 18px;
    background: white;
    color: #78434d;
    font-weight: 700;
    cursor: pointer;
}

.workplace-view-switch button.active {
    color: white;
    border-color: var(--primary);
    background: var(--primary);
}

.staffing-workplace-switch > span {
    margin-right: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.schedule-workplace-badge {
    position: absolute;
    left: 2px;
    bottom: 2px;
    z-index: 7;
    min-width: 20px;
    height: 17px;
    padding: 0 3px;
    border: 1px solid #dfa3af;
    border-radius: 5px;
    background: rgba(238, 242, 255, 0.96);
    color: #78434d;
    font-size: 9px;
    line-height: 15px;
    font-weight: 800;
    cursor: pointer;
}

.schedule-workplace-badge.is-support {
    border-color: #f59e0b;
    background: #fff7ed;
    color: #c2410c;
}

@media (max-width: 720px) {
    .workplace-view-switch,
    .staffing-workplace-switch {
        position: sticky;
        left: 0;
        padding: 7px;
        gap: 5px;
    }
    .workplace-view-switch button,
    .staffing-workplace-switch .btn {
        min-height: 34px;
        padding: 6px 12px;
        font-size: 12px;
    }
    .staffing-workplace-switch > span {
        width: 100%;
        font-size: 11px;
    }
    .schedule-workplace-badge {
        left: 1px;
        bottom: 1px;
        min-width: 14px;
        height: 14px;
        border-radius: 50%;
        padding: 0;
        overflow: hidden;
        color: transparent;
        font-size: 0;
    }
}


.badge {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
}

.nav-menu {
    list-style: none;
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255, 240, 244, 0.92);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(168, 93, 106, 0.3);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.content-area {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.top-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(255, 250, 251, 0.76);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fffdfd;
    padding: 8px 16px;
    border-radius: 99px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-weight: 600;
}

.month-selector button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.month-selector button:hover {
    color: var(--primary);
}

.mobile-menu-toggle,
.sidebar-backdrop,
.portrait-request-dot,
.schedule-scroll-hint {
    display: none;
}

.page-content {
    padding: 32px;
    flex-grow: 1;
    animation: fadeIn 0.3s ease;
    min-width: 0;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(168, 93, 106, 0.18);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.btn.btn-success { background: #059669; border: 1px solid #047857; color: #fff; }
.btn.btn-success:hover:not(:disabled) { background: #047857; transform: translateY(-1px); }

.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

/* 注意を伴うものの、実行できる操作であることが分かる色 */
.btn.btn-warning {
    background: var(--warning);
    border: 1px solid #d97706;
    color: #451a03;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.2);
}

.btn.btn-warning:hover:not(:disabled) {
    background: #d97706;
    color: #fff;
    transform: translateY(-1px);
}

.btn.btn-warning:focus-visible {
    outline: 3px solid rgba(245, 158, 11, 0.35);
    outline-offset: 2px;
}

.btn.btn-warning:disabled {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(0,0,0,0.05);
}

.generation-warning-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px;
    line-height: 1.5;
}
.generation-warning-summary strong {
    font-size: 15px;
}
.generation-warning-summary span {
    font-size: 13px;
}
.generation-warning-details {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border: 1px solid #f3d5b7;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}
.generation-warning-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.generation-warning-details ul {
    max-height: min(40vh, 320px);
    overflow-y: auto;
    margin: 10px 0 0;
    padding-left: 20px;
}
.generation-warning-detail-list {
    max-height: min(40vh, 320px);
    overflow-y: auto;
    margin-top: 10px;
}

.work-rule-reset-button {
    width: auto;
    min-height: 0;
    padding: 5px 10px;
    border: 1px solid #e7b8c1;
    border-radius: 8px;
    background: #fff0f3;
    color: #8f4d59;
    font-size: 12px;
    line-height: 1.3;
    box-shadow: none;
}
.work-rule-reset-button:hover {
    background: #fbe1e8;
}

/* 操作できないボタンだけをグレーに統一する */
.btn:disabled {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    transition: all 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 93, 106, 0.2);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 100%;
    width: 100%;
    display: block;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}
th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
}
tbody tr:hover {
    background: #F9FAFB;
}

/* Shift Table Specifics */
.shift-table th, .shift-table td {
    padding: 4px;
    text-align: center;
    border: 1px solid #E5E7EB;
    min-width: 40px;
    font-size: 14px;
}
.shift-cell {
    width: 100%;
    height: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
}
.shift-match {
    background-color: #D1FAE5; /* Green */
    color: #065F46;
}
.shift-mismatch {
    background-color: #FEE2E2; /* Red */
    color: #991B1B;
}
.shift-select {
    width: 100%;
    height: 100%;
    min-height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    text-align-last: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    margin: 0;
}
.shift-select:hover {
    background: rgba(0, 0, 0, 0.05);
}
.shift-select:focus {
    outline: none;
    background: rgba(168, 93, 106, 0.1);
}

.schedule-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 8px;
}

.schedule-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.schedule-action-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-learn-button {
    border-color: var(--secondary);
    color: var(--secondary);
}

.schedule-action-menu {
    position: relative;
    z-index: 20;
}

.schedule-action-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    box-sizing: border-box;
    padding: 8px 13px;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
}

.schedule-action-menu summary::-webkit-details-marker { display: none; }
.schedule-action-menu[open] summary { border-color: var(--primary); background: #fff1f4; color: var(--primary); }
.schedule-action-menu[open] summary .fa-chevron-down { transform: rotate(180deg); }

.schedule-action-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    width: max-content;
    min-width: 210px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.schedule-action-menu-panel button {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.schedule-action-menu-panel button:hover { background: #f1f5f9; }
.schedule-action-menu-panel button.is-danger { color: var(--danger); }
.schedule-action-menu-panel button.is-danger:hover { background: #fef2f2; }
.schedule-action-menu-panel hr { width: 100%; margin: 5px 0; border: 0; border-top: 1px solid #e2e8f0; }

.schedule-action-menu-label {
    display: block;
    margin: 4px 8px 1px;
    padding-top: 7px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.schedule-action-menu-label:first-child { border-top: 0; padding-top: 2px; }
.schedule-action-menu-label.is-danger { color: #b91c1c; }

.candidate-block-reasons {
    margin: 10px 0;
    padding-left: 22px;
    color: #475569;
    text-align: left;
    line-height: 1.65;
}

.schedule-workflow {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid rgba(168, 93, 106, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 22px rgba(168, 93, 106, 0.07);
}

.schedule-workflow-heading {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 10px;
}

.schedule-workflow-heading span { color: #64748b; font-size: 11px; font-weight: 800; }
.schedule-workflow-heading strong { color: #334155; font-size: 14px; }

.schedule-workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.schedule-workflow-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 7px 10px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
}

.schedule-workflow-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #cbd5e1;
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.schedule-workflow-step.is-complete { background: #ecfdf5; color: #047857; }
.schedule-workflow-step.is-complete > span { background: #10b981; }
.schedule-workflow-step.is-active { background: #fff1f4; color: #78434d; box-shadow: inset 0 0 0 2px rgba(168, 93, 106, 0.38); }
.schedule-workflow-step.is-active > span { background: var(--primary); }
.schedule-workflow.is-revision .schedule-workflow-step.is-active { background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.5); }
.schedule-workflow.is-revision .schedule-workflow-step.is-active > span { background: #f59e0b; }

.schedule-workflow-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 13px;
}

.schedule-workflow-next p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.schedule-support-guidance,
.schedule-confirmation-guidance {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid rgba(168, 93, 106, 0.22);
    border-radius: 10px;
    background: #fff7f8;
    color: #75414a;
}
.schedule-support-guidance { margin-top: 13px; }
.schedule-confirmation-guidance { margin-bottom: 13px; }
.schedule-support-guidance i,
.schedule-confirmation-guidance i { margin-top: 3px; color: var(--primary); }
.schedule-support-guidance p,
.schedule-confirmation-guidance p { margin: 0; font-size: 12px; line-height: 1.65; }
.schedule-support-guidance strong,
.schedule-confirmation-guidance strong { margin-right: 0.35em; }
.confirmation-history-panel { padding: 20px; }
.confirmation-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.confirmation-history-heading h3 { margin: 0 0 5px; color: var(--text-main); }
.confirmation-history-heading h3 i { color: var(--primary); margin-right: 7px; }
.confirmation-history-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }
.confirmation-history-list { display: grid; gap: 12px; }
.confirmation-history-card { padding: 15px; border: 1px solid #ead9dd; border-left: 5px solid #78b89a; border-radius: 12px; background: rgba(255,255,255,.8); }
.confirmation-history-card.is-exception { border-left-color: #f59e0b; background: #fffaf2; }
.confirmation-history-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.confirmation-history-card-head > div { display: flex; align-items: center; gap: 9px; }
.confirmation-history-card-head time { color: var(--text-muted); font-size: 12px; }
.confirmation-type-badge { padding: 4px 8px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 11px; font-weight: 800; }
.confirmation-type-badge.is-exception { background: #ffedd5; color: #9a3412; }
.confirmation-history-card dl { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 13px 0; }
.confirmation-history-card dl div { min-width: 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.75); }
.confirmation-history-card dt { color: var(--text-muted); font-size: 10px; }
.confirmation-history-card dd { overflow: hidden; margin: 2px 0 0; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.confirmation-history-card details { padding-top: 10px; border-top: 1px solid #ead9dd; }
.confirmation-history-card summary { cursor: pointer; color: #9a3412; font-size: 12px; font-weight: 800; }
.confirmation-history-card ul { margin: 8px 0 0 20px; color: #7c2d12; font-size: 12px; line-height: 1.6; }
.confirmation-no-warning { margin: 0; padding-top: 10px; border-top: 1px solid #dbe9e1; color: #277451; font-size: 12px; }
.confirmation-no-warning i { margin-right: 5px; }
.schedule-workflow-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 9px; flex: 0 0 auto; }
.schedule-primary-action { flex: 0 0 auto; min-width: 210px; white-space: nowrap; }
.schedule-secondary-action { flex: 0 0 auto; min-width: 170px; white-space: nowrap; background: #fff; color: var(--primary); border-color: rgba(168, 93, 106, 0.45); }

.schedule-generation-settings {
    padding: 0 !important;
    overflow: hidden;
}

.schedule-generation-settings > summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.schedule-generation-settings > summary::-webkit-details-marker { display: none; }
.schedule-generation-settings > summary span { font-size: 14px; font-weight: 800; }
.schedule-generation-settings > summary small { color: #64748b; font-size: 12px; }
.schedule-generation-settings > summary > i { color: #64748b; transition: transform .2s; }
.schedule-generation-settings[open] > summary > i { transform: rotate(180deg); }
.schedule-generation-settings-body { padding: 2px 16px 16px; border-top: 1px solid rgba(148, 163, 184, .25); }
.generation-mode-setting {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid rgba(168, 93, 106, .2);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
}

.monthly-staffing-balance { margin: 14px 0 18px; padding: 14px; border: 1px solid #efc4cd; border-radius: 14px; background: rgba(255,255,255,.7); }
.monthly-staffing-balance-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.monthly-staffing-balance-heading h4 { margin: 0; font-size: 15px; }
.monthly-staffing-balance-heading h4 i { color: var(--primary); margin-right: 6px; }
.monthly-staffing-balance-heading p { margin: 5px 0 0; color: #64748b; font-size: 12px; }
.monthly-balance-status { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.monthly-balance-status.is-surplus { background: #dcfce7; color: #166534; }
.monthly-balance-status.is-even { background: #e0f2fe; color: #075985; }
.monthly-balance-status.is-short { background: #fee2e2; color: #b91c1c; }
.monthly-balance-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.monthly-balance-summary > div { padding: 9px 10px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.monthly-balance-summary small { display: block; color: #64748b; font-size: 11px; }
.monthly-balance-summary strong { display: block; margin-top: 2px; font-size: 19px; }
.monthly-balance-summary .is-surplus strong { color: #15803d; }
.monthly-balance-summary .is-even strong { color: #0369a1; }
.monthly-balance-summary .is-short strong { color: #dc2626; }
.monthly-balance-table { margin-top: 8px; }
.monthly-balance-table table { min-width: 520px; }
.monthly-balance-table th, .monthly-balance-table td { padding: 8px 10px; font-size: 12px; }
.monthly-balance-table td:first-child strong, .monthly-balance-table td:first-child small { display: block; }
.monthly-balance-table td:first-child small { color: #64748b; margin-top: 2px; }
.monthly-balance-table .is-positive { color: #15803d; font-weight: 800; }
.monthly-balance-table .is-negative { color: #dc2626; font-weight: 800; }
.monthly-balance-note { margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; background: #eff6ff; color: #334155; font-size: 12px; line-height: 1.55; }
.monthly-reduced-projection, .monthly-capability-warning { margin-top: 12px; padding: 11px; border-radius: 10px; background: #fff; border: 1px solid #e2e8f0; }
.monthly-reduced-projection h5, .monthly-capability-warning h5 { margin: 0 0 8px; font-size: 13px; }
.monthly-reduced-projection h5 i { color: #d97706; margin-right: 6px; }
.monthly-capability-warning h5 i { color: #dc2626; margin-right: 6px; }
.monthly-reduced-projection ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.monthly-reduced-projection li { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 8px; padding: 8px; border-radius: 8px; font-size: 12px; }
.monthly-reduced-projection li.is-covered { background: #fff7ed; color: #9a3412; }
.monthly-reduced-projection li.is-short { background: #fef2f2; color: #b91c1c; }
.monthly-reduced-projection p, .monthly-capability-warning p { margin: 8px 0 0; color: #64748b; font-size: 11px; line-height: 1.5; }
.monthly-capability-warning .monthly-balance-table { margin-top: 0; }
.pre-generation-diagnosis { margin: 0 0 18px; padding: 14px; border: 1px solid #bbf7d0; border-radius: 14px; background: rgba(240,253,244,.8); }
.pre-generation-diagnosis.is-warning { border-color: #fde68a; background: rgba(255,251,235,.85); }
.pre-generation-diagnosis.is-major { border-color: #fecaca; background: rgba(254,242,242,.88); }
.pre-generation-diagnosis-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.pre-generation-diagnosis-heading h4 { margin: 0; font-size: 15px; }
.pre-generation-diagnosis-heading h4 i { margin-right: 6px; color: var(--primary); }
.pre-generation-diagnosis-heading p { margin: 5px 0 0; color: #64748b; font-size: 12px; }
.pre-generation-diagnosis-heading > strong { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 12px; }
.pre-generation-diagnosis.is-warning .pre-generation-diagnosis-heading > strong { background: #fef3c7; color: #92400e; }
.pre-generation-diagnosis.is-major .pre-generation-diagnosis-heading > strong { background: #fee2e2; color: #b91c1c; }
.pre-generation-diagnosis ul { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.pre-generation-diagnosis li { display: grid; grid-template-columns: auto 1fr; gap: 9px; padding: 9px 10px; border-radius: 9px; background: #fff; border-left: 4px solid #f59e0b; }
.pre-generation-diagnosis li.is-major { border-left-color: #ef4444; }
.pre-generation-diagnosis li > span { align-self: start; padding: 2px 6px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 800; }
.pre-generation-diagnosis li.is-major > span { background: #fee2e2; color: #b91c1c; }
.pre-generation-diagnosis li strong { font-size: 13px; }
.pre-generation-diagnosis li p { margin: 3px 0 0; color: #475569; font-size: 12px; line-height: 1.45; }
.diagnosis-clear { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 9px; background: #fff; color: #166534; font-size: 13px; font-weight: 700; }
.diagnosis-more, .pre-generation-diagnosis-note { margin: 9px 0 0; color: #64748b; font-size: 11px; line-height: 1.5; }
.diagnosis-input-summary { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; padding: 11px 13px; border: 1px solid #efc4cd; border-radius: 10px; background: #fff1f4; color: #78434d; font-size: 13px; line-height: 1.55; }
.diagnosis-input-summary.is-empty { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.diagnosis-more { color: #92400e; font-weight: 700; }

.schedule-change-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.schedule-change-methods button {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 3px 10px;
    align-items: center;
    min-height: 112px;
    padding: 16px;
    border: 1px solid #efc4cd;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.schedule-change-methods button:hover { border-color: var(--primary); background: #fff1f4; }
.schedule-change-methods i { grid-row: 1 / span 2; color: var(--primary); font-size: 25px; text-align: center; }
.schedule-change-methods strong { font-size: 15px; }
.schedule-change-methods small { color: var(--text-muted); line-height: 1.45; }

.discard-schedule-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.discard-schedule-summary section { padding: 14px; border: 1px solid; border-radius: 11px; }
.discard-schedule-summary section.is-removed { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.discard-schedule-summary section.is-kept { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.discard-schedule-summary strong { display: flex; align-items: center; gap: 7px; }
.discard-schedule-summary ul { margin: 9px 0 0; padding-left: 20px; color: #334155; font-size: 13px; line-height: 1.65; }
.discard-schedule-note { margin: 13px 0 0; padding: 10px 12px; border-radius: 9px; background: #eff6ff; color: #1e40af; font-size: 13px; }

.schedule-generate-button {
    flex: 0 0 auto;
    min-width: 174px;
    white-space: nowrap;
}

.schedule-request-legend,
.schedule-zoom-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.schedule-request-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.schedule-request-legend small {
    font-size: 10px;
    font-weight: 600;
}

.request-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.request-legend-dot.is-granted {
    background: #16a34a;
}

.request-legend-dot.is-rejected {
    background: #eab308;
}

.schedule-zoom-button,
.schedule-zoom-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border: 1px solid #d1d5db;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    cursor: pointer;
}

.schedule-zoom-button {
    width: 30px;
    border-radius: 7px;
}

.schedule-zoom-value {
    min-width: 54px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
}

.schedule-zoom-button:hover,
.schedule-zoom-value:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Shift Request Indicators */
.shift-cell-container {
    position: relative;
    padding: 0 !important;
}

/* 管理者希望（上）・実際の勤務（中央）・職員希望（下）の3段表示 */
.shift-table .shift-day-column {
    min-width: 50px;
    width: 50px;
    max-width: 50px;
}

.shift-cell-container {
    height: 58px;
    vertical-align: middle;
    overflow: hidden;
}

.schedule-employee-name,
.schedule-employee-roles {
    display: block;
}

.schedule-employee-roles {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.15;
    white-space: normal;
}

.schedule-main-table .shift-table .col-sticky-name {
    min-width: 104px;
    width: 104px;
    max-width: 104px;
    overflow: hidden;
}
.schedule-main-table .schedule-employee-name,
.schedule-main-table .schedule-employee-roles {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-wrap: normal;
}
.schedule-main-table .schedule-employee-name {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-align: center;
}
.schedule-main-table .schedule-employee-name:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
@media (max-width: 640px) {
    .schedule-main-table .shift-table .col-sticky-name {
        min-width: 72px;
        width: 72px;
        max-width: 72px;
    }
}

.schedule-role-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid #6366f1;
    border-radius: 4px;
    background: #fff1f4;
    color: #78434d;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.schedule-role-badge.is-unset {
    border-color: #dc2626;
    background: #fee2e2;
    color: #b91c1c;
}

.shift-cell-container .shift-select {
    display: block;
    height: 30px;
    min-height: 30px;
    padding: 0 2px;
    font-size: 14px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.shift-request-layer {
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr) 10px;
    align-items: center;
    width: 100%;
    height: 14px;
    min-height: 14px;
    box-sizing: border-box;
    padding: 0 3px;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 9px;
    line-height: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    background: transparent;
}

.shift-request-layer-empty {
    cursor: default;
    background: transparent;
}

.shift-request-admin {
    color: #8f4d59;
    border-bottom: 1px solid rgba(168, 93, 106, 0.08);
}

.shift-request-employee {
    color: #0f766e;
    border-top: 1px solid rgba(15, 118, 110, 0.08);
}

.shift-request-layer.is-granted {
    background: transparent;
}

.shift-request-layer.is-rejected {
    color: #b91c1c;
    background: transparent;
}

.shift-request-source {
    font-size: 8px;
    font-weight: 800;
    opacity: 0.72;
}

.shift-request-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.shift-request-status {
    font-size: 9px;
    font-weight: 900;
}

.shift-request-layer.is-granted .shift-request-status {
    color: #15803d;
}

.shift-request-layer.is-rejected .shift-request-status {
    color: #dc2626;
}

.shift-request-layer:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Desktop schedule: request dots, with admin above employee. */
.schedule-main-table .shift-cell-container .shift-select {
    height: 58px;
    min-height: 58px;
}

.schedule-main-table .shift-request-layer {
    position: absolute;
    right: 0;
    z-index: 4;
    display: block;
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: normal;
}

.schedule-main-table .shift-request-admin {
    top: 0;
    bottom: auto;
}

.schedule-main-table .shift-request-employee {
    top: auto;
    bottom: 0;
}

.schedule-main-table .shift-request-layer-empty {
    visibility: hidden;
    pointer-events: none;
}

.schedule-main-table .shift-request-layer span {
    display: none;
}

.schedule-main-table .shift-request-layer::after {
    content: '';
    position: absolute;
    right: 3px;
    width: 9px;
    height: 9px;
    border: 1.5px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
}

.schedule-main-table .shift-request-admin::after {
    top: 3px;
}

.schedule-main-table .shift-request-employee::after {
    bottom: 3px;
}

.schedule-main-table .shift-request-layer.is-granted::after {
    background: #16a34a;
}

.schedule-main-table .shift-request-layer.is-rejected::after {
    background: #eab308;
}

.schedule-request-details {
    display: grid;
    gap: 8px;
}

.schedule-request-detail {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.schedule-request-detail.is-granted {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.schedule-request-detail.is-rejected {
    background: #fef2f2;
    border-color: #fecaca;
}

.schedule-request-detail.is-empty {
    color: var(--text-muted);
    background: #f8fafc;
}

@media (max-width: 640px) {
    .shift-table .shift-day-column {
        min-width: 48px;
        width: 48px;
        max-width: 48px;
    }

    .schedule-request-detail {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .schedule-page-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 7px;
    }

    .schedule-generate-button {
        grid-row: 1;
        width: 100%;
        min-width: 0;
        min-height: 42px !important;
    }

    .schedule-action-secondary {
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    .schedule-action-secondary > .btn,
    .schedule-action-menu summary {
        width: 100%;
        min-height: 34px;
    }

    .schedule-action-menu-panel {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 74px;
        left: 10px;
        width: auto;
        min-width: 0;
        z-index: 60;
    }

    .schedule-workflow { padding: 11px; }
    .schedule-workflow-heading { margin-bottom: 8px; }
    .schedule-workflow-steps { gap: 4px; }
    .schedule-workflow-step { display: grid; justify-items: center; gap: 4px; min-height: 58px; padding: 5px 3px; font-size: 10px; text-align: center; }
    .schedule-workflow-step > span { width: 22px; height: 22px; flex-basis: 22px; }
    .schedule-workflow-next { display: grid; gap: 9px; }
    .confirmation-history-heading { display: grid; }
    .confirmation-history-card-head { align-items: flex-start; flex-direction: column; }
    .confirmation-history-card dl { grid-template-columns: 1fr; }
    .schedule-workflow-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 7px; }
    .schedule-primary-action { width: 100%; min-width: 0; }
    .schedule-secondary-action { width: 100%; min-width: 0; white-space: normal; }
    .schedule-generation-settings > summary { grid-template-columns: 1fr auto; gap: 5px 10px; padding: 12px; }
    .schedule-generation-settings > summary small { grid-column: 1; grid-row: 2; }
    .schedule-generation-settings > summary > i { grid-column: 2; grid-row: 1 / span 2; }
    .schedule-generation-settings-body { padding: 2px 12px 12px; }
    .monthly-staffing-balance-heading { display: grid; }
    .monthly-balance-status { width: fit-content; }
    .monthly-balance-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .pre-generation-diagnosis-heading { display: grid; }
    .pre-generation-diagnosis-heading > strong { width: fit-content; }
    .schedule-change-methods { grid-template-columns: 1fr; }
    .schedule-change-methods button { min-height: 92px; }
    .discard-schedule-summary { grid-template-columns: 1fr; }
}

.request-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.request-granted {
    background-color: #10B981; /* Green */
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.6);
}

.request-mismatch {
    background-color: #F59E0B; /* Orange/Amber */
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.6);
}

/* 配置基準設定の新しいUI */
.staffing-page-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.68);
}
.staffing-page-mode > div { display: grid; gap: 3px; }
.staffing-page-mode strong { color: var(--text); }
.staffing-page-mode small { color: var(--text-muted); }
.staffing-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.staff-condition-page { display: grid; gap: 18px; }
.staff-condition-intro, .staff-condition-check, .staff-condition-section {
    padding: 22px;
    border: 1px solid rgba(99,102,241,.16);
    border-radius: 16px;
    background: rgba(255,255,255,.82);
}
.staff-condition-intro, .staff-condition-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.staff-condition-intro h4, .staff-condition-section h5 { margin: 0 0 5px; color: var(--text); }
.staff-condition-intro p, .staff-condition-section-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.staff-condition-choice { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.staff-condition-check { background: #f8fafc; }
.staff-condition-check h5 { margin: 0 0 10px; }
.staff-condition-check ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.staff-condition-check li { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 9px; font-size: 13px; }
.staff-condition-check li.is-ok { color: #047857; background: #ecfdf5; }
.staff-condition-check li.is-warning { color: #92400e; background: #fffbeb; }
.staff-condition-check li.is-error { color: #b91c1c; background: #fef2f2; }
.staff-condition-card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; margin-top: 14px; }
.staff-condition-card { padding: 14px; border: 1px solid #ead8dc; border-radius: 12px; background: white; }
.staff-condition-card-head { display: flex; align-items: center; gap: 8px; }
.staff-condition-card p { margin: 9px 0 5px; font-size: 13px; line-height: 1.55; }
.staff-condition-card small { color: var(--text-muted); }
.staff-condition-kind, .staff-condition-status { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.staff-condition-kind.is-attribute { color: #6d28d9; background: #f3e8ff; }
.staff-condition-status.is-ok { color: #047857; background: #d1fae5; }
.staff-condition-status.is-off { color: #64748b; background: #e2e8f0; }
.condition-warning-text { color: #b45309; font-weight: 800; }
.staff-condition-empty { padding: 16px; border: 1px dashed #cbd5e1; border-radius: 10px; color: var(--text-muted); }
.staff-condition-section .table-container { margin-top: 14px; }
.staff-condition-section tr.is-inactive { opacity: .58; }
.staff-condition-link-panel { margin-top: 18px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid rgba(99,102,241,.2); border-radius: 12px; background: #fff8fa; }
.staff-condition-link-panel p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.staffing-disclosure { margin-top: 14px; border: 1px solid rgba(99,102,241,.18); border-radius: 12px; background: rgba(255,255,255,.72); overflow: hidden; }
.staffing-disclosure > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 700; }
.staffing-disclosure > summary::-webkit-details-marker { display: none; }
.staffing-disclosure > summary span { flex: 1; }
.staffing-disclosure > summary small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.staffing-disclosure-chevron { color: var(--text-muted); transition: transform .2s; }
.staffing-disclosure[open] .staffing-disclosure-chevron { transform: rotate(180deg); }
.staffing-disclosure-content { padding: 0 16px 16px; }
.staffing-disclosure-content > .support-pattern-panel { margin-top: 0; }

@media (max-width: 760px) {
    .staffing-page-mode { align-items: stretch; flex-direction: column; }
    .staffing-page-mode .btn { width: 100%; justify-content: center; }
    .staffing-tabs { gap: 8px 16px; }
    .staffing-tab { font-size: 12px; padding: 9px 0; }
    .staff-condition-intro, .staff-condition-section-head, .staff-condition-link-panel { align-items: stretch; flex-direction: column; }
    .staff-condition-choice, .staff-condition-choice .btn, .staff-condition-section-head > .btn { width: 100%; }
    .staff-condition-choice .btn { justify-content: center; }
    .staff-condition-intro, .staff-condition-check, .staff-condition-section { padding: 15px; }
}
.staffing-tab {
    padding: 12px 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    position: relative;
    font-size: 15px;
    transition: all 0.3s;
}
.staffing-tab.active {
    color: var(--primary);
}
.staffing-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.closure-settings-panel { padding: 24px; }
.closure-settings-heading h4 { color: var(--primary); margin-bottom: 6px; }
.closure-settings-heading p { color: var(--text-muted); font-size: 13px; }
.closure-setting-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(99,102,241,.14); }
.closure-setting-section h5 { margin-bottom: 10px; font-size: 15px; }
.closure-weekday-buttons, .closure-shift-options { display: flex; gap: 8px; flex-wrap: wrap; }
.closure-weekday-buttons label, .closure-shift-options label { cursor: pointer; }
.closure-weekday-buttons input, .closure-shift-options input { position: absolute; opacity: 0; pointer-events: none; }
.closure-weekday-buttons span, .closure-shift-options span { display: block; padding: 9px 14px; border: 1px solid #cbd5e1; border-radius: 10px; background: white; font-weight: 700; font-size: 13px; }
.closure-weekday-buttons label.is-selected span, .closure-weekday-buttons input:checked + span, .closure-shift-options input:checked + span { color: white; border-color: var(--primary); background: var(--primary); }
.closure-calendar-weekdays, .closure-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.closure-calendar-weekdays { margin-bottom: 6px; text-align: center; font-weight: 800; font-size: 12px; }
.closure-calendar-weekdays .is-sunday { color: #dc2626; }
.closure-calendar-weekdays .is-saturday { color: #2563eb; }
.closure-calendar-day { min-height: 62px; padding: 7px 3px; border: 1px solid #ead8dc; border-radius: 10px; background: white; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.closure-calendar-day strong { font-size: 15px; }
.closure-calendar-day em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b91c1c; font-size: 9px; font-style: normal; font-weight: 800; }
.closure-calendar-day small { font-size: 10px; color: var(--text-muted); }
.closure-calendar-day.is-public-holiday:not(.is-closed) { color: #b91c1c; border-color: #fecaca; background: #fff7f7; }
.closure-calendar-day.is-closed { color: #b91c1c; border-color: #fca5a5; background: #fee2e2; }
.closure-calendar-day.is-closed small { color: #b91c1c; font-weight: 800; }
.closure-calendar-day.is-override { box-shadow: inset 0 0 0 2px #f59e0b; }
.closure-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; color: var(--text-muted); font-size: 11px; }
.closure-legend span { display: inline-flex; align-items: center; gap: 5px; }
.closure-legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #cbd5e1; background: white; }
.closure-legend i.is-closed { border-color: #fca5a5; background: #fee2e2; }
.closure-legend i.is-override { border: 2px solid #f59e0b; }
.closure-year-list { margin-top: 18px; border: 1px solid #ead8dc; border-radius: 10px; background: rgba(255,255,255,.7); }
.closure-year-list summary { padding: 12px 14px; cursor: pointer; font-weight: 800; }
.closure-year-list > div { padding: 0 14px 14px; display: grid; gap: 6px; }
.closure-year-list span { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 7px; background: white; font-size: 12px; }
.closure-year-list span strong { min-width: 48px; }
.closure-year-list button { margin-left: auto; border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.closure-setting-note { padding: 11px 13px; border-radius: 9px; background: #eef6ff; color: #334155; font-size: 12px; line-height: 1.7; }
.closure-exception-add { display: grid; grid-template-columns: minmax(130px,1fr) minmax(150px,1fr) 90px auto auto; gap: 8px; align-items: center; margin: 12px 0; }
.closure-exception-add label { white-space: nowrap; font-size: 12px; }
.closure-count-input { width: 80px; min-width: 70px; }
.closure-empty-exceptions { padding: 16px; border: 1px dashed #f59e0b; border-radius: 9px; background: #fff7ed; color: #9a3412; font-size: 12px; }

@media (max-width: 600px) {
    .closure-settings-panel { padding: 15px; }
    .closure-calendar-weekdays, .closure-calendar-grid { gap: 3px; }
    .closure-calendar-day { min-height: 50px; border-radius: 7px; }
    .closure-calendar-day strong { font-size: 13px; }
    .closure-calendar-day small { font-size: 8px; }
    .closure-exception-add { grid-template-columns: 1fr 1fr; }
    .closure-exception-add .btn { width: 100%; }
}

.staffing-edit-day-label {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff1f4;
    color: var(--primary);
    font-weight: 800;
}

.staffing-edit-nolimit {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.staffing-edit-nolimit label {
    margin: 0;
    font-weight: 600;
}

.staffing-edit-note {
    padding: 9px 11px;
    border-radius: 7px;
    background: #fffbeb;
    color: #92400e;
    font-size: 11px;
}

.staffing-day-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.staffing-copy-button {
    flex: 0 0 auto;
}

.staffing-copy-source {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fff1f4;
}

.staffing-copy-source span,
.staffing-copy-source small {
    color: var(--text-muted);
    font-size: 11px;
}

.staffing-copy-source strong {
    color: var(--primary);
}

.staffing-copy-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.staffing-copy-targets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.staffing-copy-target {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 7px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #f8fafc;
    cursor: pointer;
}

.staffing-copy-target input {
    grid-row: 1 / 3;
    align-self: center;
}

.staffing-copy-target span {
    font-size: 12px;
    font-weight: 700;
}

.staffing-copy-target small {
    color: var(--text-muted);
    font-size: 9px;
}

.staffing-copy-modes {
    display: grid;
    gap: 7px;
}

.staffing-copy-modes > label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
}

.staffing-copy-modes span,
.staffing-copy-modes small {
    display: block;
}

.staffing-copy-modes small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
}

.staffing-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.staffing-sidebar {
    width: 280px;
    flex-shrink: 0;
}
.staffing-main {
    flex-grow: 1;
    background: #f8fbfa;
    border: 1px solid #eef7f4;
    border-radius: 16px;
    padding: 32px;
}

.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.mini-cal-header {
    font-size: 12px;
    font-weight: bold;
    padding: 8px 0;
}
.mini-cal-header.sun { color: var(--danger); }
.mini-cal-header.sat { color: var(--secondary); }

.mini-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8f9fa;
    position: relative;
}
.mini-cal-day:hover {
    background: #e9ecef;
}
.mini-cal-day.active {
    background: var(--primary);
    color: white;
    font-weight: bold;
}
.mini-cal-day.has-special::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}
.mini-cal-day.active.has-special::after {
    background: white;
}
.mini-cal-day.empty {
    background: transparent;
    cursor: default;
}

.special-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.special-staffing-actions {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
    padding: 10px;
    border: 1px solid #dbe4ff;
    border-radius: 10px;
    background: #fffafb;
}

.special-staffing-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.special-pattern-action-row {
    padding-top: 7px;
    border-top: 1px solid #dbe4ff;
}

.special-staffing-actions .btn {
    min-height: 34px;
}

.special-reset-button {
    border-color: #f59e0b;
    color: #b45309;
}

.special-template-warning {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 11px;
    line-height: 1.5;
}

.special-template-editor-head,
.special-template-edit-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(130px, 1.25fr) 82px 94px 38px;
    gap: 7px;
    align-items: center;
}

.special-template-editor-head {
    padding: 0 8px 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.special-template-edit-rows {
    display: grid;
    gap: 7px;
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 3px;
}

.special-template-edit-row {
    padding: 7px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.special-template-nolimit {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 11px;
    white-space: nowrap;
}
.date-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: bold;
    margin-right: 12px;
}

.empty-setting-box {
    border: 2px dashed #d1e7dd;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    color: #88a;
    background: white;
    margin-bottom: 24px;
}

.staffing-note {
    background: #fff;
    border: 1px solid #d1e7dd;
    padding: 16px;
    border-radius: 8px;
    font-size: 12px;
    color: #667;
    line-height: 1.6;
}

.request-mismatch-tag {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    background: #F59E0B;
    color: white;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
}

.request-granted-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    color: #10B981;
    z-index: 3;
    pointer-events: none;
}

/* シフト表の列固定（スティッキー表示） */
.col-sticky-prev {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: white !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.col-sticky-name {
    position: sticky;
    left: 40px; /* 前月末連勤列の幅(40px) */
    z-index: 10;
    background-color: white !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    min-width: 80px;
}

.col-sticky-right {
    position: static;
    z-index: auto;
    background-color: #f9fafb !important;
    box-shadow: none;
}

.shift-table thead th.col-sticky-prev,
.shift-table thead th.col-sticky-name,
.shift-table thead th.col-sticky-right {
    z-index: 11;
    background-color: #f3f4f6;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.glass-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 24px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.modal-overlay.hidden .glass-modal {
    transform: translateY(20px);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Utility classes */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-4 { gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-1 { grid-template-columns: 1fr; }

/* Employee request calendar */
.employee-request-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 10px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(168, 93, 106, 0.07);
    color: var(--text-muted);
    font-size: 13px;
}

.employee-request-summary strong {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 14px;
}

.employee-request-shared-count {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 5px auto 0;
    padding: 2px 5px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
}

.employee-request-holiday-count {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 3px auto 0;
    padding: 2px 5px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
}

.employee-request-holiday-count.is-over {
    background: #ffedd5;
    color: #c2410c;
}

.employee-monthly-message,
.employee-holiday-guideline {
    margin: 12px 0;
    padding: 13px 15px;
    border-radius: 10px;
}

.employee-monthly-message {
    border-left: 4px solid #4f46e5;
    background: #fff1f4;
}

.employee-holiday-guideline {
    border-left: 4px solid #0ea5e9;
    background: #f0f9ff;
}

.employee-monthly-message p,
.employee-holiday-guideline p {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.6;
}

.monthly-request-message-editor textarea {
    margin-top: 10px;
    resize: vertical;
}

.shared-employee-requests {
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: rgba(239, 246, 255, 0.7);
}

.shared-request-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #dbeafe;
}

.shared-request-heading h4 {
    margin: 0 0 3px;
}

.shared-request-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.shared-request-list {
    max-height: 310px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.82);
}

.shared-request-row {
    display: grid;
    grid-template-columns: 52px minmax(100px, 0.8fr) minmax(140px, 1.4fr) 58px;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.shared-request-row:last-child {
    border-bottom: 0;
}

.shared-request-date {
    color: var(--primary);
    font-weight: 800;
}

.shared-request-row small {
    color: var(--text-muted);
    font-weight: 700;
}

.employee-request-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.035);
}

.employee-request-weekday {
    padding: 7px 2px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.employee-request-weekday.is-sunday,
.employee-request-day.is-sunday .employee-request-date {
    color: #dc2626;
}

.employee-request-weekday.is-saturday,
.employee-request-day.is-saturday .employee-request-date {
    color: #2563eb;
}

.employee-request-day {
    min-width: 0;
    min-height: 104px;
    padding: 7px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.employee-request-day:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(168, 93, 106, 0.14);
    transform: translateY(-1px);
}

.employee-request-day.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.employee-request-day.is-sunday {
    background: #fff7f7;
}

.employee-request-holiday-name {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #b91c1c;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-request-day.is-saturday {
    background: #f5f9ff;
}

.employee-request-day.has-request {
    border: 2px solid #818cf8;
    background: #fff1f4;
}

.employee-request-day.has-unavailable-request {
    border-color: #f59e0b;
    background: #fffbeb;
}

.employee-request-day.has-unavailable-request .employee-request-shift {
    color: #b45309;
}

.employee-request-day.is-out-of-period,
.employee-request-day.is-out-of-period:hover {
    border-color: #d1d5db;
    background: #e5e7eb;
    color: #6b7280;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
    opacity: 0.72;
}

.employee-request-out-label {
    display: block;
    margin-top: 13px;
    font-size: 10px;
    font-weight: 700;
}

.employee-out-of-period {
    background: repeating-linear-gradient(135deg, #e5e7eb, #e5e7eb 5px, #f3f4f6 5px, #f3f4f6 10px) !important;
    color: #6b7280;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
}

.employee-period-column {
    width: 1%;
    min-width: 120px;
    white-space: nowrap;
}

.employee-period-value {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.employee-period-value.is-unlimited {
    color: var(--text-muted);
    font-weight: 500;
}

.employee-period-date-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 38px 10px 13px;
    overflow: hidden;
    color: #111827;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.employee-period-date-field:focus,
.employee-period-date-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 93, 106, 0.14);
}

.employee-period-date-display {
    font-size: 14px;
    line-height: 20px;
    pointer-events: none;
}

.employee-period-date-display.is-empty {
    color: #9ca3af;
}

.employee-period-calendar-icon {
    position: absolute;
    right: 13px;
    color: #374151;
    pointer-events: none;
}

.employee-period-date-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

/* 勤務表の版管理 */
.schedule-version-panel {
    position: relative;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(100, 116, 139, 0.22);
    border-left: 4px solid #64748b;
    border-radius: 12px;
}

.schedule-version-panel.is-draft { border-left-color: #64748b; }
.schedule-version-panel.is-confirmed { border-left-color: #2563eb; }
.schedule-version-panel.is-revision { border-left-color: #f59e0b; }

.schedule-version-panel > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-version-panel > p {
    margin: 7px 0 10px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.schedule-version-badge {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    color: white;
    background: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.is-confirmed .schedule-version-badge { background: #2563eb; }
.is-revision .schedule-version-badge { background: #f59e0b; }

.schedule-version-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-rebuild-details {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
    font-size: 13px;
}

.schedule-rebuild-details summary {
    width: fit-content;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
}

.schedule-rebuild-details p {
    margin: 9px 0;
    color: var(--text-muted);
}

.schedule-rebuild-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #ef4444;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    cursor: pointer;
}

.schedule-change-pending {
    box-shadow: inset 0 0 0 3px #f59e0b !important;
    background-image: linear-gradient(rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.1));
}

.schedule-change-confirmed {
    box-shadow: inset 4px 0 0 #2563eb !important;
}

/* 勤務変更条件モーダル */
.glass-modal.revision-modal {
    display: flex;
    flex-direction: column;
    width: min(94%, 880px);
    max-width: 880px;
    padding: 0;
    overflow: hidden;
}

.revision-modal > .modal-header {
    flex: 0 0 auto;
    margin: 0;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.revision-setup-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 20px;
    overflow-y: auto;
}

.revision-start-setting,
.revision-condition-form {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.revision-start-setting {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px);
    gap: 6px 14px;
    align-items: center;
}

.revision-start-setting small {
    grid-column: 1 / -1;
    color: var(--text-muted);
}

.revision-condition-list {
    margin: 16px 0;
}

.revision-condition-list h4,
.revision-condition-form h4 {
    margin-bottom: 10px;
}

.revision-condition-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 11px 12px;
    background: white;
    border: 1px solid #dbe2ea;
    border-left: 4px solid #f59e0b;
    border-radius: 9px;
}

.revision-condition-card.is-editing {
    box-shadow: 0 0 0 2px rgba(168, 93, 106, 0.15);
}

.revision-condition-card-main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.revision-condition-card-main span {
    font-size: 13px;
}

.revision-condition-card-main small,
.revision-condition-empty {
    color: var(--text-muted);
    font-size: 12px;
}

.revision-condition-card-actions,
.revision-form-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.revision-condition-card-actions button {
    padding: 6px 9px;
    color: #334155;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
}

.revision-condition-card-actions button.is-danger {
    color: #dc2626;
    border-color: #fca5a5;
}

.revision-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.revision-form-grid .form-group {
    margin: 0;
}

.revision-kind-field[hidden] {
    display: none;
}

.revision-reason-field {
    grid-column: 1 / -1;
}

.revision-form-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.revision-generation-note {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    color: #1e40af;
    background: #eff6ff;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.revision-setup-footer {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
    .schedule-version-panel {
        padding: 11px 12px;
    }

    .schedule-version-panel > div:first-child {
        align-items: flex-start;
    }

    .schedule-version-panel > p,
    .schedule-rebuild-details {
        font-size: 12px;
    }

    .schedule-version-buttons .btn {
        flex: 1 1 145px;
        min-width: 0;
        padding: 9px 10px;
        white-space: normal;
    }

    .schedule-rebuild-button {
        width: min(100%, 260px);
        font-size: 12px;
    }

    .schedule-rebuild-button span {
        overflow-wrap: anywhere;
    }

    .glass-modal.revision-modal {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }

    .revision-modal > .modal-header {
        padding: 13px 14px 11px;
    }

    .revision-modal > .modal-header h3 {
        font-size: 17px;
    }

    .revision-setup-body {
        padding: 12px;
    }

    .revision-start-setting,
    .revision-form-grid {
        grid-template-columns: 1fr;
    }

    .revision-start-setting {
        padding: 11px;
    }

    .revision-condition-card {
        align-items: stretch;
        flex-direction: column;
    }

    .revision-condition-card-actions button {
        flex: 1;
        min-height: 38px;
    }

    .revision-reason-field {
        grid-column: auto;
    }

    .revision-form-actions .btn {
        flex: 1;
        min-width: 0;
        white-space: normal;
    }

    .revision-setup-footer {
        padding: 10px 12px 12px;
    }

    .revision-setup-footer .btn {
        flex: 1;
        min-width: 0;
        padding: 9px 8px;
        font-size: 12px;
        white-space: normal;
    }
}

.employee-request-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
}

.employee-request-date strong {
    font-size: 15px;
}

.employee-request-shift,
.employee-request-priority,
.employee-request-empty-label {
    display: block;
    text-align: center;
}

.employee-request-shift {
    margin-top: 12px;
    overflow: hidden;
    color: var(--primary);
    font-size: 17px;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.employee-request-priority {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.employee-request-empty-label {
    margin-top: 15px;
    color: #cbd5e1;
    font-size: 21px;
    font-weight: 400;
}

.request-day-lock-notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.request-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.request-type-selector label,
.request-unavailable-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.request-unavailable-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 6px 0 8px;
}

.request-day-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.request-day-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.request-delete-button {
    border-color: var(--danger);
    color: var(--danger);
}

.quick-request-modal-body {
    display: grid;
    gap: 16px;
    max-height: min(72vh, 680px);
    padding: 18px 20px 22px;
    overflow-y: auto;
}

.quick-schedule-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 20px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.quick-schedule-tabs button {
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    cursor: pointer;
}

.quick-schedule-tabs button.is-active {
    border-color: var(--primary);
    background: #fff1f4;
    color: var(--primary);
}

.quick-training-intro {
    padding: 10px 12px;
    border-left: 4px solid #06b6d4;
    border-radius: 7px;
    background: #ecfeff;
    color: #155e75;
    font-size: 13px;
}

.quick-training-period {
    color: #0e7490;
    font-size: 15px;
    font-weight: 800;
}

.quick-request-section,
.quick-employee-reference-section {
    padding: 14px;
    border: 1px solid rgba(168, 93, 106, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.quick-request-section h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.quick-request-list,
.quick-employee-reference-list {
    display: grid;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.quick-request-row,
.quick-employee-reference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.quick-request-row {
    position: relative;
    padding: 14px 14px 14px 16px;
    overflow: hidden;
    border: 1px solid #efc4cd;
    border-left: 5px solid var(--primary);
    background: linear-gradient(135deg, #ffffff 0%, #fff8fa 100%);
    box-shadow: 0 3px 10px rgba(168, 93, 106, 0.08);
}

.quick-request-row-main,
.quick-employee-reference {
    min-width: 0;
}

.quick-request-row-main {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(100px, 1fr) auto;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.quick-request-employee {
    color: #1e293b;
    font-size: 16px;
}

.quick-request-shift {
    color: var(--primary);
    font-size: 17px;
    font-weight: 800;
}

.quick-request-priority {
    padding: 4px 7px;
    border-radius: 999px;
    background: #fde7ec;
    color: #78434d;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.quick-request-row-main span,
.quick-employee-reference span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-request-row-main small,
.quick-employee-reference small {
    color: var(--text-muted);
}

.quick-request-row-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.quick-request-action-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.quick-request-action-button:hover {
    background: #fde7ec;
    color: var(--primary);
}

.quick-request-action-button.is-delete {
    color: #dc2626;
}

.quick-request-action-button.is-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.quick-request-empty,
.quick-employee-reference-section > p {
    color: var(--text-muted);
    font-size: 13px;
}

.quick-employee-reference-section summary {
    cursor: pointer;
    font-weight: 700;
}

.quick-employee-reference-section > p {
    margin: 8px 0;
}

.quick-employee-reference {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(120px, 2fr) auto;
}

.quick-employee-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 210px;
    margin-top: 8px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    overscroll-behavior: contain;
}

.quick-employee-dropdown {
    width: 100%;
}

.quick-employee-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.quick-employee-dropdown-trigger:hover,
.quick-employee-dropdown-trigger.is-open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 93, 106, 0.1);
}

.quick-employee-dropdown-arrow {
    transition: transform 0.15s ease;
}

.quick-employee-dropdown-trigger.is-open .quick-employee-dropdown-arrow {
    transform: rotate(180deg);
}

.quick-employee-dropdown-panel {
    margin-top: 6px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.quick-employee-dropdown-panel .quick-employee-choices {
    margin-top: 7px;
}

.quick-employee-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: white;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.quick-employee-choice:hover {
    border-color: #dfa3af;
}

.quick-employee-choice.is-selected {
    border-color: var(--primary);
    background: #fff1f4;
    color: var(--primary);
    font-weight: 700;
}

.quick-employee-choice span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-employee-choice-check {
    visibility: hidden;
}

.quick-employee-choice.is-selected .quick-employee-choice-check {
    visibility: visible;
}

.quick-employee-search-empty {
    display: block;
    padding: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.quick-employee-fixed {
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 700;
}

/* Employee setting templates */
.employee-template-picker {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #efc4cd;
    border-radius: 10px;
    background: #fff1f4;
}

.employee-template-picker p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.employee-template-manager-actions,
.employee-template-from-employee {
    display: flex;
    align-items: center;
    gap: 8px;
}

.employee-template-manager-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.employee-template-from-employee .form-control {
    min-width: 180px;
}

.employee-template-list {
    display: grid;
    gap: 8px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 3px;
}

.employee-template-empty {
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    color: var(--text-muted);
    text-align: center;
}

.employee-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: white;
}

.employee-template-card.is-inactive {
    opacity: 0.68;
    background: #f8fafc;
}

.employee-template-card-main {
    min-width: 0;
}

.employee-template-card-main p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.employee-template-card-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.employee-template-card .badge {
    align-self: auto;
    padding: 2px 6px;
    font-size: 9px;
}

.employee-template-card .template-inactive-badge {
    background: #64748b;
}

td .template-inactive-badge {
    display: inline-flex;
    margin-top: 4px;
    background: #64748b;
    color: #fff;
}

.template-warning-badge {
    padding: 2px 6px;
    border-radius: 99px;
    background: #fef3c7;
    color: #92400e;
    font-size: 9px;
    font-weight: 800;
}

.template-problem-text {
    display: block;
    margin-top: 4px;
    color: #b45309;
}

.employee-template-form {
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 5px;
}

.template-checkbox-group,
.template-checkbox-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 9px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #f8fafc;
    font-size: 12px;
}

.template-checkbox-stack {
    margin-bottom: 14px;
}

.template-number-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-shift-checkboxes {
    max-height: 120px;
    overflow-y: auto;
}

.employee-template-exclusion-note {
    padding: 9px 11px;
    border-radius: 7px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 11px;
}

/* Admin Home Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: rgba(0,0,0,0.02);
    padding: 12px;
    border-radius: 12px;
}

.cal-header {
    text-align: center;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 4px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.65);
    border-radius: 7px;
}

.cal-header.is-sunday,
.cal-cell.is-sunday .cal-day {
    color: #dc2626;
}

.cal-header.is-saturday,
.cal-cell.is-saturday .cal-day {
    color: #2563eb;
}

.cal-weekday-short,
.cal-day-weekday {
    display: none;
}

.cal-cell {
    background: white;
    height: 128px; /* Fixed height for scrolling */
    border-radius: 8px;
    padding: 6px;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Enable vertical scroll */
}

.cal-cell.is-sunday {
    background: #fff7f7;
    border-color: #fecaca;
}

.calendar-holiday-name {
    margin-left: auto;
    overflow: hidden;
    color: #b91c1c;
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-cell.is-saturday {
    background: #f5f9ff;
    border-color: #bfdbfe;
}
/* Scrollbar styling for cal-cell */
.cal-cell::-webkit-scrollbar {
    width: 4px;
}
.cal-cell::-webkit-scrollbar-track {
    background: transparent;
}
.cal-cell::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}


.cal-cell.empty { background: transparent; border: none; }

.cal-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}

.cal-reqs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    max-height: 86px;
}

.cal-badge {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    background: #f3f4f6;
    border-left: 3px solid #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-badge.p-1 { background: #fee2e2; border-left-color: #ef4444; color: #b91c1c; }
.cal-badge.p-2, .cal-badge.p-3, .cal-badge.p-4, .cal-badge.p-5 { background: #e0f2fe; border-left-color: #0ea5e9; color: #0369a1; }
.cal-badge.cal-training-badge { background: #ecfeff; border-left-color: #06b6d4; color: #0e7490; }

/* AI Loading Overlay */
.ai-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ai-pulse {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    margin-bottom: 24px;
    animation: ai-pulse-anim 1.5s infinite ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    box-shadow: 0 0 20px rgba(168, 93, 106, 0.4);
}

@keyframes ai-pulse-anim {
    0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(168, 93, 106, 0.4); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 40px 20px rgba(168, 93, 106, 0); }
    100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(168, 93, 106, 0); }
}

.ai-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

.ai-progress-bar {
    width: min(300px, calc(100vw - 48px));
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    margin-top: 24px;
    overflow: hidden;
}

.ai-progress-inner {
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
}

.ai-progress-inner.is-processing {
    width: 38%;
    animation: ai-progress-moving 1.4s infinite ease-in-out;
}

.ai-progress-inner.is-complete {
    width: 100%;
    background: #10b981;
    transition: width 0.25s ease, background 0.25s ease;
}

@keyframes ai-progress-moving {
    0% { transform: translateX(-110%); }
    50% { transform: translateX(85%); }
    100% { transform: translateX(265%); }
}

.ai-status-message {
    margin: 16px 16px 0;
    min-height: 1.6em;
    color: var(--text);
    font-weight: 700;
    text-align: center;
}

.ai-elapsed-time {
    margin-top: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.ai-wait-note {
    max-width: 440px;
    margin: 10px 20px 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

@keyframes error-pulse {
    0% { background-color: var(--danger); }
    50% { background-color: #f87171; }
    100% { background-color: var(--danger); }
}

/* Mobile Support for Calendar (List View) */
@media (max-width: 768px) {
    .master-settings-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .master-settings-panel {
        width: 100%;
        min-width: 0;
    }

    .master-page-header {
        margin-bottom: 12px;
    }

    .master-page-header h3 {
        font-size: 20px;
    }

    .master-settings-table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .master-settings-table th,
    .master-settings-table td {
        padding: 10px 9px;
        white-space: nowrap;
        word-break: keep-all;
    }

    .master-shift-types-table table {
        min-width: 540px;
    }

    .master-roles-table table {
        min-width: 300px;
    }

    .master-settings-table .btn {
        min-height: 32px;
        padding: 5px 9px;
        white-space: nowrap;
    }

    .staffing-layout {
        width: 100%;
        flex-direction: column;
        gap: 14px;
    }

    .staffing-sidebar,
    .staffing-main {
        width: 100%;
        min-width: 0;
    }

    .staffing-sidebar {
        flex: 0 0 auto;
    }

    .staffing-main {
        padding: 16px;
    }

    .special-staffing-action-row .btn {
        writing-mode: horizontal-tb;
        white-space: normal;
    }

    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 7px;
        background: transparent;
        padding: 0;
    }
    .cal-header {
        display: none; /* Hide standard headers */
    }
    .cal-cell {
        height: auto;
        min-height: 58px;
        max-height: 200px;
        flex-direction: row;
        align-items: stretch;
        padding: 8px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        border: 1px solid #e5e7eb;
    }
    .cal-cell.empty {
        display: none;
    }
    .cal-date-heading {
        display: flex;
        align-items: center;
        flex: 0 0 112px;
        padding-right: 8px;
        margin-right: 8px;
        border-right: 1px solid #e5e7eb;
    }
    .cal-day {
        display: none;
    }
    .cal-day-weekday {
        display: block;
        font-size: 13px;
        font-weight: 800;
        color: var(--text-main);
        white-space: nowrap;
    }
    .cal-cell.is-sunday .cal-day-weekday {
        color: #dc2626;
    }
    .cal-cell.is-saturday .cal-day-weekday {
        color: #2563eb;
    }
    .cal-reqs {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 4px;
        flex: 1;
        max-height: 180px;
        overflow-y: auto;
    }
    .cal-badge {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    /* Bottom Navigation Layout */
    .sidebar {
        display: none !important; /* Hide sidebar on mobile */
    }
    .main-content {
        margin-left: 0 !important;
        padding-bottom: 80px !important; /* Space for bottom nav */
    }
    
    /* Create bottom navigation */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        padding: 8px 16px;
        padding-bottom: env(safe-area-inset-bottom, 8px);
        justify-content: space-around;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        gap: 4px;
        padding: 8px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    .bottom-nav-item i {
        font-size: 20px;
    }
    .bottom-nav-item.active {
        color: var(--primary);
        background: rgba(168, 93, 106, 0.1);
    }
}

/* Compact layout: use available width rather than device orientation. */
@media (max-width: 1024px) {
    .schedule-table-toolbar {
        justify-content: flex-end;
    }

    .schedule-request-legend {
        display: none;
    }

    .glass-sidebar {
        width: min(82vw, 280px);
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 12px 0 30px rgba(15, 23, 42, 0.18);
    }

    .glass-sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 39;
        background: rgba(15, 23, 42, 0.38);
    }

    .sidebar-backdrop.is-visible {
        display: block;
    }

    .content-area {
        width: 100%;
        margin-left: 0;
    }

    .top-header {
        height: 52px;
        padding: 0 6px;
        gap: 4px;
    }

    .top-header #page-title {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 17px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.82);
        color: var(--text-main);
        font-size: 17px;
        cursor: pointer;
    }

    .header-actions {
        flex: 0 0 auto;
    }

    .month-selector {
        gap: 5px;
        padding: 4px 7px;
        font-size: 14px;
    }

    .month-selector button {
        width: 22px;
        height: 22px;
    }

    .page-content {
        padding: 6px;
    }

    .schedule-page-header {
        align-items: flex-start;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .schedule-page-header h3 {
        font-size: 18px;
    }

    .schedule-page-header p {
        font-size: 14px !important;
        margin-top: 3px !important;
    }

    .schedule-page-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 5px;
    }

    .schedule-page-actions .btn {
        flex: 0 1 auto;
        min-height: 32px;
        padding: 5px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .page-content .glass-panel {
        font-size: 13px;
        padding: 10px !important;
        margin-bottom: 8px !important;
        border-radius: 8px;
    }

    .page-content .schedule-adjustment-summary {
        min-height: 62px;
        padding: 11px 13px !important;
    }

    .page-content .glass-panel h4,
    .page-content .glass-panel label,
    .page-content .glass-panel p {
        font-size: 12px !important;
    }

    .page-content .form-group {
        margin-bottom: 8px;
    }

    .page-content .form-control {
        min-height: 32px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .page-content .mt-3 {
        margin-top: 8px;
    }

    .page-content .gap-4 {
        gap: 8px;
    }

    .shift-table-container {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
        touch-action: pan-x pan-y;
        border-radius: 8px;
    }

    .shift-table {
        width: max-content;
        min-width: 100%;
    }

    .shift-table thead th.shift-day-column,
    .shift-table thead th.col-sticky-name {
        position: sticky;
        top: 0;
        z-index: 8;
    }

    .shift-table thead th.col-sticky-right {
        position: static;
        top: auto;
        right: auto !important;
    }

    .shift-table .col-sticky-prev {
        display: none;
    }

    .shift-table .col-sticky-name {
        left: 0;
        min-width: 64px;
        width: 64px;
        max-width: 64px;
        padding: 3px 2px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        z-index: 12;
        font-size: 12px;
    }

    .shift-table thead .col-sticky-name {
        z-index: 13;
    }

    .shift-table .shift-day-column {
        min-width: 42px;
        width: 42px;
        max-width: 42px;
    }

    .shift-cell-container {
        height: 40px;
        min-height: 40px;
    }

    .shift-cell-container .shift-select {
        height: 40px !important;
        min-height: 40px !important;
        font-size: 12px;
    }

    .shift-cell-container .shift-request-layer {
        display: none;
    }

    .portrait-request-dot {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 4;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .portrait-request-dot::after {
        content: '';
        position: absolute;
        top: 3px;
        right: 3px;
        width: 9px;
        height: 9px;
        border: 1.5px solid white;
        border-radius: 50%;
        background: #16a34a;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
    }

    .portrait-request-dot:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: -2px;
        border-radius: 6px;
    }
}

@media (max-width: 640px) {
    .top-header {
        height: 48px;
    }

    .top-header #page-title {
        font-size: 15px;
    }

    .month-selector {
        font-size: 12px;
    }

    .schedule-page-header h3 {
        font-size: 16px;
    }

    .schedule-page-header p {
        font-size: 12px !important;
    }

    .schedule-page-actions .btn {
        min-height: 30px;
        padding: 4px 7px;
        font-size: 11px;
        gap: 5px;
    }

    .shift-table th,
    .shift-table td,
    .shift-table .col-sticky-name,
    .shift-cell-container .shift-select {
        font-size: 11px;
    }

    .shift-table .col-sticky-name {
        min-width: 58px;
        width: 58px;
        max-width: 58px;
    }

    .shift-table .shift-day-column {
        min-width: 39px;
        width: 39px;
        max-width: 39px;
    }

    .shift-cell-container,
    .shift-cell-container .shift-select {
        height: 38px !important;
        min-height: 38px !important;
    }

    .employee-request-summary {
        align-items: flex-start;
        margin: 8px 0 6px;
        padding: 7px 8px;
        font-size: 11px;
    }

    .employee-request-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 7px;
    }

    .employee-request-summary span {
        max-width: 76%;
    }

    .employee-request-summary strong {
        font-size: 12px;
    }

    .employee-request-calendar {
        gap: 3px;
        padding: 4px;
        border-radius: 8px;
    }

    .employee-request-weekday {
        padding: 5px 1px;
        font-size: 10px;
    }

    .employee-request-day {
        min-height: 68px;
        padding: 4px 2px;
        border-radius: 6px;
    }

    .employee-request-date {
        font-size: 9px;
    }

    .employee-request-date strong {
        font-size: 12px;
    }

    .employee-request-shift {
        margin-top: 7px;
        font-size: 13px;
    }

    .employee-request-priority {
        margin-top: 2px;
        font-size: 8px;
    }

    .employee-request-empty-label {
        margin-top: 8px;
        font-size: 17px;
    }

    .employee-request-shared-count {
        margin-top: 3px;
        padding: 1px 3px;
        font-size: 7px;
    }

    .employee-request-holiday-count {
        margin-top: 2px;
        padding: 1px 3px;
        font-size: 7px;
    }

    .employee-monthly-message,
    .employee-holiday-guideline {
        margin: 8px 0;
        padding: 10px;
    }

    .shared-request-heading {
        padding: 10px;
    }

    .shared-request-heading p {
        font-size: 10px;
    }

    .shared-request-row {
        grid-template-columns: 36px minmax(72px, 0.8fr) minmax(90px, 1.4fr) 42px;
        gap: 5px;
        padding: 8px;
        font-size: 11px;
    }

    .request-day-form {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .request-type-selector,
    .request-unavailable-options {
        grid-template-columns: 1fr;
    }

    .quick-request-modal-body {
        padding: 10px;
    }

    .quick-request-row {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-request-row-main,
    .quick-employee-reference {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .quick-request-shift,
    .quick-employee-reference span {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .quick-request-row-actions {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #ead8dc;
    }

    .quick-request-editor-actions .btn {
        flex: 1;
    }

    .quick-employee-choices {
        grid-template-columns: 1fr;
        max-height: 200px;
    }

    .request-day-actions .btn {
        flex: 1 1 auto;
    }

    .employee-list-header,
    .employee-template-card {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .employee-list-header > .flex,
    .employee-template-card-actions {
        width: 100%;
    }

    .employee-list-header .btn,
    .employee-template-card-actions .btn {
        flex: 1 1 auto;
    }

    .employee-template-picker {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    .employee-template-manager-actions,
    .employee-template-from-employee {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-template-manager-actions .btn,
    .employee-template-from-employee,
    .employee-template-from-employee .form-control {
        width: 100%;
    }

    .template-number-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .staffing-day-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .staffing-copy-button {
        width: 100%;
    }

    .staffing-copy-targets {
        grid-template-columns: repeat(2, 1fr);
    }

    .special-day-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .special-staffing-action-row .btn {
        flex: 1 1 calc(50% - 7px);
        padding: 6px 8px;
        font-size: 10px;
    }

    .special-template-editor-head {
        display: none;
    }

    .special-template-edit-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .special-template-edit-row .special-template-role,
    .special-template-edit-row .special-template-shift {
        grid-column: 1 / -1;
    }

    .special-template-edit-row > .btn {
        justify-self: end;
    }
}
.special-reduced-summary {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #a7d7c5;
    border-radius: 12px;
    background: #f1fbf7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.special-reduced-summary p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.special-reduced-summary.is-stale { border-color: #f59e0b; background: #fff8e8; }

@media (max-width: 700px) {
    .special-reduced-summary { align-items: stretch; flex-direction: column; }
    .special-reduced-summary .flex { width: 100%; }
    .special-reduced-summary .btn { flex: 1; }
}
.generation-policy-panel { grid-column: 1 / -1; }
.generation-policy-summary { display:grid; gap:6px; margin:14px 0; padding:14px 16px; border:1px solid #efc4cd; border-radius:12px; background:#fff1f4; }
.generation-policy-summary strong { color:#78434d; }
.generation-policy-summary span, .generation-policy-summary small { line-height:1.55; }
.generation-policy-details { margin-top:14px; border:1px solid #ead8dc; border-radius:12px; background:#fff; overflow:hidden; }
.generation-policy-details > summary { cursor:pointer; padding:14px 16px; font-weight:700; color:#78434d; background:#f8fafc; }
.generation-policy-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:16px; }
.generation-policy-item { display:grid; gap:8px; align-content:start; padding:14px; border:1px solid #e2e8f0; border-radius:12px; }
.generation-policy-item label { display:block; font-weight:700; }
.generation-policy-item small { display:block; margin-top:4px; color:var(--text-muted); line-height:1.45; }
.generation-policy-impact { display:grid; gap:5px; padding:10px; border-radius:9px; background:#f8fafc; font-size:12px; line-height:1.5; }
.generation-policy-impact span:last-child { color:#92400e; }
.generation-policy-fixed { display:flex; gap:12px; align-items:flex-start; margin-top:14px; padding:12px 14px; border-left:4px solid #10b981; background:#ecfdf5; border-radius:8px; }
.generation-policy-fixed span { line-height:1.55; }
@media (max-width: 760px) {
    .generation-policy-list { grid-template-columns:1fr; padding:10px; }
    .generation-policy-fixed { flex-direction:column; gap:4px; }
}
.schedule-policy-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(99, 102, 241, .18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.schedule-policy-summary > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.schedule-policy-summary i { color: #4f46e5; }
.schedule-policy-summary span, .schedule-policy-summary small { color: #64748b; }
.schedule-policy-summary .schedule-policy-note { flex-basis: 100%; padding-left: 24px; color: #92400e; }
.support-pattern-panel { padding-top: 20px; border-top: 1px solid rgba(99, 102, 241, .18); }
.support-pattern-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shared-staffing-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; }
.shared-staffing-heading-text { min-width: 0; }
.shared-staffing-actions { display: flex; align-items: stretch; gap: 8px; }
.shared-staffing-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; margin: 0; white-space: nowrap; }
.shared-staffing-actions .btn-primary { width: 96px; min-width: 96px; flex: 0 0 96px; }
.staffing-disclosure-content > .support-pattern-panel > .flex.justify-between > .btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    width: 96px; min-width: 96px; min-height: 42px; flex: 0 0 96px;
    margin: 0; white-space: nowrap;
}
.staffing-copy-extra { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid #efc4cd; border-radius: 12px; background: #fffafb; cursor: pointer; }
.staffing-copy-extra input { margin-top: 3px; }
.staffing-copy-extra span { display: grid; gap: 3px; }
.staffing-copy-extra small { color: var(--text-muted); line-height: 1.45; }
@media (max-width: 760px) {
    .shared-staffing-heading { grid-template-columns: 1fr; gap: 12px; }
    .shared-staffing-actions { display: flex; flex-direction: column; width: 100%; }
    .shared-staffing-actions .btn, .shared-staffing-actions .btn-primary { width: 100%; min-width: 0; flex: none; white-space: nowrap; }
    .staffing-disclosure-content > .support-pattern-panel > .flex.justify-between { flex-direction: column; align-items: stretch; }
    .staffing-disclosure-content > .support-pattern-panel > .flex.justify-between > .btn-primary { width: 100%; min-width: 0; flex: none; }
}
.shared-setting-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 3px 8px; border-radius: 999px; color: #8f4d59; background: #fff1f4; border: 1px solid #efc4cd; font-size: 11px; font-weight: 700; vertical-align: middle; }
.shared-support-setting-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 12px 14px; border: 1px solid #efc4cd; border-radius: 12px; color: #78434d; background: #fff8fa; font-size: 13px; line-height: 1.55; }
.shared-support-setting-note i { margin-top: 3px; }
.support-overlap-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.support-overlap-badge.is-error { color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca; }
.support-overlap-badge.is-warning { color: #9a3412; background: #ffedd5; border: 1px solid #fed7aa; }
.support-comparison-help { display: grid; gap: 16px; }
.support-comparison-help table th, .support-comparison-help table td { vertical-align: top; }
.support-comparison-help section { padding: 14px 16px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.support-comparison-help section h4 { margin: 0 0 8px; color: #312e81; }
.support-comparison-help section p { margin: 6px 0; line-height: 1.6; }
.support-comparison-help .support-help-caution { border-color: #fed7aa; background: #fff7ed; }
.support-comparison-help .support-help-caution h4 { color: #9a3412; }
.support-comparison-help ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.generation-policy-support-group { grid-column: 1 / -1; margin-top: 4px; padding: 0; overflow: hidden; border: 1px solid #efc4cd; border-radius: 14px; background: #fffafb; container-type: inline-size; }
.generation-policy-support-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: #fff1f4; border-bottom: 1px solid #efc4cd; }
.generation-policy-support-heading > div { display: grid; gap: 4px; }
.generation-policy-support-heading strong { color: #312e81; font-size: 16px; }
.generation-policy-support-heading small { color: #64748b; line-height: 1.45; }
.generation-policy-support-switch { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid #dfa3af; border-radius: 10px; background: #fff; color: #78434d; font-weight: 700; cursor: pointer; }
.generation-policy-support-switch input { width: 17px; height: 17px; margin: 0; }
.generation-policy-support-group .generation-policy-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px; }
.generation-policy-support-group .generation-policy-item { background: #fff; }
.generation-policy-support-group .generation-policy-list.is-disabled { opacity: .48; }
@container (max-width: 720px) {
    .generation-policy-support-group .generation-policy-list { grid-template-columns: 1fr; }
    .generation-policy-support-heading { align-items: stretch; flex-direction: column; }
    .generation-policy-support-switch { justify-content: center; }
}
@media (max-width: 700px) { .support-pattern-form { grid-template-columns: 1fr; } }
.schedule-policy-summary strong { color: #312e81; }
@media (max-width: 700px) {
    .schedule-policy-summary { align-items: stretch; flex-direction: column; }
    .schedule-policy-summary .btn { width: 100%; }
}
.password-change-panel { display:grid; gap:14px; width:100%; text-align:left; }
.password-change-panel h3, .password-change-panel p { margin:0; }
.password-change-panel p { color:var(--text-muted); line-height:1.6; }
.password-change-icon { display:grid; place-items:center; width:52px; height:52px; margin:0 auto; border-radius:50%; color:#b54d62; background:#fff0f3; font-size:22px; }
.account-password-card { max-width:620px; margin:0 auto; padding:26px; }
.account-password-heading { display:flex; gap:14px; align-items:flex-start; margin-bottom:22px; }
.account-password-heading > i { color:#b54d62; font-size:24px; }
.account-password-heading h3, .account-password-heading p { margin:0; }
.account-password-heading p { margin-top:5px; color:var(--text-muted); }
.employee-credential-note { display:flex; gap:9px; align-items:flex-start; padding:11px 12px; border:1px solid #efc4cd; border-radius:10px; color:#78434d; background:#fff8fa; font-size:13px; line-height:1.5; }
.employee-credential-note i { margin-top:3px; }
.employee-login-badges { margin-top:5px; }
.employee-login-badges span { display:inline-flex; padding:2px 7px; border-radius:999px; font-size:11px; font-weight:700; }
.employee-login-badges .is-active { color:#047857; background:#d1fae5; }
.employee-login-badges .is-initial { color:#9a3412; background:#ffedd5; }
.employee-login-badges .is-disabled { color:#64748b; background:#e2e8f0; }
.employee-login-badges .is-locked { color:#b91c1c; background:#fee2e2; }
.login-unlock-button { color:#b91c1c; border-color:#fca5a5; background:#fff7f7; }
.temporary-password-result { display:grid; gap:16px; }
.temporary-password-value { display:flex; gap:10px; align-items:center; padding:16px; border-radius:12px; background:#fff1f4; }
.temporary-password-value code { flex:1; font-size:20px; font-weight:700; letter-spacing:.04em; color:#7f3343; overflow-wrap:anywhere; }
.security-warning { padding:12px 14px; border:1px solid #fed7aa; border-radius:10px; color:#9a3412; background:#fff7ed; line-height:1.55; }
