/* ============================================================
   辅理善宿舍管理系统 · Design System
   ============================================================ */
:root {
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --bg: #f2f6f3;
  --card: #ffffff;
  --ink: #172927;
  --ink-2: #2f4641;
  --muted: #6f837d;
  --muted-2: #93a39e;
  --line: #e3ebe6;
  --line-strong: #d5e1db;
  --brand: #1b7566;
  --brand-deep: #0a332c;
  --brand-soft: #e8f3ef;
  --teal: #2b9b8c;
  --teal-soft: #e6f5f1;
  --amber: #d5a348;
  --amber-deep: #a97620;
  --amber-soft: #fbf3e3;
  --blue: #497ba7;
  --blue-soft: #ebf2f9;
  --red: #b95a51;
  --red-soft: #fbeeec;
  --purple: #7a6aa8;
  --purple-soft: #f1eef8;
  --radius: 14px;
  --shadow: 0 16px 36px -26px rgba(11, 53, 45, .35);
  --shadow-lg: 0 28px 60px -30px rgba(9, 43, 37, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 13px;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ---------- Boot ---------- */
#boot-splash {
  position: fixed; inset: 0; z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
  background: var(--brand-deep); color: #fff; transition: opacity .35s ease, visibility .35s ease;
}
#boot-splash.done { opacity: 0; visibility: hidden; }
.boot-logo .brand-glyph { width: 84px; height: 52px; border-radius: 14px; padding: 6px 8px; }
.boot-name { font-size: 19px; letter-spacing: .12em; font-weight: 500; }
.boot-name b { color: #e8c37b; }
.boot-line { width: 120px; height: 2px; background: rgba(255,255,255,.14); overflow: hidden; border-radius: 2px; }
.boot-line i { display: block; width: 45%; height: 100%; background: #e8c37b; border-radius: 2px; animation: bootSlide 1s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }

/* ---------- Brand ---------- */
.brand-glyph {
  width: 48px; height: 32px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; padding: 3px 4px; background: #fff;
  box-shadow: 0 5px 14px -7px rgba(5, 32, 26, .55); overflow: hidden;
}
.brand-glyph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-word { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-word strong { font-size: 17px; letter-spacing: .02em; color: #fff; font-weight: 650; white-space: nowrap; }
.brand-word strong em { font-style: normal; color: #e8c37b; font-size: 11px; letter-spacing: .1em; margin-left: 1px; }
.brand-word span { font-size: 8.5px; color: rgba(255,255,255,.46); letter-spacing: .14em; margin-top: 4px; white-space: nowrap; }

/* ---------- Login ---------- */
#login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(420px, .9fr); }
.login-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: clamp(26px, 4vw, 54px) clamp(28px, 5vw, 74px);
  color: #f3f7f5;
  background:
    radial-gradient(circle at 88% 18%, rgba(66, 160, 139, .22), transparent 28%),
    radial-gradient(circle at 15% 95%, rgba(213, 163, 72, .16), transparent 32%),
    linear-gradient(142deg, #0a332c 0%, #0e433a 55%, #0a2b26 100%);
}
.login-visual-grid {
  position: absolute; inset: 0; opacity: .24; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 50% 38%, #000 0%, transparent 72%);
}
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-glyph { width: 64px; height: 42px; border-radius: 11px; }
.login-copy { position: relative; z-index: 2; margin-top: clamp(44px, 9vh, 90px); max-width: 590px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 600; letter-spacing: .19em; color: var(--brand); text-transform: uppercase; }
.eyebrow i { width: 18px; height: 1px; background: currentColor; display: inline-block; }
.eyebrow.light { color: rgba(232,195,123,.92); }
.login-copy h1 { margin: 17px 0 0; font-size: clamp(36px, 3.6vw, 55px); line-height: 1.22; font-weight: 600; letter-spacing: -.04em; color: #f7faf8; }
.login-copy h1 span { color: #e8c37b; }
.login-copy p { max-width: 500px; margin: 22px 0 0; font-size: 13.5px; line-height: 1.95; color: rgba(234,243,239,.66); }
.login-metrics { display: flex; gap: 36px; margin-top: 34px; }
.login-metrics div { display: flex; flex-direction: column; gap: 5px; }
.login-metrics b { font-size: 25px; font-weight: 600; color: #f2d59f; }
.login-metrics span { font-size: 9px; letter-spacing: .12em; color: rgba(234,243,239,.45); }
.login-room-visual {
  position: relative; z-index: 2; margin-top: auto; width: min(460px, 86%); padding: 15px 17px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.045);
  backdrop-filter: blur(8px);
}
.room-visual-head { display: flex; align-items: center; gap: 8px; font-size: 9px; color: rgba(234,243,239,.5); letter-spacing: .08em; }
.room-visual-head i { flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.room-visual-head b { color: #e4bf7d; font-weight: 500; }
.room-visual-body { display: flex; align-items: center; gap: 18px; margin-top: 13px; }
.room-window { width: 78px; height: 72px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(160deg, rgba(118,190,173,.28), rgba(255,255,255,.03)); display: grid; grid-template-columns: 1fr 1fr; padding: 7px; gap: 4px; }
.room-window i { border-radius: 3px; background: rgba(255,255,255,.09); }
.room-window i:nth-child(2) { grid-row: span 2; }
.room-window span { border-radius: 3px; background: rgba(255,255,255,.06); }
.bunk-visual { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bunk-bed { border-radius: 7px; padding: 8px 9px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); display: grid; grid-template-columns: auto 1fr; gap: 1px 7px; align-items: center; }
.bunk-bed span { font-size: 8px; color: rgba(255,255,255,.34); grid-row: span 2; }
.bunk-bed b { font-size: 10px; color: rgba(255,255,255,.82); font-weight: 500; }
.bunk-bed small { font-size: 8px; color: rgba(232,195,123,.75); }
.bunk-bed.occupied { background: rgba(213,163,72,.12); border-color: rgba(213,163,72,.24); }
.bunk-bed.empty b { color: rgba(255,255,255,.35); }
.login-footer { position: relative; z-index: 2; display: flex; justify-content: space-between; margin-top: 34px; font-size: 9px; color: rgba(234,243,239,.3); letter-spacing: .06em; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 36px; background: radial-gradient(circle at 82% 10%, #fbf4e8 0%, transparent 30%), #fafcfb; }
.login-form-inner { width: min(380px, 100%); }
.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 30px; }
.login-mobile-brand strong { font-size: 17px; }
.login-form-inner h2 { font-size: 32px; letter-spacing: -.04em; margin: 9px 0 0; font-weight: 650; }
.login-sub { margin: 9px 0 0; font-size: 12.5px; color: var(--muted); }
#login-form { margin-top: 30px; }
.field-label { display: block; margin: 0 0 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
#login-form .field-label:not(:first-child) { margin-top: 18px; }
.input-shell { position: relative; display: flex; align-items: center; width: 100%; }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); padding: 0 12px; outline: none; transition: border-color .18s, box-shadow .18s;
  font-size: 12.5px;
}
.textarea { height: auto; min-height: 82px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: #7eb7aa; box-shadow: 0 0 0 3px rgba(43,155,140,.1); }
.input::placeholder, .textarea::placeholder { color: #a7b5b0; }
.input-shell .input { padding-left: 38px; }
.input-icon { position: absolute; left: 12px; color: #94a59f; width: 16px; height: 16px; }
.input-action { position: absolute; right: 7px; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 18px; }
.checkbox { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); cursor: pointer; }
.checkbox input { display: none; }
.checkbox span { width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; position: relative; }
.checkbox input:checked + span { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked + span::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }
.text-link { border: 0; background: none; padding: 0; font-size: 11px; color: var(--brand); }
.form-error { background: var(--red-soft); border: 1px solid #f0d2ce; color: #9d4238; border-radius: 8px; padding: 9px 11px; font-size: 11px; margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 9px; border: 1px solid transparent; font-size: 11.5px; font-weight: 550; transition: .18s; white-space: nowrap; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 10.5px; }
.btn-lg { height: 46px; width: 100%; font-size: 13px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -12px rgba(15,78,66,.7); }
.btn-primary:hover { background: #155f54; transform: translateY(-1px); }
.btn-secondary { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-secondary:hover { border-color: #b7cfc6; background: #fbfdfc; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.login-submit { margin-top: 2px; }
.login-submit .icon { transition: transform .2s; }
.login-submit:hover .icon { transform: translateX(3px); }
.login-security-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; font-size: 9.5px; color: var(--muted-2); }
.login-security-note .icon { width: 12px; height: 12px; color: var(--brand); }
.login-agreement { margin-top: 12px; text-align: center; font-size: 9px; color: #aab7b2; }
.login-agreement a { color: #84958f; border-bottom: 1px solid #dae3df; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: 232px; padding: 22px 13px 16px;
  display: flex; flex-direction: column; color: #e9f1ed;
  background: radial-gradient(circle at 20% 0%, rgba(67,155,137,.2), transparent 34%), linear-gradient(170deg, #0b352e 0%, #072923 100%);
  border-right: 1px solid rgba(255,255,255,.055);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 7px 20px; }
.sidebar-context { display: flex; align-items: center; gap: 9px; margin: 0 2px 18px; padding: 10px 10px; border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.065); }
.context-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: rgba(220,177,95,.13); color: #dfba74; flex: 0 0 auto; }
.context-icon .icon { width: 14px; height: 14px; }
.sidebar-context > div { min-width: 0; flex: 1; }
.sidebar-context span { display: block; font-size: 8px; color: rgba(233,241,237,.38); letter-spacing: .04em; }
.sidebar-context b { display: block; font-size: 10.5px; font-weight: 550; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-context em { display: block; font-style: normal; font-size: 8px; color: #d9b26b; margin-top: 2px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #62c2a3; box-shadow: 0 0 0 4px rgba(98,194,163,.1); }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group { display: block; padding: 15px 11px 6px; font-size: 8px; letter-spacing: .14em; color: rgba(233,241,237,.28); text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 11px; border-radius: 8px; color: rgba(233,241,237,.6); font-size: 11.5px; transition: .16s; }
.nav-item .icon { width: 16px; height: 16px; color: rgba(233,241,237,.42); }
.nav-item:hover { background: rgba(255,255,255,.055); color: #f2f7f4; }
.nav-item.active { background: linear-gradient(90deg, rgba(220,177,95,.15), rgba(220,177,95,.04)); color: #f1d19b; box-shadow: inset 2px 0 0 #dcb15f; }
.nav-item.active .icon { color: #e4c17c; }
.nav-badge { margin-left: auto; min-width: 17px; height: 17px; border-radius: 5px; background: rgba(220,177,95,.13); color: #e0bd79; font-size: 8px; display: inline-grid; place-items: center; font-style: normal; }
.nav-badge:empty { display: none; }
.sidebar-help { margin-top: auto; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.035); border-radius: 11px; padding: 12px; }
.help-icon { width: 25px; height: 25px; border-radius: 7px; background: rgba(220,177,95,.13); color: #dfba74; display: grid; place-items: center; margin-bottom: 8px; }
.help-icon .icon { width: 13px; height: 13px; }
.sidebar-help b { display: block; font-size: 10px; font-weight: 550; color: rgba(240,247,243,.85); }
.sidebar-help span { display: block; font-size: 8.5px; line-height: 1.65; color: rgba(233,241,237,.35); margin-top: 4px; }
.sidebar-version { display: flex; justify-content: space-between; padding: 13px 5px 0; font-size: 8px; color: rgba(233,241,237,.24); }
.sidebar-mask { display: none; }
.shell { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; background: rgba(255,255,255,.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 40; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted-2); }
.breadcrumb b { color: var(--ink-2); font-weight: 550; }
.breadcrumb .icon { width: 11px; height: 11px; }
.mobile-menu { display: none; }
.global-search { position: relative; width: 230px; display: flex; align-items: center; gap: 7px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #fff; }
.global-search .icon { width: 14px; height: 14px; color: #9eadA8; }
.global-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 10.5px; color: var(--ink); background: transparent; }
.global-search input::placeholder { color: #a7b5b0; }
.global-search kbd { font-family: var(--font); font-size: 8px; color: #aab7b2; background: #f5f8f6; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; }
.search-popover { position: absolute; left: 0; right: 0; top: 39px; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; max-height: 350px; overflow-y: auto; }
.search-result { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.search-result:hover { background: var(--brand-soft); }
.search-result .search-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.search-result .search-ico .icon { width: 13px; height: 13px; }
.search-result div { min-width: 0; }
.search-result b { display: block; font-size: 10.5px; font-weight: 550; color: var(--ink); }
.search-result span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.search-empty { padding: 17px; text-align: center; font-size: 10px; color: var(--muted); }
.topbar-date { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.topbar-date .icon { width: 13px; height: 13px; color: #9bada7; }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 3px; color: var(--ink); }
.user-menu-btn > .icon { width: 12px; height: 12px; color: var(--muted-2); }
.user-menu-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-menu-copy b { font-size: 10.5px; font-weight: 550; }
.user-menu-copy small { font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: 0 0 auto; background: linear-gradient(145deg, #3b9a89, #176b5e); }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 10.5px; }
.user-popover { position: absolute; right: 0; top: 42px; z-index: 80; width: 205px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 6px; }
.popover-head { display: flex; align-items: center; gap: 9px; padding: 9px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.popover-head b { display: block; font-size: 11px; }
.popover-head span { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.popover-body { display: flex; flex-direction: column; }
.popover-item { display: flex; align-items: center; gap: 8px; border: 0; background: none; border-radius: 7px; padding: 9px; font-size: 10.5px; color: var(--ink-2); text-align: left; }
.popover-item .icon { width: 14px; height: 14px; color: var(--muted); }
.popover-item:hover { background: var(--brand-soft); }
.popover-item.danger { color: var(--red); }
.popover-item.danger .icon { color: var(--red); }

/* ---------- Page framework ---------- */
.page { padding: 30px 34px 42px; flex: 1; max-width: 1540px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 25px; letter-spacing: -.045em; margin: 7px 0 0; font-weight: 650; }
.page-head p { margin: 7px 0 0; font-size: 11.5px; color: var(--muted); }
.page-actions { display: flex; gap: 8px; align-items: center; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-mini { display: flex; align-items: center; gap: 11px; padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.mini-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.mini-icon .icon { width: 17px; height: 17px; }
.summary-mini > div { min-width: 0; }
.summary-mini b { display: block; font-size: 22px; letter-spacing: -.04em; font-weight: 600; line-height: 1.1; }
.summary-mini span { display: block; font-size: 9px; color: var(--muted); margin-top: 4px; }
.summary-mini .mini-extra { margin-left: auto; font-size: 8.5px; color: var(--muted-2); white-space: nowrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-result { font-size: 9.5px; color: var(--muted-2); }
.filter-result b { color: var(--ink-2); }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 12px; }
.filter-bar-spacer { flex: 1; }
.search-field { display: flex; align-items: center; gap: 7px; width: 250px; height: 33px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: #fff; }
.search-field .icon { width: 14px; height: 14px; color: #9baca6; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 10.5px; }
.filter-bar .select { width: auto; min-width: 116px; height: 33px; font-size: 10.5px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 8px; background: #edf3ef; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; font-size: 10px; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 2px 6px -4px rgba(10,60,50,.5); }
.segmented .count { font-size: 8px; color: var(--muted-2); margin-left: 3px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 0; }
.card-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.card-title .icon { width: 15px; height: 15px; color: var(--brand); }
.card-sub { margin-top: 4px; font-size: 9.5px; color: var(--muted); }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { text-align: left; padding: 11px 14px; font-size: 8.5px; font-weight: 600; color: var(--muted-2); letter-spacing: .06em; background: #fbfdfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #edf2ef; font-size: 10.5px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; font-size: 9px; color: var(--muted-2); border-top: 1px solid var(--line); }
.row-title { font-size: 10.5px; font-weight: 550; color: var(--ink); }
.row-sub { font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.table-actions { display: flex; justify-content: flex-end; gap: 2px; }
.table-action { display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; border-radius: 5px; padding: 5px 6px; font-size: 9px; color: var(--muted); }
.table-action .icon { width: 12px; height: 12px; }
.table-action:hover { background: var(--brand-soft); color: var(--brand); }
.table-action.danger:hover { background: var(--red-soft); color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px; border-radius: 5px; font-size: 8.5px; color: var(--muted); background: #f3f6f4; white-space: nowrap; }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.no-dot::before { display: none; }
.badge-green { background: var(--brand-soft); color: var(--brand); }
.badge-amber { background: var(--amber-soft); color: var(--amber-deep); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-gray { background: #f2f5f3; color: var(--muted); }
.progress-wrap { display: flex; align-items: center; gap: 7px; }
.progress { width: 82px; height: 5px; border-radius: 4px; background: #edf2ef; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.progress.amber i { background: var(--amber); }
.progress.red i { background: var(--red); }
.progress-wrap span { font-size: 9px; color: var(--muted); white-space: nowrap; }
.empty { padding: 48px 24px; text-align: center; }
.empty-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty-icon .icon { width: 22px; height: 22px; }
.empty b { display: block; font-size: 12px; font-weight: 550; }
.empty p { margin: 5px 0 14px; font-size: 10px; color: var(--muted); }
.loading-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef4f0 25%, #f8fbf9 50%, #eef4f0 75%); background-size: 200% 100%; animation: skeleton 1.3s infinite; margin-bottom: 12px; }
.skeleton-line.short { width: 30%; } .skeleton-line { width: 100%; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Dashboard ---------- */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dash-hero h1 { margin: 8px 0 0; font-size: 28px; letter-spacing: -.045em; font-weight: 650; }
.dash-hero p { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.dash-hero p b { color: var(--brand); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { position: relative; overflow: hidden; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -35px; bottom: -45px; border-radius: 50%; background: radial-gradient(circle, var(--brand-soft), transparent 70%); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 9.5px; color: var(--muted); }
.stat-ico { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat-ico .icon { width: 15px; height: 15px; }
.stat-value { margin-top: 12px; font-size: 30px; line-height: 1; font-weight: 600; letter-spacing: -.05em; }
.stat-value small { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat-foot { display: flex; align-items: center; gap: 5px; margin-top: 11px; font-size: 8.5px; color: var(--muted); }
.stat-foot b { color: var(--brand); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); gap: 14px; margin-bottom: 14px; }
.dash-grid-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, .8fr); gap: 14px; }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dash-card-body { padding: 17px 18px 19px; }
.building-bars { display: flex; flex-direction: column; gap: 15px; margin-top: 18px; }
.building-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 46px; align-items: center; gap: 12px; }
.building-row b { font-size: 10.5px; font-weight: 550; }
.building-row .bar { height: 8px; border-radius: 5px; background: #eef3f0; overflow: hidden; }
.building-row .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2b9b8c, #1b7566); }
.building-row span { font-size: 9px; color: var(--muted); text-align: right; }
.donut-wrap { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.donut { position: relative; width: 118px; height: 118px; flex: 0 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-label b { font-size: 23px; font-weight: 600; letter-spacing: -.04em; }
.donut-label span { font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--muted); }
.legend-item i { width: 7px; height: 7px; border-radius: 2px; }
.legend-item b { margin-left: auto; color: var(--ink-2); font-weight: 550; padding-left: 10px; }
.dept-list { display: flex; flex-direction: column; gap: 13px; margin-top: 18px; }
.dept-row { display: grid; grid-template-columns: 55px minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.dept-row span { font-size: 9.5px; color: var(--muted); }
.dept-row .track { height: 6px; border-radius: 4px; background: #f0f4f2; overflow: hidden; }
.dept-row .track i { display: block; height: 100%; border-radius: 4px; background: #9abfb4; }
.dept-row b { text-align: right; font-size: 9px; color: var(--muted); font-weight: 500; }
.recent-list { display: flex; flex-direction: column; margin-top: 10px; }
.recent-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eff4f1; }
.recent-item:last-child { border-bottom: 0; }
.recent-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-top: 5px; flex: 0 0 auto; }
.recent-item b { display: block; font-size: 10px; font-weight: 550; }
.recent-item span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.recent-item time { margin-left: auto; font-size: 8px; color: var(--muted-2); white-space: nowrap; }
.quick-links { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.quick-link { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; border: 0; text-align: left; }
.quick-link:hover { background: var(--brand-soft); }
.quick-link .icon { width: 14px; height: 14px; color: var(--brand); }
.quick-link b { display: block; font-size: 9.5px; font-weight: 550; }
.quick-link span { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.room-mini-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.room-mini { display: flex; align-items: center; gap: 9px; }
.room-mini .room-tag { width: 40px; height: 29px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 8px; line-height: 1.2; }
.room-mini .room-tag b { font-size: 9px; }
.room-mini-info { flex: 1; min-width: 0; }
.room-mini-info b { display: block; font-size: 9.5px; font-weight: 550; }
.room-mini-info span { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.room-mini > span { font-size: 8.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Employees ---------- */
.employee-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.employee-cell .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 10px; overflow: hidden; }
.employee-cell .avatar img { width: 100%; height: 100%; object-fit: cover; }
.employee-cell b { display: block; font-size: 10.5px; font-weight: 550; }
.employee-cell span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.contact-cell b { display: block; font-size: 10px; font-weight: 500; }
.contact-cell span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.id-chip { font-family: var(--mono); font-size: 8.5px; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.room-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 9px; white-space: nowrap; }
.room-chip.empty-chip { background: var(--amber-soft); color: var(--amber-deep); }
.room-chip .icon { width: 11px; height: 11px; }

/* ---------- Dorms ---------- */
.dorm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.dorm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: .2s; }
.dorm-card:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -30px rgba(10,55,46,.42); border-color: #cadcd5; }
.dorm-card-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
.dorm-identity { display: flex; gap: 10px; align-items: center; }
.dorm-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.dorm-icon .icon { width: 19px; height: 19px; }
.dorm-identity h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; font-weight: 600; }
.dorm-identity p { margin: 3px 0 0; font-size: 8.5px; color: var(--muted); }
.dorm-card-body { padding: 0 16px 14px; }
.dorm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 13px; }
.dorm-stat { padding: 8px; border-radius: 8px; background: #f7faf8; text-align: center; }
.dorm-stat b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.03em; }
.dorm-stat span { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.dorm-progress { margin-bottom: 13px; }
.dorm-progress-head { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--muted); margin-bottom: 5px; }
.dorm-progress-head b { color: var(--brand); font-weight: 600; }
.dorm-progress .progress { width: 100%; height: 6px; }
.dorm-card-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); background: #fcfefd; }
.dorm-card-foot > span { font-size: 8.5px; color: var(--muted); }
.dorm-card-actions { display: flex; gap: 2px; }

/* ---------- Bed layout ---------- */
.bed-layout-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bed-layout-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--muted); }
.legend-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.legend-pill.empty i { background: #d4dfda; }
.legend-pill.disabled i { background: #d9cfc9; }
.bunk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.drawer .bunk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.drawer .bed-card { min-height: 64px; padding: 9px; gap: 7px; }
.drawer .bed-card .bed-card-actions { display: none; }
.drawer .bed-card .bed-position { margin-left: auto; }
.bunk-pair { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.bunk-pair-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: #f8fbf9; border-bottom: 1px solid var(--line); }
.bunk-pair-head span { font-size: 8.5px; color: var(--muted); font-weight: 550; }
.bunk-pair-head em { font-style: normal; font-size: 8px; color: var(--muted-2); }
.bunk-stack { display: flex; flex-direction: column; }
.bed-card { position: relative; padding: 10px 11px; min-height: 67px; display: flex; align-items: center; gap: 9px; border-bottom: 1px dashed #e6eeea; background: #fff; }
.bed-card:last-child { border-bottom: 0; }
.bed-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #d6e3dc; }
.bed-card.occupied::before { background: var(--teal); }
.bed-card.disabled::before { background: #cbb8af; }
.bed-card.empty:hover { background: #fbfdfc; }
.bed-card .bed-avatar { width: 27px; height: 27px; border-radius: 7px; background: #eef4f1; color: #89a39a; display: grid; place-items: center; font-size: 8.5px; font-weight: 600; flex: 0 0 auto; }
.bed-card.occupied .bed-avatar { background: var(--teal-soft); color: var(--brand); }
.bed-card .bed-main { min-width: 0; flex: 1; }
.bed-card .bed-main b { display: block; font-size: 9.5px; font-weight: 550; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bed-card .bed-main span { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.bed-card .bed-main em { font-style: normal; color: var(--brand); }
.bed-position { font-size: 7.5px; color: var(--muted-2); background: #f2f6f3; border-radius: 4px; padding: 2px 5px; white-space: nowrap; }
.bed-card.occupied .bed-position { background: var(--teal-soft); color: var(--brand); }
.bed-card-actions { display: flex; gap: 0; }
.bed-card-actions .table-action { padding: 4px; }
.bed-card-actions .icon { width: 12px; height: 12px; }
.bed-empty-inline { font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.bed-config-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 14px; }
.bed-config-bar .select { width: 180px; }
.bed-config-bar .spacer { flex: 1; }
.room-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-summary .badge { height: 20px; }
.room-selector { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.room-pill { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 10px; font-size: 9px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.room-pill b { color: var(--ink); font-weight: 550; }
.room-pill small { font-size: 8px; color: var(--muted-2); }
.room-pill.active { background: var(--brand-soft); border-color: #bfd9d0; color: var(--brand); }
.room-pill.active b { color: var(--brand); }

/* ---------- Files ---------- */
.file-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.file-card-list { display: flex; flex-direction: column; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.file-item:last-child { border-bottom: 0; }
.file-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: 0 0 auto; }
.file-ico .icon { width: 16px; height: 16px; }
.file-ico.img { background: var(--brand-soft); color: var(--brand); }
.file-main { flex: 1; min-width: 0; }
.file-main b { display: block; font-size: 10.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-main span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 3px; }
.file-meta { display: flex; align-items: center; gap: 8px; }
.file-meta .badge { height: 18px; }
.file-size { font-size: 8.5px; color: var(--muted-2); white-space: nowrap; }
.file-actions { display: flex; gap: 2px; }
.upload-zone { border: 1.5px dashed #c7d9d2; border-radius: 12px; padding: 26px 20px; text-align: center; background: #fbfdfc; cursor: pointer; transition: .18s; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--teal); background: var(--teal-soft); }
.upload-zone .upload-ico { width: 44px; height: 44px; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 10px; color: var(--brand); }
.upload-zone .upload-ico .icon { width: 19px; height: 19px; }
.upload-zone b { display: block; font-size: 11px; font-weight: 550; }
.upload-zone span { display: block; margin-top: 4px; font-size: 9px; color: var(--muted); }
.upload-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdfc; margin-top: 10px; }
.upload-file .icon { color: var(--brand); }
.upload-file b { font-size: 10px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-file span { font-size: 8.5px; color: var(--muted); margin-left: auto; }
.upload-file button { border: 0; background: none; color: var(--muted); padding: 2px; }

/* ---------- Modal / Drawer / Toast ---------- */
.modal-overlay, .drawer-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5, 31, 25, .38); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s ease; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: hidden; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn .22s ease; display: flex; flex-direction: column; }
.modal-lg { width: min(850px, 100%); }
.modal-head { padding: 20px 22px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; font-weight: 600; }
.modal-head p { margin: 5px 0 0; font-size: 10px; color: var(--muted); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 13px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fcfefd; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 10px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-field label em { color: var(--red); font-style: normal; }
.form-field .input, .form-field .select, .form-field .textarea { font-size: 11px; }
.form-field .input, .form-field .select { height: 38px; }
.hint { margin-top: 5px; font-size: 8.5px; color: var(--muted-2); line-height: 1.5; }
.info-box, .hint-box { display: flex; gap: 8px; border-radius: 9px; padding: 10px 12px; font-size: 9.5px; line-height: 1.6; }
.info-box { background: var(--brand-soft); color: var(--brand); }
.hint-box { background: var(--amber-soft); color: var(--amber-deep); }
.info-box .icon, .hint-box .icon { width: 14px; height: 14px; margin-top: 1px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { width: min(470px, 100%); height: 100%; background: #f7faf8; box-shadow: -20px 0 60px -25px rgba(4, 35, 28, .5); animation: drawerIn .24s ease; display: flex; flex-direction: column; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 21px 22px 16px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.drawer-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.drawer-head p { margin: 5px 0 0; font-size: 9.5px; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 26px; }
.drawer-section { margin-bottom: 14px; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.drawer-section-title span { font-weight: 600; color: var(--ink-2); }
.drawer-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.profile-card { display: flex; align-items: center; gap: 13px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.profile-card .avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 17px; }
.profile-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.profile-card p { margin: 4px 0 0; font-size: 9.5px; color: var(--muted); }
.kv-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv { background: #fff; padding: 10px 12px; min-width: 0; }
.kv.wide { grid-column: 1 / -1; }
.kv span { display: block; font-size: 8.5px; color: var(--muted-2); }
.kv b { display: block; margin-top: 3px; font-size: 10px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }
.drawer-foot { padding: 12px 18px; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 220px; max-width: 360px; padding: 11px 13px; border-radius: 9px; background: #123e35; color: #f3f8f5; font-size: 10.5px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: flex-start; animation: toastIn .22s ease; }
.toast .icon { width: 14px; height: 14px; margin-top: 1px; color: #9cd7c5; }
.toast.error { background: #6c2c26; }
.toast.error .icon { color: #f0b4aa; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.assignment-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.assignment-row { display: grid; grid-template-columns: 1fr 1fr 26px; gap: 7px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; }
.line-remove { width: 26px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--muted); display: grid; place-items: center; }
.line-remove:hover { color: var(--red); border-color: #edcfc9; background: var(--red-soft); }
.line-remove .icon { width: 13px; height: 13px; }

/* ---------- Misc ---------- */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.text-btn { border: 0; background: none; color: var(--brand); font-size: 9px; padding: 0; }
.inline-actions { display: flex; align-items: center; gap: 6px; }
.empty-list { padding: 25px 12px; text-align: center; color: var(--muted); font-size: 9.5px; }
.assignment-history { display: flex; flex-direction: column; gap: 0; }
.history-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 4px; flex: 0 0 auto; }
.history-item b { display: block; font-size: 9.5px; font-weight: 550; }
.history-item span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Scan check-in ---------- */
.scan-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; align-items: start; }
.qr-panel { position: sticky; top: 84px; padding-bottom: 16px; }
.qr-frame { margin: 15px 17px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; padding: 16px 12px 13px; }
.qr-image { width: 100%; max-width: 230px; aspect-ratio: 1; display: block; margin: 0 auto 10px; border-radius: 5px; }
.qr-frame b { display: block; font-size: 12px; letter-spacing: .06em; color: var(--brand); font-weight: 600; }
.qr-frame span { display: block; margin-top: 3px; font-size: 9px; color: var(--muted); letter-spacing: .12em; }
.qr-url { display: flex; align-items: center; gap: 5px; margin: 0 17px; padding: 7px 8px; background: #f5f9f7; border: 1px solid var(--line); border-radius: 7px; }
.qr-url span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 8px; color: var(--muted); }
.qr-url .icon-btn { width: 24px; height: 24px; flex: 0 0 auto; }
.qr-url .icon-btn .icon { width: 12px; height: 12px; }
.qr-tip { margin: 11px 17px 0; font-size: 9px; line-height: 1.75; color: var(--muted); }
.qr-actions { display: flex; gap: 7px; margin: 14px 17px 0; }
.qr-actions .btn { flex: 1; }
.scan-list { min-width: 0; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head, .summary-strip, .scan-list, .sidebar-mask { display: none !important; }
  .shell { margin: 0 !important; }
  .page { padding: 0; max-width: none; }
  .scan-layout { display: block; }
  .qr-panel { position: static; border: 0; box-shadow: none; width: 330px; margin: 30px auto; }
  .qr-actions { display: none; }
  .qr-image { max-width: 280px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-wide { grid-template-columns: 1fr 1fr; }
  .dash-grid-wide > :last-child { grid-column: 1 / -1; }
  .dorm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bunk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  #login-view { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-wrap { min-height: 100vh; padding: 26px; }
  .login-mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-mask { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(4,25,21,.4); opacity: 0; visibility: hidden; transition: .25s; }
  body.sidebar-open .sidebar-mask { opacity: 1; visibility: visible; }
  .shell { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 0 16px; height: 62px; }
  .page { padding: 22px 16px 34px; }
  .topbar-date { display: none; }
  .global-search { width: 170px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-wide { grid-template-columns: 1fr; }
  .dash-grid-wide > :last-child { grid-column: auto; }
  .dorm-grid { grid-template-columns: 1fr; }
  .scan-layout { grid-template-columns: 1fr; }
  .qr-panel { position: static; }
}
@media (max-width: 700px) {
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-mini .mini-extra { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 26px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .global-search { width: 140px; }
  .global-search kbd { display: none; }
  .user-menu-copy { display: none; }
  .bunk-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar .search-field { width: 100%; }
  .filter-bar .select { flex: 1; min-width: 90px; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero h1 { font-size: 24px; }
  .dash-hero .page-actions { width: 100%; }
  .dash-hero .page-actions .btn { flex: 1; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-right { width: 100%; }
  .segmented { overflow-x: auto; max-width: 100%; }
  .filter-result { margin-left: 0; }
  .file-item { align-items: flex-start; flex-wrap: wrap; }
  .file-meta { width: 100%; padding-left: 48px; }
  .file-actions { margin-left: auto; }
  .bed-config-bar .select { width: 100%; }
  .bed-config-bar .spacer { display: none; }
  .bed-config-bar .btn { flex: 1; }
}
@media (max-width: 430px) {
  .summary-strip { grid-template-columns: 1fr; }
  .global-search { display: none; }
  .topbar-right { gap: 8px; }
  .login-form-inner h2 { font-size: 28px; }
}
