:root {
  --ink: #17243d;
  --muted: #66748b;
  --line: #dfe5ec;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --accent: #275fbb;
  --accent-dark: #194b98;
  --accent-soft: #eaf1fc;
  --danger: #b23846;
  --shadow: 0 14px 40px rgba(31, 50, 78, .10);
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.45 "Segoe UI", Arial, sans-serif; }
main { flex: 1 1 auto; min-height: 0; overflow: auto; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.topbar { position: relative; flex: 0 0 auto; min-height: 74px; padding: 10px 20px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 18px; background: #122746; color: white; box-shadow: 0 4px 18px rgba(14, 33, 61, .22); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; }
h2 { margin-bottom: 8px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 3px; color: #92b9f5; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.app-brand { grid-column: 1; display: flex; min-width: 0; align-items: center; gap: 12px; }
.app-brand h1 { display: flex; flex: 0 0 auto; min-height: 30px; align-items: center; line-height: 1; }
.current-filename { display: inline-flex; min-width: 0; height: 30px; max-width: min(34vw, 520px); align-items: center; overflow: hidden; padding: 0 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; background: rgba(255,255,255,.08); color: #cbd9ec; font-size: 12px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { grid-column: 3; display: flex; align-items: center; justify-self: end; gap: 9px; }
.sql-sync-status { flex: 0 0 24px; width: 24px; height: 24px; padding: 0; border: 1px solid #527292; border-radius: 50%; background: #173452; color: #b5e1cf; font-size: 14px; cursor: pointer; }
.sql-sync-status.sync-working { animation: database-save-pulse 1.2s ease-in-out infinite; }
.sql-user-button { border: 1px solid #49607d; background: transparent; color: #e0e9f6; border-radius: 9px; padding: 7px 12px; cursor: pointer; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sql-user-menu { position: fixed; z-index: 1000; min-width: 230px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.sql-user-menu .button { display: block; width: 100%; margin: 0 !important; text-align: left; background: transparent; border: 0; padding: 10px 12px; height: auto; }
.sql-user-menu .button:hover { background: var(--accent-soft); }
#sqlDocumentSelect { width: min(300px,25vw); flex: 0 1 300px; cursor: pointer; }
#sqlDocumentSelect option { color: var(--ink); background: white; }
.sql-sync-status.sync-error { color: #ffe1af; border-color: #b48a4b; }
.topbar .header-icon-button { display: inline-flex; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 11px; background: linear-gradient(145deg, #3477d7, #194b98); color: white; box-shadow: 0 5px 12px rgba(5,20,45,.28), inset 0 1px 0 rgba(255,255,255,.18); }
.topbar .header-icon-button:hover { background: linear-gradient(145deg, #4384dd, #2057a8); box-shadow: 0 7px 16px rgba(5,20,45,.34), inset 0 1px 0 rgba(255,255,255,.22); transform: translateY(-1px); }
.header-icon-button svg { flex: 0 0 26px; width: 26px; height: 26px; overflow: visible; fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.05; transform-origin: center; transition: transform .18s cubic-bezier(.2,.8,.2,1), opacity .18s ease; }
.header-icon-button:not(:disabled):hover svg { opacity: 1; transform: scale(1.04); }
.header-icon-button:not(:disabled):active svg { opacity: 1; transform: translateY(1px) scale(.93); }
.header-icon-button.icon-clicked svg { animation: icon-pop .32s cubic-bezier(.2,.85,.25,1); }
.header-icon-button.settings-button.icon-clicked svg { animation-name: settings-tune; animation-duration: .38s; }
.header-icon-button.undo-button.icon-clicked svg { animation-name: undo-swing; animation-duration: .38s; }
.header-icon-button.save-button.icon-clicked svg { animation-name: save-settle; animation-duration: .38s; }
.header-icon-button.print-button.icon-clicked svg { animation-name: print-press; animation-duration: .4s; }
@keyframes print-press { 45% { transform: translateY(2px) scale(.94); } 70% { transform: translateY(-1px) scale(1.03); } }
@keyframes icon-pop { 0% { transform: scale(1); } 45% { transform: scale(.82); } 75% { transform: scale(1.13); } 100% { transform: scale(1); } }
@keyframes settings-tune { 0% { transform: translateX(0) scale(1); } 35% { transform: translateX(-2px) scale(.9); } 70% { transform: translateX(2px) scale(1.05); } 100% { transform: translateX(0) scale(1); } }
@keyframes undo-swing { 0% { transform: translateX(0) rotate(0); } 45% { transform: translateX(-4px) rotate(-12deg) scale(.9); } 100% { transform: translateX(0) rotate(0); } }
@keyframes save-settle { 0% { transform: translateY(0) scale(1); } 42% { transform: translateY(3px) scale(.88); } 72% { transform: translateY(-2px) scale(1.08); } 100% { transform: translateY(0) scale(1); } }
.view-switch { grid-column: 2; display: flex; justify-self: center; padding: 4px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.07); }
.view-button { height: 34px; padding: 0 15px; border: 0; border-radius: 6px; background: transparent; color: #c8d7ec; cursor: pointer; font-weight: 650; }
.view-button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.topbar label { color: #c8d7ec; }
select, input[type="date"], input[type="text"] { height: 39px; min-width: 190px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); outline: none; }
input[type="search"] { height: 39px; min-width: 220px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); outline: none; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39,95,187,.13); }
.button { height: 39px; padding: 0 16px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-weight: 650; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: default; transform: none; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { border-color: var(--line); background: white; color: var(--ink); }
.ghost { width: 100%; border-color: #cbd7e9; background: #f7faff; color: var(--accent-dark); }
.danger { background: #fff0f2; border-color: #f0c4ca; color: var(--danger); }
.welcome { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 50% 32%, #fff 0, #f3f6fa 42%, #e9eef5 100%); }
.welcome-card { width: min(520px, 92vw); min-height: 352px; padding: 38px 42px 42px; text-align: center; background: rgba(255,255,255,.96); border: 1px solid #dbe3ed; border-radius: 18px; box-shadow: 0 20px 60px rgba(26,47,78,.14); }
.welcome-mark { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 22px; border-radius: 18px; background: linear-gradient(145deg, #3477d7, #194b98); box-shadow: 0 10px 24px rgba(39,95,187,.27); color: white; }
.welcome-mark svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.welcome-mark .mark-accent { color: #a9f0c0; stroke-width: 3; }
.welcome-state { animation: welcome-state-in .28s ease both; }
.welcome-state h2 { margin-bottom: 7px; font-size: 22px; }
.welcome-state p { margin-bottom: 0; color: var(--muted); }
.loader-orbit { position: relative; width: 38px; height: 38px; margin: 4px auto 18px; border: 3px solid #dbe7f8; border-radius: 50%; }
.loader-orbit::before { content: ""; position: absolute; inset: -3px; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); border-radius: 50%; animation: loader-spin .8s linear infinite; }
.loader-orbit span { position: absolute; inset: 10px; border-radius: 50%; background: #dce9fb; animation: loader-pulse 1.2s ease-in-out infinite; }
.welcome-file-picker { display: grid; grid-template-columns: minmax(0,1fr) 43px; gap: 9px; margin-top: 24px; text-align: left; }
.welcome-file-picker select { width: 100%; min-width: 0; }
.welcome-open-button { display: inline-flex; align-items: center; justify-content: center; width: 43px; padding: 0; }
.welcome-open-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.file-picker-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: #8a97a9; font-size: 11px; text-align: center; }
.file-picker-divider::before, .file-picker-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.browse-local-file, .welcome-create-button { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.browse-local-file svg, .welcome-create-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.file-loader { display: flex; justify-content: center; gap: 7px; height: 38px; margin: 7px auto 15px; align-items: center; }
.file-loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: file-dot 1s ease-in-out infinite; }
.file-loader span:nth-child(2) { animation-delay: .14s; }
.file-loader span:nth-child(3) { animation-delay: .28s; }
#fileLoadingName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-pulse { 0%,100% { transform: scale(.72); opacity: .55; } 50% { transform: scale(1); opacity: 1; } }
@keyframes file-dot { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-8px); opacity: 1; } }
@keyframes welcome-state-in { from { transform: translateY(5px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loader-orbit::before, .loader-orbit span, .file-loader span, .welcome-state, .header-icon-button.icon-clicked svg, .save-progress-icon svg, .save-progress-icon > span, .save-progress-line span, .header-icon-button.save-button.saving svg { animation-duration: .01ms; animation-iteration-count: 1; } }
.workspace { display: block; height: 100%; min-height: 0; }
.sidebar { padding: 12px; border-right: 1px solid var(--line); background: #e9eef5; }
.panel { margin-bottom: 9px; padding: 12px; border: 1px solid #d5dee9; border-radius: 8px; background: rgba(255,255,255,.82); }
.panel label { margin-bottom: 9px; }
.panel select, .panel input { min-width: 0; width: 100%; }
.schedule-toolbar { flex: 0 0 auto; margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 3px 12px rgba(31,50,78,.05); }
.schedule-mode-tabs { display: flex; gap: 1px; min-height: 34px; padding: 3px 5px 0; border-bottom: 1px solid var(--line); background: #f5f7fa; }
.schedule-mode-tab { min-width: 118px; height: 30px; padding: 0 13px; border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.schedule-mode-tab:hover { color: var(--accent-dark); background: #eef3fa; }
.schedule-mode-tab.active { border-color: var(--line); background: white; color: var(--accent-dark); font-weight: 700; }
.schedule-control-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 10px; }
.schedule-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; padding-right: 7px; border-right: 1px solid var(--line); }
.schedule-action-button { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #40516a; cursor: pointer; transition: color .15s ease, background .15s ease, transform .15s ease; }
.schedule-action-button:hover { background: #eaf1fc; color: var(--accent-dark); transform: translateY(-1px); }
.schedule-action-button:active { transform: translateY(1px) scale(.94); }
.schedule-action-button:disabled { opacity: .32; cursor: default; transform: none; }
.schedule-action-button svg { width: 23px; height: 23px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.schedule-picker { display: flex; align-items: center; gap: 5px; }
.schedule-picker > span { color: #40516a; font-size: 11px; font-weight: 650; white-space: nowrap; }
.schedule-picker select { width: min(310px, 26vw); min-width: 190px; height: 31px; padding: 0 8px; border-radius: 4px; }
.schedule-picker[data-schedule-selector] > span { flex: 0 0 92px; width: 92px; }
.schedule-picker[data-schedule-selector] select { width: 190px; min-width: 190px; }
.class-speciality-filter > span { flex-basis: 92px !important; width: 92px !important; }
.class-speciality-filter select { width: 150px !important; min-width: 150px !important; }
.class-group-picker > span { flex-basis: 58px !important; width: 58px !important; }
.teacher-chair-filter > span { flex-basis: 58px !important; width: 58px !important; }
.teacher-chair-filter select { width: 135px !important; min-width: 135px !important; }
.week-picker select { width: 190px; min-width: 190px; }
.schedule-picker select.schedule-complete { border-color: #79bb88; background: #e2f7e6; color: #185c2a; }
.schedule-picker select.schedule-incomplete { border-color: #d98a91; background: #ffe3e5; color: #8e2632; }
.schedule-picker select.schedule-inactive { background: white; color: var(--ink); }
.schedule-picker select option.schedule-complete { background: #d9f5df; color: #164f25; }
.schedule-picker select option.schedule-incomplete { background: #ffd9dc; color: #83222d; }
.schedule-picker select option.schedule-inactive { background: white; color: #758195; }
.step-button { display: inline-flex; align-items: center; justify-content: center; width: 27px; min-width: 27px; height: 29px; padding: 0 0 2px; border: 1px solid #cbd7e5; border-radius: 4px; background: #f7fafc; color: #198238; cursor: pointer; font-size: 20px; font-weight: 700; line-height: 1; }
.step-button:hover { border-color: #89ad93; background: #edf8f0; }
.step-button:disabled { opacity: .38; cursor: default; }
.panel-label { display: block; margin-bottom: 15px; color: var(--ink); font-size: 13px; font-weight: 750; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat strong { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 11px; }
.hint p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.schedule-area { display: flex; flex-direction: column; min-width: 0; width: 100%; height: 100%; padding: 10px 12px 12px; overflow: hidden; }
.directory-workspace { display: grid; grid-template-columns: 205px minmax(700px, 1fr); min-height: calc(100vh - 74px); }
.data-workspace { min-height: calc(100vh - 74px); padding: 18px; background: #eef3f8; }
.data-tabs-shell { margin-bottom: 0; overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: white; box-shadow: 0 3px 12px rgba(31,50,78,.05); }
.data-tabs { display: flex; gap: 1px; min-height: 34px; padding: 3px 5px 0; border-bottom: 1px solid var(--line); background: #f5f7fa; }
.data-tab { min-width: 118px; height: 30px; padding: 0 13px; border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.data-tab:hover { color: var(--accent-dark); background: #eef3fa; }
.data-tab.active { border-color: var(--line); background: white; color: var(--accent-dark); font-weight: 700; }
.data-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: white; box-shadow: 0 5px 18px rgba(31,50,78,.05); }
.data-toolbar { display: flex; align-items: end; gap: 12px; min-height: 58px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.data-toolbar label { min-width: 210px; }
.data-toolbar label.data-group-picker { min-width: 0; }
.data-group-picker { display: flex; flex-direction: column; gap: 5px; color: #40516a; font-size: 11px; font-weight: 700; }
.data-group-picker > div { display: grid; grid-template-columns: 25px minmax(210px,280px) 25px; align-items: center; gap: 5px; }
.data-group-picker select { width: 100%; min-width: 0; }
.data-group-picker > select[data-data-mode] { width: 155px; }
.data-group-picker > select[data-data-chair] { width: 210px; }
.data-note { margin: 0; padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.data-summary { align-self: center; color: var(--muted); font-size: 12px; }
.data-table-wrap { max-height: calc(100vh - 230px); overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 31px; padding: 4px 34px 4px 7px; border: 1px solid #d5dde7; background: #edf2f7; color: #4d5d73; font-size: 11px; line-height: 1.15; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.data-table td { height: 29px; padding: 4px 7px; border: 1px solid #dfe5ec; font-size: 11px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.data-table tbody tr:hover td { background: #f3f7fc; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr[data-selection-key] { user-select: none; touch-action: none; }
.data-table tbody tr.data-row-selected td { background: #e7f0fd !important; }
.data-table tbody tr.data-row-selected:hover td { background: #dceafd !important; }
.sortable-column { position: relative; cursor: pointer; user-select: none; }
.sortable-column::after { content: "↕"; position: absolute; right: 21px; top: 50%; color: #9aa7b8; font-size: 9px; transform: translateY(-50%); }
.sortable-column.sort-ascending::after { content: "▲"; color: var(--accent); }
.sortable-column.sort-descending::after { content: "▼"; color: var(--accent); }
.table-filter-control { position: absolute; right: 3px; top: 50%; z-index: 8; display: block; transform: translateY(-50%); }
.table-filter-button { display: grid; width: 16px; height: 16px; place-items: center; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #8795a8; cursor: pointer; }
.table-filter-button:hover, .table-filter-button.active, .table-filter-control.open .table-filter-button { background: #dce7f6; color: var(--accent-dark); }
.table-filter-button svg { width: 11px; height: 11px; fill: currentColor; }
.table-filter-popover { display: none; position: fixed; z-index: 2000; width: 260px; padding: 8px; border: 1px solid #bdc9d9; border-radius: 7px; background: white; box-shadow: 0 9px 24px rgba(31,50,78,.2); color: var(--ink); font-size: 11px; font-weight: 400; text-align: left; text-transform: none; }
.table-filter-popover.open { display: block; }
.table-filter-popover input[type="search"] { width: 100%; min-width: 0; height: 29px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 400; text-transform: none; }
.table-filter-sort { display: grid; gap: 2px; margin-bottom: 7px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.table-filter-sort button { height: 27px; padding: 0 7px; border: 0; border-radius: 4px; background: transparent; color: #344862; cursor: pointer; font-size: 11px; text-align: left; }
.table-filter-sort button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.table-filter-sort .table-filter-reset-top { margin-top: 3px; padding-top: 4px; border-top: 1px solid var(--line); color: var(--danger); }
.table-filter-selection-actions { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 4px; }
.table-filter-selection-actions button { padding: 0; border: 0; background: transparent; color: var(--accent-dark); cursor: pointer; font-size: 10px; }
.table-filter-selection-actions button:hover { text-decoration: underline; }
.table-filter-values { display: block; max-height: 210px; overflow: auto; padding: 3px 0; border: 1px solid var(--line); border-radius: 4px; background: #fbfcfe; }
.table-filter-option { display: flex; flex-direction: row; align-items: center; gap: 7px; min-height: 27px; padding: 3px 7px; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 400; }
.table-filter-option:hover { background: #edf3fb; }
.table-filter-option input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; }
.table-filter-option span { min-width: 0; overflow-wrap: anywhere; }
.plan-table { table-layout: fixed; }
.plan-table th:nth-child(1), .plan-table td:nth-child(1) { width: 3%; text-align: center; }
.plan-table th:nth-child(2), .plan-table td:nth-child(2) { width: 34%; }
.plan-table th:last-child, .plan-table td:last-child { width: 7%; }
.plan-table th .table-header-label { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.data-load-table { width: 100%; min-width: 0; table-layout: fixed; }
.data-load-table th, .data-load-table td { height: auto; min-height: 29px; padding: 5px 7px; overflow-wrap: anywhere; white-space: normal; word-break: normal; vertical-align: top; }
.data-load-table th:nth-child(1), .data-load-table td:nth-child(1) { width: 3%; padding-left: 3px; padding-right: 3px; text-align: center; }
.data-load-table th:nth-child(2), .data-load-table td:nth-child(2) { width: 14%; }
.data-load-table th:nth-child(3), .data-load-table td:nth-child(3) { width: 38%; }
.data-load-table th:nth-child(4), .data-load-table td:nth-child(4) { width: 22%; }
.data-load-table th:nth-child(5), .data-load-table td:nth-child(5) { width: 13%; }
.data-load-table th:nth-child(6), .data-load-table td:nth-child(6) { width: 10%; padding-left: 3px; padding-right: 3px; font-size: 11px; font-weight: 700; text-align: center; }
.data-load-table td.data-load-total-ok { background: #d9f8de; color: #185c2a; }
.data-load-table td.data-load-total-mismatch { background: #ffd9db; color: #8e2632; }
.data-load-table-wrap { max-height: calc(100vh - 340px); }
.data-load-missing-note { max-height: 105px; overflow: auto; padding: 8px 12px 10px; border-top: 1px solid var(--line); background: #fff7f7; color: #7f2932; font-size: 11px; }
.data-load-missing-note.complete { background: #eefaf0; color: #216232; }
.data-load-missing-note.empty { background: #f7f9fc; color: var(--muted); }
.data-load-missing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.data-load-missing-head strong { font-size: 12px; }
.data-load-missing-head .checkbox { flex: 0 0 auto; gap: 5px; margin: 0; color: #52647b; font-size: 11px; font-weight: 600; }
.data-load-missing-head .checkbox input { width: 14px; height: 14px; }
.data-load-missing-list { display: flex; flex-wrap: wrap; gap: 5px 8px; }
.data-load-missing-item { min-width: 0; padding: 3px 7px; border: 1px solid #efc2c6; border-radius: 5px; background: white; line-height: 1.3; overflow-wrap: anywhere; }
.graph-table-wrap { max-height: calc(100vh - 250px); }
.graph-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 11px; }
.graph-table th, .graph-table td { height: 24px; padding: 2px 3px; line-height: 1.05; }
.graph-table th:nth-child(1), .graph-table td:nth-child(1) { width: 2%; text-align: center; }
.graph-table th:nth-child(2), .graph-table td:nth-child(2) { width: 16%; }
.graph-table th:nth-child(3), .graph-table td:nth-child(3) { width: 12%; }
.graph-table th:nth-child(4), .graph-table td:nth-child(4) { width: 8%; }
.graph-table th:nth-child(5), .graph-table td:nth-child(5) { width: 6%; text-align: center; }
.graph-table th:nth-child(n+6), .graph-table td:nth-child(n+6) { padding: 1px; text-align: center; }
.graph-table th:nth-child(n+6)::after { display: none; }
.graph-table input { width: 100%; min-width: 0; height: 20px; padding: 0; border: 0; border-radius: 2px; background: rgba(255,255,255,.72); font-size: 11px; text-align: center; }
.graph-week-available { background-color: #e2f5e6 !important; }
.graph-week-unavailable { background-color: #eef1f5 !important; color: #8994a4 !important; }
.graph-total-ok { background: #d9f8de !important; }
.graph-total-mismatch { background: #ffd9db !important; }
.graph-table tfoot td { position: sticky; bottom: 0; z-index: 2; height: 27px; border-top: 2px solid #9cabc0; background: #e8eef7; color: #263d5d; font-weight: 800; text-align: center; }
.graph-table tfoot td:nth-child(2) { text-align: left; }
.graph-mask-dialog { width: min(720px,calc(100vw - 28px)); }
.graph-mask-dialog .dialog-head { margin-bottom: 13px; }
.graph-mask-meta { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.graph-mask-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.graph-mask-presets button { min-width: 54px; height: 31px; padding: 0 10px; border: 1px solid #cbd7e5; border-radius: 6px; background: #f7f9fc; color: #40516a; cursor: pointer; font-size: 12px; font-weight: 700; }
.graph-mask-presets button:hover { border-color: #89a6ce; background: #eaf1fc; color: var(--accent-dark); }
.graph-mask-fit { margin-top: 12px; }
.graph-mask-preview { display: grid; grid-template-columns: repeat(18,minmax(25px,1fr)); gap: 3px; max-height: 112px; margin-top: 12px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.graph-mask-week { display: grid; min-width: 25px; height: 42px; place-items: center; border: 1px solid #cbd6e3; border-radius: 5px; background: white; color: #344862; font-size: 12px; font-weight: 750; }
.graph-mask-week::before { content: attr(data-week); display: block; color: #8a96a8; font-size: 8px; font-weight: 600; line-height: 1; }
.graph-mask-week.unavailable { background: #e9edf2; color: #a0a9b5; }
.graph-mask-week.empty { color: #b2bac5; }
.graph-mask-status { min-height: 20px; margin: 8px 0 0; color: #397049; font-size: 12px; }
.graph-mask-status.error { color: var(--danger); }
.form-section-title { margin: 16px 0 8px; color: #40516a; font-size: 13px; }
.hours-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 12px; max-height: 260px; overflow: auto; padding: 2px; }
.hours-form-grid input { width: 100%; }
.inline-actions { display: flex; align-items: end; gap: 7px; }
select[multiple] { height: auto; padding: 5px; }
.directory-nav { padding: 12px 9px; border-right: 1px solid var(--line); background: #e9eef5; }
.directory-nav .panel-label { padding: 0 8px; }
.directory-nav-button { width: 100%; margin-bottom: 3px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: #40516a; cursor: pointer; font-size: 13px; text-align: left; }
.directory-nav-button:hover { background: rgba(255,255,255,.7); }
.directory-nav-button.active { background: white; color: var(--accent-dark); box-shadow: 0 2px 9px rgba(31,50,78,.08); font-weight: 700; }
.directory-nav-button span { float: right; color: var(--muted); font-size: 11px; }
.directory-main { min-width: 0; padding: 15px 18px 28px; }
.directory-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.directory-head h2 { margin-bottom: 0; }
.directory-actions { display: flex; align-items: center; gap: 9px; }
.directory-tool-button, .data-tool-button { display: inline-grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #40516a; cursor: pointer; transition: color .15s ease, background .15s ease, transform .15s ease; }
.directory-tool-button svg, .data-tool-button svg { width: 23px; height: 23px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.directory-tool-button:hover:not(:disabled), .data-tool-button:hover:not(:disabled) { background: #eaf1fc; color: var(--accent-dark); transform: translateY(-1px); }
.directory-tool-button:active:not(:disabled), .data-tool-button:active:not(:disabled) { transform: translateY(1px) scale(.94); }
.directory-tool-button.delete:not(:disabled), .data-tool-button.delete:not(:disabled) { color: #a43b48; }
.directory-tool-button.delete:hover:not(:disabled), .data-tool-button.delete:hover:not(:disabled) { background: #fff1f2; }
.directory-tool-button:disabled, .data-tool-button:disabled { color: #40516a; cursor: default; opacity: .32; transform: none; }
.directory-description { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.directory-table-wrap { overflow: auto; max-height: calc(100vh - 180px); border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 7px 25px rgba(31,50,78,.07); }
.directory-table { min-width: 760px; table-layout: auto; }
.directory-table th { position: sticky; top: 0; z-index: 2; height: 38px; padding: 7px 34px 7px 10px; background: #f5f8fc; color: #506078; font-size: 12px; text-transform: uppercase; white-space: normal; overflow-wrap: anywhere; }
.directory-table td { height: 38px; padding: 8px 10px; cursor: pointer; font-size: 14px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.directory-table tbody tr[data-directory-id] { user-select: none; }
.directory-table tbody tr:hover td { background: #f7faff; }
.directory-table tbody tr.directory-row-selected td { background: #e7f0fd; }
.directory-table tbody tr.directory-row-selected:hover td { background: #dceafd; }
.directory-id { width: 72px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-directory { padding: 40px !important; color: var(--muted); text-align: center; }
.schedule-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 8px; }
.schedule-head h2 { margin-bottom: 0; }
.legend { color: var(--muted); font-size: 12px; }
.legend span { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: var(--accent); }
.table-wrap { flex: 1 1 0; min-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 5px 18px rgba(31, 50, 78, .06); }
table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { border-right: 0; }
tr:last-child td { border-bottom: 0; }
thead th { position: sticky; top: 0; z-index: 2; height: 42px; padding: 5px 7px; background: #f7f9fc; text-align: left; }
thead th:first-child { width: 88px; }
.day-name { display: block; font-size: 13px; }
.day-date { color: var(--muted); font-size: 11px; font-weight: 500; }
.schedule-day-with-toggle { padding-right: 34px; }
.schedule-day-work-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 22px; height: 22px; place-items: center; padding: 0 0 1px; transform: translateY(-50%); border: 1px solid #bbc8d8; border-radius: 6px; background: white; color: #31516f; cursor: pointer; font-size: 16px; font-weight: 750; line-height: 1; transition: background .12s ease, color .12s ease, transform .12s ease; }
.schedule-day-work-toggle:hover:not(:disabled) { transform: translateY(-50%) scale(1.07); background: #e8f1fb; color: #123f70; }
.schedule-day-work-toggle:disabled { opacity: .4; cursor: default; }
.time-cell { padding: 6px 7px; vertical-align: top; background: #fafbfd; font-size: 11px; }
.time-cell strong { display: block; }
.time-cell small { color: var(--muted); }
.slot { position: relative; height: 48px; padding: 0; overflow: hidden; vertical-align: top; background: white; cursor: pointer; transition: background .12s; }
.slot-content { position: relative; box-sizing: border-box; height: 48px; max-height: 48px; padding: 3px; overflow: hidden; }
#scheduleTable tbody tr { height: 48px; }
.slot:hover { background: #f7faff; }
.slot.entity-available { background: #e3f9e6; }
.slot.entity-unavailable { background: #ffe1e3; }
.slot.holiday-cell { background: repeating-linear-gradient(135deg,#ffe1e3 0,#ffe1e3 8px,#f8cdd2 8px,#f8cdd2 16px); }
#scheduleTable th.holiday-day { background: #f7d8dc; color: #8c2935; }
.slot-work-toggle { position: absolute; right: 3px; bottom: 3px; z-index: 3; display: grid; width: 18px; height: 18px; place-items: center; padding: 0 0 1px; border: 1px solid rgba(45,75,106,.25); border-radius: 5px; background: rgba(255,255,255,.78); color: #31516f; cursor: pointer; font-size: 14px; font-weight: 750; line-height: 1; opacity: 0; transition: opacity .12s ease, transform .12s ease, background .12s ease; }
.slot:hover .slot-work-toggle, .slot-work-toggle:focus-visible { opacity: 1; }
.slot-work-toggle:hover { background: white; transform: scale(1.08); }
.slot.drop-ready { box-shadow: inset 0 0 0 2px #257c3b; }
.slot.availability-available, .slot.availability-busy { background: #aaf2ae; }
.slot.availability-unavailable { background: #f49da1; }
.slot.availability-teacher-busy { background: #9cc9f3; }
.slot.availability-current { background: #c4a7eb; }
.slot.availability-teacher-busy .availability-note { color: #173f65; }
.availability-note { display: block; margin: 0; overflow: hidden; color: #783b20; font-size: 8px; font-weight: 750; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.availability-occupant { margin: 0; padding: 1px 3px; color: var(--ink); }
.availability-occupant strong, .availability-occupant span { display: block; overflow: hidden; font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.availability-occupant strong { font-size: 10px; }
.availability-legend { color: var(--muted); font-size: 10px; white-space: nowrap; }
.availability-legend span { display: inline-block; width: 11px; height: 11px; margin: 0 4px 0 9px; border: 1px solid rgba(0,0,0,.12); vertical-align: -2px; }
.availability-legend span:first-child { margin-left: 0; }
.availability-legend .available { background: #aaf2ae; }
.availability-legend .unavailable { background: #f49da1; }
.availability-legend .busy { background: #aaf2ae; }
.availability-legend .teacher-busy { background: #9cc9f3; }
.availability-legend .current { background: #c4a7eb; }
.lesson { position: relative; margin-bottom: 3px; padding: 4px 25px 4px 6px; border: 1px solid #c9d8ef; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); cursor: grab; touch-action: none; }
.lesson:hover { border-color: #8facd9; }
.lesson[draggable="true"] { cursor: grab; }
.lesson[draggable="true"]:active { cursor: grabbing; }
.lesson.pointer-dragging { opacity: .58; cursor: grabbing; }
.slot.pointer-drop-target { box-shadow: inset 0 0 0 2px rgba(36,57,79,.72); }
body.dragging-schedule-card { cursor: grabbing; user-select: none; }
#scheduleTable.availability-mode .lesson { margin: 0; padding: 1px 3px; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: inherit; }
#scheduleTable.availability-mode .lesson:hover { border: 0; }
#scheduleTable.availability-mode .lesson-menu, #scheduleTable.availability-mode .lesson.fixed::after { display: none; }
#scheduleTable.availability-mode .slot.availability-compact-conflict .lesson { display: none; }
#scheduleTable.availability-mode .lesson.pointer-dragging { opacity: 1; }
#scheduleTable.availability-mode .lesson strong { font-size: 10px; line-height: 1.05; }
#scheduleTable.availability-mode .lesson span { font-size: 8.5px; line-height: 1.05; }
#scheduleTable.availability-mode .empty-plus { display: none; }
#scheduleTable.availability-mode .slot-work-toggle { display: none; }
.lesson strong { display: block; overflow: hidden; font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.lesson span { display: block; overflow: hidden; color: #43546c; font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.lesson .lesson-type { color: var(--ink); font-weight: 750; }
.lesson-room-quick { display: inline; padding: 0; border: 0; background: transparent; color: #1f57a7; cursor: pointer; font-family: inherit; font-size: inherit; font-weight: 750; line-height: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.lesson-room-quick:hover { color: #123d7b; text-decoration-style: solid; }
.lesson-room-quick.room-unassigned { color: #c62828; }
.lesson-room-quick.room-unassigned:hover { color: #991b1b; }
.lesson.fixed::after { content: "●"; position: absolute; top: 5px; right: 23px; color: var(--danger); font-size: 8px; }
.lesson-menu { position: absolute; top: 2px; right: 2px; z-index: 4; }
.lesson-menu-trigger { display: grid; place-items: center; width: 19px; height: 19px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #52647d; cursor: pointer; font-size: 16px; line-height: 1; }
.lesson-menu-trigger:hover, .lesson-menu.open .lesson-menu-trigger { background: rgba(255,255,255,.82); color: var(--accent-dark); }
.lesson-menu-actions { display: none; position: fixed; z-index: 1000; width: 174px; padding: 3px; border: 1px solid #cbd6e4; border-radius: 5px; background: white; box-shadow: 0 8px 22px rgba(31,50,78,.2); }
.lesson-menu.open .lesson-menu-actions { display: block; }
.lesson-menu-actions button { display: block; width: 100%; height: 27px; padding: 0 7px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-size: 10px; text-align: left; }
.lesson-menu-actions button:hover { background: var(--accent-soft); }
.lesson-menu-actions button:disabled { color: #9da8b6; cursor: default; }
.lesson-menu-actions button:disabled:hover { background: transparent; }
.lesson-menu-actions button.delete { color: var(--danger); }
.load-row-menu { position: relative; top: auto; right: auto; display: inline-block; }
.load-row-menu .lesson-menu-trigger { margin: 0 auto; }
.load-entity-action { display: flex; align-items: center; justify-content: space-between; gap: 3px; min-width: 0; }
.load-entity-action + .load-entity-action { margin-top: 2px; padding-top: 2px; border-top: 1px solid rgba(93,112,138,.2); }
.load-entity-action > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.empty-plus { display: grid; place-items: center; height: 100%; color: transparent; font-size: 22px; }
.slot:hover .empty-plus { color: #a6bad7; }
.load-panel { display: flex; flex: 0 0 var(--load-panel-height, max(240px, calc(100% - 396px))); flex-direction: column; min-height: 145px; margin-top: 7px; border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; box-shadow: 0 5px 18px rgba(31,50,78,.05); }
.load-panel-resizer { flex: 0 0 7px; position: relative; border-bottom: 1px solid #d4dce7; background: #eef2f7; cursor: ns-resize; touch-action: none; }
.load-panel-resizer::after { content: ""; position: absolute; top: 2px; left: 50%; width: 46px; height: 2px; border-top: 1px solid #9baabd; border-bottom: 1px solid #9baabd; transform: translateX(-50%); }
.load-panel-resizer:hover, body.resizing-load-panel .load-panel-resizer { background: #dfe9f6; }
body.resizing-load-panel { cursor: ns-resize; user-select: none; }
.load-panel-head { min-height: 38px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #f5f8fc; border-bottom: 1px solid var(--line); }
.load-panel-head strong { margin-right: 10px; }
.load-panel-head #loadSummary { color: var(--muted); font-size: 11px; }
.load-legend { color: var(--muted); font-size: 10px; white-space: nowrap; }
.load-legend span { display: inline-block; width: 11px; height: 11px; margin: 0 4px 0 9px; border: 1px solid rgba(0,0,0,.12); vertical-align: -2px; }
.load-legend span:first-child { margin-left: 0; }
.load-legend .placed { background: #bdf2c5; }
.load-legend .missing { background: #ffc4c7; }
.load-legend .inactive { background: #f1f3f6; }
.load-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.load-table { min-width: 850px; table-layout: fixed; }
.load-table th { position: sticky; top: 0; z-index: 2; height: 25px; padding: 2px 34px 2px 6px; background: #eef3f8; color: #516177; font-size: 9.5px; text-transform: uppercase; white-space: normal; overflow-wrap: anywhere; }
.load-table th:nth-child(1), .load-table td:nth-child(1) { width: 2%; text-align: center; }
.load-table th:nth-child(2), .load-table td:nth-child(2) { width: 16%; }
.load-table th:nth-child(3), .load-table td:nth-child(3) { width: 6%; }
.load-table th:nth-child(4), .load-table td:nth-child(4) { width: 6%; }
.load-table th:nth-child(5), .load-table td:nth-child(5) { width: 27%; }
.load-table th:nth-child(6), .load-table td:nth-child(6) { width: 25%; }
.load-table th:nth-child(7), .load-table td:nth-child(7) { width: 9%; }
.load-table th:nth-child(8), .load-table td:nth-child(8) { width: 9%; }
.load-table td { height: 23px; padding: 2px 6px; border-right: 1px solid rgba(210,219,229,.8); font-size: 10.5px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.load-table tbody tr.load-placed td { background: #d9f8de; }
.load-table tbody tr.load-missing td { background: #ffd9db; }
.load-table tbody tr.load-inactive td { background: #f6f7f9; color: #8792a3; }
.load-table tbody tr:hover td { box-shadow: inset 0 0 0 9999px rgba(36,58,88,.025); }
.load-table tbody tr.load-draggable { cursor: grab; touch-action: none; }
.load-table tbody tr.load-draggable:active, .load-table tbody tr.load-draggable.pointer-dragging { cursor: grabbing; }
.load-table tbody tr.load-draggable.pointer-dragging td { filter: brightness(.93); }
.load-table tbody tr.load-selected td { box-shadow: inset 0 0 0 1px #275fbb; filter: saturate(1.1); }
.load-progress { font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
dialog { width: min(700px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 25px 80px rgba(12, 30, 58, .24); }
dialog input:not([type=checkbox]):not([type=radio]), dialog select, dialog textarea { border-radius: 8px; }
dialog :is(input,select,textarea):focus-visible { outline: 2px solid #c6daf8; outline-offset: 1px; }
dialog .button { border-radius: 8px; }
dialog::backdrop { background: rgba(12, 25, 46, .55); backdrop-filter: blur(2px); }
dialog form { padding: 16px; font-size: 15px; }
dialog label { font-size: 13px; }
.small-dialog { width: min(480px, calc(100vw - 32px)); }
.auto-schedule-dialog { width: min(940px, calc(100vw - 28px)); }
.print-wizard-dialog { width: min(920px,calc(100vw - 28px)); }
.print-wizard-dialog form { min-height: min(650px,calc(100vh - 36px)); display: flex; flex-direction: column; }
.print-wizard-head { margin-bottom: 10px; }
.print-wizard-caption { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.print-wizard-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: print-wizard; }
.print-wizard-steps li { position: relative; padding: 10px 8px 10px 37px; border-radius: 7px; background: #eef2f7; color: #6c7889; font-size: 12px; font-weight: 750; }
.print-wizard-steps li::before { counter-increment: print-wizard; content: counter(print-wizard); display: grid; position: absolute; left: 9px; top: 6px; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #d5dde8; color: #526278; }
.print-wizard-steps li.active { background: #dfeafa; color: var(--accent-dark); }
.print-wizard-steps li.active::before { background: var(--accent); color: white; }
.print-wizard-steps li.done { background: #e4f7e7; color: #2c6d3b; }
.print-wizard-steps li.done::before { content: "✓"; background: #4da661; color: white; }
.print-wizard-panel { flex: 1 1 auto; min-height: 0; overflow: auto; }
.print-wizard-panel h3 { margin: 2px 0 13px; color: #344862; }
.print-choice-grid,.print-template-grid,.print-format-grid { display: grid; gap: 10px; }
.print-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.print-template-grid,.print-format-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.print-choice,.print-template-card,.print-format-card { display: flex; align-items: flex-start; gap: 10px; min-height: 74px; padding: 13px; border: 1px solid #d6dfeb; border-radius: 10px; background: #f8fafc; cursor: pointer; }
.print-choice:has(input:checked),.print-template-card:has(input:checked),.print-format-card:has(input:checked) { border-color: #78a5e5; background: #eaf2fd; box-shadow: inset 0 0 0 1px #78a5e5; }
.print-choice input,.print-template-card input,.print-format-card input { margin-top: 3px; }
.print-choice span:last-child,.print-template-card span:last-child,.print-format-card span:last-child { display: grid; gap: 5px; }
.print-choice small,.print-template-card small,.print-format-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.print-selection-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.print-selection-head { display: flex; align-items: center; gap: 13px; margin-bottom: 9px; }
.print-selection-head input[type="search"] { width: 230px; margin-left: auto; }
.print-selection-head label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.print-check-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px 10px; max-height: 255px; overflow: auto; padding: 4px; }
.print-check-list.print-teacher-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.print-check-list label { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 7px; border-radius: 5px; background: white; color: #40516a; }
.print-check-list label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-check-list .print-chair-heading { grid-column: 1 / -1; margin-top: 5px; padding: 6px 7px 2px; background: transparent; color: var(--accent-dark); font-size: 12px; font-weight: 750; cursor: pointer; }
.print-mode-hint { margin: 8px 0 0; text-align: center; }
.print-options-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.print-options-grid .checkbox { padding: 9px; border-radius: 7px; background: white; }
.print-format-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.print-format-card { align-items: center; }
.format-mark { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: #3066b1; color: white; font-size: 18px; font-weight: 850; }
.format-mark.excel { background: #28774c; }
.format-mark.html { background: #566476; }
.print-summary { margin-top: 18px; padding: 14px 16px; border-radius: 9px; background: #eaf2fd; color: #344862; line-height: 1.6; }
.print-wizard-actions { flex: 0 0 auto; }
.print-preview-dialog { width: min(1180px,calc(100vw - 24px)); height: calc(100vh - 24px); }
.print-preview-shell { box-sizing: border-box; display: flex; flex-direction: column; height: 100%; padding: 14px; }
.print-preview-shell .dialog-head { flex: 0 0 auto; margin-bottom: 10px; }
#printPreviewFrame { flex: 1 1 auto; min-height: 0; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: white; }
.auto-schedule-dialog form { min-height: min(680px, calc(100vh - 34px)); display: flex; flex-direction: column; }
.auto-wizard-head { margin-bottom: 12px; }
.auto-wizard-steps { display: grid; grid-template-columns: repeat(8,1fr); gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: wizard; }
.auto-wizard-steps li { position: relative; min-width: 0; padding: 9px 4px 9px 27px; border-radius: 6px; overflow: hidden; background: #eef2f7; color: #6c7889; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.auto-wizard-steps li::before { counter-increment: wizard; content: counter(wizard); display: grid; place-items: center; position: absolute; left: 7px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #d5dde8; color: #526278; }
.auto-wizard-steps li.active { background: #dfeafa; color: var(--accent-dark); }
.auto-wizard-steps li.active::before { background: var(--accent); color: white; }
.auto-wizard-steps li.done { background: #e4f7e7; color: #2c6d3b; }
.auto-wizard-steps li.done::before { content: "✓"; background: #4da661; color: white; }
.auto-wizard-panel { flex: 1 1 auto; min-height: 0; }
.auto-parameter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; max-width: 680px; margin: 20px auto 18px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; }
.auto-parameter-grid input { width: 100%; }
.auto-checks { display: grid; gap: 9px; max-width: 680px; margin: 0 auto; }
.auto-wizard-panel > .note { max-width: 680px; margin: 14px auto 0; }
.auto-preset-card { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px 22px; max-width: 720px; margin: 35px auto 0; padding: 23px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; }
.auto-preset-card h3 { margin: 0 0 5px; }
.auto-preset-card p { margin: 0; color: var(--muted); font-size: 12px; }
.auto-preset-card select { width: 100%; }
.auto-preset-details { grid-column: 1 / -1; min-height: 54px; padding: 11px 13px; border-radius: 7px; background: white; color: #52627a; font-size: 11px; line-height: 1.55; }
.auto-preset-note { max-width: 720px !important; }
.auto-panel-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.auto-panel-intro h3 { margin: 0 0 3px; font-size: 15px; }
.auto-panel-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.auto-panel-intro input { width: 245px; }
.auto-mapping-list { max-height: min(475px, calc(100vh - 235px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.auto-mapping-row { display: grid; grid-template-columns: minmax(240px,1fr) minmax(260px,360px); align-items: center; gap: 14px; min-height: 45px; padding: 5px 10px; border-bottom: 1px solid #e3e8ef; }
.auto-mapping-row:last-child { border-bottom: 0; }
.auto-mapping-row:hover { background: #f7faff; }
.auto-mapping-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.auto-mapping-row select { width: 100%; min-width: 0; }
.auto-mapping-empty { padding: 45px; color: var(--muted); text-align: center; }
.auto-select-all { flex-direction: row; align-items: center; gap: 8px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f4f7fb; font-size: 12px; }
.auto-select-all input { width: 16px; height: 16px; }
.auto-select-all span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.auto-selection-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; max-height: min(430px,calc(100vh - 280px)); overflow: auto; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: white; }
.auto-selection-row { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; min-height: 37px; padding: 5px 9px; border-right: 1px solid #e3e8ef; border-bottom: 1px solid #e3e8ef; font-size: 11px; font-weight: 600; }
.auto-selection-row input { flex: 0 0 auto; width: 15px; height: 15px; }
.auto-selection-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-selection-row small { margin-left: auto; color: var(--muted); font-size: 9px; font-weight: 500; }
.auto-final-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.auto-final-grid fieldset { display: grid; align-content: start; gap: 10px; min-height: 130px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.auto-final-grid fieldset.auto-no-existing { opacity: .55; }
.auto-final-grid legend { padding: 0 5px; color: #40516a; font-size: 12px; font-weight: 750; }
.auto-summary { padding: 15px 17px; border: 1px solid #cfdded; border-radius: 9px; background: #eef5fd; color: #41536d; font-size: 12px; line-height: 1.65; }
.auto-summary strong { color: var(--ink); }
.auto-save-preset { display: grid; grid-template-columns: 1.3fr 1fr; align-items: end; gap: 14px; margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.auto-save-preset input[type="text"] { width: 100%; }
.auto-progress { display: grid; place-items: center; min-height: 390px; text-align: center; }
.auto-progress h3 { margin: 16px 0 4px; }
.auto-progress p { margin: 0; color: var(--muted); }
.auto-progress-track { width: min(580px,90%); height: 9px; margin-top: 22px; overflow: hidden; border-radius: 999px; background: #dfe6ef; }
.auto-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#3675c8,#55b66b); transition: width .22s ease; }
.auto-orbit { position: relative; width: 72px; height: 72px; animation: auto-spin 2.2s linear infinite; }
.auto-orbit span { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 5px 15px rgba(46,102,181,.25); }
.auto-orbit span:nth-child(1) { left: 27px; top: 0; }
.auto-orbit span:nth-child(2) { right: 4px; bottom: 7px; background: #55b66b; }
.auto-orbit span:nth-child(3) { left: 4px; bottom: 7px; background: #f3b649; }
@keyframes auto-spin { to { transform: rotate(360deg); } }
.auto-result { margin-top: 20px; padding: 22px; border: 1px solid #bcdcc4; border-radius: 10px; background: #effaf1; }
.auto-result h3 { margin: 0 0 10px; color: #27643a; }
.auto-result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 15px 0; }
.auto-result-grid div { padding: 11px; border-radius: 7px; background: rgba(255,255,255,.72); }
.auto-result-grid strong { display: block; font-size: 20px; }
.auto-result details { margin-top: 12px; }
.auto-result details div { max-height: 150px; overflow: auto; margin-top: 7px; color: #6e3b40; font-size: 11px; }
.auto-wizard-actions { flex: 0 0 auto; }
.excel-import-dialog { width: min(1080px,calc(100vw - 28px)); }
.directory-import-dialog { max-height:calc(100dvh - 32px); padding:24px; overflow:auto; border-radius:16px; }
.directory-import-dialog[open] { display:flex; flex-direction:column; gap:14px; animation:welcome-state-in .22s ease both; }
.directory-import-dialog .dialog-head { flex-shrink:0; margin:0; }
.directory-import-steps { grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; }
.directory-import-panel { min-height:260px; animation:welcome-state-in .22s ease both; }
.directory-import-panel > label { display:flex; flex-direction:column; gap:8px; margin:12px 0; }
.directory-import-panel > label.checkbox { flex-direction:row; align-items:center; }
.directory-import-panel input[type=file] { width:100%; padding:14px; border:1px dashed var(--line); border-radius:9px; background:white; }
.directory-import-panel textarea { width:100%; resize:vertical; min-height:120px; font-size:14px; }
.directory-import-source { padding:20px; background:#f7f9fc; border:1px solid var(--line); border-radius:12px; margin-bottom:18px; }
.directory-import-source label { display:grid; gap:12px; font-weight:600; }
.directory-import-panel [data-map] { margin-top:18px; padding:16px; border:1px solid var(--line); border-radius:10px; background:#f7f9fc; gap:14px; }
.directory-import-panel [data-map] label { min-width:0; font-size:13px; }
.directory-import-panel [data-map] select { width:100%; min-width:0; margin-top:6px; }
.directory-import-status { padding:12px 15px; border-radius:9px; background:#eef5fd; color:#40516a; margin:0; font-size:14px; }
.directory-import-dialog .excel-import-loading { width:100%; max-width:none; }
.directory-import-dialog .excel-import-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:0; padding-top:14px; border-top:1px solid var(--line); }
.directory-import-dialog .excel-import-actions > [data-close] { margin-left:auto; }
.directory-import-dialog[aria-busy=true] { cursor:progress; }
@media(max-width:650px) { .directory-import-dialog { padding:14px; }.directory-import-dialog [data-map] { grid-template-columns:1fr; }.directory-import-steps li { font-size:10px; padding-right:3px; } }
@media(prefers-reduced-motion:reduce) { .directory-import-dialog[open],.directory-import-panel,.directory-import-dialog .excel-import-loading > span { animation:none; } }
.excel-import-dialog form { display: flex; flex-direction: column; min-height: min(720px,calc(100vh - 34px)); }
.excel-import-head { margin-bottom: 10px; }
.excel-import-caption { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.excel-import-steps { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: excel-step; }
.excel-import-steps li { position: relative; min-width: 0; padding: 9px 8px 9px 33px; border-radius: 6px; overflow: hidden; background: #eef2f7; color: #6c7889; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.excel-import-steps li::before { counter-increment: excel-step; content: counter(excel-step); display: grid; place-items: center; position: absolute; left: 8px; top: 6px; width: 21px; height: 21px; border-radius: 50%; background: #d5dde8; color: #526278; font-size: 10px; }
.excel-import-steps li.active { background: #dfeafa; color: var(--accent-dark); }
.excel-import-steps li.active::before { background: var(--accent); color: white; }
.excel-import-steps li.done { background: #e4f7e7; color: #2c6d3b; }
.excel-import-steps li.done::before { content: "✓"; background: #4da661; color: white; }
.excel-import-panel { flex: 1 1 auto; min-height: 0; }
.excel-file-card { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 20px; max-width: 650px; margin: 75px auto 18px; padding: 25px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; }
.excel-file-card h3 { margin: 0 0 5px; }
.excel-file-card p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.excel-file-mark { display: grid; width: 66px; height: 76px; place-items: center; border: 3px solid #3b7f4d; border-radius: 9px; background: #eef9f0; color: #2d733f; font-size: 31px; font-weight: 850; box-shadow: 0 6px 15px rgba(43,113,62,.12); }
.excel-import-loading { display: flex; align-items: center; gap: 12px; max-width: 650px; margin: 0 auto; padding: 12px 15px; border-radius: 8px; background: #eef5fd; color: #40516a; }
.excel-import-loading > span { width: 22px; height: 22px; border: 3px solid #bfd2e9; border-top-color: var(--accent); border-radius: 50%; animation: auto-spin .8s linear infinite; }
.excel-import-loading strong,.excel-import-loading small { display: block; }
.excel-import-loading small { margin-top: 2px; color: var(--muted); }
.excel-import-file-info { max-width: 650px; margin: 0 auto; padding: 12px 15px; border: 1px solid #badbc2; border-radius: 8px; background: #effaf1; color: #306841; font-size: 12px; line-height: 1.55; }
.excel-import-scope { display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: start; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.excel-import-scope select { width: 100%; }
.excel-import-scope fieldset { min-height: 72px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.excel-import-scope legend { padding: 0 4px; color: #40516a; font-size: 11px; font-weight: 700; }
.excel-import-check-list { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 7px; }
.excel-import-check-list .checkbox { min-width: 65px; }
.excel-import-groups-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 14px 0 8px; }
.excel-import-groups-head h3 { margin: 0 0 3px; font-size: 14px; }
.excel-import-groups-head p { margin: 0; color: var(--muted); font-size: 11px; }
.excel-import-groups-head input[type="search"] { width: min(330px,45vw); }
.excel-import-select-all { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: #f4f7fb; }
.excel-import-select-all span { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 500; }
.excel-import-group-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: start; max-height: 310px; overflow: auto; border: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.excel-import-group-list label { display: flex; flex-direction: row; align-items: center; gap: 7px; min-width: 0; min-height: 36px; padding: 5px 9px; border-right: 1px solid #e3e8ef; border-bottom: 1px solid #e3e8ef; font-size: 11px; font-weight: 650; }
.excel-import-group-list label[hidden] { display: none; }
.excel-import-group-list small { margin-left: auto; color: var(--muted); font-size: 9px; }
.excel-import-table-wrap { max-height: min(490px,calc(100vh - 245px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.excel-import-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.excel-import-table th { position: sticky; top: 0; z-index: 2; padding: 7px; border: 1px solid #d5dde7; background: #edf2f7; color: #4d5d73; text-align: left; }
.excel-import-table td { padding: 6px 7px; border: 1px solid #dfe5ec; overflow-wrap: anywhere; vertical-align: top; }
.excel-import-table select { width: 100%; min-width: 0; font-size: 11px; }
#excelImportMatchTable th:nth-child(1) { width: 25%; } #excelImportMatchTable th:nth-child(2) { width: 29%; } #excelImportMatchTable th:nth-child(3),#excelImportMatchTable th:nth-child(4) { width: 17%; } #excelImportMatchTable th:nth-child(5) { width: 12%; }
#excelImportRowsTable th:nth-child(1) { width: 4%; } #excelImportRowsTable th:nth-child(2) { width: 13%; } #excelImportRowsTable th:nth-child(3) { width: 22%; } #excelImportRowsTable th:nth-child(4) { width: 12%; } #excelImportRowsTable th:nth-child(5) { width: 24%; } #excelImportRowsTable th:nth-child(6) { width: 7%; } #excelImportRowsTable th:nth-child(7) { width: 18%; }
.excel-import-table tr.import-unavailable td { background: #fff1f1; color: #7c4b50; }
.excel-import-table tr.import-existing td { background: #fff9e9; }
.excel-import-hours { display: grid; gap: 2px; }
.excel-import-hours span { display: flex; justify-content: space-between; gap: 8px; }
.excel-import-hours em { color: var(--muted); font-style: normal; }
.excel-import-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 40px auto 18px; max-width: 820px; }
.excel-import-summary > div { padding: 17px; border: 1px solid #cbd8e8; border-radius: 9px; background: #f4f8fd; }
.excel-import-summary strong { display: block; margin-bottom: 4px; font-size: 24px; }
.excel-import-summary small { color: var(--muted); }
.excel-import-warnings { max-width: 820px; max-height: 240px; overflow: auto; margin: 0 auto; padding: 12px 15px; border: 1px solid #eccb94; border-radius: 8px; background: #fff8e9; color: #765324; font-size: 11px; line-height: 1.55; }
.excel-import-actions { flex: 0 0 auto; }
.room-conflict-dialog { width: min(760px, calc(100vw - 32px)); }
.room-conflict-note { margin: 0 0 12px; }
.room-conflict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.room-conflict-grid article { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9fc; }
.room-conflict-grid article > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.room-conflict-grid article strong { display: block; overflow: hidden; margin-bottom: 3px; text-overflow: ellipsis; white-space: nowrap; }
.room-conflict-grid article p { margin: 0; color: #52627a; font-size: 11px; }
.settings-dialog { width: min(760px, calc(100vw - 28px)); }
.database-dialog { width: min(960px, calc(100vw - 28px)); max-height: 90vh; overflow: auto; padding: 26px; background: var(--paper); }
.database-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.database-heading h2 { margin: 0; font-size: 24px; }
.database-close { flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--canvas); color: var(--muted); font-size: 24px; cursor: pointer; }
.database-close:hover { background: var(--accent-soft); color: var(--accent-dark); }
.database-dialog label { display: grid; gap: 6px; margin: 10px 0 !important; color: var(--ink); font-size: 14px; font-weight: 600; }
.database-dialog input:not([type=checkbox]), .database-dialog select { width: 100%; min-width: 0; height: 40px; padding: 8px 11px; border: 1px solid var(--line); background: white; font-size: 14px; }
.database-dialog input[type=file] { height: auto; }
.database-dialog input::file-selector-button { padding: 5px 10px; margin-right: 12px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); cursor: pointer; }
.database-dialog input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.database-dialog form { padding: 0; display: grid; gap: 10px; }
.database-dialog p { color: var(--muted); line-height: 1.6; }
.database-section { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfd; }
.database-section h3 { margin: 0 0 14px; font-size: 17px; }
.database-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.database-dialog .button { height: auto; min-height: 36px; white-space: normal; margin: 3px !important; }
.database-toolbar .button { margin: 0 !important; }
.database-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: white; }
.database-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.database-table th { padding: 11px; background: #edf2f9; color: #43546d; text-align: left; font-size: 13px; }
.database-table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.database-table tr:hover td { background: #f6f9fe; }
.database-table label { min-width: 100px; }
.database-table label:has(input[type=checkbox]) { min-width: 20px; }
.database-dialog pre { padding: 16px; background: var(--canvas); border-radius: 10px; overflow-wrap: anywhere; font-size: 13px; }
@media(max-width:600px) { .database-dialog { padding: 16px; } .database-heading h2 { font-size: 21px; } .database-section { padding: 12px; } }
.settings-dialog.database-setup { width: min(480px, calc(100vw - 28px)) !important; padding: 30px; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 80px rgba(18,39,70,.24); }
.database-setup h2 { margin: 0; font-size: 25px; }
.database-setup-intro { margin: 16px 0 22px; color: var(--muted); line-height: 1.6; }
.database-setup-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 15px 18px; margin-bottom: 20px; border: 1px solid #d7e4f7; border-radius: 12px; background: var(--accent-soft); }
.database-setup-account span { font-size: 13px; color: var(--muted); }
.database-setup-account strong { color: var(--accent-dark); font-size: 17px; }
.database-setup-account span:last-child { margin-left: auto; }
.database-setup-form { display: grid; gap: 14px; }
.database-setup-form label { display: grid; gap: 7px; margin: 0 !important; font-size: 14px; font-weight: 600; }
.database-setup-form input { width: 100%; height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 15px; }
.database-setup-form input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.database-setup-form .button { min-height: 44px; height: auto; white-space: normal; border-radius: 9px; }
.database-setup-error { margin: 0; color: var(--danger); font-size: 13px; }
.database-setup-error:empty { display: none; }
.database-setup-note { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.database-save-progress { text-align: center; padding: 8px 0 4px; }
.database-save-symbol { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 20px; border-radius: 24px; background: var(--accent-soft); color: var(--accent); animation: database-save-pulse 1.8s ease-in-out infinite; }
.database-save-symbol svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.database-save-name { display: block; overflow-wrap: anywhere; font-size: 17px; margin-bottom: 10px; }
.database-save-progress progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; accent-color: var(--accent); }
.database-save-progress progress::-webkit-progress-bar { background: var(--accent-soft); border-radius: 8px; }
.database-save-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.database-save-progress progress:indeterminate { appearance: none; background: linear-gradient(90deg,var(--accent-soft) 20%,#8bb3ed 50%,var(--accent-soft) 80%); background-size: 200% 100%; animation: database-save-sweep 1.4s linear infinite; }
.database-save-progress progress:indeterminate::-webkit-progress-bar { background: transparent; }
.database-save-steps { display: flex; justify-content: space-between; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.database-save-steps li::before { content: '○'; display: block; font-size: 18px; }
.database-save-steps li.active { color: var(--accent); font-weight: 700; }
.database-save-steps li.active::before { content: '●'; }
.database-save-steps li.done::before { content: '✓'; color: #23805c; }
.database-save-progress.complete .database-save-symbol { animation: none; color: #23805c; background: #e6f5ed; font-size: 40px; }
@keyframes database-save-pulse { 50% { transform: translateY(-3px); box-shadow: 0 0 0 9px rgba(39,95,187,.05); } }
@keyframes database-save-sweep { to { background-position: -200% 0; } }
@media(prefers-reduced-motion:reduce) { .database-save-symbol, .database-save-progress progress:indeterminate { animation: none; } }
.copy-load-dialog { width: min(690px,calc(100vw - 28px)); }
.copy-load-route { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: end; gap: 10px; }
.copy-load-route > span { padding-bottom: 10px; color: var(--accent); font-size: 22px; font-weight: 800; text-align: center; }
.copy-load-route select, .copy-load-route input { width: 100%; }
.copy-load-preview { margin-top: 15px; padding: 13px 15px; border: 1px solid #cfdaea; border-radius: 8px; background: #f3f7fc; color: #465a74; font-size: 12px; line-height: 1.65; }
.copy-load-preview strong { color: var(--ink); }
.copy-load-conflict { display: grid; gap: 8px; margin-top: 14px; padding: 12px 15px; border: 1px solid #efc6a8; border-radius: 8px; background: #fff7ee; }
.copy-load-conflict legend { padding: 0 5px; color: #9a5527; font-size: 12px; font-weight: 750; }
.copy-load-conflict p { margin: 0 0 3px; color: #75492d; font-size: 11px; line-height: 1.5; }
.settings-tabs { display: flex; gap: 3px; margin: -4px 0 13px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.settings-tab { height: 32px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.settings-tab.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.settings-panel { min-height: 270px; padding: 4px; }
.settings-form-grid { max-width: 620px; }
.settings-dates-grid { display: grid; grid-template-columns: minmax(245px,.9fr) minmax(320px,1.1fr); gap: 18px; }
.holiday-editor { min-width: 0; }
.holiday-calendar-head { display: grid; grid-template-columns: 29px 1fr 29px; align-items: center; gap: 8px; margin-bottom: 7px; }
.holiday-calendar-head strong { text-align: center; text-transform: capitalize; }
.holiday-calendar-head .step-button { width: 29px; height: 29px; }
.holiday-weekdays, .holiday-calendar { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; }
.holiday-weekdays { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.holiday-calendar { padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.holiday-calendar button, .holiday-calendar-blank { height: 29px; }
.holiday-calendar button { min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; font-size: 11px; transition: border-color .14s, background .14s, transform .14s; }
.holiday-calendar button:hover:not(:disabled) { border-color: #9eb6d6; background: #edf4fd; transform: translateY(-1px); }
.holiday-calendar button.weekend { color: #9b3a45; }
.holiday-calendar button.selected { border-color: #d16b76; background: #f7b9c0; color: #781e29; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(209,107,118,.18); }
.holiday-calendar button:disabled { opacity: .3; cursor: default; }
.holiday-calendar-legend { margin: 6px 0 8px; color: var(--muted); font-size: 10px; }
.holiday-calendar-legend span { display: inline-block; width: 12px; height: 12px; margin-right: 5px; border: 1px solid #d16b76; border-radius: 3px; background: #f7b9c0; vertical-align: -2px; }
.holiday-editor textarea { min-height: 75px; resize: vertical; }
textarea { width: 100%; padding: 8px 10px; resize: vertical; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font: inherit; }
.bells-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bell-times { max-height: 285px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
.bell-row { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 8px; min-height: 38px; padding: 4px 7px; border-bottom: 1px solid var(--line); }
.bell-row:last-child { border-bottom: 0; }
.bell-row input { width: 100%; min-width: 0; }
.bell-row button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 18px; }
.reference-with-action { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.reference-action { height: 39px; padding: 0 10px; }
.cycles-list { max-height: 300px; overflow: auto; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; }
.cycle-row { display: grid; grid-template-columns: 54px 1fr 36px; gap: 7px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cycle-row:last-child { border-bottom: 0; }
.cycle-row span { color: var(--muted); font-size: 11px; }
.cycle-row input { width: 100%; min-width: 0; }
.cycle-row button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 18px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
.dialog-head h2 { margin-bottom: 0; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef2f7; color: var(--muted); cursor: pointer; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.data-load-dialog .dialog-head { margin-bottom: 12px; }
.data-load-dialog .form-grid { gap: 7px 12px; }
.data-load-dialog .dialog-actions { margin-top: 14px; }
.data-load-dialog .inline-actions .button { flex: 1 1 0; min-width: 0; padding: 0 9px; font-size: 12px; white-space: nowrap; }
.load-hours-pair { display: grid; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.data-load-dialog .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.data-load-dialog .form-grid > * { min-width: 0; }
.data-load-dialog select, .data-load-dialog input:not([type=checkbox]) { width: 100%; min-width: 0; }
.load-subgroup-panel { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 8px; }
.load-subgroup-panel > label { grid-column: 1 / -1; }
.load-subgroup-panel .button { width: 100%; min-width: 0; font-size: 12px; padding: 0 6px; white-space: nowrap; height: 36px; margin-top: 6px; }
.load-main-numbers { display: grid; grid-template-columns: minmax(0,3fr) minmax(94px,1fr); gap: 12px; }
.load-main-numbers > label:last-child { white-space: nowrap; }
.data-load-dialog label:not(.checkbox) { display: flex; flex-direction: column; gap: 6px; }
.data-load-dialog select:not([multiple]), .data-load-dialog input:not([type=checkbox]):not([type=hidden]), .data-load-dialog .button { height: 36px; box-sizing: border-box; }
.data-load-dialog .form-field-heading { height: 20px; min-height: 20px; margin-bottom: 0; line-height: 20px; }
.data-load-dialog label:not(.checkbox) { line-height: 20px; }
.load-advanced { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #f8fafd; }
.load-advanced summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; }
.load-advanced[open] summary { margin-bottom: 14px; }
.load-feedback { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #e7f5ed; color: #206446; overflow-wrap: anywhere; }
.load-feedback.error { background: #fff0ee; color: var(--danger); }
#attestationHeaderOptions label { display: grid; gap: 6px; margin-bottom: 12px; }
#attestationHeaderOptions textarea { width: 100%; resize: vertical; min-height: 100px; padding: 10px; border: 1px solid var(--line); font: inherit; }
@media(max-width:560px) { .data-load-dialog .form-grid { grid-template-columns: minmax(0,1fr); } }
.load-hours-pair label { min-width: 0; }
.load-hours-pair input { width: 100%; min-width: 0; }
.copy-class-template { display: grid; grid-template-columns: minmax(210px,1fr) minmax(280px,1.2fr); align-items: end; gap: 7px 16px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cfdaea; border-radius: 8px; background: #f3f7fc; }
.copy-class-template strong { display: block; margin-bottom: 3px; color: #344862; font-size: 12px; }
.copy-class-template p { margin: 0; color: var(--muted); font-size: 10px; }
.copy-class-controls { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.copy-class-controls select { min-width: 0; width: 100%; }
.copy-class-status { grid-column: 1 / -1; min-height: 14px; color: #397049 !important; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid select, .form-grid input { width: 100%; min-width: 0; }
.form-field-with-option { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.form-field-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.form-field-with-option .compact-checkbox { margin: 0; color: var(--muted); font-size: 11px; }
.form-field-with-option .compact-checkbox input { flex: 0 0 16px; width: 16px; }
.checkbox { flex-direction: row; align-items: center; }
.checkbox input { width: 16px; height: 16px; }
.load-info { min-height: 44px; margin-top: 16px; padding: 10px 12px; border-radius: 7px; background: #f3f6fa; color: var(--muted); font-size: 12px; }
.work-hours-block { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 13px 15px; border: 1px solid #d8e2ef; border-radius: 8px; background: #f6f9fd; }
.work-hours-block p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.work-hours-dialog { width: min(760px, calc(100vw - 24px)); }
.week-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.week-toolbar select { min-width: 270px; }
.work-hours-grids { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 12px; }
.work-week { min-width: 0; width: 100%; }
.work-week h3 { margin: 0 0 8px; color: #40516a; font-size: 13px; }
.work-grid { width: 100%; min-width: 0; table-layout: fixed; border: 1px solid #b9c6d5; border-collapse: collapse; }
.work-grid th, .work-grid td { height: 24px; padding: 0; border: 1px solid #c8d2de; text-align: center; }
.work-grid th { position: static; background: #f4f7fb; font-size: 11px; }
.work-grid th:first-child, .work-grid td:first-child { width: 28px; background: #f4f7fb; font-weight: 700; }
.work-axis-button { width: 100%; height: 23px; padding: 0; border: 0; background: transparent; color: #344862; cursor: pointer; font: inherit; font-weight: 750; }
.work-axis-button:hover, .work-axis-button:focus-visible { background: #dfe9f6; }
.work-cell { width: 100%; height: 23px; padding: 0; border: 0; cursor: pointer; touch-action: none; }
.work-cell.available { background: #85ee8c; }
.work-cell.unavailable { background: #ff8589; }
.work-cell:hover { filter: brightness(.93); }
.work-hours-legend { margin-top: 9px; color: var(--muted); font-size: 11px; }
.work-hours-legend small { display: block; margin-top: 5px; font-size: 10px; }
.work-hours-legend span { display: inline-block; width: 18px; height: 14px; margin: 0 6px 0 14px; vertical-align: middle; border: 1px solid #aeb9c6; }
.work-hours-legend span:first-child { margin-left: 0; }
.work-hours-legend .available { background: #85ee8c; }
.work-hours-legend .unavailable { background: #ff8589; }
.copy-week-panel { display: grid; grid-template-columns: minmax(300px, 1fr) 230px; gap: 16px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.copy-week-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; max-height: 245px; overflow: auto; padding: 5px; }
.copy-week-list label { flex-direction: row; align-items: center; gap: 7px; color: #40516a; font-size: 11px; font-weight: 500; }
.copy-presets { display: flex; flex-direction: column; gap: 7px; }
.copy-presets strong { margin-bottom: 2px; }
.copy-schedule-dialog { width: min(760px, 92vw); }
.copy-schedule-groups { margin-top: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.copy-schedule-groups-head { display: grid; grid-template-columns: 1fr minmax(180px, 240px) auto; align-items: center; gap: 12px; }
.copy-schedule-groups-head input[type="search"] { width: 100%; min-width: 0; height: 32px; }
.copy-schedule-groups-head label { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.copy-schedule-group-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; max-height: 112px; margin-top: 9px; overflow: auto; padding: 3px; }
.copy-schedule-group-list label { flex-direction: row; align-items: center; gap: 6px; overflow: hidden; color: #40516a; font-size: 11px; font-weight: 500; white-space: nowrap; }
.copy-schedule-group-list label span { overflow: hidden; text-overflow: ellipsis; }
.copy-schedule-layout { display: grid; grid-template-columns: minmax(360px, 1fr) 210px; gap: 16px; margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.copy-schedule-week-list { display: grid; grid-template-columns: 1fr; gap: 4px; max-height: 310px; overflow: auto; padding: 4px; }
.copy-schedule-week-list label { flex-direction: row; align-items: center; gap: 7px; color: #40516a; font-size: 11px; font-weight: 500; }
.copy-schedule-week-list label.current-week { opacity: .5; }
.copy-schedule-presets { display: flex; flex-direction: column; gap: 7px; }
.copy-schedule-presets strong { margin-bottom: 3px; }
.dialog-actions { display: flex; gap: 9px; margin-top: 20px; }
.spacer { flex: 1; }
.note { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.small-dialog label input { width: 100%; }
.save-progress { min-width: 340px; min-height: 226px; padding: 19px 12px 8px; text-align: center; }
.save-progress h2 { margin: 14px 0 5px; }
.save-progress p { max-width: 330px; margin: 0 auto; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.save-progress-icon { position: relative; width: 60px; height: 60px; margin: 0 auto; color: var(--accent); }
.save-progress-icon svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; animation: save-file-pulse 1.15s ease-in-out infinite; }
.save-progress-icon > span { position: absolute; right: 0; bottom: 3px; width: 16px; height: 16px; border: 3px solid #dce7f6; border-top-color: var(--accent); border-radius: 50%; background: white; animation: loader-spin .7s linear infinite; }
.save-progress-line { width: 230px; height: 4px; margin: 23px auto 0; overflow: hidden; border-radius: 4px; background: #e4ebf4; }
.save-progress-line span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--accent); animation: save-line 1.15s ease-in-out infinite; }
.header-icon-button.save-button.saving svg { opacity: 1; animation: save-header-pulse .85s ease-in-out infinite; }
@keyframes save-file-pulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes save-line { 0% { transform: translateX(-110%); } 50% { transform: translateX(80%); } 100% { transform: translateX(250%); } }
@keyframes save-header-pulse { 0%,100% { transform: scale(1); opacity: .65; } 50% { transform: scale(.88); opacity: 1; } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 420px; padding: 12px 16px; border-radius: 8px; background: #152d50; color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8e2c38; }
#sqlDocumentSelect.current-filename { width: min(15vw,180px); max-width: min(15vw,180px); flex: 0 1 180px; }
#planTable td[contenteditable="true"]:focus { outline: 2px solid #3477d7; outline-offset: -2px; background: #eef5ff; }
@media (max-width: 900px) {
  .topbar { display: flex; align-items: stretch; flex-direction: column; }
  .file-actions { flex-wrap: wrap; }
  .directory-workspace { grid-template-columns: 1fr; }
  .data-tabs { overflow-x: auto; }
  .hours-form-grid { grid-template-columns: 1fr 1fr; }
  .directory-nav { border-right: 0; }
  #directoryNav { display: flex; overflow-x: auto; }
  .directory-nav-button { width: auto; min-width: max-content; }
  .schedule-control-row { align-items: flex-start; flex-wrap: wrap; }
  .schedule-control-row .spacer { display: none; }
  .schedule-picker select { width: min(360px, 58vw); }
  .availability-legend { width: 100%; }
  .work-hours-grids { grid-template-columns: 1fr; }
  .copy-week-panel { grid-template-columns: 1fr; }
  .copy-schedule-layout { grid-template-columns: 1fr; }
  .copy-schedule-groups-head { grid-template-columns: 1fr; }
  .copy-schedule-group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auto-wizard-steps li { padding-left: 8px; text-align: center; }
  .auto-wizard-steps li::before { display: none; }
  .auto-parameter-grid, .auto-final-grid { grid-template-columns: 1fr; }
  .auto-panel-intro { align-items: stretch; flex-direction: column; }
  .auto-panel-intro input { width: 100%; }
  .auto-mapping-row { grid-template-columns: 1fr; gap: 4px; padding: 8px 10px; }
  .settings-dates-grid { grid-template-columns: 1fr; }
  .auto-preset-card, .auto-save-preset { grid-template-columns: 1fr; }
  .auto-selection-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .excel-import-scope { grid-template-columns: 1fr; }
  .excel-import-group-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .excel-import-steps li { padding-left: 8px; text-align: center; }
  .excel-import-steps li::before { display: none; }
  .excel-import-summary { grid-template-columns: 1fr; }
}

/* One day after another on phones; retain the same cells and event handlers. */
@media screen and (max-width: 600px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .app-brand { min-width: 0; flex-wrap: wrap; }
  .app-brand h1 { font-size: 17px; }
  .current-filename { max-width: 100%; }
  .view-switch { align-self: center; }
  .file-actions { justify-content: flex-end; gap: 5px; }
  .schedule-area { overflow-y: auto; padding: 8px; display: block; }
  .schedule-area > .table-wrap { overflow: visible; min-height: 0; }
  .schedule-area .load-panel { height: 280px; min-height: 180px; margin-top: 12px; }
  .schedule-area .load-panel-resizer { display: none; }
  .schedule-control-row { gap: 8px; }
  .schedule-picker { width: 100%; min-width: 0; }
  .schedule-picker select { width: auto; flex: 1; min-width: 0; }
  .schedule-picker[data-schedule-selector] select { width: auto; min-width: 0; }
  .availability-legend { white-space: normal; line-height: 1.8; }
  #scheduleTable { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; min-width: 0; table-layout: auto; }
  #scheduleTable thead, #scheduleTable tbody, #scheduleTable tr { display: contents; }
  #scheduleTable thead th:first-child, #scheduleTable .time-cell { display: none; }
  #scheduleTable thead th:not(:first-child) { grid-row: var(--mobile-row); grid-column: 1; position: static; width: auto; padding: 12px 42px 12px 12px; text-align: left; background: #e7eef8; border-top: 8px solid white; }
  #scheduleTable .day-name, #scheduleTable .day-date { display: inline; margin-right: 8px; }
  #scheduleTable .slot { grid-row: var(--mobile-row); grid-column: 1; display: block; height: auto; min-height: 82px; padding: 0 30px 4px 0; }
  #scheduleTable .slot::before { content: attr(data-mobile-time); display: block; padding: 5px 8px 2px; font-size: 12px; font-weight: 600; color: #354962; }
  #scheduleTable .slot-content { height: auto; max-height: none; min-height: 40px; overflow: visible; padding: 3px 6px; }
  #scheduleTable .lesson { height: auto; max-height: none; min-height: 44px; }
  #scheduleTable .lesson strong { font-size: 13px; line-height: 1.3; }
  #scheduleTable .lesson span { font-size: 12px; line-height: 1.3; }
  #scheduleTable .lesson strong, #scheduleTable .lesson span { white-space: normal; overflow-wrap: anywhere; }
  #scheduleTable .slot-work-toggle { opacity: 1; width: 26px; height: 26px; }
  #scheduleTable .schedule-day-with-toggle { position: relative; }
  #scheduleTable .availability-note { font-size: 12px; }
}
