:root {
  --bg: #f6f8fb;
  --panel: #fff;
  --line: #dfe7ef;
  --text: #17212f;
  --muted: #667085;
  --teal: #0f8b8d;
  --accent: #0f8b8d;
  --accent-strong: #087276;
  --accent-soft: #e5f7f4;
  --accent-faint: #f3fbfa;
  --sidebar-bg: #f8fbfb;
  --sidebar-line: #dbe8e8;
  --sidebar-text: #304750;
  --blue: #2868c7;
  --green: #2d9a59;
  --amber: #be7a13;
  --red: #c44848;
}

html[data-school-theme="ocean"] {
  --bg: #f3f7fc;
  --line: #dbe5f1;
  --teal: #2f6fda;
  --accent: #2f6fda;
  --accent-strong: #2457af;
  --accent-soft: #e8f0ff;
  --accent-faint: #f4f7ff;
  --sidebar-bg: #f7f9fd;
  --sidebar-line: #d9e3f1;
  --sidebar-text: #34465f;
}

html[data-school-theme="sunset"] {
  --bg: #faf7f2;
  --line: #ebe1d5;
  --teal: #d06f32;
  --accent: #d06f32;
  --accent-strong: #a95425;
  --accent-soft: #fff0e5;
  --accent-faint: #fff9f4;
  --sidebar-bg: #fdfaf6;
  --sidebar-line: #eadfd2;
  --sidebar-text: #59483d;
}

html[data-school-theme="cyber"] {
  color-scheme: dark;
  --bg: #050b18;
  --panel: #0d172b;
  --line: #253957;
  --text: #e8f5ff;
  --muted: #8ca7c1;
  --teal: #20ccff;
  --accent: #168dff;
  --accent-strong: #53dcff;
  --accent-soft: #102b4d;
  --accent-faint: #091d35;
  --sidebar-bg: #071224;
  --sidebar-line: #1d3858;
  --sidebar-text: #c9e8ff;
  --blue: #49a5ff;
  --green: #35e1a1;
  --amber: #ffc866;
  --red: #ff6f8d;
}

html[data-school-theme="candy"] {
  --bg: #fff6f8;
  --panel: #fffdfd;
  --line: #f0d9e1;
  --text: #5d3e4b;
  --muted: #967382;
  --teal: #ef709b;
  --accent: #ef709b;
  --accent-strong: #d85282;
  --accent-soft: #ffe4ed;
  --accent-faint: #fff4f7;
  --sidebar-bg: #fff1f5;
  --sidebar-line: #f1d4de;
  --sidebar-text: #744e5e;
  --blue: #709be9;
  --green: #66b98d;
  --amber: #e9a351;
  --red: #e75f75;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

button:hover { border-color: var(--teal); color: var(--teal); }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

textarea { min-height: 90px; resize: vertical; }

.hidden { display: none !important; }

.login-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  color: #183763;
  background: #285cf4 url("./images/login/dl_bg.jpg") center / cover no-repeat;
}

.login-stage {
  width: min(1240px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: clamp(28px, 6vh, 66px) 0 24px;
}

.login-system-title {
  width: min(760px, 70vw);
  max-height: 102px;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(1, 31, 110, .26));
}

.login-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(390px, 450px);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  padding: 20px 42px 12px;
}

.login-visual {
  min-width: 0;
  display: grid;
  place-items: center;
}

.login-visual img {
  width: min(650px, 100%);
  max-height: 570px;
  object-fit: contain;
  filter: drop-shadow(0 22px 28px rgba(0, 30, 122, .24));
}

.login-panel {
  width: 100%;
  display: grid;
  gap: 17px;
  padding: 30px 38px 26px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 22px;
  background: rgba(239, 248, 255, .93);
  box-shadow: 0 22px 54px rgba(5, 35, 132, .28), inset 0 1px 0 rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
}

.login-panel-head { text-align: center; }
.login-panel h1 { margin: 0; color: #177cff; font-size: 26px; font-weight: 700; }
.login-panel p { margin: 7px 0 0; color: #7b94b5; font-size: 13px; }
.login-field { display: grid; gap: 6px; color: #6681a5; font-size: 12px; }

.login-field > input,
.login-field .captcha-row > input {
  height: 52px;
  padding-left: 46px;
  border-color: #d6e0ec;
  border-radius: 10px;
  color: #263955;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: 13px center;
  background-size: 22px 22px;
  outline: none;
}

.login-field > input:focus,
.login-field .captcha-row > input:focus {
  border-color: #5aa2ff;
  box-shadow: 0 0 0 3px rgba(46, 132, 255, .12);
}

.login-field-user > input { background-image: url("./images/login/dl_xtb_yh.png"); }
.login-field-password > input { background-image: url("./images/login/dl_xtb_mm.png"); }
.login-field-captcha .captcha-row > input { background-image: url("./images/login/dl_xtb_yzm.png"); }
.login-submit {
  height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(90deg, #168cff, #176cff);
  box-shadow: 0 9px 18px rgba(23, 111, 255, .22);
  font-size: 17px;
  font-weight: 700;
}
.login-submit:hover { color: #fff; background: linear-gradient(90deg, #087df1, #0b5fe8); }
.login-error { min-height: 18px; color: #d83e52; font-size: 13px; text-align: center; }
.login-copyright {
  justify-self: center;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(3, 31, 100, .36);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
}

.captcha-row img {
  width: 130px;
  height: 52px;
  border: 1px solid #d6e0ec;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
  cursor: pointer;
}

@media (max-width: 900px) {
  .login-stage { width: min(560px, calc(100vw - 32px)); padding-top: 24px; }
  .login-layout { grid-template-columns: 1fr; padding: 18px 0; }
  .login-visual { display: none; }
  .login-system-title { width: min(520px, 92vw); }
}

@media (max-width: 520px) {
  .login-panel { padding: 24px 20px 20px; border-radius: 16px; }
  .login-layout { padding-top: 10px; }
  .captcha-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .captcha-row img { width: 112px; }
}

.sidebar {
  height: 100vh;
  min-height: 0;
  padding: 14px 10px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a9bdc8 transparent;
}

.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b6c8d1;
}

.brand {
  display: flex;
  justify-items: initial;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--line);
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 10px rgba(22, 119, 190, .2));
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong, .brand span { display: block; }
.brand strong {
  overflow: hidden;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.brand span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-school-row {
  min-width: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.brand-switch-account {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
}

.brand-switch-account:hover {
  color: #fff;
  background: var(--accent);
}

.brand-switch-account svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 30%, transparent) transparent;
}

nav::-webkit-scrollbar { width: 6px; }
nav::-webkit-scrollbar-track { background: transparent; }
nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.nav-tree {
  display: grid;
  gap: 8px;
  padding-right: 3px;
}

.nav-tree-group {
  overflow: hidden;
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent-faint));
}

.nav-tree-group-title {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 6px 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--sidebar-line) 75%, transparent);
  color: var(--sidebar-text);
  background: color-mix(in srgb, var(--accent-faint) 65%, var(--panel));
  text-align: left;
}

.nav-tree-group-title:hover { color: var(--accent-strong); }
.nav-tree-group.contains-active .nav-tree-group-title {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-tree-group-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: color-mix(in srgb, var(--accent) 70%, #708090);
  font-size: 11px;
  font-weight: 800;
}

.nav-tree-group.contains-active .nav-tree-group-icon { background: var(--accent); }
.nav-tree-group-title strong { min-width: 0; font-size: 12px; }
.nav-tree-group-title small { color: var(--muted); font-size: 10px; }
.nav-tree-group.collapsed .nav-tree-group-title { border-bottom-color: transparent; }
.nav-tree-group.collapsed .nav-tree-group-content { display: none; }

.nav-tree-section {
  position: relative;
  padding: 5px 5px 5px 12px;
}

.nav-tree-section + .nav-tree-section {
  border-top: 1px dashed color-mix(in srgb, var(--sidebar-line) 80%, transparent);
}

.nav-tree-section-title {
  width: 100%;
  height: 26px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  padding: 0 4px 0 0;
  color: #71808c;
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.nav-tree-section-title:hover {
  color: var(--accent-strong);
  background: var(--accent-faint);
}
.nav-tree-section.contains-active .nav-tree-section-title { color: var(--accent-strong); }
.nav-tree-branch {
  width: 8px;
  height: 8px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  border-radius: 0 0 0 3px;
  opacity: .65;
}

.nav-tree-leaves {
  display: grid;
  gap: 2px;
}

.nav-tree-section.collapsed .nav-tree-leaves { display: none; }
.nav-tree-toggle-arrow {
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .18s ease;
  opacity: .65;
}

.nav-tree-group.collapsed > .nav-tree-group-title .nav-tree-toggle-arrow,
.nav-tree-section.collapsed > .nav-tree-section-title .nav-tree-toggle-arrow {
  transform: rotate(0deg);
}

.nav-tree-level-2 { padding: 5px; }

.nav-channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.nav-tab {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  min-height: 30px;
  border: 1px solid #e1e9ef;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 7px;
  color: #47596a;
  background: #fff;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.nav-tab:hover {
  color: var(--teal);
  border-color: #b7dddd;
  background: #f4fbfa;
}

.nav-tab.active {
  color: #073d42;
  border-color: #84d4cf;
  background: #e8faf7;
  box-shadow: 0 3px 10px rgba(15, 139, 141, .1);
}

.nav-tab-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #0f8b8d;
  font-size: 10px;
  font-weight: 800;
}

.nav-tab-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 700;
}

.nav-title-count {
  display: none;
}

.nav-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
  background: #fff;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.nav-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f6;
  color: #243241;
  font-weight: 800;
}

.nav-panel-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nav-items {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 4px;
  padding: 6px;
  overflow: visible;
}

.nav-items::-webkit-scrollbar { width: 7px; }
.nav-items::-webkit-scrollbar-track { background: transparent; }
.nav-items::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b6c8d1;
}

.nav-subgroup {
  display: grid;
  gap: 4px;
  border: 1px solid #e7eef3;
  border-radius: 8px;
  background: #fbfdfe;
  overflow: hidden;
}

.nav-subgroup-toggle {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 7px 9px;
  color: #3e5364;
  background: #f5f9fb;
  text-align: left;
}

.nav-subgroup-toggle:hover,
.nav-subgroup.contains-active .nav-subgroup-toggle {
  color: #176d70;
  background: #eef9f7;
}

.nav-subgroup-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #6f94a5;
  font-size: 10px;
  font-weight: 800;
}

.nav-subgroup.contains-active .nav-subgroup-icon { background: var(--teal); }
.nav-subgroup-title { min-width: 0; font-size: 12px; font-weight: 800; }
.nav-subgroup-toggle small { color: var(--muted); font-size: 11px; }
.nav-subgroup-arrow { color: #78909c; font-size: 19px; line-height: 1; transition: transform .18s ease; }
.nav-subgroup.expanded .nav-subgroup-arrow { transform: rotate(90deg); }

.nav-subgroup-items {
  display: none;
  gap: 3px;
  padding: 0 5px 5px;
}

.nav-subgroup.expanded .nav-subgroup-items { display: grid; }

.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  text-align: left;
  color: var(--sidebar-text);
  background: transparent;
  font-size: 12px;
}

.nav-btn:hover {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--sidebar-line));
  background: var(--accent-faint);
}

.nav-btn.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--sidebar-line));
  font-weight: 700;
}
.nav-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .45;
}
.nav-btn.active .nav-dot { opacity: 1; }
.nav-btn-level-3 {
  min-height: 29px;
  padding: 4px 7px 4px 17px;
  background: transparent;
  font-size: 11px;
}
.nav-btn-level-3 .nav-dot { width: 6px; height: 6px; }
.nav-label {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.25;
  display: block;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  color: #596a78;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  word-break: break-all;
}

.theme-switcher {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 84%, var(--accent-faint));
  text-align: left;
}

.theme-switcher > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.theme-options button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 3px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.theme-options button:hover,
.theme-options button.active {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--sidebar-line));
  background: var(--accent-soft);
}

.theme-options i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f8b8d;
}

.theme-options [data-school-theme="ocean"] i { background: #2f6fda; }
.theme-options [data-school-theme="sunset"] i { background: #d06f32; }
.theme-options [data-school-theme="cyber"] i {
  background: linear-gradient(135deg, #20e7ff, #246dff);
  box-shadow: 0 0 7px rgba(32, 215, 255, .8);
}
.theme-options [data-school-theme="candy"] i {
  background: linear-gradient(135deg, #ff91b5, #ffc278);
  box-shadow: 0 0 0 2px rgba(255, 145, 181, .14);
}

.main {
  min-width: 0;
  height: 100vh;
  padding: 22px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-theme-switcher {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 4px 6px 4px 9px;
  border-color: var(--line);
  background: var(--panel);
}

.top-theme-switcher > span { white-space: nowrap; }
.top-theme-switcher .theme-options { display: flex; }
.top-theme-switcher .theme-options button { min-width: 48px; }

.user-profile-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-color: #cfe0e7;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.user-profile-trigger:hover {
  border-color: #83c9c4;
  background: #f1fbf9;
}

.user-profile-avatar,
.user-profile-card-avatar {
  display: block;
  border-radius: 50%;
  background: #eaf5ff;
  object-fit: cover;
  user-select: none;
}

.user-profile-avatar {
  width: 27px;
  height: 27px;
}

.user-profile-trigger-copy {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.user-profile-trigger-copy strong {
  max-width: 92px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-trigger-copy small {
  color: var(--muted);
  font-size: 10px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 3px 12px rgba(25, 45, 65, .04);
}

.query-filters {
  min-width: 0;
  flex: 1 1 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.query-filters input,
.query-filters select { min-width: 132px; }
.query-filters #studentNameInput { width: 132px; }
.query-filters #classFilterInput { width: 160px; }
.query-filters input[type="date"] { width: 150px; }

.primary-query-action {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 700;
}

.primary-query-action:hover {
  color: #fff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.toolbar-divider {
  width: 1px;
  height: 30px;
  flex: 0 0 auto;
  background: var(--line);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
}
.simulation-action { border-color: #0f8b8d; color: #fff; background: #0f8b8d; font-weight: 700; }
.simulation-action:hover { background: #0b7779; }

.device-type-slices {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.device-type-slice-heading {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

.device-type-slice-heading strong { color: #173e4c; font-size: 14px; }
.device-type-slice-heading span { color: var(--muted); font-size: 12px; }

.device-type-slice-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: thin;
}

.device-type-slice {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #dce8ec;
  border-radius: 999px;
  color: #49636d;
  background: #f8fbfc;
  font-weight: 700;
  white-space: nowrap;
}

.device-type-slice em {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #58717b;
  background: #e9f1f4;
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.device-type-slice:hover {
  border-color: #9dd6d2;
  color: var(--teal);
  background: #f0fbfa;
}

.device-type-slice.active {
  border-color: #138d87;
  color: #fff;
  background: linear-gradient(135deg, #18a59d, #117d86);
  box-shadow: 0 5px 14px rgba(17, 125, 134, .18);
}

.device-type-slice.active em {
  color: #0d696c;
  background: rgba(255, 255, 255, .88);
}

@media (max-width: 900px) {
  .device-type-slices { grid-template-columns: 1fr; gap: 10px; }
  .device-type-slice-heading { min-width: 0; }
}

.dashboard { display: grid; gap: 16px; }

/* 园所中控数据大屏 */
.data-screen-view { min-width: 0; }
.dashboard-cockpit {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(42, 184, 255, .24);
  border-radius: 20px;
  color: #e9f7ff;
  background:
    radial-gradient(circle at 14% 0%, rgba(0, 207, 255, .17), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(126, 87, 255, .19), transparent 30%),
    linear-gradient(145deg, #07172d 0%, #081d37 48%, #07152a 100%);
  box-shadow: 0 24px 70px rgba(2, 16, 36, .25), inset 0 0 80px rgba(0, 151, 255, .04);
}
.dashboard-cockpit::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .16;
  background-image:
    linear-gradient(rgba(68, 181, 255, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 181, 255, .18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.cockpit-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 17px 22px;
  border: 1px solid rgba(83, 199, 255, .24);
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(9, 47, 84, .82), rgba(17, 35, 76, .58));
  box-shadow: inset 4px 0 #16d9ff, inset -1px 0 rgba(122, 101, 255, .5), 0 14px 36px rgba(0, 0, 0, .16);
}
.cockpit-hero-copy > span { color: #55dfff; font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.cockpit-hero-copy h2 { margin: 5px 0 4px; color: #fff; font-size: clamp(23px, 2vw, 32px); letter-spacing: .04em; text-shadow: 0 0 20px rgba(31, 205, 255, .25); }
.cockpit-hero-copy p { margin: 0; color: #88aac3; font-size: 12px; }
.cockpit-hero-actions { display: flex; align-items: center; gap: 14px; }
.cockpit-hero-actions button {
  border-color: rgba(22, 217, 255, .55);
  color: #c9f7ff;
  background: rgba(8, 70, 109, .55);
  box-shadow: inset 0 0 16px rgba(22, 217, 255, .08);
}
.cockpit-hero-actions button:hover { color: #fff; background: rgba(12, 104, 149, .65); box-shadow: 0 0 22px rgba(22, 217, 255, .18); }
.cockpit-live { display: flex; align-items: center; gap: 8px; color: #73f5c0; font-size: 12px; white-space: nowrap; }
.cockpit-live i { width: 9px; height: 9px; border-radius: 50%; background: #3ee6a1; box-shadow: 0 0 0 5px rgba(62, 230, 161, .1), 0 0 15px #3ee6a1; animation: cockpitPulse 1.8s ease-in-out infinite; }

.cockpit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.cockpit-kpi {
  --tone: #16d9ff;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tone) 36%, transparent);
  border-radius: 13px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 11%, rgba(8, 28, 55, .88)), rgba(8, 27, 52, .72));
  box-shadow: inset 0 1px rgba(255,255,255,.03), 0 10px 24px rgba(0,0,0,.13);
}
.cockpit-kpi::after { content: ''; position: absolute; right: -28px; bottom: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--tone); opacity: .07; filter: blur(4px); }
.cockpit-kpi.blue { --tone: #4f8cff; }
.cockpit-kpi.green { --tone: #39e39f; }
.cockpit-kpi.purple { --tone: #9f7cff; }
.cockpit-kpi.amber { --tone: #ffc45c; }
.cockpit-kpi.red { --tone: #ff6577; }
.cockpit-kpi-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--tone) 56%, transparent); border-radius: 12px; color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, transparent); font-size: 17px; font-weight: 900; box-shadow: inset 0 0 18px color-mix(in srgb, var(--tone) 12%, transparent), 0 0 18px color-mix(in srgb, var(--tone) 10%, transparent); }
.cockpit-kpi > div { min-width: 0; display: grid; }
.cockpit-kpi small { color: #89a9c0; font-size: 11px; }
.cockpit-kpi strong { margin-top: 3px; color: #fff; font-size: 27px; line-height: 1; }
.cockpit-kpi strong b { margin-left: 2px; color: var(--tone); font-size: 13px; }
.cockpit-kpi em { margin-top: 5px; overflow: hidden; color: #6f92ac; font-size: 10px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }

.cockpit-care-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.cockpit-care-kpi {
  --tone: #16d9ff;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 9%, rgba(8, 28, 55, .84)), rgba(7, 25, 49, .76));
}
.cockpit-care-kpi.blue { --tone: #4f8cff; }
.cockpit-care-kpi.purple { --tone: #9f7cff; }
.cockpit-care-kpi.amber { --tone: #ffc45c; }
.cockpit-care-kpi > span { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); box-shadow: inset 0 0 15px color-mix(in srgb, var(--tone) 10%, transparent); font-size: 13px; font-weight: 900; }
.cockpit-care-kpi > div { min-width: 0; display: grid; }
.cockpit-care-kpi small { color: #7f9fb6; font-size: 10px; }
.cockpit-care-kpi strong { margin-top: 2px; color: #fff; font-size: 23px; line-height: 1.1; }
.cockpit-care-kpi strong b { margin-left: 3px; color: var(--tone); font-size: 10px; }
.cockpit-care-kpi em { margin-top: 4px; overflow: hidden; color: #688ba5; font-size: 9px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }

.cockpit-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.cockpit-layout .span-8 { grid-column: span 8; }
.cockpit-layout .span-6 { grid-column: span 6; }
.cockpit-layout .span-4 { grid-column: span 4; }
.cockpit-layout .span-12 { grid-column: span 12; }
.cockpit-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(69, 166, 225, .2);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(10, 36, 67, .88), rgba(7, 27, 52, .82));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 12px 30px rgba(0,0,0,.14);
}
.cockpit-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 11px 15px; border-bottom: 1px solid rgba(77, 163, 220, .15); background: linear-gradient(90deg, rgba(16, 67, 107, .32), transparent); }
.cockpit-panel > header > div { display: flex; align-items: center; min-width: 0; gap: 9px; }
.cockpit-panel > header div > span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(22, 217, 255, .38); border-radius: 6px; color: #4fdcff; background: rgba(22, 217, 255, .07); font-size: 9px; font-weight: 900; }
.cockpit-panel h3 { margin: 0; overflow: hidden; color: #e7f8ff; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.cockpit-panel header small { color: #638aa7; font-size: 10px; white-space: nowrap; }
.cockpit-panel-body { min-height: 220px; padding: 13px 15px; }
.cockpit-empty { min-height: 150px; display: grid; place-items: center; color: #597e99; font-size: 12px; text-align: center; }

.cockpit-trend-chart { height: 100%; }
.cockpit-trend-chart svg { width: 100%; min-height: 190px; display: block; overflow: visible; }
.cockpit-chart-grid { stroke: rgba(103, 167, 209, .13); stroke-width: 1; }
.cockpit-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; filter: drop-shadow(0 0 5px currentColor); }
.cockpit-line.checked { color: #16d9ff; stroke: #16d9ff; }
.cockpit-line.normal { color: #3ee6a1; stroke: #3ee6a1; stroke-width: 2; }
.cockpit-dot { stroke-width: 2; }
.cockpit-dot.checked { fill: #102e4b; stroke: #16d9ff; }
.cockpit-dot.normal { fill: #102e4b; stroke: #3ee6a1; }
.cockpit-axis-label { fill: #678aa5; font-size: 10px; text-anchor: middle; }
.cockpit-chart-legend { display: flex; justify-content: center; gap: 20px; margin-top: -4px; color: #7b9ab1; font-size: 10px; }
.cockpit-chart-legend span::before, .cockpit-care-legend span::before { content: ''; width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.cockpit-chart-legend .cyan, .cockpit-care-legend .cyan { color: #16d9ff; }
.cockpit-chart-legend .green { color: #3ee6a1; }

.cockpit-device-overview { min-height: 246px; display: grid; grid-template-columns: minmax(120px, .9fr) minmax(130px, 1.1fr); align-items: center; gap: 16px; padding: 18px; }
.cockpit-ring { --percent: 0; position: relative; width: min(150px, 100%); aspect-ratio: 1; display: grid; place-items: center; margin: auto; border-radius: 50%; background: conic-gradient(#16d9ff calc(var(--percent) * 1%), rgba(61, 111, 150, .19) 0); filter: drop-shadow(0 0 12px rgba(22,217,255,.18)); }
.cockpit-ring::before { content: ''; position: absolute; inset: 13px; border-radius: 50%; background: radial-gradient(circle at 50% 34%, #123a5b, #071b35 72%); box-shadow: inset 0 0 20px rgba(22,217,255,.08); }
.cockpit-ring > div { position: relative; display: grid; text-align: center; }
.cockpit-ring strong { color: #fff; font-size: 28px; }
.cockpit-ring span { color: #6f9ab7; font-size: 10px; }
.cockpit-device-overview dl { display: grid; gap: 8px; margin: 0; }
.cockpit-device-overview dl > div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px dashed rgba(87, 152, 194, .18); }
.cockpit-device-overview dt { color: #7495ad; font-size: 11px; }
.cockpit-device-overview dd { margin: 0; color: #dcefff; font-size: 13px; font-weight: 800; }
.cockpit-device-overview dd.ok { color: #3ee6a1; }
.cockpit-device-overview dd.bad { color: #ff6577; }

.cockpit-bar-list { display: grid; gap: 14px; }
.cockpit-bar-row { display: grid; gap: 6px; }
.cockpit-bar-meta { display: flex; justify-content: space-between; gap: 12px; }
.cockpit-bar-meta strong { color: #dcefff; font-size: 11px; }
.cockpit-bar-meta span { color: #688ca6; font-size: 10px; }
.cockpit-bar-meta em { color: #ff7f8e; font-style: normal; }
.cockpit-progress { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(55, 104, 139, .2); box-shadow: inset 0 1px 2px rgba(0,0,0,.28); }
.cockpit-progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #1476ff, #16d9ff); box-shadow: 0 0 12px rgba(22,217,255,.45); transition: width .5s ease; }

.cockpit-care-chart { display: grid; gap: 10px; }
.cockpit-care-legend { display: flex; justify-content: flex-end; gap: 12px; color: #789ab2; font-size: 9px; }
.cockpit-care-legend .blue { color: #4f8cff; }
.cockpit-care-legend .purple { color: #9f7cff; }
.cockpit-care-legend .amber { color: #ffc45c; }
.cockpit-care-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 54px; align-items: center; gap: 9px; }
.cockpit-care-row > strong { overflow: hidden; color: #d9edfa; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.cockpit-care-row > small { color: #668aa4; font-size: 9px; text-align: right; }
.cockpit-care-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.cockpit-care-bars span { height: 10px; overflow: hidden; border-radius: 2px; background: rgba(62, 109, 143, .18); }
.cockpit-care-bars i { height: 100%; display: block; border-radius: inherit; }
.cockpit-care-bars i.cyan { background: #16d9ff; box-shadow: 0 0 8px rgba(22,217,255,.35); }
.cockpit-care-bars i.blue { background: #4f8cff; }
.cockpit-care-bars i.purple { background: #9f7cff; }
.cockpit-care-bars i.amber { background: #ffc45c; }

.cockpit-care-rings { min-height: 220px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 17px 12px; }
.cockpit-mini-ring-card { --tone: #16d9ff; min-width: 0; display: grid; justify-items: center; gap: 4px; color: #dcefff; text-align: center; }
.cockpit-mini-ring-card.blue { --tone: #4f8cff; }
.cockpit-mini-ring-card.purple { --tone: #9f7cff; }
.cockpit-mini-ring-card.amber { --tone: #ffc45c; }
.cockpit-mini-ring { --percent: 0; position: relative; width: 72px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--percent) * 1%), rgba(61, 111, 150, .19) 0); filter: drop-shadow(0 0 9px color-mix(in srgb, var(--tone) 22%, transparent)); }
.cockpit-mini-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #0a213d; }
.cockpit-mini-ring strong { position: relative; color: #fff; font-size: 14px; }
.cockpit-mini-ring-card > span { font-size: 10px; font-weight: 800; }
.cockpit-mini-ring-card > small { color: #678ca6; font-size: 8px; }

@keyframes cockpitPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .62; transform: scale(.8); } }

.class-overview-view { min-width: 0; }
.class-overview-shell { display: grid; gap: 16px; }
.class-overview-loading,
.class-overview-empty {
  padding: 42px 24px;
  border: 1px dashed #cddbe5;
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}
.class-overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid #bde8df;
  border-radius: 13px;
  background: linear-gradient(135deg, #eafaf7 0%, #f3f8ff 62%, #fff 100%);
  box-shadow: 0 10px 30px rgba(31, 50, 73, .05);
}
.class-overview-hero > div:first-child > span { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.class-overview-hero h2 { margin: 5px 0 6px; font-size: 24px; }
.class-overview-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.class-overview-refresh { display: grid; grid-template-columns: 10px auto; gap: 4px 8px; align-items: center; min-width: 190px; }
.class-overview-refresh i { width: 9px; height: 9px; border-radius: 50%; background: #26a269; box-shadow: 0 0 0 5px rgba(38, 162, 105, .12); }
.class-overview-refresh strong { color: #185f4b; font-size: 13px; }
.class-overview-refresh span { grid-column: 2; color: var(--muted); font-size: 11px; }
.class-overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.class-overview-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.class-overview-summary span { color: var(--muted); font-size: 12px; }
.class-overview-summary strong { font-size: 24px; }
.class-overview-summary .attention { border-color: #f1c4bd; background: #fff7f5; }
.class-overview-summary .attention strong { color: var(--red); }
.class-overview-classes { display: grid; gap: 16px; }
.class-overview-class {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 50, 73, .05);
}
.class-overview-class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 20px;
  border-bottom: 1px solid #e7edf2;
  background: #f8fbfc;
}
.class-overview-class-head > div:first-child > span { color: var(--teal); font-size: 11px; font-weight: 800; }
.class-overview-class-head h3 { margin: 3px 0 4px; font-size: 20px; }
.class-overview-class-head p { margin: 0; color: var(--muted); font-size: 12px; }
.class-overview-class-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.class-overview-class-summary span { padding: 6px 9px; border-radius: 999px; color: #526171; background: #edf3f6; font-size: 11px; }
.class-overview-class-summary b { color: var(--text); font-size: 13px; }
.class-overview-class-summary .attention { color: #9d382e; background: #fbe8e5; }
.class-overview-class-summary .attention b { color: var(--red); }
.class-overview-students { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; padding: 14px; }
.class-overview-student { min-width: 0; padding: 13px; border: 1px solid #e3eaf0; border-radius: 11px; background: #fff; }
.class-overview-student.attention { border-color: #efc6bf; box-shadow: inset 3px 0 #d65e51; }
.class-overview-student.away { opacity: .68; background: #f8f9fa; }
.class-overview-student > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.class-overview-student > header > div { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.class-overview-student > header strong { overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.class-overview-student > header small { color: var(--muted); }
.class-overview-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 0 9px; }
.class-overview-tags span { padding: 3px 6px; border-radius: 5px; color: #9d382e; background: #fff0ed; font-size: 10px; }
.class-overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.class-overview-metric { min-width: 0; padding: 8px; border-radius: 8px; background: #f5f8fa; }
.class-overview-metric span,
.class-overview-metric strong,
.class-overview-metric small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.class-overview-metric span { color: var(--muted); font-size: 10px; }
.class-overview-metric strong { margin-top: 3px; font-size: 12px; }
.class-overview-metric small { margin-top: 2px; color: #6b7f8e; font-size: 10px; }

/* 园所中控 - 当日照护总览 */
.care-overview-view,
.care-overview-shell { min-width: 0; }
.care-overview-shell { display: grid; gap: 14px; }
.care-overview-loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #cddbe5;
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
}
.care-overview-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 50, 73, .04);
}
.care-overview-tabs button {
  min-width: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-color: transparent;
  color: #607180;
  background: transparent;
  box-shadow: none;
}
.care-overview-tabs button i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #248c84;
  background: #e9f7f4;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.care-overview-tabs button.active {
  border-color: #9ddbd4;
  color: #147a73;
  background: #edf9f7;
}
.care-overview-tabs button.active i { color: #fff; background: #18978f; }
.care-overview-summary { display: grid; gap: 14px; }
.care-overview-intro {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid #bde8df;
  border-radius: 14px;
  background:
    radial-gradient(circle at 88% 0%, rgba(70, 166, 255, .13), transparent 30%),
    linear-gradient(135deg, #eafaf7, #f5f9ff 65%, #fff);
}
.care-overview-intro span { color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.care-overview-intro h2 { margin: 5px 0; font-size: 23px; }
.care-overview-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.care-overview-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}
.care-overview-card {
  --care-tone: #1b9c94;
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--care-tone) 24%, #dfe8ed);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 24px rgba(31, 50, 73, .045);
}
.care-overview-card.water { --care-tone: #3087dc; }
.care-overview-card.sleep { --care-tone: #7668d9; }
.care-overview-card.toilet { --care-tone: #d78932; }
.care-overview-card.milk { --care-tone: #b8793c; }
.care-overview-card.sport { --care-tone: #2e9c61; }
.care-overview-card:hover { transform: translateY(-2px); border-color: var(--care-tone); box-shadow: 0 12px 28px color-mix(in srgb, var(--care-tone) 12%, transparent); }
.care-overview-card header { display: flex; align-items: center; gap: 10px; }
.care-overview-card header > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--care-tone);
  background: color-mix(in srgb, var(--care-tone) 11%, white);
  font-size: 12px;
  font-weight: 900;
}
.care-overview-card header div { min-width: 0; display: grid; }
.care-overview-card header strong { font-size: 15px; }
.care-overview-card header small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.care-overview-card-main { display: flex; align-items: baseline; gap: 5px; }
.care-overview-card-main strong { color: var(--care-tone); font-size: 30px; line-height: 1; }
.care-overview-card-main span { color: var(--muted); font-size: 11px; }
.care-overview-card footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.care-overview-card footer span { min-width: 0; padding: 8px; border-radius: 8px; color: var(--muted); background: #f5f8fa; font-size: 9px; }
.care-overview-card footer b { display: block; overflow: hidden; margin-bottom: 2px; color: var(--text); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.care-overview-card footer .attention { color: #a4463c; background: #fff1ef; }
.care-overview-card footer .attention b { color: #c44f43; }
.care-overview-class-panel,
.care-overview-detail {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 50, 73, .04);
}
.care-overview-class-panel > header,
.care-overview-detail-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfc;
}
.care-overview-class-panel > header > div,
.care-overview-detail-head > div:first-child { display: grid; gap: 3px; }
.care-overview-class-panel header strong,
.care-overview-detail-head strong { font-size: 15px; }
.care-overview-class-panel header span,
.care-overview-detail-head span { color: var(--muted); font-size: 11px; }
.care-overview-table-scroll { min-width: 0; overflow: auto; }
.care-overview-table-scroll table { width: 100%; min-width: 720px; border-collapse: collapse; }
.care-overview-table-scroll th {
  padding: 10px 12px;
  color: #687887;
  background: #fbfcfd;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.care-overview-table-scroll td {
  padding: 10px 12px;
  border-top: 1px solid #edf1f4;
  color: #40505e;
  font-size: 12px;
  white-space: nowrap;
}
.care-overview-table-scroll tbody tr:hover { background: #f8fbfc; }
.care-overview-no-data { padding: 36px; color: var(--muted); text-align: center; }
.care-overview-empty-value { color: #a6b0b8; }
.care-overview-detail-search { display: flex; align-items: center; gap: 7px; }
.care-overview-detail-search input { min-width: 190px; }
.care-overview-thumb { width: 54px; height: 38px; display: block; border-radius: 6px; object-fit: cover; }
.care-overview-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.care-overview-pagination div { display: flex; gap: 7px; }

@media (max-width: 1100px) {
  .care-overview-card-grid { grid-template-columns: repeat(2, minmax(210px, 1fr)); }
  .care-overview-tabs { grid-template-columns: repeat(7, minmax(82px, 1fr)); }
}
@media (max-width: 720px) {
  .care-overview-card-grid { grid-template-columns: 1fr; }
  .care-overview-intro,
  .care-overview-detail-head { align-items: flex-start; flex-direction: column; }
  .care-overview-detail-search { width: 100%; flex-wrap: wrap; }
  .care-overview-detail-search input { min-width: 0; flex: 1 1 180px; }
}

.summary-band {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid #bde8df;
  border-radius: 8px;
  background: #effbf8;
}
.summary-band h2 { margin: 0; font-size: 20px; }
.summary-band p { margin: 6px 0 0; color: var(--muted); }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.kpi, .panel, .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.kpi { padding: 14px; }
.kpi-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi-value { margin-top: 8px; font-size: 28px; font-weight: 800; }
.kpi-note { margin-top: 5px; color: var(--muted); font-size: 12px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-title h2 { margin: 0; font-size: 17px; }
.panel-title span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.panel-body { padding: 14px; }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-wrap table {
  min-width: 980px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

th { background: #f8fafc; color: #475467; font-weight: 600; }
td.actions-cell { width: 190px; white-space: normal; }
td.actions-cell button { margin: 2px; padding: 5px 8px; font-size: 12px; }

.teacher-name-link {
  border: 0;
  padding: 0;
  color: #176d70;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.teacher-name-link:hover { color: var(--teal); text-decoration: underline; }

.teacher-class-list-button {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.teacher-class-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #b8e2df;
  border-radius: 999px;
  color: #176d70;
  background: #effaf8;
  font-size: 12px;
  white-space: nowrap;
}

.teacher-class-list-button:hover .teacher-class-chip {
  border-color: var(--teal);
  background: #e2f6f3;
}

.teacher-class-empty {
  color: #98a2b3;
  font-size: 12px;
}

.teacher-class-list-button.is-empty:hover .teacher-class-empty {
  color: var(--teal);
  text-decoration: underline;
}

.student-face-upload-dialog {
  width: min(680px, calc(100vw - 32px));
}

.student-face-upload-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px;
}

.student-face-preview {
  display: grid;
  place-items: center;
  width: 220px;
  height: 260px;
  overflow: hidden;
  border: 1px dashed #b8c6d1;
  border-radius: 14px;
  color: #98a2b3;
  background: #f8fafc;
}

.student-face-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-face-file-picker {
  display: flex;
  flex-direction: column;
  align-self: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid #dce7e5;
  border-radius: 12px;
  background: #f5fbfa;
}

.student-face-file-picker strong { color: #176d70; }
.student-face-file-picker span { color: #667085; font-size: 12px; }
.student-face-file-picker input { margin-top: 8px; }

.student-face-upload-body > p {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.student-face-upload-body code {
  color: #176d70;
  background: #eaf7f5;
  padding: 2px 5px;
  border-radius: 4px;
}

.student-face-import-result-dialog {
  width: min(900px, calc(100vw - 32px));
}

.student-face-import-body {
  padding: 20px 24px;
}

.student-face-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.student-face-import-summary > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #f8fafc;
}

.student-face-import-summary b { font-size: 22px; color: #344054; }
.student-face-import-summary small { color: #667085; }
.student-face-import-summary .ok { background: #effaf6; }
.student-face-import-summary .warning { background: #fffaeb; }
.student-face-import-summary .bad { background: #fff1f0; }

.student-face-import-results {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
}

.student-face-import-results article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr);
  gap: 16px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid #eef1f4;
}

.student-face-import-results article:last-child { border-bottom: 0; }
.student-face-import-results article > div { display: flex; flex-direction: column; gap: 4px; }
.student-face-import-results article > div:last-child { align-items: flex-end; }
.student-face-import-results article span,
.student-face-import-results article small { color: #667085; font-size: 12px; }
.student-face-import-results article .status { color: inherit; }

@media (max-width: 720px) {
  .student-face-upload-body { grid-template-columns: 1fr; }
  .student-face-preview { width: 100%; height: 260px; }
  .student-face-upload-body > p { grid-column: auto; }
  .student-face-import-summary { grid-template-columns: repeat(2, 1fr); }
  .student-face-import-results article { grid-template-columns: 1fr; }
  .student-face-import-results article > div:last-child { align-items: flex-start; }
}

.table-wrap {
  overflow: auto;
}

td.data-cell {
  cursor: pointer;
}

td.data-cell:hover {
  background: #f8fbff;
}

.cell-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.table-image-link {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.table-thumb {
  width: 104px;
  height: 68px;
  display: block;
  object-fit: cover;
  transition: transform .18s ease;
}

.table-image-link:hover .table-thumb {
  transform: scale(1.04);
}

.image-empty {
  color: var(--muted);
  font-size: 12px;
}

.image-data-cell .cell-text {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

td.cell-expanded .cell-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  color: #475467;
  background: #eef2f6;
}
.status.ok { color: #047857; background: #e9f8ef; }
.status.warn { color: #a16207; background: #fff7df; }
.status.bad { color: #b42318; background: #fff1f0; }
.status.info { color: #1d4ed8; background: #eff6ff; }

.cards-list { display: grid; gap: 10px; }
.record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.record h3 { margin: 0; font-size: 14px; }
.record p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(780px, calc(100vw - 32px));
  box-shadow: 0 24px 80px rgba(15,23,42,.25);
}
dialog::backdrop { background: rgba(15,23,42,.42); }

.dialog header,
.dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}
.icon-btn { border: 0; padding: 0 8px; font-size: 22px; line-height: 1; }

.account-dialog {
  width: min(520px, calc(100vw - 32px));
}

.account-hint {
  margin: 0;
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.account-options {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.account-option {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  justify-items: start;
  text-align: left;
  border-color: #d7e3ec;
}

.account-option strong {
  color: var(--text);
  font-size: 15px;
}

.account-option span {
  color: #2b5e78;
  font-size: 13px;
}

.account-option small {
  color: var(--muted);
  font-size: 12px;
}

.account-option.active {
  border-color: var(--teal);
  background: #eefbf8;
}

.user-profile-dialog {
  width: min(760px, calc(100vw - 32px));
}

.user-profile-dialog .dialog > header h2 {
  margin: 0;
  font-size: 19px;
}

.user-profile-dialog .dialog > header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.user-profile-body {
  display: grid;
  gap: 14px;
  max-height: min(720px, calc(100vh - 120px));
  padding: 16px;
  overflow-y: auto;
  background: #f7fafc;
}

.user-profile-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cce4e3;
  border-radius: 10px;
  background: linear-gradient(135deg, #effbf8 0%, #f3f8ff 100%);
}

.user-profile-card-avatar {
  width: 52px;
  height: 52px;
}

.user-profile-card strong,
.user-profile-card span {
  display: block;
}

.user-profile-card strong {
  color: var(--text);
  font-size: 18px;
}

.user-profile-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-profile-card em {
  padding: 5px 10px;
  border-radius: 999px;
  color: #176d70;
  background: #dff5f1;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.user-profile-section {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.user-profile-section.password-section {
  border-color: #d8e1f1;
}

.user-profile-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.user-profile-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.user-profile-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.user-profile-section-head > span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #375f9e;
  background: #edf3fd;
  font-size: 11px;
}

.user-profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-profile-form-grid label {
  display: grid;
  gap: 6px;
  color: #516473;
  font-size: 13px;
}

.user-profile-form-grid label.full {
  grid-column: 1 / -1;
}

.user-profile-form-grid input:disabled {
  color: #657783;
  background: #f1f5f7;
}

.user-profile-section-actions {
  display: flex;
  justify-content: flex-end;
}

.user-profile-section-actions button {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
  font-weight: 700;
}

.user-profile-section-actions button:hover {
  background: #0b7779;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.form-grid label.full { grid-column: 1 / -1; }

.leave-request-dialog {
  width: min(940px, calc(100vw - 32px));
}

.leave-request-dialog .dialog > header h2 {
  margin: 0;
  font-size: 20px;
}

.leave-request-dialog .form-grid {
  max-height: min(690px, calc(100vh - 150px));
  overflow: auto;
}

.leave-student-picker {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.leave-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 9%, var(--panel)), var(--panel));
}

.leave-picker-heading > div:first-child {
  display: grid;
  grid-template-columns: 30px auto;
  align-items: center;
  column-gap: 10px;
}

.leave-picker-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.leave-picker-heading small {
  grid-column: 2;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.leave-picker-step {
  display: grid;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.leave-picker-selected {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 8px;
  min-width: 210px;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}

.leave-picker-selected > span {
  grid-row: 1 / span 2;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg);
  font-size: 11px;
}

.leave-picker-selected strong,
.leave-picker-selected small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-picker-selected strong {
  font-size: 13px;
}

.leave-picker-selected small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.leave-picker-selected.ready {
  border-style: solid;
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
}

.leave-picker-selected.ready > span {
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, var(--panel));
}

.leave-picker-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 292px;
}

.leave-class-panel {
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 62%, var(--panel));
}

.leave-class-panel h3,
.leave-student-toolbar h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.leave-class-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 245px;
  overflow: auto;
}

.leave-class-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border-color: transparent;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.leave-class-list button:hover {
  border-color: var(--line);
  background: var(--panel);
}

.leave-class-list button.active {
  border-color: color-mix(in srgb, var(--teal) 34%, var(--line));
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 11%, var(--panel));
  font-weight: 800;
}

.leave-class-list button i {
  font-size: 18px;
  font-style: normal;
}

.leave-student-panel {
  min-width: 0;
  padding: 14px;
}

.leave-student-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.leave-student-toolbar > div {
  display: grid;
  gap: 3px;
}

.leave-student-toolbar small {
  color: var(--muted);
  font-size: 11px;
}

.leave-student-search {
  display: flex !important;
  grid-column: auto !important;
  flex-direction: row;
  align-items: center;
  gap: 6px !important;
  width: min(230px, 45%);
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.leave-student-search span {
  color: var(--muted);
  font-size: 18px;
}

.leave-student-search input {
  min-width: 0;
  width: 100%;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.leave-student-bulk-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px 0 10px;
}

.leave-student-bulk-actions button {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 25%, var(--line));
  background: color-mix(in srgb, var(--teal) 7%, var(--panel));
  font-size: 11px;
}

.leave-student-bulk-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.leave-student-bulk-actions span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.leave-student-bulk-actions b {
  color: var(--teal);
  font-size: 14px;
}

.leave-student-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 203px;
  overflow: auto;
}

.leave-student-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 9px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}

.leave-student-card:hover {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  transform: translateY(-1px);
}

.leave-student-card.active {
  border-color: var(--teal);
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, var(--panel));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 12%, transparent);
}

.leave-student-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 13%, var(--panel));
  font-size: 11px;
  font-weight: 800;
}

.leave-student-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-student-card i {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-style: normal;
}

.leave-picker-empty {
  padding: 15px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.leave-picker-empty.large {
  grid-column: 1 / -1;
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 55%, var(--panel));
}

@media (max-width: 760px) {
  .leave-picker-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .leave-picker-selected {
    min-width: 0;
  }

  .leave-picker-layout {
    grid-template-columns: 1fr;
  }

  .leave-class-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .leave-class-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .leave-class-list button {
    flex: 0 0 auto;
    width: auto;
  }

  .leave-student-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.camera-simulation-dialog > header h2 { margin: 0; font-size: 19px; }
.camera-simulation-dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.camera-simulation-body { display: grid; gap: 14px; padding: 16px; }
.camera-simulation-body label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.camera-simulation-body small { color: #6b7f8d; line-height: 1.5; }
.camera-simulation-body textarea { resize: vertical; }
.camera-simulation-steps { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.camera-simulation-steps i { height: 2px; background: #dbe6ec; }
.camera-simulation-steps span { display: flex; align-items: center; gap: 7px; color: #7b8e9b; font-size: 13px; font-weight: 700; }
.camera-simulation-steps span b { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #607785; background: #e7eef2; }
.camera-simulation-steps span.active { color: #176d70; }
.camera-simulation-steps span.active b { color: #fff; background: var(--teal); }
.camera-simulation-step { display: grid; gap: 14px; }
.camera-selected-device { padding: 12px 14px; border: 1px solid #bfe3df; border-radius: 8px; color: #176d70; background: #effbf8; font-weight: 700; }
.camera-simulation-preview { display: grid; min-height: 180px; place-items: center; overflow: hidden; border: 1px dashed #afc4d0; border-radius: 8px; color: var(--muted); background: #f8fbfd; }
.camera-simulation-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.camera-ai-hint { margin: 0; padding: 10px 12px; border-radius: 7px; color: #73510d; background: #fff8df; font-size: 13px; line-height: 1.55; }

.sleep-binding-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
}
.sleep-binding-dialog .dialog > header h2 { margin: 0; font-size: 20px; }
.sleep-binding-dialog .dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.sleep-binding-body { width: 100%; min-width: 0; display: grid; gap: 15px; max-height: calc(100vh - 170px); padding: 16px; overflow: auto; overflow-x: hidden; background: #f8fafc; }
.sleep-binding-body > * { min-width: 0; }
.sleep-binding-steps { display: grid; grid-template-columns: auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto; align-items: center; gap: 10px; padding: 2px 4px 4px; }
.sleep-binding-steps i { height: 2px; background: #dbe6ec; }
.sleep-binding-steps span { display: flex; align-items: center; gap: 7px; color: #7b8e9b; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sleep-binding-steps span b { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #607785; background: #e7eef2; }
.sleep-binding-steps span.active { color: #176d70; }
.sleep-binding-steps span.active b { color: #fff; background: var(--teal); }
.sleep-binding-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.sleep-binding-section-head > div strong { display: block; font-size: 14px; }
.sleep-binding-section-head > div span,
.sleep-binding-section-head > span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.sleep-binding-section-head input { width: 190px; padding: 7px 9px; background: #fff; }
.sleep-binding-classes { width: 100%; max-width: 100%; display: flex; gap: 8px; padding-bottom: 3px; overflow-x: auto; }
.sleep-binding-class {
  min-width: 150px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  text-align: left;
  background: #fff;
}
.sleep-binding-class strong { font-size: 13px; }
.sleep-binding-class small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.sleep-binding-class em { min-width: 28px; padding: 3px 7px; border-radius: 999px; color: #28706e; background: #e9f7f4; font-size: 11px; font-style: normal; text-align: center; }
.sleep-binding-class.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15,139,141,.1); background: #effbf8; }
.sleep-binding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sleep-binding-panel { min-width: 0; min-height: 410px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sleep-binding-panel .sleep-binding-section-head { min-height: 61px; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f5f9fc; }
.sleep-binding-options { display: grid; align-content: start; gap: 8px; max-height: 350px; padding: 10px; overflow: auto; }
.sleep-binding-option {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  text-align: left;
  background: #fff;
}
.sleep-binding-option:hover:not(:disabled) { background: #f7fcfb; }
.sleep-binding-option.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15,139,141,.1); background: #effbf8; }
.sleep-binding-option:disabled { cursor: not-allowed; opacity: .66; background: #f4f6f8; }
.sleep-binding-option__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; color: #176d70; background: #e7f6f3; font-size: 14px; font-weight: 800; }
.sleep-binding-option__icon.device { color: #385ea8; background: #eaf0fb; }
.sleep-binding-option__main { min-width: 0; }
.sleep-binding-option__main strong { display: block; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.sleep-binding-option__main small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sleep-binding-option__state { padding: 4px 7px; border-radius: 999px; color: #247462; background: #e8f7f1; font-size: 10px; white-space: nowrap; }
.sleep-binding-option__state.used { color: #8a5b16; background: #fff3d6; }
.sleep-binding-option__state.offline { color: #667085; background: #edf0f3; }
.sleep-binding-empty { display: grid; min-height: 220px; place-items: center; padding: 24px; color: var(--muted); font-size: 13px; text-align: center; }
.sleep-binding-selection {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px dashed #9dcfc9;
  border-radius: 10px;
  color: #176d70;
  background: #f1fbf9;
}
.sleep-binding-selection.empty { display: block; min-height: auto; color: var(--muted); border-color: #cad6df; background: #fff; text-align: center; }
.sleep-binding-selection > div { min-width: 0; }
.sleep-binding-selection strong,
.sleep-binding-selection span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sleep-binding-selection small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.sleep-binding-selection > b { font-size: 20px; }
.sleep-binding-dialog footer button:disabled { cursor: not-allowed; opacity: .5; }
.class-binding-edit-hint {
  padding: 9px 12px;
  border: 1px solid #f0d49a;
  border-radius: 8px;
  color: #805b16;
  background: #fff8e8;
  font-size: 12px;
  line-height: 1.5;
}
.device-class-binding-dialog .sleep-binding-class { min-width: 170px; }

.nap-arrangement-dialog {
  width: min(1040px, calc(100vw - 32px));
}
.nap-arrangement-dialog .dialog > header h2 { margin: 0; font-size: 19px; }
.nap-arrangement-dialog .dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.nap-arrangement-body { display: grid; gap: 12px; padding: 16px; }
.nap-binding-select { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.nap-arrangement-summary { min-height: 20px; color: #286174; font-size: 13px; }
.nap-arrangement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nap-student-panel { min-height: 390px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; }
.nap-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f5f9fc; }
.nap-panel-head input { width: 160px; }
.nap-panel-head span { color: var(--muted); font-size: 12px; }
.nap-student-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; padding: 12px; overflow: auto; }
.nap-student-choice { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid #dce7ef; border-radius: 7px; background: #fff; cursor: pointer; }
.nap-student-choice.selected { border-color: #68bfb4; background: #eefbf8; }
.nap-student-choice input { width: auto; }
.nap-selected-students { display: grid; align-content: start; gap: 8px; max-height: 360px; min-height: 320px; padding: 12px; overflow: auto; }
.nap-selected-students.empty { place-items: center; color: var(--muted); font-size: 13px; }
.nap-sort-card { display: grid; grid-template-columns: 28px 42px 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 8px; border: 1px solid #cddfe8; border-radius: 8px; background: #fff; cursor: grab; }
.nap-sort-card.dragging { opacity: .45; }
.nap-sort-card.drag-over { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(15,139,141,.12); }
.nap-drag-handle { color: #79909f; font-size: 18px; text-align: center; }
.nap-position-code { padding: 5px 7px; border-radius: 6px; color: #fff; background: #278b89; font-size: 12px; font-weight: 700; text-align: center; }
.nap-sort-actions { display: flex; gap: 4px; }
.nap-sort-actions button { padding: 4px 7px; font-size: 12px; }

.column-dialog {
  width: min(620px, calc(100vw - 32px));
}

.teacher-class-dialog {
  width: min(760px, calc(100vw - 32px));
}
.teacher-class-dialog .dialog > header h2 { margin: 0; font-size: 19px; }
.teacher-class-dialog .dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.teacher-class-body { display: grid; gap: 12px; padding: 16px; }
.teacher-class-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.teacher-class-toolbar > span { color: #286174; font-size: 13px; font-weight: 700; }
.teacher-class-toolbar > div { display: flex; gap: 8px; }
.teacher-class-toolbar button { padding: 6px 10px; font-size: 12px; }
.teacher-class-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
}
.teacher-class-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 9px;
  min-height: 72px;
  padding: 11px;
  border: 1px solid #dce7ef;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.teacher-class-option.selected { border-color: #68bfb4; background: #eefbf8; }
.teacher-class-option input { width: auto; margin-top: 2px; }
.teacher-class-option strong { display: block; color: var(--text); font-size: 14px; }
.teacher-class-option small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.teacher-class-options .empty { grid-column: 1 / -1; padding: 40px; color: var(--muted); text-align: center; }

.allergy-category-list { display: flex; flex-wrap: wrap; gap: 5px; }
.allergy-category-list span { padding: 3px 8px; border-radius: 999px; color: #b42318; background: #fff1f0; font-size: 12px; }
.allergy-category-list em { color: var(--muted); font-style: normal; }

.student-allergy-dialog { width: min(700px, calc(100vw - 32px)); }
.student-allergy-detail-dialog { width: min(900px, calc(100vw - 32px)); }
.student-allergy-dialog .dialog > header h2,
.student-allergy-detail-dialog .dialog > header h2 { margin: 0; font-size: 19px; }
.student-allergy-dialog .dialog > header p,
.student-allergy-detail-dialog .dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.student-allergy-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 16px; }
.student-allergy-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.student-allergy-form label.full { grid-column: 1 / -1; }
.student-allergy-form textarea { resize: vertical; }
.student-allergy-records { display: grid; gap: 11px; max-height: 570px; padding: 16px; overflow: auto; }
.student-allergy-records > .empty { padding: 52px 20px; color: var(--muted); text-align: center; }
.student-allergy-record { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.student-allergy-record.active { border-color: #f4b4ad; background: #fffafa; }
.student-allergy-record.archived { background: #f8fafc; }
.student-allergy-record-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-allergy-record-head > div { display: flex; align-items: center; gap: 9px; }
.student-allergy-record-head strong { font-size: 16px; }
.student-allergy-record-head button { color: #fff; border-color: #d92d20; background: #d92d20; }
.student-allergy-record dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.student-allergy-record dl > div { padding: 8px 10px; border-radius: 7px; background: rgba(238, 243, 247, .72); }
.student-allergy-record dt { color: var(--muted); font-size: 11px; }
.student-allergy-record dd { margin: 4px 0 0; color: var(--text); font-size: 12px; }
.student-allergy-record p { margin: 0; padding: 9px 10px; color: #526574; background: #f8fafc; font-size: 12px; line-height: 1.5; }

.column-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.column-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.column-toolbar button {
  padding: 6px 10px;
  font-size: 13px;
}

.column-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.column-grid {
  max-height: 420px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.column-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
}

.column-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.column-option span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.toast-root {
  position: fixed;
  z-index: 1000;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.dialog-toast-root {
  z-index: 10000;
  top: 24px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 40px));
}
.toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  pointer-events: auto;
}
.dialog-toast-root .toast {
  border-width: 2px;
  border-left-width: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .34);
}
.toast strong { display: block; margin-bottom: 3px; font-size: 14px; }
.toast span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; word-break: break-word; }
.toast button { border: 0; padding: 0 4px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
.toast.info { border-left-color: var(--blue); }

.school-calendar-view {
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.calendar-shell {
  max-width: 1320px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(31, 50, 73, .07);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 18px;
  background: linear-gradient(135deg, #f4fbfb 0%, #f8fbff 100%);
  border-bottom: 1px solid var(--line);
}

.calendar-eyebrow {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.calendar-header h2 { margin: 6px 0 5px; font-size: 27px; }
.calendar-header p { margin: 0; color: var(--muted); font-size: 14px; }
.calendar-month-nav { display: flex; gap: 8px; }

.calendar-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 54px;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.calendar-summary b { color: var(--text); font-size: 18px; }
.calendar-selected-count { margin-left: auto; }

.calendar-batch-panel {
  margin: 18px 20px;
  padding: 16px;
  border: 1px solid #d7e8e8;
  border-radius: 11px;
  background: #f8fcfc;
}

.calendar-time-fields {
  display: grid;
  grid-template-columns: 180px 180px minmax(240px, 1fr);
  gap: 12px;
}

.calendar-time-fields label {
  display: grid;
  gap: 6px;
  color: #526171;
  font-size: 13px;
  font-weight: 600;
}

.calendar-batch-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.calendar-batch-actions button.primary,
.calendar-batch-actions button.school-day-action {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.calendar-batch-actions button.holiday-action {
  color: #8a5a11;
  border-color: #efcf99;
  background: #fff8e8;
}

.calendar-action-divider { width: 1px; height: 28px; margin: 0 4px; background: var(--line); }
.calendar-batch-tip { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 8px;
  padding: 0 20px;
}

.calendar-weekdays { padding-top: 2px; padding-bottom: 8px; }
.calendar-weekdays span { color: var(--muted); text-align: center; font-size: 12px; font-weight: 700; }
.calendar-grid { padding-bottom: 20px; }

.calendar-day {
  position: relative;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  background: #fff;
}

.calendar-day.empty { border-color: transparent; background: transparent; }
.calendar-day.school_day { border-color: #b9ded1; background: #f2fbf7; }
.calendar-day.holiday { border-color: #ead8b6; background: #fffaf0; }
.calendar-day.unconfigured { border-style: dashed; background: #fafbfc; }
.calendar-day.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(40, 104, 199, .18); }
.calendar-day.today::after { content: "今天"; position: absolute; top: 9px; right: 9px; color: var(--blue); font-size: 11px; font-weight: 700; }
.calendar-day-number { font-size: 18px; font-weight: 800; }
.calendar-day strong { color: #344054; font-size: 13px; }
.calendar-day small { margin-top: auto; color: var(--muted); font-size: 11px; }

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: #fbfcfd;
}

.calendar-legend span { width: 9px; height: 9px; margin-left: 10px; border-radius: 50%; }
.calendar-legend .school-day-dot { margin-left: 0; background: #58aa86; }
.calendar-legend .holiday-dot { background: #d9a950; }
.calendar-legend .unconfigured-dot { border: 1px solid #98a2b3; background: transparent; }

.term-promotion-view { min-width: 0; }
.term-shell { display: grid; gap: 18px; }
.term-current-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 26px;
  border: 1px solid #cfe5e2;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0faf8 0%, #f7fbff 100%);
  box-shadow: 0 12px 34px rgba(31, 50, 73, .06);
}
.term-current-card span { color: var(--teal); font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.term-current-card h2 { margin: 5px 0; font-size: 26px; }
.term-current-card p { margin: 0; color: var(--muted); }
.term-current-card > strong { padding: 9px 14px; border-radius: 999px; color: #156c62; background: #dff4ef; }
.term-grid { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.2fr); gap: 18px; align-items: start; }
.term-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 34px rgba(31, 50, 73, .06); }
.term-panel > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 19px 21px 15px; border-bottom: 1px solid var(--line); }
.term-panel > header h3 { margin: 0 0 4px; font-size: 19px; }
.term-panel > header p { margin: 0; color: var(--muted); font-size: 13px; }
.term-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 17px 20px; background: #f9fbfc; border-bottom: 1px solid var(--line); }
.term-form label, .promotion-config label, .promotion-execute label { display: grid; gap: 6px; color: #526171; font-size: 12px; font-weight: 700; }
.term-form button { align-self: end; }
.term-form button.primary, .promotion-actions button.primary { color: #fff; border-color: var(--teal); background: var(--teal); }
.term-list { display: grid; max-height: 430px; overflow: auto; }
.term-list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.term-list-item:last-child { border-bottom: 0; }
.term-list-item.current { background: #f3fbf8; }
.term-list-item > div { display: grid; gap: 4px; }
.term-list-item > div:last-child { justify-items: end; }
.term-list-item span, .term-list-item small { color: var(--muted); font-size: 12px; }
.promotion-config { display: grid; grid-template-columns: 1fr 1fr 150px; gap: 11px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: #f9fbfc; }
.promotion-mapping { padding: 4px 20px 12px; }
.promotion-section-title { display: flex; justify-content: space-between; padding: 14px 0 9px; }
.promotion-section-title span { color: var(--muted); font-size: 12px; }
.promotion-map-row { display: grid; grid-template-columns: minmax(130px, .7fr) 26px minmax(220px, 1.3fr); align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #edf0f2; }
.promotion-map-row > span { display: grid; gap: 3px; }
.promotion-map-row small { color: var(--muted); }
.promotion-map-row i { color: var(--teal); font-size: 20px; font-style: normal; text-align: center; }
.promotion-actions { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.promotion-preview-table { max-height: 520px; overflow: auto; }
.promotion-preview-table table, .promotion-history table { width: 100%; border-collapse: collapse; }
.promotion-preview-table th, .promotion-preview-table td, .promotion-history th, .promotion-history td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.promotion-preview-table th, .promotion-history th { position: sticky; top: 0; z-index: 1; color: #526171; background: #f7f9fa; }
.promotion-preview-table select { min-width: 140px; }
.promotion-execute { display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; align-items: end; gap: 16px; padding: 16px 20px; background: #fffaf7; }
.promotion-execute > label:first-child { display: flex; align-items: center; padding-bottom: 10px; }
.promotion-execute button.danger { color: #fff; border-color: #c84c3f; background: #c84c3f; }
.promotion-history > .empty, .term-list > .empty, .promotion-mapping > .empty { padding: 24px; color: var(--muted); text-align: center; }

.school-diet-view { display: grid; gap: 18px; }
.diet-page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; border-radius: 16px; color: #fff;
  background: linear-gradient(125deg, #0c6f72 0%, #139b8d 56%, #57b879 100%);
  box-shadow: 0 12px 30px rgba(15, 139, 141, .2);
}
.diet-page-head h2 { margin: 6px 0 7px; font-size: 25px; }
.diet-page-head p, .diet-page-head > div > span { margin: 0; color: rgba(255,255,255,.78); font-size: 12px; letter-spacing: .08em; }
.diet-sync-actions { display: grid; justify-items: end; gap: 10px; }
.diet-sync-actions button { border-color: #fff; color: #087277; background: #fff; font-weight: 700; box-shadow: 0 5px 15px rgba(0,0,0,.12); }
.diet-sync-actions button:disabled { opacity: .65; cursor: wait; }
.diet-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.diet-summary-grid > div { min-height: 94px; display: grid; align-content: space-between; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.diet-summary-grid span { color: var(--muted); font-size: 12px; }
.diet-summary-grid strong { font-size: 20px; }
.diet-summary-grid strong.status { justify-self: start; font-size: 13px; }
.diet-section { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.diet-section-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.diet-section-title span { color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.diet-section-title h2 { margin: 3px 0 0; font-size: 20px; }
.diet-section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.diet-meal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.diet-meal-card { overflow: hidden; border: 1px solid #dce8e5; border-radius: 12px; background: #fbfdfc; }
.diet-meal-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border-bottom: 1px solid #e4ecea; }
.diet-meal-card header span { color: var(--teal); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.diet-meal-card h3 { margin: 3px 0 0; font-size: 18px; }
.diet-meal-actual { display: grid; justify-items: end; }
.diet-meal-actual strong { color: var(--teal); }
.diet-meal-actual small { color: var(--muted); font-size: 11px; }
.diet-meal-image { display: block; width: 100%; height: 160px; object-fit: cover; }
.diet-dish-list { display: grid; gap: 0; }
.diet-dish { padding: 13px 17px; border-top: 1px dashed #e1e9e7; }
.diet-dish:first-child { border-top: 0; }
.diet-dish > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.diet-dish > div span { color: var(--muted); font-size: 11px; }
.diet-dish p { margin: 6px 0 0; color: #65726e; font-size: 12px; line-height: 1.6; }
.diet-nutrient-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.diet-nutrient-card { padding: 14px; border: 1px solid var(--line); border-left: 4px solid #91a0b4; border-radius: 10px; background: #fbfcfe; }
.diet-nutrient-card.ok { border-left-color: var(--green); }
.diet-nutrient-card.warning { border-left-color: var(--amber); }
.diet-nutrient-card.bad { border-left-color: var(--red); }
.diet-nutrient-card > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.diet-nutrient-card b { color: inherit; font-size: 11px; }
.diet-nutrient-card > strong { display: block; margin-top: 12px; font-size: 21px; }
.diet-nutrient-card > strong small { color: var(--muted); font-size: 12px; font-weight: 500; }
.diet-nutrient-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.diet-empty-state { display: grid; justify-items: center; gap: 8px; padding: 46px 20px; border: 1px dashed #b7d7d1; border-radius: 14px; text-align: center; background: #f8fcfb; }
.diet-empty-state b { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); }
.diet-empty-state h3, .diet-empty-state p { margin: 0; }
.diet-empty-state p, .diet-empty-inline, .diet-loading { color: var(--muted); }
.diet-loading { padding: 60px; text-align: center; }
.diet-empty-inline { padding: 20px; text-align: center; }

.student-rfid-view {
  display: grid;
  gap: 16px;
}
.student-rfid-view.hidden { display: none; }
.student-rfid-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 26px;
  color: #fff;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255,255,255,.18), transparent 28%),
    linear-gradient(125deg, #123b73, #2563eb 58%, #4f80ee);
  box-shadow: 0 16px 34px rgba(37,99,235,.18);
}
.student-rfid-overview span { font-size: 12px; letter-spacing: .12em; opacity: .75; }
.student-rfid-overview h2 { margin: 5px 0 8px; font-size: 25px; }
.student-rfid-overview p { margin: 0; color: rgba(255,255,255,.78); font-size: 13px; }
.student-rfid-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(94px, 1fr));
  gap: 10px;
  min-width: 350px;
}
.student-rfid-summary > div {
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
}
.student-rfid-summary strong { display: block; font-size: 23px; }
.student-rfid-summary small { color: rgba(255,255,255,.72); }
.student-rfid-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.student-rfid-viewbar > span { color: var(--muted); font-size: 13px; }
.student-rfid-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.student-rfid-view-switch button {
  padding: 8px 18px;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
}
.student-rfid-view-switch button.active {
  color: #1d4ed8;
  background: #edf4ff;
  box-shadow: 0 2px 7px rgba(37,99,235,.12);
}
.student-rfid-content {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.student-rfid-table { width: 100%; border-collapse: collapse; }
.student-rfid-table th {
  padding: 13px 16px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  text-align: left;
}
.student-rfid-table td { padding: 14px 16px; border-top: 1px solid #eef2f7; }
.student-rfid-table code {
  color: #164e8b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  background: #eff6ff;
}
.student-rfid-person { display: flex; align-items: center; gap: 10px; }
.student-rfid-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #1d4ed8;
  font-weight: 800;
  border-radius: 50%;
  background: #e8f1ff;
}
.student-rfid-person strong, .student-rfid-person small { display: block; }
.student-rfid-person small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.student-rfid-edit {
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.student-rfid-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
}
.student-rfid-card {
  display: grid;
  gap: 13px;
  padding: 17px;
  border: 1px solid #e6ebf2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,.04);
}
.student-rfid-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-rfid-card-count { color: #64748b; font-size: 12px; }
.student-rfid-card-count b { color: #1d4ed8; font-size: 16px; }
.student-rfid-card-tags { display: grid; gap: 8px; min-height: 42px; }
.student-rfid-card-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f8fafc;
}
.student-rfid-card-tag div { min-width: 0; }
.student-rfid-card-tag strong { display: block; font-size: 12px; }
.student-rfid-card-tag code {
  display: block;
  margin-top: 2px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-rfid-empty-tag { color: #94a3b8; font-size: 12px; }
.student-rfid-card > button {
  justify-self: stretch;
  color: #1d4ed8;
  border: 1px dashed #93c5fd;
  background: #f7fbff;
}
.student-rfid-dialog { width: min(1040px, calc(100vw - 32px)); }
.student-rfid-dialog .dialog { max-width: none; }
.student-rfid-dialog .dialog > header h2 { margin: 0; font-size: 20px; }
.student-rfid-dialog .dialog > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.student-rfid-dialog-body { display: grid; gap: 20px; padding: 20px; }
.student-rfid-dialog-steps {
  display: grid;
  grid-template-columns: max-content 1fr max-content 1fr max-content;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 12px;
}
.student-rfid-dialog-steps span { display: flex; align-items: center; gap: 7px; }
.student-rfid-dialog-steps b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #64748b;
  border-radius: 50%;
  background: #e2e8f0;
}
.student-rfid-dialog-steps span.active { color: #1d4ed8; font-weight: 700; }
.student-rfid-dialog-steps span.active b { color: #fff; background: #2563eb; }
.student-rfid-dialog-steps i { height: 1px; background: #dbe3ee; }
.student-rfid-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.student-rfid-section-head strong, .student-rfid-section-head small { display: block; }
.student-rfid-section-head small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.student-rfid-section-head > span { color: #64748b; font-size: 12px; }
.student-rfid-section-head input { width: 190px; }
.student-rfid-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.student-rfid-class {
  padding: 12px;
  text-align: left;
  border: 1px solid #dce4ee;
  background: #fff;
}
.student-rfid-class strong, .student-rfid-class small { display: block; }
.student-rfid-class small { margin-top: 5px; color: var(--muted); }
.student-rfid-class.selected {
  color: #1d4ed8;
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59,130,246,.1);
}
.student-rfid-dialog-grid {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
  gap: 16px;
}
.student-rfid-student-panel,
.student-rfid-config-panel {
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fbfdff;
}
.student-rfid-student-list {
  display: grid;
  gap: 7px;
  max-height: 320px;
  overflow: auto;
}
.student-rfid-student-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid #e5eaf1;
  background: #fff;
}
.student-rfid-student-choice > span { display: flex; align-items: center; gap: 9px; }
.student-rfid-student-choice small { color: var(--muted); }
.student-rfid-student-choice.selected { border-color: #60a5fa; background: #eff6ff; }
.student-rfid-config-panel { display: grid; align-content: start; gap: 14px; }
.student-rfid-config-panel label,
.student-rfid-config-panel fieldset { margin: 0; }
.student-rfid-code-field > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 7px; }
.student-rfid-code-field button { color: #64748b; background: #eef2f7; }
.student-rfid-purpose,
.student-rfid-status { padding: 0; border: 0; }
.student-rfid-purpose legend,
.student-rfid-status legend { margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.student-rfid-purpose > div { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.student-rfid-purpose button { color: #475569; border: 1px solid #dbe3ee; background: #fff; }
.student-rfid-purpose button.active { color: #1d4ed8; border-color: #60a5fa; background: #eff6ff; }
.student-rfid-status { display: flex; flex-wrap: wrap; gap: 8px; }
.student-rfid-status legend { width: 100%; }
.student-rfid-status label { cursor: pointer; }
.student-rfid-status input { position: absolute; opacity: 0; }
.student-rfid-status span {
  display: inline-flex;
  padding: 8px 17px;
  color: #64748b;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
}
.student-rfid-status input:checked + span { color: #1d4ed8; border-color: #60a5fa; background: #eff6ff; }
.student-rfid-selection {
  padding: 12px;
  color: #64748b;
  border-radius: 11px;
  background: #eef4fb;
  font-size: 12px;
}
.student-rfid-selection strong { color: #123b73; }

.nap-binding-view { display: grid; gap: 16px; min-height: 0; }
.nap-binding-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  color: #fff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 15%, rgba(255,255,255,.2), transparent 30%),
    linear-gradient(135deg, #116b83, #1b8fa3 58%, #56b5aa);
  box-shadow: 0 12px 28px rgba(17,107,131,.18);
}
.nap-binding-overview > div:first-child > span {
  display: block;
  margin-bottom: 5px;
  color: #c8f7f0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}
.nap-binding-overview h2 { margin: 0; font-size: 22px; }
.nap-binding-overview p { margin: 7px 0 0; color: rgba(255,255,255,.82); font-size: 13px; }
.nap-binding-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 8px;
  min-width: 300px;
}
.nap-binding-summary > div {
  padding: 11px 13px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
}
.nap-binding-summary b, .nap-binding-summary small { display: block; }
.nap-binding-summary b { font-size: 22px; }
.nap-binding-summary small { margin-top: 2px; color: rgba(255,255,255,.76); font-size: 11px; }
.nap-binding-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e3eaf0;
  border-radius: 14px;
  background: #fff;
}
.nap-binding-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #edf4f6;
}
.nap-binding-view-switch button { color: #56717a; background: transparent; }
.nap-binding-view-switch button.active {
  color: #0f7085;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,112,133,.12);
}
.nap-binding-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nap-binding-filters select { min-width: 150px; }
.nap-binding-filters input { width: 220px; }
.nap-binding-filters .primary { color: #fff; background: #167f91; }
.nap-binding-result-hint { color: #64748b; font-size: 12px; }
.nap-binding-content { display: grid; gap: 16px; padding-bottom: 8px; }
.nap-binding-class-group {
  padding: 16px;
  border: 1px solid #e1e8ee;
  border-radius: 16px;
  background: #f9fbfc;
}
.nap-binding-class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.nap-binding-class-title { display: flex; align-items: center; gap: 10px; }
.nap-binding-class-title > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #0f7085;
  border-radius: 11px;
  background: #dff4f3;
  font-weight: 800;
}
.nap-binding-class-title strong, .nap-binding-class-title small { display: block; }
.nap-binding-class-title small { margin-top: 2px; color: #78909a; }
.nap-binding-class-head > small { color: #64748b; }
.nap-binding-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}
.nap-binding-device-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid #dfe7ec;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(15,23,42,.04);
}
.nap-binding-device-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.nap-binding-device-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nap-binding-device-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #16869a, #45afa5);
  font-size: 18px;
}
.nap-binding-device-name strong,
.nap-binding-device-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nap-binding-device-name small { margin-top: 3px; color: #7b8d96; }
.nap-binding-class-tag {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #7b5a16;
  border-radius: 999px;
  background: #fff3cf;
  font-size: 11px;
  font-weight: 700;
}
.nap-binding-students {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}
.nap-binding-student {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 10px;
  background: #f4f8fa;
}
.nap-binding-position {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #0d7186;
  border-radius: 9px;
  background: #dff2f4;
  font-size: 12px;
  font-weight: 800;
}
.nap-binding-student strong,
.nap-binding-student small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nap-binding-student strong { font-size: 12px; }
.nap-binding-student small { margin-top: 2px; color: #8a9aa2; font-size: 10px; }
.nap-binding-empty-students {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  color: #94a3b8;
  border: 1px dashed #cad7de;
  border-radius: 11px;
}
.nap-binding-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nap-binding-card-foot span { color: #64748b; font-size: 12px; }
.nap-binding-card-foot button {
  color: #0f7085;
  border: 1px solid #acd8dc;
  background: #effafb;
}

@media (max-width: 980px) {
  body {
    height: 100vh;
    overflow: hidden;
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .sidebar {
    height: 100vh;
    min-height: 0;
    max-height: none;
    padding: 10px 8px;
    overflow: hidden;
    overflow-x: hidden;
  }
  nav {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
  .column-grid {
    grid-template-columns: 1fr;
  }
  .main {
    height: 100vh;
    padding: 14px;
    overflow: auto;
  }
  .calendar-header { flex-direction: column; }
  .calendar-time-fields { grid-template-columns: 1fr 1fr; }
  .calendar-remark-field { grid-column: 1 / -1; }
  .calendar-weekdays, .calendar-grid { grid-template-columns: repeat(7, minmax(82px, 1fr)); overflow-x: auto; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .nap-arrangement-grid { grid-template-columns: 1fr; }
  .sleep-binding-grid { grid-template-columns: 1fr; }
  .sleep-binding-panel { min-height: 330px; }
  .sleep-binding-options { max-height: 280px; }
  .teacher-class-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-allergy-record dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nap-student-panel { min-height: 300px; }
  .span-2 { grid-column: auto; }
  .topbar { display: grid; }
  .term-grid { grid-template-columns: 1fr; }
  .diet-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diet-meal-grid { grid-template-columns: 1fr; }
  .diet-nutrient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diet-page-head, .diet-section-title { align-items: flex-start; flex-direction: column; }
  .diet-sync-actions { justify-items: start; }
  .class-overview-hero,
  .class-overview-class-head { align-items: flex-start; flex-direction: column; }
  .class-overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-overview-class-summary { justify-content: flex-start; }
  .class-overview-students { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .promotion-execute { grid-template-columns: 1fr; }
  .cockpit-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit-care-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit-layout .span-8,
  .cockpit-layout .span-6,
  .cockpit-layout .span-4 { grid-column: span 12; }
  .student-rfid-overview { align-items: flex-start; flex-direction: column; }
  .student-rfid-summary { width: 100%; min-width: 0; }
  .student-rfid-dialog-grid { grid-template-columns: 1fr; }
  .nap-binding-overview { align-items: flex-start; flex-direction: column; }
  .nap-binding-summary { width: 100%; min-width: 0; }
  .nap-binding-toolbar { align-items: flex-start; flex-direction: column; }
  .nap-binding-filters { width: 100%; }
}

@media (min-width: 981px) and (max-height: 720px) {
  .sidebar {
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .brand {
    padding-bottom: 7px;
  }
  .nav-channel-tabs {
    gap: 4px;
  }
  .nav-tab {
    min-height: 27px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .nav-panel-head {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .sidebar-footer {
    padding-top: 5px;
    line-height: 1.35;
  }
}

@media (max-width: 620px) {
  .sleep-binding-steps { grid-template-columns: 1fr; }
  .sleep-binding-steps i { display: none; }
  .sleep-binding-section-head { align-items: flex-start; flex-direction: column; }
  .sleep-binding-section-head input { width: 100%; }
  .sleep-binding-selection { grid-template-columns: 1fr; text-align: center; }
  .sleep-binding-selection > b { transform: rotate(90deg); }
  .teacher-class-options { grid-template-columns: 1fr; }
  .student-allergy-form,
  .student-allergy-record dl { grid-template-columns: 1fr; }
  .calendar-time-fields { grid-template-columns: 1fr; }
  .calendar-remark-field { grid-column: auto; }
  .calendar-summary { align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; }
  .calendar-selected-count { margin-left: 0; }
  .term-form, .promotion-config { grid-template-columns: 1fr; }
  .promotion-map-row { grid-template-columns: 1fr; }
  .promotion-map-row i { transform: rotate(90deg); }
  .class-overview-summary,
  .class-overview-students { grid-template-columns: 1fr; }
  .class-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-cockpit { padding: 12px; border-radius: 14px; }
  .cockpit-hero { align-items: flex-start; flex-direction: column; }
  .cockpit-hero-actions { width: 100%; justify-content: space-between; }
  .cockpit-kpi-grid { grid-template-columns: 1fr; }
  .cockpit-care-kpi-grid { grid-template-columns: 1fr; }
  .cockpit-device-overview { grid-template-columns: 1fr; }
  .cockpit-care-row { grid-template-columns: 62px minmax(0, 1fr); }
  .cockpit-care-row > small { display: none; }
  .diet-summary-grid, .diet-nutrient-grid { grid-template-columns: 1fr; }
  .student-rfid-summary { grid-template-columns: 1fr; }
  .student-rfid-viewbar { align-items: flex-start; flex-direction: column; }
  .student-rfid-dialog-steps { grid-template-columns: 1fr; }
  .student-rfid-dialog-steps i { display: none; }
  .student-rfid-section-head { align-items: flex-start; flex-direction: column; }
  .student-rfid-section-head input { width: 100%; }
  .nap-binding-summary { grid-template-columns: 1fr; }
  .nap-binding-filters select,
  .nap-binding-filters input,
  .nap-binding-filters button { width: 100%; }
  .nap-binding-device-grid { grid-template-columns: 1fr; }
  .nap-binding-students { grid-template-columns: 1fr; }
}

@media print {
  body { display: block; height: auto; overflow: visible; }
  .sidebar, .topbar .top-actions { display: none !important; }
  .main { height: auto; padding: 0; overflow: visible; }
  .dashboard-cockpit { print-color-adjust: exact; -webkit-print-color-adjust: exact; box-shadow: none; }
}

@media (max-width: 760px) {
  .user-profile-trigger-copy { display: none; }
  .user-profile-trigger { padding-right: 6px; }
  .user-profile-form-grid { grid-template-columns: 1fr; }
  .user-profile-form-grid label.full { grid-column: auto; }
}
.diet-planning-view {
  min-width: 0;
}

.diet-planning-shell {
  display: grid;
  gap: 16px;
  color: #25342f;
}

.diet-focus-enter {
  border-color: #a9cfc0 !important;
  color: #218a64 !important;
  background: #f3fbf7 !important;
  font-weight: 750;
}

.diet-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid #d8e7df;
  border-radius: 13px;
  background: linear-gradient(115deg, #f1faf5, #fffdf7);
  box-shadow: 0 5px 18px rgba(33, 91, 68, .07);
}

.diet-focus-title,
.diet-focus-title > div,
.diet-focus-actions {
  display: flex;
  align-items: center;
}

.diet-focus-title {
  gap: 12px;
}

.diet-focus-title > span {
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: #2ba779;
  font-size: 12px;
  font-weight: 800;
}

.diet-focus-title > div {
  gap: 9px;
}

.diet-focus-title strong {
  color: #263b32;
  font-size: 15px;
}

.diet-focus-title small {
  color: #7e8c85;
  font-size: 11px;
}

.diet-focus-actions {
  justify-content: flex-end;
  gap: 7px;
}

.diet-focus-actions button,
.diet-focus-actions input {
  min-height: 36px;
  border: 1px solid #d5e2dc;
  border-radius: 9px;
  background: #fff;
}

.diet-focus-actions button {
  padding: 0 11px;
}

.diet-focus-actions input {
  padding: 0 8px;
}

.diet-focus-actions .diet-focus-publish {
  border-color: #2ba779;
  color: #fff;
  background: #2ba779;
  font-weight: 800;
}

body.diet-focus-mode {
  grid-template-columns: 1fr;
  background: #edf4f0;
}

body.diet-focus-mode > .sidebar,
body.diet-focus-mode .main > .topbar {
  display: none !important;
}

body.diet-focus-mode .main {
  height: 100vh;
  padding: 10px;
  overflow: hidden;
}

body.diet-focus-mode .diet-planning-view,
body.diet-focus-mode .diet-planning-shell.focus-mode {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.diet-planning-shell.focus-mode {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.diet-planning-shell.focus-mode > .diet-plan-content,
.diet-planning-shell.focus-mode .diet-week-content,
.diet-planning-shell.focus-mode .diet-week-workspace {
  min-height: 0;
  height: 100%;
}

.diet-planning-shell.focus-mode > .diet-plan-content {
  overflow: hidden;
}

.diet-planning-shell.focus-mode .diet-week-content {
  grid-template-rows: auto minmax(0, 1fr);
}

.diet-planning-shell.focus-mode .diet-live-summary {
  grid-template-columns: 110px minmax(0, 1fr);
}

.diet-planning-shell.focus-mode .diet-live-summary.empty {
  grid-template-columns: 1fr;
}

.diet-planning-shell.focus-mode .diet-live-summary > button {
  display: none;
}

.diet-planning-shell.focus-mode .diet-week-workspace {
  grid-template-columns: 320px minmax(680px, 1fr);
  align-items: stretch;
}

.diet-planning-shell.focus-mode .diet-dish-picker {
  position: static;
  height: 100%;
  min-height: 0;
}

.diet-planning-shell.focus-mode .diet-week-grid {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.diet-planning-head,
.diet-library > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid #dce9e2;
  border-radius: 18px;
  background: linear-gradient(125deg, #f4fbf7 0%, #fffaf0 100%);
}

.diet-planning-head h2,
.diet-library > header h2 {
  margin: 3px 0 5px;
  font-size: 25px;
}

.diet-planning-head p,
.diet-library > header p {
  margin: 0;
  color: #75817d;
}

.diet-planning-head > div:first-child > span,
.diet-library > header > div > span,
.diet-picker-title span {
  color: #31a477;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.diet-week-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.diet-week-actions input,
.diet-plan-settings select,
.diet-plan-settings input,
.diet-dish-picker input,
.diet-editor-dialog input,
.diet-editor-dialog select {
  min-height: 38px;
  border: 1px solid #d7e2dc;
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  color: #25342f;
}

.diet-week-actions button,
.diet-plan-tabs button,
.diet-library button,
.diet-dish-picker button,
.diet-editor-dialog button {
  border: 1px solid #d7e2dc;
  border-radius: 10px;
  background: #fff;
  color: #385047;
  cursor: pointer;
  min-height: 36px;
  padding: 0 13px;
}

.diet-week-actions button.primary,
.diet-editor-dialog button.primary {
  border-color: #2ba779;
  background: #2ba779;
  color: #fff;
}

.diet-plan-settings {
  border: 1px solid #e3ebe7;
  border-radius: 14px;
  background: #fff;
}

.diet-plan-settings summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 800;
}

.diet-plan-settings summary small {
  margin-left: 8px;
  color: #8b9692;
  font-weight: 400;
}

.diet-plan-settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 4px 18px 18px;
  border-top: 1px solid #edf2ef;
}

.diet-plan-settings-grid > label,
.diet-setting-group {
  display: grid;
  gap: 7px;
  color: #617069;
  font-size: 13px;
}

.diet-plan-settings-grid .full {
  grid-column: 1 / -1;
}

.diet-check-row,
.diet-meal-setting-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.diet-check-row label,
.diet-meal-setting {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #e0e9e4;
  border-radius: 10px;
  background: #f9fbfa;
}

.diet-meal-setting input[type="number"] {
  width: 58px;
  min-height: 30px;
  padding: 0 5px;
}

.diet-meal-setting em {
  color: #7f8e87;
  font-style: normal;
}

.diet-age-snapshot {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  background: #f5f8f6;
  padding: 11px 13px;
}

.diet-age-snapshot small {
  color: #7d8984;
}

.diet-plan-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #dfe9e4;
}

.diet-plan-tabs button {
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
}

.diet-plan-tabs button.active {
  background: #eaf7f1;
  color: #218a64;
  font-weight: 800;
}

.diet-week-content {
  display: grid;
  gap: 10px;
}

.diet-live-summary {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 7px 9px;
  border: 1px solid #dce9e2;
  border-radius: 13px;
  background: linear-gradient(110deg, #f4fbf7, #fffdf7);
}

.diet-live-summary.empty {
  grid-template-columns: minmax(0, 1fr) auto;
}

.diet-live-summary-title,
.diet-live-summary.empty > div {
  display: grid;
  gap: 2px;
}

.diet-live-summary-title > span,
.diet-live-summary.empty > div > span {
  color: #2d9d74;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.diet-live-summary-title > strong,
.diet-live-summary.empty > div > strong {
  color: #253c33;
  font-size: 13px;
}

.diet-live-summary-title > small,
.diet-live-summary.empty > div > small {
  color: #849089;
  font-size: 9px;
}

.diet-live-standard {
  line-height: 1.25;
}

.diet-live-summary-metrics {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 4px;
}

.diet-live-summary-metrics article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1px 4px;
  min-height: 42px;
  padding: 4px 5px;
  border: 1px solid #e1e9e5;
  border-left: 2px solid #91a4b7;
  border-radius: 7px;
  background: rgba(255, 255, 255, .82);
}

.diet-live-summary-metrics article.ok { border-left-color: #2ba779; }
.diet-live-summary-metrics article.bad { border-left-color: #d45656; }
.diet-live-summary-metrics article.warning { border-left-color: #d99537; }
.diet-live-summary-metrics article.info { border-left-color: #91a4b7; }
.diet-live-summary-metrics article > span { color: #697971; font-size: 9px; }
.diet-live-summary-metrics article > strong { color: #243b32; font-size: 13px; }
.diet-live-summary-metrics article > strong small { margin-left: 1px; color: #87948e; font-size: 7px; }
.diet-live-summary-metrics article > em {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #8a9791;
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-live-summary > button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #b9d8ca;
  border-radius: 7px;
  color: #218a64;
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
}

.diet-week-workspace {
  display: grid;
  grid-template-columns: 330px minmax(700px, 1fr);
  align-items: start;
  gap: 14px;
}

.diet-week-grid {
  display: block;
  min-width: 0;
  overflow: auto;
  border: 1px solid #dfe8e4;
  border-radius: 15px;
  background: #fff;
}

.diet-week-row {
  width: 100%;
  min-width: var(--diet-grid-min-width, 887px);
  display: grid;
  grid-template-columns: 112px repeat(var(--diet-days), minmax(155px, 1fr));
  align-items: stretch;
}

.diet-week-header-row {
  position: sticky;
  top: 0;
  z-index: 4;
}

.diet-meal-row {
  min-height: var(--diet-row-min-height, 118px);
  height: auto;
  overflow: visible;
}

.diet-grid-corner,
.diet-grid-day,
.diet-grid-meal,
.diet-grid-cell {
  min-width: 0;
  border-right: 1px solid #e8eeeb;
  border-bottom: 1px solid #e8eeeb;
  padding: 10px;
}

.diet-grid-corner,
.diet-grid-day {
  background: #f3f9f6;
}

.diet-grid-corner {
  color: #7c8983;
  font-size: 12px;
}

.diet-grid-day,
.diet-grid-meal {
  display: grid;
  gap: 3px;
}

.diet-grid-day span,
.diet-grid-meal span {
  color: #86928d;
  font-size: 11px;
}

.diet-grid-meal {
  align-content: start;
  background: #fbfcfb;
}

.diet-grid-cell {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  align-self: stretch;
  background: #fff;
  transition: box-shadow .18s, background .18s;
}

.diet-grid-cell.selected {
  box-shadow: inset 0 0 0 2px #43b88a;
  background: #f6fcf9;
}

.diet-drag-active .diet-grid-cell {
  background: #fbfefc;
}

.diet-grid-cell.drag-over {
  box-shadow: inset 0 0 0 3px #2ba779, 0 8px 22px rgba(43, 167, 121, .16);
  background: #eaf8f1;
}

.diet-grid-cell.drag-over .diet-cell-add {
  border-color: #2ba779;
  color: #218a64;
  background: rgba(255, 255, 255, .78);
}

.diet-recipe-card {
  display: block;
  margin-bottom: 7px;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid #dcebe4;
  border-radius: 10px;
  background: #f7fbf9;
  cursor: context-menu;
  outline: none;
}

.diet-recipe-card:hover,
.diet-recipe-card:focus {
  border-color: #9ed4bd;
  background: #f0faf5;
  box-shadow: 0 3px 10px rgba(43, 126, 91, .08);
}

.diet-recipe-card > strong {
  display: block;
  overflow: hidden;
  color: #344b42;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-recipe-context-menu {
  position: fixed;
  z-index: 1200;
  width: 168px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid #dbe6e0;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(25, 52, 41, .2);
}

.diet-recipe-context-menu > div {
  min-width: 0;
  padding: 5px 7px 7px;
  border-bottom: 1px solid #edf2ef;
}

.diet-recipe-context-menu strong,
.diet-recipe-context-menu small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-recipe-context-menu strong {
  color: #30483e;
  font-size: 12px;
}

.diet-recipe-context-menu small {
  margin-top: 2px;
  color: #8a9791;
  font-size: 10px;
}

.diet-recipe-context-menu button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: #40564d;
  background: transparent;
  text-align: left;
}

.diet-recipe-context-menu button:hover,
.diet-recipe-context-menu button:focus {
  color: #218a64;
  background: #edf8f3;
}

.diet-recipe-context-menu button.danger {
  color: #b54c4c;
}

.diet-recipe-context-menu button.danger:hover,
.diet-recipe-context-menu button.danger:focus {
  color: #a83d3d;
  background: #fff0f0;
}

.diet-cell-add {
  width: 100%;
  min-height: 31px;
  border: 1px dashed #c8ddd2;
  border-radius: 8px;
  background: transparent;
  color: #64a388;
  cursor: pointer;
}

.diet-dish-picker {
  position: sticky;
  top: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  height: calc(100vh - 420px);
  max-height: none;
  min-height: 460px;
  overflow: hidden;
  padding: 9px;
  border: 1px solid #dfe8e4;
  border-radius: 15px;
  background: #fff;
}

.diet-picker-source-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 2px;
  border-radius: 8px;
  background: #eef3f0;
}

.diet-picker-source-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: #65756e;
  background: transparent;
  cursor: pointer;
}

.diet-picker-source-tabs button b {
  font-size: 11px;
}

.diet-picker-source-tabs button span {
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 999px;
  color: #84918b;
  background: #dfe7e3;
  font-size: 8px;
}

.diet-picker-source-tabs button.active {
  color: #fff;
  background: #2ba779;
  box-shadow: 0 4px 12px rgba(43, 167, 121, .2);
}

.diet-picker-source-tabs button.active span {
  color: #218a64;
  background: #fff;
}

#dietDishSearch {
  min-height: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.diet-picker-browser {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e1e9e5;
  border-radius: 10px;
  background: #fff;
}

.diet-picker-types {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  overflow-y: auto;
  padding: 6px;
  border-right: 1px solid #e5ece8;
  background: #f6f9f7;
}

.diet-picker-types button {
  flex: 0 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  height: 34px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  color: #607169;
  background: transparent;
  text-align: left;
  font-size: 10px;
  cursor: pointer;
}

.diet-picker-types button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-picker-types button b {
  min-width: 19px;
  padding: 2px 4px;
  border-radius: 999px;
  color: #85918c;
  background: #e9efec;
  text-align: center;
  font-size: 9px;
}

.diet-picker-types button.root {
  color: #344b42;
  font-weight: 750;
}

.diet-picker-types button.child {
  padding-left: 12px;
  color: #a0ada7;
}

.diet-picker-types button:hover {
  color: #218a64;
  background: #edf7f2;
}

.diet-picker-types button.active {
  color: #fff;
  background: #2ba779;
  box-shadow: 0 4px 11px rgba(43, 167, 121, .2);
}

.diet-picker-types button.active b {
  color: #218a64;
  background: #fff;
}

.diet-picker-results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: 8px;
}

.diet-picker-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px 8px;
}

.diet-picker-result-head strong {
  overflow: hidden;
  color: #31473e;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.diet-picker-result-head span {
  flex: 0 0 auto;
  color: #8a9891;
  font-size: 10px;
}

.diet-picker-list {
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}

.diet-picker-dish {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  height: auto;
  min-height: 50px;
  padding: 7px;
  border: 1px solid #dfe8e4;
  border-radius: 9px;
  color: #344b42;
  background: #fff;
  text-align: left;
  cursor: grab;
  user-select: none;
  transition: border-color .16s, box-shadow .16s, transform .16s, opacity .16s;
}

.diet-picker-dish.dish-item {
  min-height: 60px;
}

.diet-picker-dish:hover {
  border-color: #9ed4bd;
  box-shadow: 0 5px 13px rgba(41, 126, 90, .09);
  transform: translateY(-1px);
}

.diet-picker-dish:active {
  cursor: grabbing;
}

.diet-picker-dish.dragging {
  opacity: .42;
}

.diet-picker-dish > i {
  color: #9aa8a1;
  font-style: normal;
  letter-spacing: -2px;
}

.diet-picker-dish-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.diet-picker-dish-copy strong,
.diet-picker-dish-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-picker-dish-copy strong {
  font-size: 12px;
  line-height: 1.25;
}

.diet-picker-dish-copy small {
  color: #7c8983;
  font-size: 9px;
}

.diet-picker-more {
  margin: 7px 0 0;
  color: #8b9791;
  font-size: 10px;
  text-align: center;
}

.diet-live-analysis-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #187d5b;
  background: #ddf6e9;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.diet-library {
  display: grid;
  gap: 14px;
}

.diet-library > header {
  padding: 17px 20px;
}

.diet-library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diet-readonly-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f1;
  color: #64736c;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.diet-library-actions input {
  min-height: 38px;
  width: 220px;
  border: 1px solid #d7e2dc;
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
}

.diet-library-more {
  padding: 13px 16px;
  color: #7a8781;
  font-size: 12px;
  text-align: center;
}

.diet-food-table {
  overflow: auto;
  border: 1px solid #e0e9e5;
  border-radius: 14px;
  background: #fff;
}

.diet-food-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr .7fr .8fr .8fr .8fr .8fr .65fr;
  gap: 10px;
  align-items: center;
  min-width: 880px;
  padding: 12px 15px;
  border-bottom: 1px solid #edf1ef;
}

.diet-food-row.head {
  background: #f4f8f6;
  color: #728079;
  font-size: 12px;
  font-weight: 700;
}

.diet-food-row em {
  color: #8a9891;
  font-style: normal;
}

.diet-library-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}

.diet-library-cards article {
  display: grid;
  gap: 10px;
  padding: 17px;
  border: 1px solid #e0e9e4;
  border-radius: 14px;
  background: #fff;
}

.diet-library-cards h3 {
  margin: 3px 0 0;
}

.diet-library-cards p {
  min-height: 40px;
  margin: 0;
  color: #74827c;
  font-size: 12px;
  line-height: 1.7;
}

.diet-analysis-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.diet-analysis-panels article {
  padding: 18px;
  border: 1px solid #e0e8e4;
  border-radius: 14px;
  background: #fff;
}

.diet-analysis-panels p {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  color: #69776f;
}

.diet-editor-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 22px 70px rgb(31 58 46 / 22%);
}

.diet-editor-dialog::backdrop {
  background: rgb(24 42 35 / 48%);
}

.diet-editor-dialog form > header,
.diet-editor-dialog form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #e7ece9;
}

.diet-editor-dialog form > footer {
  justify-content: flex-end;
  border-top: 1px solid #e7ece9;
  border-bottom: 0;
}

.diet-editor-dialog h2 {
  margin: 3px 0;
}

.diet-editor-dialog p {
  margin: 0;
  color: #7b8882;
}

.diet-dialog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 20px 22px;
}

.diet-dialog-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diet-dialog-grid label {
  display: grid;
  gap: 6px;
  color: #65736c;
  font-size: 12px;
}

.diet-ingredient-editor {
  display: grid;
  gap: 10px;
  padding: 15px 22px 22px;
}

.diet-ingredient-editor > div:first-child,
.diet-ingredient-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diet-ingredient-editor > div:first-child {
  justify-content: space-between;
}

.diet-ingredient-row select {
  flex: 1;
}

.diet-ingredient-row input {
  width: 110px;
}

@media (max-width: 1200px) {
  .diet-week-workspace {
    grid-template-columns: 1fr;
  }
  .diet-dish-picker {
    position: static;
    height: 520px;
    max-height: none;
    min-height: 440px;
  }
  .diet-live-summary {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .diet-live-summary > button {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .diet-picker-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* 深蓝科幻主题：深色工作台、蓝色霓虹层级和高对比业务数据 */
html[data-school-theme="cyber"] body {
  background:
    radial-gradient(circle at 82% -10%, rgba(20, 117, 255, .22), transparent 34%),
    radial-gradient(circle at 18% 105%, rgba(0, 213, 255, .12), transparent 31%),
    linear-gradient(145deg, #050916, #071326 58%, #050b18);
}

html[data-school-theme="cyber"] button,
html[data-school-theme="cyber"] input,
html[data-school-theme="cyber"] select,
html[data-school-theme="cyber"] textarea {
  border-color: var(--line);
  color: var(--text);
  background-color: #101d33;
}

html[data-school-theme="cyber"] input::placeholder,
html[data-school-theme="cyber"] textarea::placeholder { color: #66819c; }
html[data-school-theme="cyber"] option { color: var(--text); background: #101d33; }

html[data-school-theme="cyber"] .sidebar {
  border-right-color: #1a4770;
  background:
    linear-gradient(rgba(28, 106, 171, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 106, 171, .06) 1px, transparent 1px),
    linear-gradient(180deg, #08182d, #050d1b);
  background-size: 22px 22px, 22px 22px, auto;
  box-shadow: 12px 0 40px rgba(0, 0, 0, .28);
}

html[data-school-theme="cyber"] .brand {
  border-bottom-color: rgba(57, 181, 255, .24);
}

html[data-school-theme="cyber"] .brand-mark {
  filter:
    drop-shadow(0 0 8px rgba(32, 220, 255, .52))
    drop-shadow(0 7px 12px rgba(0, 105, 255, .28));
}

html[data-school-theme="cyber"] .nav-tree-group {
  border-color: rgba(64, 136, 194, .3);
  background: linear-gradient(145deg, rgba(17, 38, 66, .94), rgba(8, 24, 46, .96));
  box-shadow: inset 0 1px rgba(108, 205, 255, .05);
}

html[data-school-theme="cyber"] .nav-tree-group-title {
  border-bottom-color: rgba(65, 137, 196, .2);
  color: #c8e7ff;
  background: linear-gradient(90deg, rgba(14, 45, 76, .92), rgba(12, 28, 53, .9));
}

html[data-school-theme="cyber"] .nav-tree-group.contains-active {
  border-color: rgba(45, 196, 255, .62);
  box-shadow: 0 0 18px rgba(31, 173, 255, .12), inset 3px 0 #20ccff;
}

html[data-school-theme="cyber"] .nav-tree-group.contains-active .nav-tree-group-title,
html[data-school-theme="cyber"] .nav-btn.active {
  color: #effbff;
  background: linear-gradient(90deg, rgba(19, 116, 196, .55), rgba(22, 63, 118, .42));
  text-shadow: 0 0 12px rgba(81, 219, 255, .36);
}

html[data-school-theme="cyber"] .nav-tree-group-icon {
  background: linear-gradient(135deg, #0d77d8, #0cc5e7);
  box-shadow: 0 0 12px rgba(28, 198, 255, .2);
}

html[data-school-theme="cyber"] .nav-tree-section-title { color: #779ab8; }
html[data-school-theme="cyber"] .nav-btn { color: #9dbad2; background: transparent; }
html[data-school-theme="cyber"] .nav-btn:hover {
  border-color: rgba(48, 197, 255, .26);
  color: #dff7ff;
  background: rgba(17, 100, 164, .22);
}

html[data-school-theme="cyber"] .top-theme-switcher,
html[data-school-theme="cyber"] .user-profile-trigger,
html[data-school-theme="cyber"] .toolbar,
html[data-school-theme="cyber"] .device-type-slices,
html[data-school-theme="cyber"] :is(.kpi, .panel, .table-wrap, dialog) {
  border-color: var(--line);
  color: var(--text);
  background: rgba(12, 25, 46, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18), inset 0 1px rgba(106, 200, 255, .04);
}

html[data-school-theme="cyber"] .topbar h1 {
  color: #f0f9ff;
  text-shadow: 0 0 24px rgba(57, 184, 255, .2);
}

html[data-school-theme="cyber"] .user-profile-trigger:hover,
html[data-school-theme="cyber"] .theme-options button:hover,
html[data-school-theme="cyber"] .theme-options button.active {
  border-color: rgba(55, 202, 255, .48);
  color: #8cecff;
  background: rgba(19, 82, 133, .5);
}

html[data-school-theme="cyber"] .primary-query-action,
html[data-school-theme="cyber"] .simulation-action {
  border-color: #16bdf5;
  color: #fff;
  background: linear-gradient(135deg, #116adb, #16bdf5);
  box-shadow: 0 0 17px rgba(22, 189, 245, .24);
}

html[data-school-theme="cyber"] th {
  color: #a9c8df;
  background: #101f35;
}

html[data-school-theme="cyber"] td {
  border-bottom-color: #213650;
  color: #d6e8f5;
}

html[data-school-theme="cyber"] :is(td.data-cell:hover, tbody tr:hover) {
  background: rgba(24, 114, 178, .12);
}

html[data-school-theme="cyber"] .care-overview-loading,
html[data-school-theme="cyber"] .care-overview-tabs,
html[data-school-theme="cyber"] .care-overview-card,
html[data-school-theme="cyber"] .care-overview-class-panel,
html[data-school-theme="cyber"] .care-overview-detail {
  border-color: #263f5c;
  color: var(--text);
  background: linear-gradient(145deg, rgba(15, 31, 55, .98), rgba(9, 21, 40, .98));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}

html[data-school-theme="cyber"] .care-overview-intro {
  border-color: rgba(40, 190, 255, .38);
  background:
    linear-gradient(rgba(28, 152, 220, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 152, 220, .07) 1px, transparent 1px),
    radial-gradient(circle at 90% 0, rgba(33, 111, 255, .32), transparent 34%),
    linear-gradient(135deg, #0b2947, #0b172c 70%);
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: inset 4px 0 #20ccff, 0 14px 36px rgba(0, 0, 0, .2);
}

html[data-school-theme="cyber"] .care-overview-tabs button { color: #91adc3; background: transparent; }
html[data-school-theme="cyber"] .care-overview-tabs button i {
  color: #63dfff;
  background: #102f4b;
}
html[data-school-theme="cyber"] .care-overview-tabs button.active {
  border-color: #1f9ed4;
  color: #e8faff;
  background: linear-gradient(135deg, rgba(19, 113, 190, .64), rgba(16, 70, 126, .62));
}
html[data-school-theme="cyber"] .care-overview-tabs button.active i {
  color: #03111e;
  background: #40dbff;
  box-shadow: 0 0 14px rgba(64, 219, 255, .42);
}

html[data-school-theme="cyber"] .care-overview-card header > span {
  background: color-mix(in srgb, var(--care-tone) 18%, #0d1b30);
}
html[data-school-theme="cyber"] .care-overview-card footer span { background: #101f34; }
html[data-school-theme="cyber"] .care-overview-card footer .attention {
  color: #ff91a5;
  background: rgba(185, 49, 80, .2);
}
html[data-school-theme="cyber"] .care-overview-card footer .attention b { color: #ff819b; }
html[data-school-theme="cyber"] .care-overview-class-panel > header,
html[data-school-theme="cyber"] .care-overview-detail-head,
html[data-school-theme="cyber"] .care-overview-table-scroll th { background: #101f35; }
html[data-school-theme="cyber"] .care-overview-table-scroll td {
  border-top-color: #213650;
  color: #cce0ee;
}
html[data-school-theme="cyber"] .care-overview-table-scroll tbody tr:hover { background: rgba(24, 114, 178, .12); }

html[data-school-theme="cyber"] .class-overview-hero,
html[data-school-theme="cyber"] .class-overview-summary > div,
html[data-school-theme="cyber"] .class-overview-class,
html[data-school-theme="cyber"] .class-overview-student {
  border-color: #263f5c;
  color: var(--text);
  background: linear-gradient(145deg, #0f1f37, #0a172b);
}
html[data-school-theme="cyber"] .class-overview-class-head,
html[data-school-theme="cyber"] .class-overview-metric,
html[data-school-theme="cyber"] .class-overview-class-summary span { background: #102037; }

html[data-school-theme="cyber"] dialog::backdrop {
  background: rgba(1, 5, 15, .72);
  backdrop-filter: blur(3px);
}

html[data-school-theme="cyber"] .dialog header,
html[data-school-theme="cyber"] .dialog footer {
  border-color: var(--line);
  background: #101f35;
}

html[data-school-theme="cyber"] .status { color: #b8cad8; background: #1b2b3e; }
html[data-school-theme="cyber"] .status.ok { color: #62ebba; background: rgba(25, 133, 93, .22); }
html[data-school-theme="cyber"] .status.warn { color: #ffd17a; background: rgba(172, 113, 11, .23); }
html[data-school-theme="cyber"] .status.bad { color: #ff8ba0; background: rgba(174, 44, 70, .23); }
html[data-school-theme="cyber"] .status.info { color: #79baff; background: rgba(42, 100, 181, .24); }

/* 幼儿暖粉主题：奶油底色、柔和糖果色和更圆润的卡片层级 */
html[data-school-theme="candy"] body {
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 195, 124, .2), transparent 25%),
    radial-gradient(circle at 30% 102%, rgba(194, 159, 255, .14), transparent 28%),
    linear-gradient(145deg, #fff7f9, #fffaf3 62%, #fff5f8);
}

html[data-school-theme="candy"] button,
html[data-school-theme="candy"] input,
html[data-school-theme="candy"] select,
html[data-school-theme="candy"] textarea { border-radius: 11px; }

html[data-school-theme="candy"] .sidebar {
  border-right-color: #efcfdb;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, .72) 0 4px, transparent 5px),
    linear-gradient(180deg, #fff1f6, #fff8f2);
  background-size: 36px 36px, auto;
  box-shadow: 10px 0 34px rgba(183, 104, 133, .09);
}

html[data-school-theme="candy"] .brand-mark {
  filter:
    drop-shadow(0 5px 9px rgba(66, 167, 214, .18))
    drop-shadow(0 2px 3px rgba(255, 139, 118, .18));
}

html[data-school-theme="candy"] .nav-tree-group {
  border-color: #efd3dd;
  border-radius: 15px;
  background: rgba(255, 253, 253, .9);
  box-shadow: 0 6px 16px rgba(179, 103, 132, .055);
}

html[data-school-theme="candy"] .nav-tree-group-title {
  min-height: 40px;
  color: #765565;
  background: linear-gradient(90deg, #fff4f7, #fffaf5);
}

html[data-school-theme="candy"] .nav-tree-group-icon {
  border-radius: 9px 9px 11px 11px;
  background: linear-gradient(135deg, #ef8baa, #e8a261);
}

html[data-school-theme="candy"] .nav-tree-group.contains-active {
  border-color: #f1a8c1;
  box-shadow: 0 8px 22px rgba(217, 91, 137, .11), inset 3px 0 #ef709b;
}

html[data-school-theme="candy"] .nav-tree-group.contains-active .nav-tree-group-title,
html[data-school-theme="candy"] .nav-btn.active {
  color: #c84c7a;
  background: linear-gradient(90deg, #ffe3ed, #fff1e4);
}

html[data-school-theme="candy"] .nav-btn { color: #8d6b79; }
html[data-school-theme="candy"] .nav-btn:hover {
  border-color: #f3bfd0;
  color: #c84c7a;
  background: #fff0f5;
}

html[data-school-theme="candy"] .top-theme-switcher,
html[data-school-theme="candy"] .user-profile-trigger,
html[data-school-theme="candy"] .toolbar,
html[data-school-theme="candy"] .device-type-slices,
html[data-school-theme="candy"] :is(.kpi, .panel, .table-wrap, dialog) {
  border-color: var(--line);
  background: rgba(255, 253, 253, .96);
  box-shadow: 0 8px 24px rgba(170, 95, 124, .07);
}

html[data-school-theme="candy"] .top-theme-switcher,
html[data-school-theme="candy"] .user-profile-trigger { border-radius: 16px; }
html[data-school-theme="candy"] .toolbar,
html[data-school-theme="candy"] .device-type-slices { border-radius: 17px; }

html[data-school-theme="candy"] .user-profile-trigger:hover,
html[data-school-theme="candy"] .theme-options button:hover,
html[data-school-theme="candy"] .theme-options button.active {
  border-color: #f1adc5;
  color: #c74c79;
  background: linear-gradient(135deg, #ffe7ef, #fff1df);
}

html[data-school-theme="candy"] .primary-query-action,
html[data-school-theme="candy"] .simulation-action {
  border-color: #eb6e9a;
  color: #fff;
  background: linear-gradient(135deg, #ef709b, #f39578);
  box-shadow: 0 7px 16px rgba(221, 89, 137, .2);
}

html[data-school-theme="candy"] th {
  color: #765968;
  background: linear-gradient(90deg, #fff1f5, #fff7ef);
}

html[data-school-theme="candy"] td.data-cell:hover,
html[data-school-theme="candy"] tbody tr:hover { background: #fff6f8; }

html[data-school-theme="candy"] .care-overview-loading,
html[data-school-theme="candy"] .care-overview-tabs,
html[data-school-theme="candy"] .care-overview-card,
html[data-school-theme="candy"] .care-overview-class-panel,
html[data-school-theme="candy"] .care-overview-detail {
  border-color: #efd6df;
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 254, 253, .97);
  box-shadow: 0 10px 28px rgba(177, 100, 130, .075);
}

html[data-school-theme="candy"] .care-overview-intro {
  border-color: #f0cbd8;
  border-radius: 20px;
  background:
    radial-gradient(circle at 91% 13%, rgba(255, 181, 105, .25), transparent 27%),
    radial-gradient(circle at 76% 105%, rgba(190, 154, 255, .18), transparent 32%),
    linear-gradient(135deg, #ffeaf1, #fff6e9 62%, #fffafd);
  box-shadow: inset 5px 0 #f07ca2, 0 12px 28px rgba(190, 100, 135, .08);
}

html[data-school-theme="candy"] .care-overview-tabs button {
  border-radius: 14px;
  color: #90707e;
}
html[data-school-theme="candy"] .care-overview-tabs button i {
  border-radius: 10px 10px 12px 12px;
  color: #ce5b84;
  background: #ffe5ee;
}
html[data-school-theme="candy"] .care-overview-tabs button.active {
  border-color: #efabc2;
  color: #c84c79;
  background: linear-gradient(135deg, #ffe3ed, #fff0df);
}
html[data-school-theme="candy"] .care-overview-tabs button.active i {
  color: #fff;
  background: linear-gradient(135deg, #ef709b, #f3a16e);
}

html[data-school-theme="candy"] .care-overview-card:nth-child(3n + 1) { background: linear-gradient(145deg, #fffdfd, #fff6f9); }
html[data-school-theme="candy"] .care-overview-card:nth-child(3n + 2) { background: linear-gradient(145deg, #fffefd, #fff9ef); }
html[data-school-theme="candy"] .care-overview-card:nth-child(3n) { background: linear-gradient(145deg, #fffdfd, #f9f5ff); }
html[data-school-theme="candy"] .care-overview-card header > span {
  border-radius: 12px 12px 15px 15px;
  background: color-mix(in srgb, var(--care-tone) 10%, #fff8fb);
}
html[data-school-theme="candy"] .care-overview-card footer span { background: #fff5f7; }
html[data-school-theme="candy"] .care-overview-card footer .attention {
  color: #c34f69;
  background: #ffe8ec;
}
html[data-school-theme="candy"] .care-overview-class-panel > header,
html[data-school-theme="candy"] .care-overview-detail-head,
html[data-school-theme="candy"] .care-overview-table-scroll th {
  background: linear-gradient(90deg, #fff3f7, #fff8f0);
}
html[data-school-theme="candy"] .care-overview-table-scroll tbody tr:hover { background: #fff6f8; }

html[data-school-theme="candy"] .class-overview-hero,
html[data-school-theme="candy"] .class-overview-summary > div,
html[data-school-theme="candy"] .class-overview-class,
html[data-school-theme="candy"] .class-overview-student {
  border-color: #efd7df;
  border-radius: 18px;
  background: #fffdfd;
  box-shadow: 0 8px 22px rgba(179, 101, 130, .06);
}
html[data-school-theme="candy"] .class-overview-hero {
  background: linear-gradient(135deg, #fff0f5, #fff8ec 70%, #fff);
}
html[data-school-theme="candy"] .class-overview-class-head,
html[data-school-theme="candy"] .class-overview-metric,
html[data-school-theme="candy"] .class-overview-class-summary span { background: #fff4f7; }

html[data-school-theme="candy"] dialog {
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(127, 65, 89, .2);
}
html[data-school-theme="candy"] dialog::backdrop {
  background: rgba(112, 71, 87, .32);
  backdrop-filter: blur(3px);
}
html[data-school-theme="candy"] .dialog header {
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #fff0f5, #fff8ee);
}
html[data-school-theme="candy"] .dialog footer { background: #fff9fa; }

html[data-school-theme="candy"] .status { color: #765968; background: #f8ebf0; }
html[data-school-theme="candy"] .status.ok { color: #3d8966; background: #eaf7ef; }
html[data-school-theme="candy"] .status.warn { color: #a26a18; background: #fff2d8; }
html[data-school-theme="candy"] .status.bad { color: #bd465d; background: #ffe8ec; }
html[data-school-theme="candy"] .status.info { color: #587bbd; background: #ebf1ff; }

@media (max-width: 760px) {
  .diet-planning-head,
  .diet-library > header {
    align-items: stretch;
    flex-direction: column;
  }
  .diet-week-actions {
    justify-content: flex-start;
  }
  .diet-plan-settings-grid,
  .diet-dialog-grid,
  .diet-dialog-grid.compact,
  .diet-analysis-panels {
    grid-template-columns: 1fr;
  }
  .diet-plan-settings-grid .full {
    grid-column: auto;
  }
  .diet-picker-browser {
    grid-template-columns: 1fr;
  }
  .diet-picker-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid #e5ece8;
  }
  .diet-live-summary {
    grid-template-columns: 1fr;
  }
  .diet-live-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .diet-live-summary > button {
    grid-column: auto;
    justify-self: stretch;
  }
}
