/* Monthly levels share the existing settings and consultant surfaces. */
.level-settings-panel { margin-bottom: 24px; min-width: 0; }
.level-config-section + .level-config-section { border-top: 1px solid var(--line, #dfe5e3); margin-top: 28px; padding-top: 28px; }
.level-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.level-section-heading h4 { margin: 0; font-size: 1rem; }
.level-section-heading p { margin: 6px 0 0; line-height: 1.5; }
.level-section-heading > div { min-width: 0; }
.level-section-heading > button, .level-section-heading > label { flex-shrink: 0; }
.level-rule-details { margin-top: 18px; }
.level-rule-details summary, .level-grace summary { cursor: pointer; font-weight: 600; line-height: 1.5; }
.level-rule-details .level-settings-wide { display: grid; gap: 8px; margin-top: 18px; }
.level-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.level-settings-grid label, .level-fields label, .level-icon-editor label, .level-change-reason { display: grid; align-content: start; gap: 8px; min-width: 0; }
.level-settings-grid small, .level-icon-editor small { color: var(--muted); line-height: 1.5; }
.level-enable { display: flex !important; align-items: center; gap: 10px; margin: 0; font-size: .85rem; }
.level-enable input { width: auto; }
.level-settings-wide { grid-column: 1 / -1; }
.level-definitions { display: grid; gap: 0; margin: 20px 0 12px; border: 1px solid var(--line, #dfe5e3); border-radius: 10px; overflow: hidden; }
.level-definition { background: var(--surface, #fff); min-width: 0; border-left: 3px solid var(--level-color, #b9442d); }
.level-definition + .level-definition { border-top: 1px solid var(--line, #dfe5e3); }
.level-definition-heading { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.level-definition-heading::-webkit-details-marker { display: none; }
.level-definition-heading:hover { background: var(--surface-soft, #f6f7f5); }
.level-definition-heading:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.level-definition-heading .level-icon { display: flex; width: 40px; height: 40px; border-radius: 8px; font-size: 1.1rem; }
.level-definition-title { display: grid; gap: 4px; min-width: 0; flex: 1; }
.level-definition-title small { color: var(--muted); font-size: .72rem; }
.level-definition-title strong { overflow-wrap: anywhere; font-size: .95rem; }
.level-definition-meta { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.level-definition-edit { display: inline-flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); }
.level-definition[open] > summary .level-definition-edit > span { transform: rotate(180deg); }
.level-editor-grid { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 24px; padding: 22px; border-top: 1px solid var(--line, #dfe5e3); }
.level-editor-footer { display: flex; justify-content: flex-end; }
.level-name-points { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .8fr); gap: 16px; }
.level-fields, .level-icon-editor { display: grid; align-content: start; gap: 14px; min-width: 0; }
.level-icon-editor input[type=file] { padding: 0; border: 0; max-width: 100%; font-size: .75rem; }
.level-icon-editor .text-button { justify-self: start; }
.level-icon { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; flex: 0 0 auto; }
.level-icon-large { width: 72px; height: 72px; }
.level-icon-placeholder { display: inline-flex; align-items: center; justify-content: center; background: #f8efdf; color: #946332; font-size: 1.5rem; font-weight: 700; }
.level-save-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line, #dfe5e3); }
.level-change-reason { margin: 0; }
.level-config-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.level-config-actions > span { flex-basis: 100%; }
.level-config-actions > span:empty { display: none; }
.level-reload-confirmation { margin-top: 18px; padding: 16px; border-left: 3px solid var(--brand); background: var(--surface-soft, #f4f6f5); }
.level-reload-confirmation[hidden] { display: none; }
.level-reload-confirmation p { margin: 0; }
.level-reload-confirmation .level-config-actions { margin-top: 12px; }
.person-level-card, .level-inactive { border: 1px solid var(--line, #dfe5e3); border-radius: 10px; padding: 22px; margin: 20px 0; background: var(--surface, #fff); min-width: 0; }
.level-current { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.level-current > div { flex: 1; min-width: 140px; }
.level-current h4 { font-size: 1.25rem; margin: 2px 0 6px; }
.level-current p { margin: 0; }
.level-progress { margin-top: 20px; }
.level-progress > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.level-progress progress { display: block; width: 100%; height: 8px; margin: 10px 0; accent-color: var(--brand); }
.level-progress progress::-webkit-progress-bar { background: #e5eae6; border-radius: 20px; }
.level-progress progress::-webkit-progress-value { background: var(--brand); border-radius: 20px; }
.level-benefits, .level-grace { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line, #dfe5e3); }
.level-benefits p, .level-custom-explanation { white-space: pre-line; overflow-wrap: anywhere; }
.level-grace p, .level-benefits p, .level-inactive p { margin: 8px 0 0; line-height: 1.6; }
.level-grace-active { border-left: 3px solid #ad7735; padding: 14px 16px; background: #fcf7ed; }
.level-next-closing { margin: 16px 0 0; line-height: 1.5; }
.level-history { margin-top: 18px; }
.level-history summary { cursor: pointer; font-weight: 600; }
.level-history .table-wrap { margin-top: 12px; }
.level-history td small { display: block; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.level-person-link { padding: 0; text-align: left; color: inherit; font: inherit; font-weight: 650; text-decoration: none; }
.level-person-link:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 700px) {
 .level-settings-grid, .level-name-points { grid-template-columns: minmax(0, 1fr); }
 .level-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
 .level-icon-editor { grid-template-columns: 72px minmax(0, 1fr); gap: 10px 16px; }
 .level-icon-editor > div { grid-row: span 2; }
 .level-icon-editor > .text-button, .level-icon-editor > p { grid-column: 2; }
 .person-level-card, .level-inactive { padding: 16px; }
 .level-editor-grid { padding: 18px; }
 .level-section-heading { flex-wrap: wrap; gap: 14px; }
 .level-definition-heading { gap: 10px; padding: 14px 12px; flex-wrap: wrap; }
 .level-definition-meta { margin-left: 50px; flex-basis: calc(100% - 120px); order: 1; }
 .level-definition-edit { margin-left: auto; }
}
.level-color-editor { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 16px; align-items: end; }
.level-color-editor input[type=color] { min-height: 42px; padding: 4px; width: 100%; cursor: pointer; }
.level-icon-placeholder { color: #263238; background: color-mix(in srgb, var(--level-color, #b9442d) 14%, white); border: 1px solid #dfe5e3; border-top: 3px solid var(--level-color, #b9442d); }
.person-level-card { border-top: 4px solid var(--level-color, #b9442d); }
.level-progress progress { accent-color: var(--level-color, var(--brand)); }
.level-progress progress::-webkit-progress-value { background: var(--level-color, var(--brand)); }
.level-calendar { min-width: 0; }
.level-calendar h4 { margin: 0; }
.level-calendar-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.level-calendar-fields label, .holiday-import label { display: grid; gap: 8px; align-content: start; min-width: 0; }
.level-calendar-fields label.mini-check { display: flex; align-items: center; align-self: center; }
.level-calendar-fields .mini-check input { width: auto; }
.holiday-import { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.holiday-import label { width: 150px; }
.holiday-import button { min-height: 44px; }
.holiday-list,.holiday-manual { margin-top: 18px; border-top: 1px solid var(--line,#dfe5e3); padding-top: 16px; }
.holiday-list summary,.holiday-manual summary,.level-count-card summary { cursor: pointer; font-weight: 600; }
.holiday-list summary small { display: block; font-weight: 400; color: var(--muted); padding-top: 8px; }
.holiday-rows { margin-top: 12px; max-height: 430px; overflow: auto; }
.holiday-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line,#dfe5e3); }
.holiday-row label { display: flex; align-items: flex-start; flex: 1; min-width: 0; gap: 10px; }
.holiday-row label input { width: auto; margin-top: 5px; flex-shrink: 0; }
.holiday-row small { display: block; margin-top: 4px; color: var(--muted); }
.holiday-row span { overflow-wrap: anywhere; }
.holiday-row button { flex-shrink: 0; }
.level-overview { margin: 20px 0 28px; min-width: 0; }
.level-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.level-overview-heading h3 { margin: 0; font-size: 1.1rem; }
.level-overview-heading > span { color: var(--muted); font-size: .85rem; }
.level-count-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; margin-top: 18px; }
.level-count-card { border: 1px solid var(--line,#dfe5e3); border-left: 3px solid var(--level-color,#b9442d); border-radius: 10px; padding: 18px; background: var(--surface,#fff); min-width: 0; }
.level-count-top { display: flex; gap: 12px; align-items: center; }
.level-count-top .level-icon { width: 42px; height: 42px; border-radius: 8px; }
.level-count-card h4 { font-size: 1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.level-count-title { min-width: 0; }
.level-count-title small { color: var(--muted); }
.level-count-metric { display: flex; gap: 12px; align-items: baseline; margin-top: 20px; }
.level-big-number { display: block; font-size: 2.25rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.level-count-metric > span { font-size: .8rem; color: var(--muted); }
.level-count-foot { display: flex; gap: 8px 16px; align-items: baseline; flex-wrap: wrap; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line,#dfe5e3); }
.level-count-foot > p { margin: 0; flex: 1; }
.level-count-foot details { flex-shrink: 0; }
.level-count-foot details[open] { flex-basis: 100%; }
.level-overview-scope { margin-top: 12px; line-height: 1.5; }
.level-count-card summary { font-size: .8rem; }
@media (max-width: 700px) { .level-calendar-fields { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 460px) { .level-count-grid { grid-template-columns: minmax(0,1fr); } .level-overview-heading { align-items: start; flex-direction: column; gap: 6px; } }
.holiday-date-field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.holiday-date-control { display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 8px; }
.holiday-date-control input[type=date] { width: 48px; min-width: 0; cursor: pointer; color: transparent; }
.holiday-date-control input[type=date]::-webkit-datetime-edit { display: none; }
.holiday-date-control input[type=date]::-webkit-calendar-picker-indicator { width: 22px; height: 22px; opacity: 1; cursor: pointer; margin: 0 auto; }
