@font-face{font-family:TH Sarabun New;src:url(/fonts/THSarabunNew.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:TH Sarabun New;src:url(/fonts/THSarabunNew_Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:TH Sarabun New;src:url(/fonts/THSarabunNew_Italic.ttf) format("truetype");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:TH Sarabun New;src:url(/fonts/THSarabunNew_BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic;font-display:swap}:root{--sidebar-w: 172px;--color-bg: #f4f6f8;--color-panel: #ffffff;--color-border: #d8dee4;--color-text: #1f2937;--color-muted: #6b7280;--color-primary: #2563eb;--color-primary-dark: #1d4ed8;--color-danger: #dc2626;--color-success: #16a34a;--color-teacher-bg: #a8ddb8;--color-teacher-border: #5fb87e;--color-student-bg: #fbe1ec;--color-student-border: #f0b3cd;--color-room-bg: #fdf5cd;--color-room-border: #ecdb9a;--color-teacher-bg-light: #d9f0e0;--color-student-bg-light: #fdeff5;--color-room-bg-light: #fdf9e5;--radius: 6px}*{box-sizing:border-box}body{margin:0;font-family:Sarabun,Noto Sans Thai,Segoe UI,sans-serif;background:var(--color-bg);color:var(--color-text)}button,input,select,textarea{font-family:inherit;font-size:14px}a{color:var(--color-primary)}.app-shell{display:flex;min-height:100vh}.sidebar{width:var(--sidebar-w, 220px);background:#111827;color:var(--color-border);display:flex;flex-direction:column;flex-shrink:0}.sidebar h1{font-size:15px;padding:12px 14px;margin:0;border-bottom:1px solid #1f2937}.sidebar nav{display:flex;flex-direction:column;padding:6px;gap:2px;flex:1}.sidebar nav a,.sidebar nav .nav-group-label{color:#cbd5e1;text-decoration:none;padding:7px 10px;border-radius:var(--radius);font-size:13px;white-space:nowrap}.sidebar nav .nav-group-label{color:#64748b;font-size:11px;text-transform:uppercase;margin-top:10px;padding-bottom:2px}.sidebar nav a:hover{background:#1f2937}.sidebar nav a.active{background:var(--color-primary);color:#fff}.sidebar .user-box{padding:10px 12px;border-top:1px solid #1f2937;font-size:13px}.sidebar .user-box button{margin-top:6px;background:none;border:1px solid #374151;color:#cbd5e1;padding:4px 10px;border-radius:var(--radius);cursor:pointer}.main-area{flex:1;padding:20px;overflow-x:auto}.schedule-page{margin-top:0}.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.page-header h1,.page-header h2{margin:0;font-size:20px}.panel{background:var(--color-panel);border:1px solid var(--color-border);border-radius:8px;padding:16px;margin-bottom:16px}.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:var(--radius);border:1px solid var(--color-border);background:#fff;cursor:pointer;font-size:14px;color:var(--color-text)}.btn:hover{background:#f3f4f6}.btn-primary{background:var(--color-primary);border-color:var(--color-primary);color:#fff}.btn-primary:hover{background:var(--color-primary-dark)}.btn-danger{background:#fecaca;border-color:#fca5a5;color:#991b1b}.btn-danger:hover{background:#fca5a5}.btn-info{background:#cfe8fb;border-color:#a8d3f5;color:#1e40af}.btn-info:hover{background:#b8dcf7}.btn-warning{background:#fef3c7;border-color:#fde68a;color:#92400e}.btn-warning:hover{background:#fde68a}.btn-orange,.btn-pastel-orange{background:#fed7aa;border-color:#fdba74;color:#9a3412}.btn-orange:hover,.btn-pastel-orange:hover{background:#fdba74}.btn-navy{background:#bfdbfe;border-color:#93c5fd;color:#1e3a8a}.btn-navy:hover{background:#93c5fd}.btn-sm{padding:4px 8px;font-size:12px}.btn:disabled{opacity:.5;cursor:not-allowed}.field{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}.field label{font-size:13px;color:var(--color-muted)}.field input:not([type=checkbox]),.field select,.field textarea{padding:7px 10px;border:1px solid var(--color-border);border-radius:var(--radius)}.field input[type=checkbox]{width:16px;height:16px;flex:none}table.data-table{width:100%;border-collapse:collapse;font-size:13px}table.data-table th,table.data-table td{border:1px solid var(--color-border);padding:6px 8px;text-align:left}table.data-table th{background:#f3f4f6;position:sticky;top:0;z-index:2}table.data-table th{box-shadow:inset 0 -1px 0 var(--color-border)}.data-table-scroll{max-height:calc(100vh - 300px);min-height:240px;overflow:auto;border:1px solid var(--color-border);border-radius:6px}table.data-table tr:hover td{background:#fafafa}table.data-table td.actions-col{white-space:nowrap}table.data-table.center-th th{text-align:center}table.data-table.fit-head{width:auto;margin-inline:auto}table.data-table.fit-head th{text-align:center;white-space:nowrap}table.data-table.fit-head td{vertical-align:top}table.data-table td.audit-over-threshold{background:#fef3c7;font-weight:600}.toolbar{display:flex;gap:8px;align-items:center;margin-bottom:12px;flex-wrap:wrap}.toolbar .spacer{flex:1}.badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px}.badge-admin{background:#ede9fe;color:#6d28d9}.badge-teacher_rep{background:#dbeafe;color:#1d4ed8}.badge-viewer{background:#f3f4f6;color:#4b5563}.badge-muted{background:#f1f5f9;color:#334155}.badge-danger{background:#fecaca;color:#991b1b}.building-distance-table th,.building-distance-table td{text-align:center;white-space:nowrap}.building-distance-table th:first-child,.building-distance-table td:first-child{text-align:left}.building-distance-self{color:var(--color-muted)}.schedule-grid-wrap{overflow-x:auto;overflow-y:hidden}.schedule-grid-wrap>table.schedule-grid{margin-left:auto;margin-right:auto}table.schedule-grid{border-collapse:collapse;font-size:12px;table-layout:fixed;width:auto}table.schedule-grid.schedule-grid-horizontal{--grid-col-size: 64px}table.schedule-grid th,table.schedule-grid td{border:1px solid var(--color-border);text-align:center;vertical-align:top;padding:0;box-sizing:border-box;overflow:hidden}table.schedule-grid.schedule-grid-horizontal tbody tr{height:var(--grid-col-size);max-height:var(--grid-col-size)}table.schedule-grid tbody td.day-row-head{white-space:nowrap;text-overflow:ellipsis}table.schedule-grid th{background:#eef2f7;padding:6px;height:auto}table.schedule-grid thead th:first-child,table.schedule-grid tbody td.day-row-head{width:64px}table.schedule-grid thead th:not(:first-child){width:var(--grid-col-size)}table.schedule-grid td.day-cell{background:#dbeafe;font-weight:600;writing-mode:horizontal-tb}table.schedule-grid td.break-col{background:#f3f4f6}.cell-3layer{width:var(--grid-col-size);height:var(--grid-col-size);max-width:var(--grid-col-size);max-height:var(--grid-col-size);padding:0;vertical-align:top;overflow:hidden}.cell-inner{display:flex;flex-direction:column;height:100%;max-height:var(--grid-col-size);overflow:hidden}.cell-empty{display:block;text-align:center;color:#cbd5e1;font-size:16px;padding-top:16px}.cell-line{flex:1;min-height:0;max-height:100%;font-size:11px;padding:2px 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.35;cursor:pointer;box-sizing:border-box}.cell-line:hover{outline:1px solid var(--color-primary);outline-offset:-1px}.cell-line.move-target{background:transparent!important;cursor:crosshair}.cell-line.move-target:hover{outline:1px dashed var(--color-primary)}.cell-line.move-origin{background:#ffddb0!important}.cell-line.teacher,.cell-line.line-teacher{background:var(--color-teacher-bg)}.cell-line.student,.cell-line.line-student{background:var(--color-student-bg)}.cell-line.room,.cell-line.line-room{background:var(--color-room-bg)}.mini-popup-grid .cell-line.line-teacher{background:var(--color-teacher-bg-light)}.mini-popup-grid .cell-line.line-student{background:var(--color-student-bg-light)}.mini-popup-grid .cell-line.line-room{background:var(--color-room-bg-light)}.schedule-popup-colors .cell-line.line-teacher{background:var(--color-teacher-bg)}.schedule-popup-colors .cell-line.line-student{background:var(--color-student-bg)}.schedule-popup-colors .cell-line.line-room{background:var(--color-room-bg)}.cell-line.line-subject{background:#f3f4f6;font-weight:600;text-align:center;font-size:11px}.cell-line.empty{background:transparent;color:#b0b7c0;cursor:pointer}.cell-line.text-muted{background:transparent;color:#4b5563;cursor:pointer}.cell-line.locked-text{color:#9a3412}.cell-line.double-period-text{color:#1e3a8a;font-style:italic;font-weight:400}.cell-line.excluded-from-count{opacity:.55;font-style:normal}td.move-target-cell{cursor:crosshair;background:transparent}td.move-target-cell:hover{background:#f1f5f9}.period-col{min-width:70px;font-size:11px;padding:4px!important;background:#f8fafc}.period-col .period-time{color:var(--color-muted);font-size:10px}.btn-group{display:inline-flex;gap:4px}.btn-group .btn.active,.btn.active{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}.panel.schedule-picker{padding:4px 10px;margin-bottom:4px;box-sizing:border-box;min-width:fit-content;max-width:100%}.schedule-picker{display:flex;flex-direction:column;gap:1px}.schedule-picker-row{display:flex;align-items:flex-end;gap:2px}.schedule-picker-field{min-width:0}.schedule-picker-field label{display:block;font-size:10px;line-height:1.25;color:var(--color-muted);margin-bottom:0;white-space:nowrap}.schedule-picker-field input{padding:2px 8px!important;font-size:12px!important;width:100%}.schedule-picker .badge{padding:2px 8px;font-size:11px}.schedule-picker .btn-sm{padding:2px 8px;font-size:11px;white-space:nowrap}.schedule-picker-field.picker-col-search{flex:0 0 250px;width:250px}.search-input-teacher{background:var(--color-teacher-bg-light)}.search-input-class{background:var(--color-student-bg-light)}.search-input-room{background:var(--color-room-bg-light)}.schedule-picker-field.picker-col-home{flex:0 0 110px;width:110px}.schedule-picker-field.picker-col-total{flex:0 0 90px;width:90px}.schedule-picker-field.picker-col-check{flex:0 0 auto}.schedule-picker-field.picker-col-open{flex:0 0 116px;width:116px}.schedule-picker-field.picker-col-note{flex:1;min-width:220px}.schedule-picker-field .picker-home-value,.schedule-picker-field .picker-total-value{display:block;text-align:center;box-sizing:border-box;width:100%}table.schedule-grid-horizontal th{font-size:11px;padding:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}table.schedule-grid-horizontal th .period-time{color:var(--color-muted);font-size:10px;font-weight:400}.day-row-head{font-size:12px;font-weight:600;padding:4px!important;background:#f8fafc;text-align:center}.legend{display:flex;gap:14px;align-items:center;font-size:12px;margin:8px 0}.legend .swatch{width:12px;height:12px;display:inline-block;border-radius:2px;margin-right:4px;vertical-align:middle}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a80;display:flex;align-items:center;justify-content:center;padding:40px 16px;overflow-y:auto;z-index:50}.main-area .modal-backdrop{padding-left:calc(16px + var(--sidebar-w, 220px))}.modal-backdrop-near-full,.main-area .modal-backdrop-near-full{padding:16px}.main-area .modal-backdrop-near-full.modal-backdrop-content-area{padding-left:calc(var(--sidebar-w, 220px) + 16px)}.modal{background:#fff;border-radius:10px;width:100%;max-width:760px;box-shadow:0 20px 50px #00000040;margin:auto}.modal-header{padding:14px 18px;border-bottom:1px solid var(--color-border);display:flex;align-items:center;justify-content:space-between;background:#4c1d95;color:#fff;border-radius:10px 10px 0 0}.modal-header h3{margin:0;font-size:16px}.modal-header button{background:none;border:none;color:#fff;font-size:18px;cursor:pointer}.modal-body{padding:18px}.modal-footer{padding:12px 18px;border-top:1px solid var(--color-border);display:flex;justify-content:flex-end;gap:8px}.modal-near-full .modal-header,.modal-near-full .modal-footer{flex:0 0 auto}.multi-move-sim-body{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;overflow:auto}.multi-move-sim-intro{color:var(--color-muted);margin-bottom:12px}.multi-move-sim-layout{display:flex;flex-direction:column;gap:14px;min-height:0}.multi-move-sim-calendar,.multi-move-sim-plan{border:1px solid var(--color-border);border-radius:8px;padding:12px;min-width:0}.multi-move-sim-calendar h4,.multi-move-sim-plan h4{margin:0 0 10px}.placement-fit{font-size:12px;padding:0 8px;border-radius:10px;background:#dcfce7;color:#166534;border:1px solid #86efac}.placement-fit-reasons{margin:4px 0 6px 18px;font-size:12px;color:#166534}.multi-move-pair-tag{display:block;color:#7c3aed;font-weight:600}.multi-move-release-tag{display:block;color:#92400e;font-weight:600}.multi-move-review-head{display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;margin-bottom:8px}.multi-move-review-head h4{margin:0}.multi-move-review-route{display:inline-flex;align-items:center;gap:4px;font-size:13px}.multi-move-review-nav{display:inline-flex;gap:6px;margin-left:auto}.multi-move-swatch-origin,.multi-move-swatch-target{display:inline-block;width:14px;height:12px;border-radius:2px}.multi-move-swatch-origin{background:#ffddb0}.multi-move-swatch-target{outline:2px solid #2563eb;outline-offset:-2px}.multi-move-step{cursor:pointer;border-radius:4px;padding:2px 4px}.multi-move-step:hover{background:#f1f5f9}.multi-move-step-active{background:#dbeafe;outline:1px solid #93c5fd}.multi-move-sim-scroll{max-height:68vh;overflow:auto}.multi-move-sim-table{--grid-col-size: 64px;width:auto;margin-left:auto;margin-right:auto;border-collapse:collapse;font-size:12px}.multi-move-sim-table th,.multi-move-sim-table td{border:1px solid var(--color-border);padding:0;text-align:center}.multi-move-sim-table.schedule-grid-horizontal thead th:first-child,.multi-move-sim-table.schedule-grid-horizontal tbody td.day-row-head{width:64px}.multi-move-sim-table.schedule-grid-horizontal thead th:not(:first-child){width:var(--grid-col-size)}.multi-move-sim-table.schedule-grid-horizontal tbody tr{height:var(--grid-col-size);max-height:var(--grid-col-size)}.multi-move-sim-table thead th,.multi-move-sim-table tbody th{background:#f1f5f9;position:sticky;z-index:1}.multi-move-sim-table thead th{top:0}.multi-move-sim-table tbody th{left:0}.multi-move-sim-cell{position:relative;cursor:pointer}.multi-move-sim-cell:not(.disabled):hover{outline:2px solid var(--color-primary);outline-offset:-2px}.multi-move-sim-cell.source-cell .cell-line{background:#ffddb0!important}.multi-move-sim-cell.target-cell{outline:2px solid var(--color-primary);outline-offset:-2px}.multi-move-sim-cell.disabled{cursor:not-allowed;opacity:.58}.multi-move-sim-plan ol{margin:0;padding-left:22px}.multi-move-sim-plan li{padding:0 0 12px 4px}.multi-move-sim-plan li div,.multi-move-sim-plan li small{display:block;margin-top:4px;color:var(--color-muted)}.multi-move-validation-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}@media (max-width: 900px){.multi-move-sim-layout{grid-template-columns:1fr}}.saved-move-drafts{position:fixed;right:18px;bottom:82px;z-index:70;max-width:min(420px,calc(100vw - 28px))}.saved-move-drafts-trigger{position:relative;border:1px solid var(--color-border);border-radius:999px;background:#fff;color:#1e293b;padding:10px 18px 10px 14px;font-weight:600;box-shadow:0 4px 18px #0f172a26;cursor:pointer}.saved-move-drafts-count{position:absolute;top:-7px;right:-7px;min-width:23px;height:23px;padding:0 5px;display:grid;place-items:center;border-radius:50%;background:#2563eb;color:#fff;border:2px solid #fff;font-size:12px}.saved-move-drafts-menu{display:none;position:absolute;right:0;bottom:calc(100% + 8px);width:min(360px,calc(100vw - 28px));max-height:min(55vh,480px);overflow-y:auto;padding:6px;border:1px solid var(--color-border);border-radius:12px;background:#fff;box-shadow:0 8px 28px #0f172a30}.saved-move-drafts:hover .saved-move-drafts-menu,.saved-move-drafts:focus-within .saved-move-drafts-menu{display:block}.saved-move-draft{display:flex;align-items:center;gap:4px;padding:3px;border-radius:8px}.saved-move-draft:hover{background:#f1f5f9}.saved-move-draft-open{flex:1;border:0;background:transparent;color:#1e293b;padding:9px 10px;text-align:left;cursor:pointer}.saved-move-draft-delete{border:0;border-radius:7px;padding:7px 9px;background:#fee2e2;color:#991b1b;cursor:pointer}.chat-launcher{position:static;display:block;width:100%;margin:0 0 8px;z-index:80;border:0;border-radius:999px;background:#2563eb;color:#fff;padding:8px 15px;font-size:13px;font-weight:700;box-shadow:0 4px 16px #0f172a40;cursor:pointer}.chat-unread-badge{display:inline-grid;place-items:center;min-width:19px;height:19px;margin-left:6px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;line-height:1;vertical-align:middle}.chat-user-unread{display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;line-height:1}.sidebar .user-box .chat-launcher{margin:0 0 8px;border:0;background:#2563eb;color:#fff;box-shadow:0 4px 16px #0f172a40}.chat-window{position:fixed;z-index:90;left:calc(var(--sidebar-w, 172px) + 16px);bottom:68px;width:min(320px,calc(100vw - var(--sidebar-w, 172px) - 32px));height:min(600px,calc(100vh - 92px));min-width:min(220px,calc(100vw - 16px));min-height:min(300px,calc(100vh - 16px));max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:flex;flex-direction:column;overflow:hidden;resize:both;border:1px solid #cbd5e1;border-radius:14px;background:#fff;box-shadow:0 12px 44px #0f172a55;font-size:13px}.chat-window.has-users{width:min(560px,calc(100vw - var(--sidebar-w, 172px) - 32px))}.chat-window.has-users.users-left{--chat-drawer-width: min(220px, calc(var(--sidebar-w, 172px) + 16px));width:calc(min(320px,calc(100vw - var(--sidebar-w, 172px) - 32px)) + var(--chat-drawer-width));transform:translate(calc(0px - var(--chat-drawer-width)))}.chat-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;flex:0 0 auto;min-height:46px;padding:0 2px 0 11px;background:#4c1d95;color:#fff;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}.chat-window.has-users.users-left .chat-header{padding-left:var(--chat-drawer-width)}.chat-settings-anchor{display:flex;align-items:center;justify-self:end}.chat-window-controls{display:flex;align-items:center;gap:7px;justify-self:start}.chat-window-controls button{position:relative;width:13px;height:13px;padding:0;border:1px solid #00000026;border-radius:50%;cursor:pointer}.chat-window-controls button span{display:none;position:absolute;top:0;right:0;bottom:0;left:0;color:#333;font-size:10px;font-weight:700;line-height:11px;text-align:center}.chat-window-controls:hover button span{display:block}.chat-window-close{background:#ff5f57}.chat-window-close span:before{content:"×"}.chat-window-minimize{background:#febc2e}.chat-window-minimize span:before{content:"−"}.chat-settings-trigger,.chat-popup-close{justify-self:end;border:0;border-radius:6px;background:#fff2;color:inherit;padding:3px 7px;font-size:19px;line-height:1;cursor:pointer}.chat-settings-trigger{background:transparent;box-shadow:none;outline:none}.chat-settings-trigger:hover,.chat-settings-trigger:active{background:transparent}.chat-header>strong{white-space:nowrap;font-size:13px}.chat-users-rail{position:absolute;z-index:4;top:46px;right:0;bottom:0;width:14px;padding:0;border:0;border-left:1px solid #e2e8f0;background:#f8fafc;color:#475569;font-size:9px;cursor:pointer}.chat-users-rail:hover{background:#eff6ff;color:#1d4ed8}.chat-window.users-left .chat-users-rail{right:auto;left:0;border-left:0;border-right:1px solid #e2e8f0}.chat-window.has-users .chat-messages,.chat-window.has-users .chat-error,.chat-window.has-users .chat-composer,.chat-window.has-users .chat-announcement-toggle{margin-right:232px}.chat-window.has-users .chat-users-rail{display:none}.chat-user-drawer{position:absolute;z-index:3;top:46px;right:0;bottom:0;display:flex;flex-direction:column;width:220px;border-left:1px solid #e2e8f0;background:#fff}.chat-window.users-left .chat-user-drawer{right:auto;left:0;border-left:0;border-right:1px solid #e2e8f0}.chat-window.has-users.users-left .chat-user-drawer{width:var(--chat-drawer-width)}.chat-window.users-left .chat-messages,.chat-window.users-left .chat-composer{margin-right:15px;margin-left:15px}.chat-window.has-users.users-left .chat-messages,.chat-window.has-users.users-left .chat-composer{margin-left:var(--chat-drawer-width)}.chat-window.has-users.users-left .chat-error,.chat-window.has-users.users-left .chat-announcement-toggle{margin-right:0;margin-left:var(--chat-drawer-width)}.chat-user-drawer-heading{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid #e2e8f0;font-size:13px}.chat-user-drawer-heading button{border:0;background:transparent;color:#64748b;font-size:20px;line-height:1;cursor:pointer}.chat-user-list{min-height:0;overflow-y:auto;padding:5px}.chat-user-list button{display:flex;flex-direction:column;width:100%;gap:2px;padding:9px;border:0;border-radius:7px;background:transparent;color:#1e293b;text-align:left;font:inherit;font-size:13px;cursor:pointer}.chat-user-list button:hover{background:#eff6ff}.chat-user-name{display:flex;align-items:center;gap:6px;min-width:0}.chat-user-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-presence-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%}.chat-presence-dot.is-online{background:#22c55e}.chat-presence-dot.is-offline{background:#ef4444}.chat-user-list small{color:#64748b;font-size:11px}.chat-composer button{border:0;border-radius:7px;background:#2563eb;color:#fff;padding:0 11px;cursor:pointer}.chat-messages{flex:1 1 auto;min-height:0;overflow-y:auto;margin-right:15px;padding:10px;background:#fff}.chat-message{display:flex;flex-direction:column;align-items:flex-start;width:fit-content;max-width:88%;margin:0 0 10px;overflow-wrap:anywhere;font-size:13px;line-height:1.4}.chat-message.is-own{align-items:flex-end;margin-left:auto}.chat-message.is-announcement .chat-message-body{border:1px solid #fbbf24;background:#fffbeb}.chat-message-meta{display:flex;justify-content:flex-start;gap:7px;margin:0 5px 3px;font-size:11px;color:#94a3b8}.chat-message.is-own .chat-message-meta{justify-content:flex-end}.chat-message-meta strong{color:#64748b;font-weight:500}.chat-message-body{max-width:100%;padding:7px 10px;border-radius:16px;background:#f1f1f1;color:#111827;white-space:pre-wrap}.chat-message.is-own .chat-message-body{background:#dbeafe}.chat-inline-editor{display:grid;gap:6px;width:min(260px,75vw)}.chat-inline-editor textarea{box-sizing:border-box;width:100%;min-height:62px;resize:vertical;padding:7px 9px;border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff;color:#111827;font:inherit}.chat-inline-editor>div{display:flex;justify-content:flex-end;gap:6px}.chat-inline-editor button{padding:4px 8px;border:0;border-radius:6px;background:#f1f5f9;color:#334155;font:inherit;font-size:11px;cursor:pointer}.chat-inline-editor .chat-inline-save{background:#2563eb;color:#fff}.chat-inline-editor .chat-inline-save:disabled{opacity:.5;cursor:default}.chat-message-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:5px}.chat-message-actions button{border:0;background:transparent;color:#2563eb;padding:2px 4px;font-size:12px;cursor:pointer}.chat-deleted{color:#94a3b8;font-style:italic}.chat-composer{display:flex;align-items:flex-end;gap:7px;margin-right:15px;padding:8px;border-top:1px solid #e2e8f0}.chat-composer textarea{box-sizing:border-box;flex:1;width:100%;height:36px;min-height:36px;max-height:36px;resize:none;overflow-y:auto;padding:7px 9px;border:1px solid #cbd5e1;border-radius:7px;font-family:inherit;font-size:13px;line-height:1.4}.chat-composer button{height:36px;min-width:42px;font-size:13px}.chat-composer button:disabled{opacity:.5;cursor:default}.chat-announcement-toggle{padding:6px 10px 0;font-size:12px;color:#111827}.chat-settings-menu{position:absolute;z-index:3;top:54px;right:10px;width:min(250px,calc(100% - 20px));display:flex;flex-direction:column;gap:4px;padding:7px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;box-shadow:0 8px 22px #0f172a30}.chat-settings-menu>button,.chat-settings-menu label{display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-radius:6px;background:transparent;padding:8px;color:#334155;text-align:left;font:inherit;font-size:13px;cursor:pointer}.chat-settings-menu>button:hover{background:#eff6ff}.chat-settings-menu select{max-width:145px;padding:5px;border:1px solid #cbd5e1;border-radius:6px;background:#fff}.chat-error{display:flex;justify-content:space-between;padding:5px 10px;color:#b91c1c;font-size:12px}.chat-error button{border:0;background:transparent;color:inherit;cursor:pointer}.chat-announcement-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;display:grid;place-items:center;padding:20px;background:#0f172a88}.chat-announcement-popup,.chat-history-popup{position:relative;width:min(520px,100%);padding:22px;border-radius:14px;background:#fff;box-shadow:0 16px 48px #0f172a55}.chat-announcement-popup{border-top:8px solid #f59e0b}.chat-announcement-popup p{white-space:pre-wrap;overflow-wrap:anywhere}.chat-announcement-popup .btn{float:right}.chat-history-popup{max-height:75vh;overflow:auto}.chat-history-popup p{padding:10px;border-bottom:1px solid #e2e8f0}.chat-popup-close{position:absolute;top:10px;right:10px;background:#f1f5f9;color:#334155}@media (max-width: 540px){.chat-window{left:8px;bottom:62px;width:min(320px,calc(100vw - 16px));height:min(620px,calc(100vh - 78px))}.chat-window.has-users{left:8px;width:min(560px,calc(100vw - 16px))}.chat-window.has-users.users-left{--chat-drawer-width: min(150px, 35vw);width:min(560px,calc(100vw - 16px));transform:translate(calc(0px - min(var(--chat-drawer-width),8px)))}.chat-window.has-users .chat-messages,.chat-window.has-users .chat-error,.chat-window.has-users .chat-composer,.chat-window.has-users .chat-announcement-toggle{margin-right:calc(min(150px,35vw) + 12px)}.chat-window.has-users.users-left .chat-messages,.chat-window.has-users.users-left .chat-composer{margin-right:15px;margin-left:var(--chat-drawer-width)}.chat-window.has-users.users-left .chat-error,.chat-window.has-users.users-left .chat-announcement-toggle{margin-right:0;margin-left:var(--chat-drawer-width)}.chat-window.has-users .chat-user-drawer{width:min(150px,35vw)}}.auto-schedule-body{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;overflow:hidden}.auto-schedule-priority-bar{flex:0 0 auto;padding:8px 12px;margin-bottom:10px}.auto-schedule-priority-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:6px}.auto-schedule-priority-heading h4{margin:0 0 3px}.auto-schedule-priority-heading small{color:var(--color-muted)}.auto-schedule-preset-controls{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.auto-schedule-preset-controls select{min-width:180px}.auto-schedule-preset-controls input{width:150px}.auto-schedule-priority-grid{display:grid;grid-template-columns:repeat(5,max-content);justify-content:space-between;gap:5px 12px}.auto-schedule-priority-column{display:grid;grid-template-columns:max-content 68px;grid-template-rows:repeat(2,auto);align-items:center;gap:5px 6px;min-width:0;justify-self:start}.auto-schedule-priority-grid label{display:contents;white-space:nowrap;font-size:12px}.auto-schedule-priority-grid label>span{grid-column:1}.auto-schedule-priority-grid label>select{grid-column:2}.auto-schedule-priority-grid select{flex:0 0 68px;width:68px;min-width:68px;padding-inline:4px}.auto-schedule-priority-grid select.priority-adjusted{border-color:var(--color-primary, #2563eb);box-shadow:0 0 0 1px var(--color-primary, #2563eb);font-weight:600}.auto-schedule-columns{display:grid;grid-template-columns:minmax(220px,.2fr) minmax(0,.8fr);grid-template-rows:minmax(0,1fr);gap:12px;flex:1 1 auto;min-height:0;overflow:hidden}.auto-schedule-selector{padding:12px;min-height:0;display:flex;flex-direction:column;gap:8px}.auto-schedule-selector h4,.auto-schedule-report h4,.auto-schedule-preview h4{margin:0}.auto-schedule-selector>input,.auto-schedule-selector>select{width:100%}.auto-schedule-select-actions{display:flex;flex-wrap:wrap;gap:6px}.auto-schedule-selected-count{color:var(--color-muted);font-size:12px}.auto-schedule-class-list{min-height:100px;flex:1 1 auto;overflow:auto;border:1px solid var(--color-border);border-radius:6px}.auto-schedule-class-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;padding:5px 8px;border-bottom:1px solid #f1f5f9}.auto-schedule-class-row.active{background:#eff6ff}.auto-schedule-class-row label{min-width:0;display:flex;align-items:center;gap:8px;cursor:pointer}.auto-schedule-class-row label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.auto-schedule-class-row small{color:#9ca3af;white-space:nowrap}.auto-schedule-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}.auto-schedule-controls label{display:flex;flex-direction:column;gap:3px;font-size:12px}.auto-schedule-controls label input:not([type=checkbox]){width:100%;min-width:0}.auto-schedule-controls .auto-schedule-checkbox{flex-direction:row;align-items:center}.auto-schedule-controls>button{align-self:end}.auto-schedule-weights{grid-column:1 / -1;font-size:12px}.auto-schedule-weights>div{max-height:180px;overflow:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-top:6px}.auto-schedule-weights label{display:flex;flex-direction:column;gap:2px}.auto-schedule-results{min-width:0;min-height:0;height:100%;max-height:100%;align-self:stretch;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;display:flex;flex-direction:column;gap:8px}.auto-schedule-trials{padding:7px 10px}.auto-schedule-trials h4{margin:0 0 5px}.auto-schedule-trial-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;max-height:none;overflow:visible}.auto-schedule-trial-list button{display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:1px;padding:4px 7px;line-height:1.25}.auto-schedule-trial-list button b{font-size:11px}.auto-schedule-trial-list button small{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.auto-schedule-report{padding:9px 10px}.auto-schedule-report>div:first-of-type{margin-top:6px;color:var(--color-muted);font-size:13px}.auto-schedule-metrics{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:8px;font-size:12px}.auto-schedule-preview{min-height:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px}.auto-schedule-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.auto-schedule-preview-heading small{color:var(--color-muted);font-size:11px}.auto-schedule-preview-heading i{display:inline-block;width:9px;height:9px;margin:0 3px 0 7px;border-radius:2px}.auto-schedule-preview-scroll{height:min(42vh,420px);min-height:280px;flex:0 0 auto;overflow:auto;overscroll-behavior:contain;border:1px solid var(--color-border);border-radius:6px}.auto-schedule-preview .schedule-grid{min-width:900px}.auto-schedule-preview .schedule-grid td{min-width:76px;height:64px;font-size:12px}.auto-schedule-preview .schedule-grid .cell-inner{max-height:64px}.auto-schedule-preview .schedule-grid .cell-line{min-height:0;flex:1 1 0}.auto-schedule-preview .schedule-grid td{position:relative}.auto-schedule-preview .schedule-grid td.cell-rule-required{background:#fecaca;outline:3px solid #dc2626;outline-offset:-3px}.auto-schedule-preview .schedule-grid td.cell-rule-required .cell-line{background:#fecaca;color:#7f1d1d;font-weight:600}.auto-schedule-preview .schedule-grid td.cell-rule-flexible{background:#fef3c7;outline:2px dashed #d97706;outline-offset:-3px}.auto-schedule-preview .schedule-grid td.cell-rule-flexible .cell-line{background:#fef3c7}.auto-schedule-preview .schedule-grid td.cell-rule-waived{outline:2px dashed #94a3b8;outline-offset:-3px}.auto-schedule-preview .schedule-grid td.cell-rule-required:hover,.auto-schedule-preview .schedule-grid td.cell-rule-flexible:hover,.auto-schedule-preview .schedule-grid td.cell-rule-waived:hover{filter:brightness(.95)}.auto-schedule-preview .schedule-grid td.cell-rule-focused:before{content:"";position:absolute;top:4px;right:4px;bottom:4px;left:4px;border:2px solid #1e3a8a;border-radius:2px;pointer-events:none;z-index:2}.cell-rule-badges{position:absolute;top:1px;right:1px;display:flex;gap:2px;pointer-events:none;z-index:1}.rule-badge{display:inline-block;min-width:15px;padding:0 3px;border-radius:8px;font-size:10px;line-height:15px;font-weight:700;text-align:center;color:#fff}.rule-badge-required{background:#dc2626}.rule-badge-flexible{background:#d97706}.rule-badge-waived{background:#94a3b8}.cell-rule-legend{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px}.cell-rule-legend .legend-cell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:18px;margin-left:6px;border-radius:3px}.cell-rule-legend .legend-cell.cell-rule-required{background:#fecaca;box-shadow:inset 0 0 0 2px #dc2626}.cell-rule-legend .legend-cell.cell-rule-flexible{background:#fef3c7;outline:2px dashed #d97706;outline-offset:-2px}.cell-rule-legend .legend-cell.cell-rule-waived{outline:2px dashed #94a3b8;outline-offset:-2px}.rule-pill{display:inline-block;padding:0 8px;border-radius:10px;font-size:12px;line-height:20px;font-weight:600;white-space:nowrap}.rule-pill-required{background:#dc2626;color:#fff}.rule-pill-flexible{background:#fef3c7;color:#92400e;border:1px dashed #d97706}.rule-pill-waived,.rule-pill-disabled{background:#f1f5f9;color:#475569;border:1px dashed #94a3b8}.violation-item{margin-bottom:16px;padding:6px 8px 6px 10px;border-left:4px solid transparent;border-radius:4px}.violation-item-required{border-left:5px solid #dc2626;background:#fef2f2}.violation-item-flexible{border-left:4px dashed #d97706;background:#fffbeb}.violation-item-waived,.violation-item-disabled{border-left:4px dashed #cbd5e1}.violation-item-flash{animation:violation-flash 1.6s ease-out 1}@keyframes violation-flash{0%,30%{box-shadow:0 0 0 3px #3b82f6}to{box-shadow:0 0 0 0 transparent}}.preview-outside-issues{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0 0 6px;padding:6px 10px;border:1px dashed #d97706;border-radius:6px;background:#fffbeb;font-size:13px}.preview-outside-issues.has-required{border:2px solid #dc2626;background:#fef2f2}.violation-focus-banner{display:flex;align-items:center;justify-content:space-between;gap:8px;scroll-margin-top:8px}.violation-period-focus td{background:#dbeafe;font-weight:600}@media (prefers-reduced-motion: reduce){.violation-item-flash{animation:none;box-shadow:0 0 0 2px #3b82f6}}.auto-schedule-move-list{border:1px solid var(--color-border);border-radius:6px;padding:8px 10px}.auto-schedule-move-list>div{max-height:180px;overflow:auto}.auto-schedule-empty{flex:1;display:grid;place-items:center;color:var(--color-muted);text-align:center}@media (max-width: 850px){.auto-schedule-priority-heading{align-items:flex-start;flex-direction:column}.auto-schedule-priority-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:190px;overflow:auto}.auto-schedule-columns{grid-template-columns:minmax(0,1fr);overflow:hidden}.auto-schedule-selector{min-height:340px}.auto-schedule-class-list{max-height:34vh;flex-basis:160px}.auto-schedule-trial-list{grid-template-columns:repeat(2,minmax(0,1fr))}}.panel-3col{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.conflict-panel{border:1px solid;border-radius:6px;overflow:hidden}.conflict-panel.teacher{border-color:var(--color-teacher-border)}.conflict-panel.student{border-color:var(--color-student-border)}.conflict-panel.room{border-color:var(--color-room-border)}.conflict-panel .cp-head{padding:3px 8px;font-weight:600;font-size:11px}.conflict-panel.teacher .cp-head{background:var(--color-teacher-bg)}.conflict-panel.student .cp-head{background:var(--color-student-bg)}.conflict-panel.room .cp-head{background:var(--color-room-bg)}.conflict-panel .cp-body{padding:4px 8px;font-size:11px}.conflict-panel .cp-row{display:flex;justify-content:space-between;padding:1px 0}.conflict-panel .cp-free{color:var(--color-success);font-weight:600}.conflict-panel .cp-taken{color:var(--color-danger);font-weight:600}.field-row-2col{display:grid;grid-template-columns:1fr 150px;gap:10px;align-items:end}.field-row-3col{display:grid;grid-template-columns:1fr 150px 110px;gap:10px;align-items:end}.field-row-3col .btn.field-row-action{height:34px;white-space:nowrap}.field-ref-box{font-size:12px;color:var(--color-text-muted, #6b7280);background:#f8fafc;border:1px solid var(--color-border);border-radius:6px;padding:7px 10px}.field-ref-box .field-ref-label{display:block;font-size:10px;color:#9ca3af;margin-bottom:2px}.lock-mode-list{display:flex;flex-direction:column;gap:6px}.lock-mode-list button{text-align:left}.lock-mode-list button.active{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}.hover-popup{position:fixed;z-index:60;background:#111827;color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;pointer-events:none;max-width:240px;line-height:1.5}.empty-state{color:var(--color-muted);text-align:center;padding:40px}.import-export-row{display:flex;gap:8px;align-items:center}.alert{padding:10px 14px;border-radius:var(--radius);font-size:13px;margin-bottom:12px}.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.alert-success{background:#dcfce7;color:#166534;border:1px solid #86efac}.alert-warn{background:#fef3c7;color:#92400e;border:1px solid #fcd34d}.print-page{background:#fff;padding:16px;margin-bottom:16px;border:1px solid var(--color-border);border-radius:8px;color:#000}.print-page,.print-page *{font-family:TH Sarabun New,Sarabun,Noto Sans Thai,sans-serif}.print-header{margin-bottom:10px;text-align:center}.print-header h2{margin:0 0 2px;font-size:17px}.print-sub{color:var(--color-muted);font-size:12px}table.print-grid{width:auto;margin:0 auto}table.print-grid th,table.print-grid td{min-width:unset}table.print-grid th,table.print-grid td{border-color:#000}table.print-grid .cell-line.line-teacher,table.print-grid .cell-line.line-student,table.print-grid .cell-line.line-room,table.print-grid .cell-line.teacher,table.print-grid .cell-line.student,table.print-grid .cell-line.room{background:transparent;color:#000}table.print-grid .cell-line.locked-text{color:#000}table.print-grid .cell-line.double-period-text{font-style:normal}table.print-grid th{font-size:16pt;padding:1px 2px}table.print-grid thead tr:first-child th{height:26px;max-height:26px;line-height:1;text-align:center;vertical-align:middle;padding-top:4px}table.print-grid .cell-line{font-size:12pt;padding:1px 2px;line-height:16px}table.print-grid .cell-inner{padding-top:0;justify-content:center}table.print-grid .cell-line{flex:0 0 auto}table.print-grid th.period-time,table.print-grid th .period-time{font-size:13pt;white-space:normal;line-height:1;text-align:center;vertical-align:middle}table.print-grid th.period-time{padding:1px 2px;height:18px;max-height:18px}table.print-grid thead tr:last-child th{height:18px;max-height:18px}table.print-grid .day-row-head{font-size:14pt}table.print-grid tbody td.day-row-head{vertical-align:middle;width:var(--print-first-col-w, 80px)}table.print-grid thead th:first-child{width:var(--print-first-col-w, 80px)}table.print-grid.schedule-grid-horizontal thead th:not(:first-child){width:70px}table.print-grid.schedule-grid-horizontal tbody tr{height:65px;max-height:65px}table.print-grid .cell-3layer{width:70px;height:65px;max-width:70px;max-height:65px}table.print-grid .cell-inner{max-height:65px}.print-school-header{display:flex;flex-direction:column;align-items:center;gap:2px;margin-bottom:6px;text-align:center}.print-logo{height:56px;width:auto;object-fit:contain}.print-school-text{font-size:16pt;line-height:1.25}.print-school-name{font-weight:700;font-size:16pt}.print-sheet-title{font-weight:600;font-size:16pt;margin-top:1px}.print-note1{margin-top:1px;font-size:12pt;color:#000}.print-signature{margin:6px auto 0;text-align:center;font-size:16pt;color:#000}.print-signature-img{display:block;height:40px;margin:0 auto 2px;object-fit:contain}.print-footer-row{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-top:6px;font-size:12pt;color:#000;border-top:1px solid #cbd5e1;padding-top:3px}.print-note2{text-align:right}@media print{@page{size:landscape;margin:5mm}.sidebar,.no-print,.toolbar{display:none!important}.main-area{padding:0}.print-page{border:none;page-break-after:always;margin:0;padding:3mm}.print-page:last-child{page-break-after:auto}}.login-shell{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#111827}.login-card{background:#fff;padding:32px;border-radius:12px;width:100%;max-width:360px}.login-card h1{font-size:20px;margin:0 0 4px}.login-card p.sub{color:var(--color-muted);margin:0 0 20px;font-size:13px}.sidebar nav a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar nav .nav-section-title{font-size:15px;font-weight:700;color:var(--color-border);white-space:nowrap;padding:12px 14px 8px;margin:8px -6px 2px;border-top:1px solid #1f2937;border-bottom:1px solid #1f2937}.sidebar nav a{padding-left:16px}.tab-nav{margin-bottom:14px}.tab-nav a.btn{text-decoration:none;display:inline-block}.period-view-buttons{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:12px}.period-view-buttons .pvb-label{font-size:12px;color:var(--color-muted)}.btn-dim-teacher{background:var(--color-teacher-bg);border-color:var(--color-teacher-border);color:#14532d}.btn-dim-teacher:hover:not(:disabled){background:var(--color-teacher-border)}.btn-dim-student{background:var(--color-student-bg);border-color:var(--color-student-border);color:#831843}.btn-dim-student:hover:not(:disabled){background:var(--color-student-border)}.btn-dim-room{background:var(--color-room-bg);border-color:var(--color-room-border);color:#713f12}.btn-dim-room:hover:not(:disabled){background:var(--color-room-border)}.btn-dim-check{background:#dbeafe;border-color:#93c5fd;color:#1e3a8a}.btn-dim-check:hover:not(:disabled){background:#bfdbfe}table.schedule-grid tbody td.day-row-head{vertical-align:middle;text-align:center}.hover-popup .hp-focus{font-weight:700;margin-bottom:2px}.hover-popup .hp-lock{margin-top:4px;padding-top:4px;border-top:1px solid #374151;color:#93c5fd}.hover-popup .hp-co{margin-top:4px;padding-top:4px;border-top:1px solid #374151;color:#6ee7b7}table.data-table td.over-day-total{background:#dbeafe;color:#1e3a8a}table.data-table td.over-day-total .over-tag{display:block;font-size:10px;font-weight:700;line-height:1.2}table.data-table td.status-short{background:#fef3c7;color:#92400e}table.data-table td.status-over{background:#dbeafe;color:#1e3a8a}.staffing-groups{box-sizing:border-box;flex:0 0 200px!important;width:200px!important;padding:12px}.staffing-groups h3{font-size:15px;line-height:1.3;margin:0 0 10px}.staffing-group{margin-bottom:8px;min-width:0}.staffing-group small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.3}.staffing-group .btn{display:block;box-sizing:border-box;width:100%;max-width:100%;margin-top:3px;padding:5px 7px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.staffing-table th.staffing-teacher-head,.staffing-table td.staffing-teacher-cell{min-width:240px}.staffing-table{width:100%;table-layout:fixed}.staffing-table .staffing-col-group{width:110px}.staffing-table .staffing-col-class{width:112px}.staffing-table .staffing-col-code{width:100px}.staffing-table .staffing-col-subject{min-width:190px}.staffing-table .staffing-col-subtype{width:145px}.staffing-table .staffing-col-credit{width:78px}.staffing-table .staffing-col-periods{width:62px}.staffing-table .staffing-col-pattern{width:84px}.staffing-table .staffing-col-teachers{min-width:240px}.staffing-table .staffing-col-room{width:120px}.staffing-table .staffing-col-note{width:135px}.staffing-table .staffing-col-actions{width:150px}.staffing-table .staffing-center{text-align:center}.staffing-table td{overflow:hidden;white-space:nowrap}.staffing-table select{box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.staffing-table .staffing-truncated{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.staffing-summary .data-table td{max-width:180px;overflow:hidden;white-space:nowrap}.staffing-summary .staffing-summary-table{width:817px;min-width:817px;table-layout:fixed}.staffing-summary .staffing-summary-table col:nth-child(1){width:52px}.staffing-summary .staffing-summary-table col:nth-child(2){width:230px}.staffing-summary .staffing-summary-table col:nth-child(3),.staffing-summary .staffing-summary-table col:nth-child(4),.staffing-summary .staffing-summary-table col:nth-child(6){width:90px}.staffing-summary .staffing-summary-table col:nth-child(5){width:125px}.staffing-summary .staffing-summary-table col:nth-child(7){width:140px}.staffing-teacher-summary section>h3{text-align:center}.staffing-teacher-summary .staffing-summary-table,.staffing-teacher-summary .staffing-summary-teacher-table{margin-left:auto;margin-right:auto}.staffing-summary .staffing-summary-teacher-table{width:1580px;min-width:1580px;table-layout:fixed}.staffing-summary .staffing-summary-teacher-table col:nth-child(1){width:45px}.staffing-summary .staffing-summary-teacher-table col:nth-child(2){width:180px}.staffing-summary .staffing-summary-teacher-table col:nth-child(3){width:140px}.staffing-summary .staffing-summary-teacher-table col:nth-child(4){width:200px}.staffing-summary .staffing-summary-teacher-table col:nth-child(5){width:140px}.staffing-summary .staffing-summary-teacher-table col:nth-child(6){width:75px}.staffing-summary .staffing-summary-teacher-table col:nth-child(7){width:95px}.staffing-summary .staffing-summary-teacher-table col:nth-child(8){width:100px}.staffing-summary .staffing-summary-teacher-table col:nth-child(9){width:320px}.staffing-summary .staffing-summary-teacher-table col:nth-child(10){width:70px}.staffing-summary .staffing-summary-teacher-table col:nth-child(11){width:70px}.staffing-summary .staffing-summary-teacher-table col:nth-child(12){width:145px}.staffing-summary .staffing-summary-table th{text-align:center}.staffing-summary .staffing-summary-table thead tr:nth-child(2) th{top:32px}.staffing-summary .staffing-summary-table tbody td:not(:nth-child(2)){text-align:center}.staffing-summary .staffing-summary-teacher-table th{text-align:center;white-space:nowrap}.staffing-summary .staffing-summary-teacher-table .staffing-number-cell{text-align:center}.staffing-summary .staffing-summary-teacher-table .staffing-index-cell,.staffing-summary .staffing-summary-teacher-table .staffing-teacher-name-cell{vertical-align:top}.staffing-summary .staffing-summary-teacher-table td.staffing-text-left{text-align:left}.staffing-summary .staffing-summary-teacher-table td.staffing-room-cell{max-width:none}.staffing-summary .staffing-summary-teacher-table tr.staffing-subtotal-row td{font-weight:700;background:#f3f4f6;border-top:2px solid #9ca3af}.staffing-summary .staffing-student-summary-table{width:970px;min-width:970px;table-layout:fixed}.staffing-summary .staffing-student-summary-table col:nth-child(1){width:130px}.staffing-summary .staffing-student-summary-table col:nth-child(2){width:280px}.staffing-summary .staffing-student-summary-table col:nth-child(3){width:90px}.staffing-summary .staffing-student-summary-table col:nth-child(4){width:70px}.staffing-summary .staffing-student-summary-table col:nth-child(5){width:240px}.staffing-summary .staffing-student-summary-table col:nth-child(6){width:160px}.staffing-student-summary section>h3{text-align:center}.staffing-student-summary .staffing-student-summary-table{margin-left:auto;margin-right:auto}.staffing-summary .staffing-student-summary-table th,.staffing-summary .staffing-student-summary-table td{text-align:center}.staffing-summary .staffing-student-summary-table td:nth-child(2),.staffing-summary .staffing-student-summary-table td:nth-child(5){text-align:left}.staffing-summary .data-table-scroll{height:min(60vh,700px);min-height:min(280px,35vh);max-height:min(60vh,700px);overflow:auto}.staffing-pdf-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.staffing-pdf-heading h2{margin-top:0}@media print{@page{size:landscape;margin:10mm}.staffing-summary{border:0!important;box-shadow:none!important;padding:0!important;margin:0!important}.staffing-summary .data-table-scroll{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;border:0!important}.staffing-summary .staffing-summary-table{width:100%!important;min-width:0!important;table-layout:fixed!important}.staffing-summary .staffing-summary-table col{width:auto!important}.staffing-summary .staffing-summary-teacher-table{width:100%!important;min-width:0!important;table-layout:fixed!important}.staffing-summary .staffing-summary-teacher-table col{width:auto!important}.staffing-summary .staffing-student-summary-table{width:100%!important;min-width:0!important;table-layout:fixed!important}.staffing-summary .staffing-student-summary-table col{width:auto!important}.staffing-summary section>h3{break-after:avoid;page-break-after:avoid}.staffing-summary table tr{break-inside:avoid;page-break-inside:avoid}.staffing-summary .staffing-teacher-note-row{display:none!important}}.teacher-pdf-report,.student-pdf-report{display:none}@media print{body.printing-teacher-report>:not(.teacher-pdf-report){display:none!important}body.printing-teacher-report .teacher-pdf-report{display:block!important;color:#111827;font-family:TH Sarabun New,sans-serif!important;font-size:16pt}body.printing-teacher-report .teacher-pdf-report *{color:#111827;font-family:TH Sarabun New,sans-serif!important;font-size:16pt}body.printing-teacher-report .teacher-pdf-report .teacher-pdf-cover{break-after:page;page-break-after:always;text-align:center}body.printing-teacher-report .teacher-pdf-report .teacher-pdf-list{break-before:page;page-break-before:always}body.printing-teacher-report .teacher-pdf-group+.teacher-pdf-group .teacher-pdf-cover{break-before:page;page-break-before:always}body.printing-teacher-report .teacher-pdf-report .teacher-pdf-logo{display:block;max-width:16mm;max-height:16mm;object-fit:contain;margin:0 auto 2mm}body.printing-teacher-report .teacher-pdf-report .teacher-pdf-cover h1{margin:0 0 4mm;font-size:16pt;font-weight:700;text-align:center}body.printing-teacher-report .teacher-pdf-report table{border:.5pt solid #000!important;border-collapse:collapse!important;font-family:TH Sarabun New,sans-serif!important;font-size:16pt}body.printing-teacher-report .teacher-pdf-report thead,body.printing-teacher-report .teacher-pdf-report tbody,body.printing-teacher-report .teacher-pdf-report tr{border:0!important}body.printing-teacher-report .teacher-pdf-report th,body.printing-teacher-report .teacher-pdf-report td{border:.5pt solid #000!important;padding:2px 4px!important;min-width:0;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}body.printing-teacher-report .teacher-pdf-report th{position:static!important;top:auto!important;z-index:auto!important;border:.5pt solid #000!important;box-shadow:none!important;padding:2px 4px!important;min-width:0;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;text-align:center!important}body.printing-teacher-report .teacher-pdf-report thead tr:first-child th{border-top:.5pt solid #000!important}body.printing-teacher-report .teacher-pdf-summary-table tbody td{text-align:center!important}body.printing-teacher-report .teacher-pdf-summary-table tbody td:nth-child(2){text-align:left!important}body.printing-teacher-report .teacher-pdf-detail-table .teacher-pdf-name-cell,body.printing-teacher-report .teacher-pdf-detail-table td.staffing-text-left,body.printing-teacher-report .teacher-pdf-detail-table td.staffing-room-cell{text-align:left!important}body.printing-teacher-report .teacher-pdf-index-cell,body.printing-teacher-report .teacher-pdf-detail-table .staffing-index-cell,body.printing-teacher-report .teacher-pdf-name-cell{vertical-align:top!important}body.printing-teacher-report .teacher-pdf-name-line{display:block;line-height:1.05;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body.printing-teacher-report .teacher-pdf-name-prefix{margin-right:0}body.printing-teacher-report .teacher-pdf-subtotal-row,body.printing-teacher-report .teacher-pdf-teacher-note-row{break-inside:avoid;page-break-inside:avoid}body.printing-teacher-report .teacher-pdf-subtotal-row td,body.printing-teacher-report .teacher-pdf-teacher-note-row td{border-left:0!important;border-right:0!important;padding-left:9mm!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere;text-overflow:clip!important}body.printing-teacher-report .teacher-pdf-subtotal-row td{border-top:.5pt solid #000!important;border-bottom:.5pt solid #000!important}body.printing-teacher-report .teacher-pdf-teacher-note-row td{border-bottom:.5pt solid #000!important}body.printing-teacher-report .teacher-pdf-detail-table tbody tr:not(.teacher-pdf-subtotal-row):not(.teacher-pdf-teacher-note-row) td:not(.teacher-pdf-name-cell):not(.staffing-text-left):not(.staffing-room-cell){text-align:center!important}body.printing-teacher-report .teacher-pdf-detail-table tbody tr.teacher-pdf-subtotal-row>td,body.printing-teacher-report .teacher-pdf-detail-table tbody tr.teacher-pdf-teacher-note-row>td{text-align:left!important}body.printing-teacher-report .teacher-pdf-report thead{display:table-header-group}body.printing-teacher-report .teacher-pdf-report tr{break-inside:avoid;page-break-inside:avoid}body.printing-teacher-report .teacher-pdf-summary-table{width:100%!important;min-width:0!important}body.printing-teacher-report .teacher-pdf-detail-table{width:100%!important;min-width:0!important;table-layout:fixed!important}body.printing-teacher-report .teacher-pdf-detail-table th,body.printing-teacher-report .teacher-pdf-detail-table td{font-size:14pt}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(1){width:9mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(2){width:34mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(3){width:18mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(4){width:47mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(5){width:12mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(6){width:12mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(7){width:72mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(8){width:20mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(9){width:12mm!important}body.printing-teacher-report .teacher-pdf-detail-table col:nth-child(10){width:45mm!important}}@media print{@page student-summary{size:A4 portrait;margin:15mm 9mm 10mm;@top-right{content:"หน้า " counter(page);font-family:TH Sarabun New,sans-serif;font-size:16pt}}body.printing-student-report>:not(.student-pdf-report){display:none!important}body.printing-student-report .student-pdf-report{display:block!important;color:#111827;font-family:TH Sarabun New,sans-serif!important;font-size:16pt}body.printing-student-report .student-pdf-report *{color:#111827;font-family:TH Sarabun New,sans-serif!important;font-size:16pt}body.printing-student-report .student-pdf-page{page:student-summary;break-after:page;page-break-after:always}body.printing-student-report .student-pdf-page-last{break-after:auto;page-break-after:auto}body.printing-student-report .student-pdf-logo{display:block;width:auto;max-width:16mm;height:auto;max-height:16mm;object-fit:contain;margin:0 auto 1mm}body.printing-student-report .student-pdf-page h1{margin:0 0 2mm;font-size:16pt;font-weight:700;text-align:center}body.printing-student-report .student-pdf-table{width:100%!important;min-width:0!important;table-layout:fixed!important;border:.5pt solid #000!important;border-collapse:collapse!important}body.printing-student-report .student-pdf-table col:nth-child(1){width:23mm!important}body.printing-student-report .student-pdf-table col:nth-child(2){width:60mm!important}body.printing-student-report .student-pdf-table col:nth-child(3){width:20mm!important}body.printing-student-report .student-pdf-table col:nth-child(4){width:15mm!important}body.printing-student-report .student-pdf-table col:nth-child(5){width:74mm!important}body.printing-student-report .student-pdf-table th,body.printing-student-report .student-pdf-table td{border:.5pt solid #000!important;padding:1px 3px!important;min-width:0;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}body.printing-student-report .student-pdf-table th{position:static!important;top:auto!important;z-index:auto!important;box-shadow:none!important;text-align:center!important}body.printing-student-report .student-pdf-table tbody td{text-align:center!important}body.printing-student-report .student-pdf-table td:nth-child(2),body.printing-student-report .student-pdf-table td:nth-child(5){text-align:left!important}body.printing-student-report .student-pdf-table tr{break-inside:avoid;page-break-inside:avoid}}.staffing-summary .staffing-truncated{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.staffing-summary h3 .staffing-truncated{display:inline-block;vertical-align:bottom;max-width:min(70vw,420px)}.staffing-hover-tooltip{position:fixed;z-index:10000;box-sizing:border-box;padding:8px 11px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#1f2937;box-shadow:0 6px 22px #0f172a38;font-size:13px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;max-height:40vh;overflow:auto;pointer-events:none}.staffing-grade-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:12px 0}.staffing-co-teacher-table select{box-sizing:border-box;width:100%;min-width:180px;max-width:320px}.staffing-teacher-room{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-muted);font-size:11px;text-align:left}.staffing-form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}.staffing-teacher-list{display:grid;gap:10px;margin:14px 0 10px}.staffing-teacher-assignment{border:1px solid var(--color-border);border-radius:8px;background:#fff;padding:10px;min-width:0}.staffing-teacher-assignment-title{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}.staffing-inline-check{display:inline-flex;align-items:center;gap:6px;margin:6px 0 0}.staffing-inline-check input{margin:0}.staffing-whole-grade-value{border:1px solid var(--color-border);border-radius:6px;padding:7px 10px;color:var(--color-muted);background:#f8fafc}.staffing-center-room-list{max-height:140px;overflow:auto;border:1px solid var(--color-border);border-radius:6px;padding:6px 8px}.staffing-center-room-list label{display:block}.staffing-room-hint>div{min-height:34px;display:flex;align-items:center;color:var(--color-muted)}.staffing-teacher-actions{display:flex;align-items:center;gap:12px;margin:6px 0 12px}.staffing-teacher-actions>span{color:var(--color-muted);font-size:12px}.staffing-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.staffing-toolbar h2{flex:1 1 220px;margin:0}.staffing-group-picker{display:flex;align-items:center;gap:8px}.staffing-group-picker label{margin:0;font-weight:600;white-space:nowrap}.staffing-group-picker select{box-sizing:border-box;min-width:220px;max-width:min(42vw,420px);padding:7px 10px}.staffing-toolbar-actions{display:flex;gap:6px}.staffing-center-room-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.staffing-center-room-heading label{margin:0}@media (max-width: 900px){.staffing-layout{flex-direction:column}.staffing-groups{width:100%!important;flex-basis:auto!important}}@media (max-width: 640px){.staffing-group-picker{width:100%}.staffing-group-picker select{flex:1;min-width:0;max-width:none}}.print-custom-header{font-weight:600}table.print-grid.print-custom-size thead th:not(:first-child){width:var(--print-col-w, var(--grid-col-size))}table.print-grid.print-custom-size .cell-3layer{width:var(--print-col-w, var(--grid-col-size));max-width:var(--print-col-w, var(--grid-col-size));height:var(--print-col-h, var(--grid-col-size));max-height:var(--print-col-h, var(--grid-col-size))}table.print-grid.print-custom-size tbody tr{height:var(--print-col-h, var(--grid-col-size));max-height:var(--print-col-h, var(--grid-col-size))}table.print-grid.print-custom-size .cell-inner{max-height:var(--print-col-h, var(--grid-col-size))}table.print-grid.print-custom-size .cell-line.line-teacher{font-size:var(--print-line1, 12pt);line-height:var(--print-line1, 12pt)}table.print-grid.print-custom-size .cell-line.line-student{font-size:var(--print-line2, 12pt);line-height:var(--print-line2, 12pt)}table.print-grid.print-custom-size .cell-line.line-room{font-size:var(--print-line3, 12pt);line-height:var(--print-line3, 12pt)}.print-sheet-body{width:var(--print-table-w, auto);margin:0 auto}.print-sheet-body .print-school-header{position:relative;width:100%;min-height:56px}.print-sheet-body .print-logo{position:absolute;left:calc(var(--print-first-col-w, 80px) + var(--print-col-w, 70px) * 2);top:-8px;height:calc(100% + 8px);width:var(--print-col-w, 70px);object-fit:contain}table.print-grid th.print-time-cell{white-space:nowrap;overflow:hidden}.period-setup-wrap{overflow-x:auto}table.period-setup-table{width:auto}table.period-setup-table th,table.period-setup-table td{white-space:nowrap;text-align:center;padding:4px 6px}table.period-setup-table thead th{min-width:96px}table.period-setup-table tbody th{background:#f3f4f6;text-align:right;position:sticky;left:0;z-index:1}table.period-setup-table input[type=text],table.period-setup-table input[type=number],table.period-setup-table input:not([type]){width:100%;min-width:88px;padding:4px 6px;text-align:center}table.permission-table th,table.permission-table td{text-align:center;white-space:nowrap;padding:4px 8px}table.permission-table tbody th{background:#f8fafc;font-weight:500;position:sticky;left:0;z-index:1}table.permission-table thead th{background:#f3f4f6}table.permission-table td input[type=checkbox]:disabled{opacity:.55}table.schedule-grid tr.parking-row{border-top:3px double var(--color-border)}table.schedule-grid tr.parking-row>td{background:#f8fafc}table.schedule-grid tr.parking-row .cell-line{position:relative}table.schedule-grid tr.parking-row .cell-line.has-count{padding-right:18px}table.schedule-grid tr.parking-row>td.day-row-head{color:var(--color-muted);font-style:italic}.parked-badge{position:absolute;top:50%;right:2px;transform:translateY(-50%);z-index:1;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;border-radius:999px;background:var(--color-primary, #2563eb);color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;pointer-events:none}table.schedule-grid .cell-line.line-no-move{position:relative}table.schedule-grid .cell-line.line-no-move:after{content:"";position:absolute;top:2px;right:2px;width:6px;height:6px;border-radius:50%;background:#b45309;pointer-events:none}table.schedule-grid td.cell-3layer.co-free-all{background:#e9d5ff}table.schedule-grid td.cell-3layer.co-free-all:hover{background:#d8b4fe}table.schedule-grid td.cell-3layer.co-free-some{background:#bfdbfe}table.schedule-grid td.cell-3layer.co-free-some:hover{background:#93c5fd}table.schedule-grid .cell-line.line-co{position:relative}table.schedule-grid .cell-line.line-co:before{content:"Co";position:absolute;right:1px;bottom:0;font-size:8px;font-weight:700;line-height:1;color:#047857;pointer-events:none}.data-tabs-page .data-table-scroll>table.data-table{margin-inline:auto}table.data-table td.cpp-problem{background:#fee2e2;color:#7f1d1d}table.data-table tr.cpp-row-focus>td{background:#fef9c3;font-weight:600}table.data-table tr.cpp-row-focus>td.cpp-problem{background:#fecaca}table.data-table td.cpp-problem-movable{background:#fca5a5;color:#7f1d1d;font-weight:700;outline:2px solid #dc2626;outline-offset:-2px}table.schedule-grid td.cell-3layer.chain-target-cell{outline:2px solid #2563eb;outline-offset:-2px}table.schedule-grid td.cell-3layer.chain-disabled-cell{opacity:.55;cursor:not-allowed}.request-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.request-preview{padding:16px;margin:8px 0 16px;border:1px solid var(--color-border, #cbd5e1);border-radius:8px}.request-preview select{max-width:100%;margin-left:8px;padding:6px}.request-legend-old,.request-legend-new{display:inline-block;padding:4px 10px;border-radius:4px;margin:4px;color:#172033}.request-legend-old{background:#ffddb0}.request-legend-new{background:#bbf7d0}.request-list-wrap{max-width:100%;overflow-x:auto}.request-list-table{width:100%;border-collapse:collapse;font-size:13px}.request-list-table th,.request-list-table td{padding:9px 12px;border:1px solid #dbe2ea;text-align:left;white-space:nowrap}.request-list-table th{background:#f1f5f9;color:#172033}.request-list-table tbody tr:hover{background:#f8fafc}.request-position-old{color:#92400e;font-weight:600}.request-position-new{color:#166534;font-weight:600}.request-timetable .request-timetable-cell{max-height:none}.request-timetable .request-timetable-entry{height:64px;max-height:64px;background:transparent;color:inherit}.request-timetable .request-timetable-entry+.request-timetable-entry{border-top:1px solid #cbd5e1}.request-timetable .cell-line{background:transparent;cursor:default}.request-timetable .request-overlay-old{background:#ffddb0}.request-timetable .request-overlay-new{background:#bbf7d0}.request-timetable .request-overlay-marker{display:block;flex:0 0 13px;font-size:10px;line-height:13px;padding:0 3px;color:#172033}.request-timetable caption{text-align:left;padding:8px 0;font-weight:600}.request-review-body{overflow-y:auto;min-height:0;flex:1}.request-quick-actions{display:flex;gap:6px;align-items:center}.request-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 5px;border-radius:50%;box-sizing:border-box;margin-left:5px;font-size:12px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;background:#64748b;color:#fff;vertical-align:middle}.request-count-pending{background:#c2410c}.request-count-rejected{background:#b91c1c}.request-count-approved{background:#15803d}.request-count-other,.request-count-zero{background:#64748b}.modal-header-draggable{cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}.modal-header-draggable:active{cursor:grabbing}.modal-header-draggable button{cursor:pointer}.request-launcher{display:inline-flex;align-items:center;gap:5.6px;min-height:36.4px;padding:7px 12.6px;font-size:11.2px;font-weight:600;border-radius:8.4px;touch-action:none;-webkit-user-select:none;user-select:none;cursor:grab;box-shadow:0 3px 12px #0f172a1a}.request-launcher:active{cursor:grabbing}.request-launcher .request-count-badge{min-width:23.8px;height:23.8px;font-size:11.2px;margin-left:3.5px;padding:0 3.5px}:root{--motion-fast: .12s;--motion-open: .18s;--motion-ease: cubic-bezier(.2, .7, .3, 1)}.btn,.chat-launcher,.chat-composer button,.sidebar nav a,.chat-user-list button,.chat-settings-menu>button{transition:background-color var(--motion-fast) ease,border-color var(--motion-fast) ease,color var(--motion-fast) ease,box-shadow var(--motion-fast) ease}.btn:active:not(:disabled):not(.request-launcher),.chat-composer button:active:not(:disabled){box-shadow:inset 0 2px 4px #0f172a24}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--color-primary);outline-offset:3px}.field input,.field select,.field textarea,.chat-composer textarea{transition:border-color var(--motion-fast) ease,box-shadow var(--motion-fast) ease}.field input:focus,.field select:focus,.field textarea:focus,.chat-composer textarea:focus{border-color:var(--color-primary);box-shadow:0 0 0 2px #2563eb1a}@keyframes surface-appear{0%{opacity:.35}to{opacity:1}}.modal,.chat-window,.chat-settings-menu{animation:surface-appear var(--motion-open) var(--motion-ease)}@keyframes count-notice{0%,to{transform:scale(1)}45%{transform:scale(1.13)}}.count-pulse{animation:count-notice .26s var(--motion-ease) 1}@media (prefers-reduced-motion: reduce){.modal,.chat-window,.chat-settings-menu,.count-pulse{animation:none}.btn,.chat-launcher,.chat-composer button,.sidebar nav a,.chat-user-list button,.chat-settings-menu>button,.field input,.field select,.field textarea,.chat-composer textarea{transition:none}}@media print{.modal,.chat-window,.chat-settings-menu,.count-pulse{animation:none}}.placement-progress{border:1px solid var(--color-border);border-radius:8px;padding:10px 12px;margin-bottom:10px;display:grid;gap:6px}.placement-progress-head{display:flex;justify-content:space-between;gap:8px;font-size:14px}.placement-progress-head span{font-variant-numeric:tabular-nums;color:var(--color-muted)}.placement-progress-bar{height:8px;border-radius:4px;background:var(--color-border);overflow:hidden}.placement-progress-bar span{display:block;height:100%;background:#4c1d95;transition:width .4s linear}.placement-progress-meta{font-size:12px;color:var(--color-muted);font-variant-numeric:tabular-nums}.placement-progress .btn{justify-self:start}.placement-tag{font-size:12px;font-weight:700;border-radius:999px;padding:1px 9px}.placement-tag-recommended{background:#4c1d95;color:#fff}.placement-tag-leastImpact{background:#e0f2fe;color:#075985;border:1px solid #7dd3fc}.placement-why{color:#92400e}.placement-impact{color:#92400e;background:#fef3c7;border-radius:4px;padding:1px 6px}.placement-net{font-weight:700;border:1px solid var(--color-border);border-radius:4px;padding:0 6px}.placement-rule-detail{font-size:12px;color:var(--color-muted);margin-bottom:4px}.placement-searched{font-size:12px;color:var(--color-muted);margin-top:6px;display:flex;flex-wrap:wrap;align-items:center;gap:4px;font-variant-numeric:tabular-nums}.placement-option{border:1px solid var(--color-border);border-radius:8px;padding:10px 12px;margin-bottom:8px}.placement-option-best{border-color:var(--color-primary, #2563eb);box-shadow:0 0 0 1px var(--color-primary, #2563eb)}.placement-option-head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;margin-bottom:4px}.placement-badge{font-size:12px;background:#fef3c7;color:#92400e;border-radius:999px;padding:1px 8px}.placement-chain{margin:4px 0 6px 18px;font-size:13px}.placement-delta{display:flex;flex-wrap:wrap;gap:6px;font-size:12px;margin-bottom:6px}.placement-better{color:#166534;background:#dcfce7;border-radius:4px;padding:1px 6px}.placement-worse{color:#991b1b;background:#fee2e2;border-radius:4px;padding:1px 6px}.double-period-picker{display:inline-flex;flex-direction:column;gap:2px;align-items:flex-start;font-size:12px}.double-period-picker label{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;cursor:pointer}table.schedule-grid.framework-grid td.framework-cell{padding:0}.framework-line{padding:0!important;background:transparent!important;overflow:hidden}.framework-line-empty{cursor:pointer}.framework-line-empty:hover{background:#eef2ff!important;outline:1px dashed var(--color-primary);outline-offset:-1px}.framework-chip{display:flex;align-items:center;justify-content:center;gap:3px;width:100%;height:100%;border:0;border-radius:2px;background:var(--color-border);color:#111827;padding:0 3px;font-size:10px;line-height:1.1;cursor:pointer;overflow:hidden;white-space:nowrap;-webkit-print-color-adjust:exact;print-color-adjust:exact}.framework-chip:hover{filter:brightness(.92);outline:1px solid var(--color-primary);outline-offset:-1px}.framework-chip-label{font-weight:600;overflow:hidden;text-overflow:ellipsis}.framework-form{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end}.framework-form .field{margin:0}.framework-form .field-grow{flex:1 1 240px;min-width:200px}.framework-form .field-color{flex:0 0 56px}.framework-form .field-color input[type=color]{width:56px;height:34px;padding:2px}.framework-form .field-narrow{flex:0 0 116px}.framework-form .field-narrow select{width:100%}.framework-form-hint{margin:6px 0 0}.framework-pickers{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin-top:12px}.framework-picker h4{margin:0 0 6px;font-size:13px;display:flex;align-items:center;gap:6px}.framework-quick{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}.framework-quick select{max-width:100%}.framework-search{flex:1 1 120px;min-width:100px;padding:5px 8px;border:1px solid var(--color-border);border-radius:6px;font-size:12px}.framework-checklist{height:340px;overflow-y:auto;border:1px solid var(--color-border);border-radius:6px;display:grid;gap:0;font-size:12px;align-content:start}.framework-checklist label{display:flex;align-items:center;gap:6px;padding:4px 8px;border-bottom:1px solid #f1f5f9;cursor:pointer}.framework-checklist label:last-child{border-bottom:0}.framework-checklist label:hover{background:#f8fafc}.framework-sub{color:#9ca3af;font-size:10px}.framework-flags{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-top:12px;font-size:13px}.framework-flags label{display:flex;align-items:center;gap:6px}.framework-note{flex:1 1 200px;min-width:160px}.framework-filter{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;font-size:12px;color:#475569;margin:4px 0 8px}.framework-filter label{display:flex;align-items:center;gap:6px;cursor:pointer}.framework-filter select{font-size:12px;padding:3px 6px}.framework-moving{display:flex;align-items:center;gap:10px;flex-wrap:wrap}table.schedule-grid.framework-grid td.framework-move-target,.framework-move-target .framework-chip{cursor:crosshair}table.schedule-grid.framework-grid td.framework-fit{background:#fff!important}table.schedule-grid.framework-grid td.framework-fit:hover{outline:2px solid var(--color-primary);outline-offset:-2px;background:#eef2ff!important}table.schedule-grid.framework-grid td.framework-unfit{background:#d1d5db!important;cursor:not-allowed}.framework-unfit .framework-chip{opacity:.45;cursor:not-allowed}.framework-blocker-list{max-height:260px;overflow-y:auto;border:1px solid var(--color-border);border-radius:6px}.framework-blocker{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid #f1f5f9;font-size:13px;cursor:pointer}.framework-blocker:last-child{border-bottom:0}.framework-blocker-lock{background:#fef9c3;color:#a16207}.framework-blocker-full{background:#fee2e2;color:#b91c1c}.framework-blocker-tag{font-size:11px;font-weight:600;opacity:.8}.framework-detail{display:grid;gap:6px;font-size:13px}.framework-page .hint{color:var(--color-muted);font-size:12px;line-height:1.35}.framework-modal-body{flex:1 1 auto;overflow-y:auto;min-height:0}.framework-footer{justify-content:flex-end;flex-wrap:wrap;align-items:center}.framework-footer .hint{margin-right:auto;text-align:left}.availability-cell{-webkit-user-select:none;user-select:none}.availability-cell:hover{outline:2px solid var(--primary, #2b6cb0);outline-offset:-2px}.availability-on{background:#2ea0432e}.availability-on .cell-line.empty:after{content:"✓";color:#2ea043;font-weight:700}.availability-off{opacity:.55}.availability-off .availability-cell:hover{outline:none}.unavailable-slot{background-color:#f2f2f2}.advisor-topbar{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:12px}.advisor-topbar label{display:flex;flex-direction:column;font-size:13px;gap:2px}.advisor-topbar input[type=number]{width:90px}.advisor-filters{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin:10px 0}.advisor-filters label{display:flex;flex-direction:column;font-size:13px;gap:2px}.advisor-note{font-size:12px;color:var(--color-muted)}.advisor-warn{font-size:12px;color:#b45309;background:#fffbeb;border:1px solid #fde68a;border-radius:4px;padding:3px 8px}.advisor-check{display:inline-flex;flex-direction:row!important;align-items:center;gap:5px}.advisor-block{border:1px solid var(--color-border);border-radius:6px;padding:10px 12px;margin:0 auto 10px;width:fit-content;max-width:100%}.advisor-block.locked{border-color:#fbbf24;background:#fffdf5}.advisor-block-head{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:8px}.advisor-block-head label{display:flex;flex-direction:column;font-size:12px;gap:2px}.advisor-block-head input[type=number]{width:80px}.advisor-tname{display:inline-block;width:var(--advisor-tname-w, 20ch)}.advisor-head-right{display:flex;align-items:flex-end;gap:10px;margin-left:auto}.advisor-code{font-size:12px;color:var(--color-muted)}.advisor-badge{font-size:12px;background:#eef2ff;color:#3730a3;border-radius:10px;padding:2px 9px}.advisor-badge.full{background:#fef3c7;color:#92400e}.advisor-table{width:auto}.advisor-block table.data-table.fit-head{margin-left:2rem;margin-right:auto}.advisor-col-class .advisor-tag{display:inline-block;margin:2px 0 0 4px}.advisor-table.wide{width:100%}.advisor-table td.advisor-off{background:#f3f4f6}.advisor-empty{color:var(--color-muted);font-style:italic}.advisor-tag{font-size:11px;margin-left:5px;padding:1px 6px;border-radius:3px;background:#f3f4f6;color:#4b5563}.advisor-tag.warn{background:#fef2f2;color:#b91c1c}.advisor-why{font-size:11px;color:#9ca3af}.advisor-short{color:#b91c1c}.advisor-ok{color:#047857}.advisor-actions{white-space:nowrap}.advisor-add{display:flex;gap:8px;align-items:center;margin-top:8px}.advisor-add-class{width:10rem}.advisor-more{margin:8px 0 16px}.advisor-grade-head{display:flex;gap:12px;align-items:center;margin:14px 0 6px}.advisor-report{border:1px solid #bfdbfe;background:#eff6ff;border-radius:6px;padding:8px 12px;margin:10px 0;font-size:13px}.advisor-report ul{margin:6px 0 6px 18px}.advisor-upload{position:relative;overflow:hidden;display:inline-flex;align-items:center;cursor:pointer}.advisor-upload input[type=file]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer}.advisor-report details{margin-top:6px}.advisor-report summary{cursor:pointer}.modal-fit-content .modal-header,.modal-fit-content .modal-footer{flex:0 0 auto}.modal-fit-content .modal-body{flex:1 1 auto;overflow:auto;min-height:0}.advisor-slot{display:flex;align-items:center;gap:4px}.advisor-name-col{width:var(--advisor-name-w, 20ch)}.advisor-slot select{width:var(--advisor-name-w, 20ch);min-width:0;max-width:none;text-overflow:ellipsis}.advisor-quota-cell{display:flex;align-items:center;gap:6px;white-space:nowrap}.advisor-quota-col{width:7.5rem}.advisor-quota-cell select{flex:1 1 auto;min-width:0}.advisor-reset{flex:0 0 auto;width:26px;height:26px;padding:0;line-height:1;display:inline-flex;align-items:center;justify-content:center;font-size:15px}.advisor-reset:disabled{opacity:.35}.advisor-lock.on{background:#fef3c7;border-color:#fcd34d}.merge-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:4px 12px;margin-bottom:12px}#ws-zoom{position:fixed;top:4px;right:8px;z-index:2147483000;display:flex;align-items:center;gap:2px;background:#ffffffeb;border:1px solid #D9DFE9;border-radius:8px;padding:2px;font:12px Tahoma,Noto Sans Thai,sans-serif;box-shadow:0 2px 8px #172a491f;opacity:.55;transition:opacity .2s}#ws-zoom:hover,#ws-zoom.show{opacity:1}#ws-zoom button{border:0;background:transparent;color:#172a49;min-width:26px;height:22px;padding:0 6px;border-radius:6px;cursor:pointer;font:inherit;line-height:22px;box-shadow:none}#ws-zoom button:hover{background:#f6e3ec}#ws-zoom .pct{min-width:46px;font-variant-numeric:tabular-nums}#ws-zoom.auto .pct{color:#166534}.ws-fit-probe-bd{right:auto!important;bottom:auto!important;width:20000px!important;height:auto!important;overflow:visible!important}.ws-fit-probe{max-height:none!important;height:auto!important}.ws-fit-probe>.modal-body{max-height:none!important;overflow:visible!important;flex:none!important}@media (hover:none){#ws-zoom{opacity:1}#ws-zoom button{min-width:34px;height:30px}}.main-area{zoom:var(--ws-zoom,1)}.main-area .modal-backdrop{zoom:calc(1 / var(--ws-zoom,1))}.modal-backdrop>.modal{zoom:var(--ws-zoom,1)}@media print{#content,.main-area,.modal-backdrop,.modal-backdrop>.modal{zoom:1!important}#ws-zoom{display:none!important}}@media screen{.app-shell>.sidebar{position:sticky;top:0;height:100vh;align-self:flex-start;overflow:hidden}.app-shell>.sidebar>h1,.app-shell>.sidebar>.user-box{flex-shrink:0}.app-shell>.sidebar>nav{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}.app-shell>.sidebar>nav>a,.app-shell>.sidebar>nav>.nav-section-title{flex-shrink:0}}.confirm-backdrop{z-index:200}.modal.confirm-dialog{max-width:520px;width:auto;min-width:360px;border:3px solid transparent}.confirm-dialog .confirm-body{font-size:15px;line-height:1.6;white-space:pre-line}.confirm-warn{border-color:#f59e0b}.confirm-warn .modal-header{background:#d97706}.confirm-danger{border-color:#dc2626}.confirm-danger .modal-header{background:#dc2626}.confirm-info{border-color:#2563eb}.confirm-info .modal-header{background:#2563eb}.btn-danger-solid{background:#dc2626;border-color:#dc2626;color:#fff}.btn-danger-solid:hover{background:#b91c1c}@media screen{:root{--color-bg: #f7f8fc;--color-panel: #ffffff;--color-border: #e4e7ef;--color-text: #172a49;--color-muted: #68758c;--color-primary: #172a49;--color-primary-dark: #273d65;--school-pink: #dc72ad;--school-soft: #fbeff6;--school-pink-ink: #9b3c63;--color-teacher-bg: #c5e5cf;--color-teacher-border: #8fbd9d;--color-student-bg: #f5e0e9;--color-student-border: #dfb5c8;--color-room-bg: #f7efcf;--color-room-border: #dacc9e}.sidebar{background:#fff;color:var(--color-text)}.sidebar .school-heading{display:flex;align-items:center;gap:6px;padding-inline:8px}.school-heading img{flex:0 0 auto;object-fit:contain}.school-heading span{white-space:nowrap;font-size:13px;line-height:1.5}.sidebar h1,.sidebar nav .nav-section-title{border-color:var(--color-border)}.sidebar nav a{color:var(--color-text)}.sidebar nav a:hover{background:#f7f8fc}.sidebar nav a.active{background:var(--school-soft);color:var(--school-pink-ink);box-shadow:inset 3px 0 var(--school-pink)}.sidebar nav .nav-section-title{color:var(--color-muted)}.sidebar .user-box{border-top-color:var(--color-border);color:var(--color-muted)}.sidebar .user-box button{border-color:var(--color-border);color:var(--color-text);background:#fff}.sidebar .user-box button:hover{border-color:var(--school-pink)}.sidebar .user-box .chat-launcher{background:var(--color-primary);color:#fff;box-shadow:none}.btn:focus-visible,a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--school-pink);outline-offset:3px}.field input:not([type=checkbox]),.field select,.field textarea{color:var(--color-text)}.tab-nav .btn.active{background:var(--school-soft);border-color:#eac9dc;color:var(--school-pink-ink)}.modal{box-shadow:0 20px 60px #172a4926}.modal-header{background:var(--color-primary)}.btn-danger{background:#fae7e7;border-color:#edc9c9;color:#993a3a}.btn-danger:hover{background:#f4d7d7}.btn-info{background:#e8f0f8;border-color:#c9dcec;color:#355c85}.btn-info:hover{background:#d9e7f3}.btn-warning{background:#faf1d9;border-color:#e9d9ae;color:#86601f}.btn-warning:hover{background:#f2e6c3}.btn-orange,.btn-pastel-orange{background:#f9e7d6;border-color:#e9cbad;color:#945b2c}.btn-orange:hover,.btn-pastel-orange:hover{background:#f1d9c1}.btn-navy{background:#e5ecf7;border-color:#c6d4e9;color:#294971}.btn-navy:hover{background:#d7e2f2}}
