/* Scoped to administrator pages only. No classroom/clock/student styles. */
.console-shell, .admin-page { --visual-space:12px; }
.console-shell button:focus-visible,.admin-page button:focus-visible {outline:3px solid #82a9d9;outline-offset:2px}
.console-shell .console-views,.console-shell .console-view,.admin-page .admin-view {min-width:0}
.console-shell .panel-head,.admin-page .preview-heading {gap:12px;flex-wrap:wrap}
.console-shell .device-card,.console-shell .device-card * {min-width:0}
.console-shell .card-top strong,.console-shell .card-caption,.console-shell .card-class {overflow-wrap:anywhere;white-space:normal}
.console-shell .card-buttons {display:flex;flex-wrap:wrap;gap:8px}
.console-shell .device-view-tools {display:flex;flex-wrap:wrap;overflow:visible;align-items:center;gap:10px}
.console-shell .device-view-tools input {min-width:0;flex:1 1 220px;max-width:none;order:0}
.console-shell .device-view-tools>button {order:0;flex:0 1 auto;white-space:normal}
.console-shell .device-filter-strip {flex:1 1 100%;display:flex;flex-direction:column;overflow:visible;gap:8px;min-width:0}
.console-shell .filter-row {display:flex;flex-wrap:wrap;align-items:center;gap:7px;white-space:normal}
.console-shell .filter-label {display:block;flex:0 0 34px}
.console-shell .filter-chip {min-height:40px;white-space:normal}
.console-shell .filter-actions {align-self:flex-end}
.console-shell .group-chips {display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:8px}
.console-shell .group-chips button,
.console-shell .group-chips button[data-secondary="true"][aria-pressed="false"] {
  display:block;min-width:0;min-height:44px;padding:9px 10px;white-space:normal;overflow-wrap:anywhere;
  text-align:center;border-radius:8px;font-size:13px;line-height:1.5
}
.console-shell .group-chips button[aria-pressed="true"] {background:#e8f1fc;border-color:#245fa7;box-shadow:inset 0 0 0 1px #245fa7}
.console-shell .scope-summary {display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.console-shell .scope-summary>span {flex:1;min-width:150px}
.console-shell .visual-account {background:#fff;border:1px solid #dce5ee;border-radius:10px;padding:18px;margin-bottom:18px}
.console-shell .visual-account h2 {font-size:17px;margin:0 0 8px}
.console-shell .visual-account p {color:#566b80;margin:0 0 14px}
.console-shell #logout.visual-logout {position:static;min-height:44px;padding:9px 18px;color:#9c333b;background:#fff4f4;border:1px solid #e2b6bc}
.product-authenticated.console-shell .console-top {position:static;height:auto;min-height:64px;margin-left:var(--product-nav);width:calc(100% - var(--product-nav));padding:12px 24px}
.product-authenticated.console-shell .console-main {padding-top:22px}
.console-shell .console-top .top-actions {width:auto;margin-left:auto;flex:0 0 auto}
.console-shell .console-top .product-breadcrumb {min-width:0;overflow-wrap:anywhere}
.console-shell .selection-bar {position:static}
.console-shell .schedule-form,.console-shell .settings-grid {min-width:0}
.visual-select-source {position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
.visual-scope-picker {display:flex;flex-wrap:wrap;gap:8px;min-width:0;width:100%}
.visual-scope-picker button.visual-choice {background:#fff;border:1px solid #bccddd;color:#345675;border-radius:8px;min-height:42px;max-width:100%;padding:8px 12px;white-space:normal;overflow-wrap:anywhere;font:inherit;line-height:1.5}
.visual-scope-picker button.visual-choice[aria-pressed="true"] {background:#e8f1fc;color:#174d87;border-color:#245fa7;box-shadow:inset 0 0 0 1px #245fa7}
.admin-page .editor-actions {display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:16px}
.admin-page .editor-actions .admin-actions {display:flex;flex-wrap:wrap;gap:10px;width:100%}
.admin-page .editor-actions label:has(#publishScope) {display:flex;flex:1 1 100%;align-items:flex-start;flex-direction:column;gap:8px}
.admin-page .editor-actions #draftState {margin:0}
.admin-page .editor-table {background:transparent;border:0;overflow:visible;max-width:100%}
.admin-page .editor-table table,
.admin-page .editor-table tbody {display:block;min-width:0;width:100%;max-width:100%;table-layout:fixed}
.admin-page .editor-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.admin-page .editor-table tbody tr {
  display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px 12px;padding:18px;margin:0 0 14px;
  background:#fff;border:1px solid #d7e2ed;border-radius:10px;align-items:start
}
.admin-page .editor-table tbody td {
  display:block;order:10;grid-column:span 3;min-width:0;padding:0;border:0;white-space:normal;overflow-wrap:anywhere
}
.admin-page .editor-table tbody td[data-label]::before {content:attr(data-label);display:block;color:#51697f;font-size:12px;line-height:1.5;margin-bottom:6px;font-weight:600}
.admin-page .editor-table tbody td.row-actions {
  order:0;grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;
  position:static;background:transparent;padding-bottom:12px;border-bottom:1px solid #e3eaf2
}
.admin-page .editor-table tbody td.row-actions[data-label]::before {content:attr(data-room-title);margin:0 auto 0 0;color:#234b72;font-size:14px}
.admin-page .editor-table td[data-column="room"] {order:1;grid-column:span 3}
.admin-page .editor-table td[data-column="teachers"] {order:2;grid-column:span 6}
.admin-page .editor-table td[data-column="roomSubject"] {order:3;grid-column:span 3}
.admin-page .editor-table td[data-column="grade"] {order:4;grid-column:span 2}
.admin-page .editor-table td[data-column="subject"] {order:5;grid-column:span 2}
.admin-page .editor-table td[data-column="date"] {order:6;grid-column:span 4}
.admin-page .editor-table td[data-column="start"],.admin-page .editor-table td[data-column="end"] {order:7;grid-column:span 2}
.admin-page .editor-table td[data-column="examName"] {order:12;grid-column:1/-1}
.admin-page .editor-table input,
.admin-page .editor-table input[type="number"],
.admin-page .editor-table input[type="time"],
.admin-page .editor-table input[type="date"],
.admin-page .editor-table input[data-field="teachers"],
.admin-page .editor-table input[data-field="examName"] {
  width:100%;min-width:0;max-width:100%;height:42px;margin:0;padding:8px 9px;font-size:14px;border:1px solid #bdcfdf;border-radius:6px
}
.admin-page .editor-table input[type="checkbox"] {height:20px;width:20px;min-width:20px}
.admin-page .editor-table .row-actions button {min-height:38px;padding:7px 13px;margin:0}
.admin-page .editor-table .preview-empty {grid-column:1/-1}
.admin-page .admin-footer {position:static;display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px}
.admin-page .scene-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:12px}
.admin-page .scene-card {min-width:0}
.admin-page .scene-card .admin-actions {display:flex;flex-wrap:wrap;gap:8px}
.admin-page .table-scroll:not(.editor-table) {max-width:100%;min-width:0}
.admin-page .table-scroll:not(.editor-table) table {width:100%;min-width:0;table-layout:fixed}
.admin-page .table-scroll:not(.editor-table) td,.admin-page .table-scroll:not(.editor-table) th {white-space:normal;overflow-wrap:anywhere;min-width:0}
.admin-page .table-scroll input,.admin-page .table-scroll select {min-width:0;max-width:100%}
.admin-page .incident-room-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px}
.admin-page .incident-room-list label {min-height:44px;margin:0;overflow-wrap:anywhere}
.admin-page .room-binding-row {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;align-items:center;padding:16px;background:#fff;border:1px solid #dce5ee;border-radius:8px;margin:12px 0;min-width:0}
.admin-page .room-binding-row>* {min-width:0;max-width:100%;margin:0;overflow-wrap:anywhere}
.admin-page .room-binding-row>strong,.admin-page .room-binding-row>span {grid-column:1/-1}
.admin-page .room-binding-row>select,.admin-page .room-binding-row>input {grid-column:span 3;width:100%;min-height:44px}
.admin-page .room-binding-row>button {grid-column:span 2;min-height:44px;white-space:normal}
.admin-page .incident-duty-person {min-width:0;overflow-wrap:anywhere}
.admin-page .incident-person-actions {display:flex;flex-wrap:wrap;gap:8px}
.admin-page .incident-person-actions button {min-height:42px;white-space:normal;margin:0}
@media(max-width:1100px) {
  .admin-page .editor-table td[data-column="grade"],.admin-page .editor-table td[data-column="subject"] {grid-column:span 3}
  .admin-page .editor-table td[data-column="date"] {grid-column:span 6}
  .admin-page .editor-table td[data-column="start"],.admin-page .editor-table td[data-column="end"] {grid-column:span 6}
}
@media(max-width:900px) {
  .product-authenticated.console-shell .console-top {margin-left:0;width:100%;min-height:60px;padding:10px 12px;display:flex;flex-wrap:wrap;gap:10px}
  .product-authenticated.console-shell .console-top .top-actions {display:none}
  .console-shell .product-mobile-menu {display:inline-flex!important;min-width:52px;min-height:40px;align-items:center;justify-content:center}
  .console-shell .product-breadcrumb {flex:1;font-size:15px}
  .product-authenticated.console-shell .console-main {width:100%;margin:0;padding:16px 12px calc(100px + env(safe-area-inset-bottom))}
  .product-authenticated.console-shell .section-nav {display:none;position:static;inset:auto;width:100%;height:auto;max-height:none;margin:0 0 18px;padding:12px;border-radius:10px;overflow:visible}
  .product-authenticated.console-shell.product-nav-open .section-nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;box-shadow:none}
  .console-shell .section-nav .product-brand,.console-shell .section-nav .product-identity,.console-shell .section-nav .product-nav-label,.console-shell .section-nav .product-nav-bottom {display:none}
  .console-shell .section-nav button {min-width:0;min-height:46px;white-space:normal;text-align:left}
  .product-authenticated.console-shell .product-mobile-tabs {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:8px 8px calc(8px + env(safe-area-inset-bottom));gap:6px}
  .product-authenticated.console-shell .product-mobile-tabs button.visual-mobile-button {display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-width:0;min-height:58px;padding:6px 2px;font-size:12px;font-weight:600;line-height:1.4;background:#f3f6fa;color:#466079;border:1px solid #d5dfeb;border-radius:8px}
  .product-authenticated.console-shell .product-mobile-tabs button.visual-mobile-button.active {background:#e7f0fc;color:#174d87;border:1px solid #245fa7}
  .console-shell .product-mobile-tabs svg {width:20px;height:20px}
  .console-shell .group-chips {grid-template-columns:repeat(3,minmax(0,1fr))}
  .admin-page .table-scroll:not(.editor-table) {overflow:visible;border:0;background:transparent}
  .admin-page .table-scroll:not(.editor-table) table,.admin-page .table-scroll:not(.editor-table) tbody {display:block;width:100%;min-width:0}
  .admin-page .table-scroll:not(.editor-table) thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .admin-page .table-scroll:not(.editor-table) tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0;padding:14px;background:#fff;border:1px solid #dce5ee;border-radius:8px}
  .admin-page .table-scroll:not(.editor-table) td {display:block;min-width:0;padding:0;border:0}
  .admin-page .table-scroll:not(.editor-table) td[data-label]::before {content:attr(data-label);display:block;color:#51697f;font-size:12px;margin-bottom:6px}
}
@media(max-width:600px) {
  .console-shell .device-view-tools input {flex-basis:100%}
  .console-shell .device-view-tools>button {flex:1 1 100%;min-height:42px}
  .console-shell .filter-label {flex-basis:100%;font-weight:600}
  .console-shell .filter-chip {min-height:44px}
  .console-shell .filter-actions {align-self:stretch}
  .console-shell .filter-actions button {width:100%}
  .console-shell .card-buttons button {flex:1 1 auto;min-height:44px}
  .console-shell .selection-bar .tiny {min-height:44px;flex:1}
  .admin-page .editor-table tbody tr {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}
  .admin-page .editor-table tbody td,
  .admin-page .editor-table td[data-column="grade"],.admin-page .editor-table td[data-column="subject"],
  .admin-page .editor-table td[data-column="room"],.admin-page .editor-table td[data-column="roomSubject"],
  .admin-page .editor-table td[data-column="start"],.admin-page .editor-table td[data-column="end"] {grid-column:span 1}
  .admin-page .editor-table td[data-column="teachers"],.admin-page .editor-table td[data-column="date"],
  .admin-page .editor-table td[data-column="examName"],.admin-page .editor-table tbody td.row-actions {grid-column:1/-1}
  .admin-page .editor-table td[data-column="room"],.admin-page .editor-table td[data-column="roomSubject"] {order:1}
  .admin-page .editor-table td[data-column="teachers"] {order:2}
  .admin-page .editor-table td[data-column="grade"],.admin-page .editor-table td[data-column="subject"] {order:3}
  .admin-page .editor-table td[data-column="date"] {order:4}
  .admin-page .editor-table td[data-column="start"],.admin-page .editor-table td[data-column="end"] {order:5}
  .admin-page .editor-table td[data-column="examName"] {order:12}
  .admin-page .editor-table input {font-size:16px;height:46px}
  .admin-page .editor-table .row-actions button {min-height:44px}
  .admin-page .admin-heading .admin-actions,.admin-page .editor-actions .admin-actions {display:flex;flex-wrap:wrap;gap:8px}
  .admin-page .admin-actions>.button {min-height:44px;flex:1 1 auto}
  .admin-page .admin-footer .button {width:100%;min-height:46px}
  .admin-page .visual-scope-picker button {flex:1 1 84px;min-height:44px}
  .admin-page .import-strip {align-items:flex-start;flex-wrap:wrap;gap:10px}
  .admin-page .scene-fields {grid-template-columns:1fr}
  .console-shell .settings-grid {grid-template-columns:1fr}
}
