/* 少林俱乐部 · 学员管理系统 · Design V8「墨与朱砂」
   手写 CSS、无编译链。design-v8/ 是视觉依据，本文件是唯一运行样式。 */

:root {
    --ink: #12100d;
    --ink-soft: #1f1b16;
    --paper: #f4eee1;
    --paper-deep: #eae2cf;
    --card: #fdfbf5;
    --line: rgba(18, 16, 13, .13);
    --muted: #8a8276;
    --red: #4a0710;
    --red-d: #33050b;
    --red-bright: #a83a45;
    --gold: #d9a13c;
    --imperial: #d9a13c;
    --danger: #b3261e;
    --ok: #2f6d62;
    --sb: #12100d;
    --sb-soft: #221e18;
    --sb-text: #cfc7b8;
    --sb-mut: #82796b;
    --shadow: 0 1px 2px rgba(18, 16, 13, .05), 0 6px 22px rgba(18, 16, 13, .05);
    --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
    --font-ui: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "SimHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    font-size: 14px;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
::selection { background: var(--red); color: var(--paper); }

/* 图标 */
.ico { width: 17px; height: 17px; flex: none; vertical-align: -3px; stroke-width: 1.7; }
.ico.sm { width: 14px; height: 14px; }

/* ============ 侧边栏 ============ */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 40;
    background: var(--sb); color: var(--sb-text);
    display: flex; flex-direction: column;
    transition: width .2s ease, transform .25s ease;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px 16px; color: var(--paper);
    border-bottom: 1px solid rgba(244, 238, 225, .08);
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; flex: none; object-fit: contain; }
.seal {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    background: var(--red); color: #fff; font-weight: 800; font-size: 19px;
    display: grid; place-items: center;
    box-shadow: 0 3px 10px rgba(154,47,31,.4);
}
.brand-text { font-family: var(--font-serif); font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: .08em; }
.brand .brand-text > span { display: block; white-space: nowrap; }
.brand-text small { display: block; margin-top: 2px; color: var(--sb-mut); font-family: var(--font-ui); font-size: 11px; font-weight: 400; letter-spacing: .08em; white-space: nowrap; }

.side-nav { flex: 1; overflow-y: auto; padding: 14px 0; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; color: var(--sb-text); font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sb-soft); color: var(--paper); text-decoration: none; }
.nav-item.on { background: var(--red); color: var(--paper); }
.nav-item.on:hover { background: var(--red-d); }
.nav-item .ico { opacity: .85; }
.nav-sep { margin: 12px 20px 6px; display: flex; align-items: center; gap: 8px; color: var(--sb-mut); font-size: 10px; letter-spacing: .28em; }
.nav-sep::after { content: ""; flex: 1; height: 1px; background: rgba(244, 238, 225, .08); }
.kid-switch { padding: 6px 14px 11px; border-bottom: 1px solid rgba(244,238,225,.06); }
.kid-switch-label { margin-bottom: 6px; color: var(--sb-mut); font-size: 11.5px; }
.kid-switch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.kid-switch-item { min-width: 0; padding: 5px 7px; border: 1px solid rgba(244,238,225,.1); color: var(--sb-text); background: var(--sb-soft); line-height: 1.25; }
.kid-switch-item:hover { border-color: rgba(244,238,225,.24); color: var(--paper); text-decoration: none; }
.kid-switch-item.on { border-color: var(--red); background: var(--red); color: var(--paper); }
.kid-switch-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.kid-switch-item small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; color: var(--sb-mut); font-size: 9.5px; white-space: nowrap; }
.kid-switch-item.on small { color: rgba(244,238,225,.65); }

.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(244,238,225,.08); }
.lang-row { display: flex; align-items: center; gap: 9px; padding: 2px 6px 10px; margin-bottom: 8px; border-bottom: 1px solid rgba(244,238,225,.06); color: var(--sb-mut); font-size: 12px; }
.lang-row a { color: var(--sb-mut); }
.lang-row a.on { color: var(--imperial); font-weight: 700; }
.legal-row { padding: 0 12px 8px; font-size: 12px; }
.legal-row a { color: var(--sb-mut); }
.legal-row a:hover { color: #fff; }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 0 6px; }
.who-row .who { color: var(--paper); font-size: 13px; font-weight: 600; }
.who-row .logout { display: inline-flex; align-items: center; gap: 6px; color: var(--sb-mut); font-size: 12px; padding: 6px 10px; }
.who-row .logout:hover { background: var(--sb-soft); color: var(--paper); text-decoration: none; }

/* 移动端顶栏 + 抽屉遮罩（桌面隐藏） */
.topbar-m { display: none; }
.backdrop { display: none; }
.nav-toggle { display: none; }
.sidebar-compact-toggle {
    flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 10px;
    width: 100%; min-height: 44px; padding: 0 20px;
    border: 0; border-top: 1px solid rgba(244,238,225,.08);
    background: var(--sb); color: var(--sb-mut); font-family: var(--font-ui); font-size: 12.5px;
    cursor: pointer; transition: background .15s, color .15s;
}
.sidebar-compact-toggle:hover { background: var(--sb-soft); color: var(--paper); }
.sidebar-compact-toggle:focus-visible { outline: 2px solid var(--imperial); outline-offset: -3px; }
.sidebar-compact-toggle .ico { width: 14px; height: 14px; transition: transform .2s ease; }
.sidebar-compact-label { white-space: nowrap; }

/* ============ 内容区 ============ */
.content { margin-left: 236px; padding: 30px 34px 64px; min-height: 100vh; transition: margin-left .2s ease; }
.content-guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.content-guest:has(.login-stage) { display: block; place-items: normal; padding: 0; }
.content-public { min-height: 100vh; padding: 28px 18px 48px; }

.page-title { font-family: var(--font-serif); font-size: 22px; line-height: 1.35; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .page-title { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.class-list-actions { justify-content: flex-end; flex-wrap: nowrap; }
.class-list-actions .btn { white-space: nowrap; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.right { text-align: right; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 13px; }

/* 栅格 */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 统计卡 */
.stat { display: block; padding: 18px 20px 16px; border-top: 2px solid var(--ink); }
.stat-ico { display: none; }
.stat-label { display: block; color: var(--muted); font-size: 12.5px; }
.stat-num { display: inline-block; margin-top: 2px; font-size: 25px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat.is-accent { border-top-color: var(--red); }
.stat.is-accent .stat-num { color: var(--red); }
.linkcard { display: block; padding: 18px 20px; }
.linkcard:hover { border-color: rgba(74,7,16,.38); background: var(--paper-deep); text-decoration: none; }

/* 家长端首页 */
.portal-hero {
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    padding: 20px 22px; margin-bottom: 16px;
}
.portal-kicker { margin: 0 0 4px; font-size: 12px; }
.portal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.portal-meta span { padding: 2px 9px; background: var(--paper-deep); }
.child-switch-panel { min-width: 210px; text-align: right; }
.child-switch-list { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.child-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 11px; border: 1px solid var(--line); color: var(--ink); background: #fff; }
.child-chip:hover { text-decoration: none; border-color: rgba(74,7,16,.38); }
.child-chip.on { color: var(--paper); background: var(--red); border-color: var(--red); }
.debt-card { border-left: 3px solid var(--danger); background: #f7e9e6; margin-bottom: 14px; color: var(--red); }
.portal-stats { margin-bottom: 16px; }
.portal-stats .stat { color: var(--ink); text-decoration: none; min-height: 108px; }
.portal-stats .stat:hover { border-color: rgba(74,7,16,.38); background: #fff; }
.portal-overview { margin-bottom: 16px; }
.portal-next-card {
    display: grid; grid-template-columns: 5px 1fr; gap: 14px; min-height: 116px;
    padding: 16px; border: 1px solid var(--line); background: #fff;
}
.portal-next-accent { background: var(--red); }
.portal-next-body { display: grid; gap: 5px; align-content: center; min-width: 0; }
.portal-next-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.portal-next-meta span { padding: 1px 8px; border: 1px solid var(--line); background: var(--paper); }
.portal-next-time { font-size: 28px; font-weight: 800; line-height: 1.12; color: var(--ink); }
.portal-next-class { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.portal-next-location { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.portal-balance-list { display: grid; gap: 9px; }
.portal-balance-list div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #f0ebe2; }
.portal-balance-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.portal-actions-card .page-head { margin-bottom: 8px; }
.portal-actions .linkcard {
    display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line);
    color: var(--ink); background: #fff; box-shadow: none;
}
.portal-actions .linkcard .ico { color: var(--red); margin-top: 2px; }
.portal-actions .linkcard span { display: grid; gap: 2px; }
.portal-actions .linkcard small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.parent-account-summary { margin-bottom: 8px; }
.sibling-list-label { margin-top: 9px; color: var(--muted); font-size: 12px; }
.sibling-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.sibling-list a { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.sibling-list a:hover { border-color: rgba(74,7,16,.38); background: var(--paper-deep); text-decoration: none; }
.sibling-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sibling-list a small { color: var(--muted); font-size: 10.5px; }
.form-grid.feedback-meta { grid-template-columns: minmax(220px, 1fr) auto; align-items: end; margin-bottom: 12px; }
.feedback-anonymous { display: inline-flex !important; align-items: center; justify-self: start; gap: 8px; min-height: 38px; }
.feedback-anonymous input { flex: 0 0 18px; width: 18px !important; height: 18px; margin: 0; accent-color: var(--red); }
.feedback-anonymous > span { display: inline !important; margin: 0 !important; color: var(--ink) !important; font-size: 13px !important; white-space: nowrap; }
.makeup-request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.makeup-request-actions > form { display: flex; align-items: stretch; margin: 0; }
.makeup-request-actions > form > .btn { min-height: 40px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; font-family: var(--font-ui); font-size: 13.5px;
    border: 1px solid #b9ae99; background: #fff; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--paper-deep); border-color: #9a8f7a; text-decoration: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn-primary:hover { background: var(--red-d); border-color: var(--red-d); color: var(--paper); }
.btn-danger { border-color: rgba(179,38,30,.4); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: #f7e9e6; color: var(--danger); }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1da851; }
.btn-wa .ico { stroke: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 4px 11px; font-size: 12.5px; gap: 5px; }
.btn-sm .ico { width: 13px; height: 13px; }
button:disabled, .btn:disabled, .btn.disabled, button.is-busy { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* 表单 */
.form-card { padding: 26px; }
/* 表单控件基线（:where 零特指度：让工具栏/页头里的「裸」输入框也有统一外观，而具体容器规则仍可覆盖） */
:where(input[type=date], input[type=time], input[type=month], input[type=text], input[type=number],
       input[type=search], input[type=email], input[type=tel], input[type=password], select, textarea) {
    font-family: var(--font-ui); font-size: 14px; padding: 8px 12px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); vertical-align: middle;
}
:where(input[type=date], input[type=time], input[type=month], input[type=text], input[type=number],
       input[type=search], input[type=email], input[type=tel], input[type=password], select) {
    height: 40px; min-height: 40px; line-height: 1.2; border-radius: 0;
}
/* Safari/iOS 的原生 select 会使用独立控件高度；使用单个下箭头并确保与 input 等高。 */
:where(select) {
    -webkit-appearance: none; appearance: none;
    padding-right: 34px !important;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f675d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-size: 16px 16px;
    background-repeat: no-repeat;
}

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid label, .form-card label { display: block; }
.form-grid span, .form-card label > span { display: block; font-size: 13px; color: #5c554c; margin-bottom: 5px; }
.form-grid input, .form-grid select, .form-card input, .form-card select {
    width: 100%; height: 42px; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); font-size: 14px; background-color: #fff; color: var(--ink); }
.form-grid input:focus, .form-grid select:focus, .form-card input:focus, input:focus, select:focus {
    outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(74,7,16,.12); }
.student-remark-field textarea, .student-remark-form textarea { width: 100%; min-height: 96px; resize: vertical; }
.phone-input-row { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(0, 1.2fr); gap: 8px; align-items: start; }
.phone-region-control { display: grid; gap: 6px; }
.phone-region-control [hidden] { display: none !important; }
.phone-field-label { display: block; font-size: 13px; color: #5c554c; margin-bottom: 5px; }
.phone-field .err { display: block; margin-top: 4px; }
.phone-region-list { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.phone-region-row { display: grid; grid-template-columns: 90px minmax(140px, 1fr) minmax(140px, 1fr) 60px 60px 38px; gap: 8px; align-items: center; min-width: 670px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.phone-region-head { color: var(--muted); font-size: 12px; font-weight: 700; }
.phone-region-head span { margin: 0; color: inherit; font-size: inherit; text-align: center; }
.phone-region-head span:nth-child(-n+3) { text-align: left; }
.phone-region-row input { min-width: 0; }
.phone-region-toggle { display: grid !important; place-items: center; margin: 0; }
.phone-region-toggle input { width: 18px !important; height: 18px !important; min-height: 18px !important; margin: 0; accent-color: var(--red); }
.phone-region-remove { justify-self: center; }
.phone-region-add { margin-top: 10px; }
.field-block > span { display: block; font-size: 13px; color: #5c554c; margin-bottom: 5px; }
.field-block textarea { width: 100%; min-height: 86px; resize: vertical; }
.form-sub { font-size: 14px; font-weight: 700; margin: 22px 0 12px; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.form-actions .btn { height: 40px; justify-content: center; }
.err { color: var(--danger); font-size: 12px; font-style: normal; }
.alert { background: #f7e9e6; border: 1px solid #e3c0b8; color: var(--red); padding: 10px 13px; font-size: 13.5px; margin-bottom: 14px; }

/* 搜索/筛选 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { padding: 8px 12px; font-size: 14px; border: 1px solid var(--line); }

/* 键值表 / 内联表单 / 开关 */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.inline-form { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.inline-form select, .inline-form input { padding: 8px 12px; border: 1px solid var(--line); }
.branch-switch-form { display: inline; margin: 0; }
.branch-switch-form:not(.branch-switch-all-form) button { padding: 0; border: 0; background: transparent; color: var(--red); font: inherit; cursor: pointer; }
.branch-switch-form:not(.branch-switch-all-form) button:hover, .branch-switch-form:not(.branch-switch-all-form) button:focus-visible { text-decoration: underline; }
.branch-switch-all-form { display: block; }
.branch-required-card { display: flex; align-items: flex-start; gap: 18px; max-width: 720px; padding: 28px; }
.branch-required-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; color: var(--red); background: #f7e9e6; border-radius: 50%; }
.branch-required-card h2 { margin: 0 0 8px; font-size: 20px; }
.branch-required-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.65; }
@media (max-width: 680px) {
    .branch-required-card { gap: 12px; padding: 20px; }
    .branch-required-icon { width: 42px; height: 42px; }
}
.payment-net-preview { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; color: var(--red); font-size: 13px; font-weight: 700; white-space: nowrap; }
.payment-net-preview.is-invalid { color: var(--danger); }
.item-sale-summary { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.inline-edit { display: inline-block; margin-left: 8px; }
.inline-edit > summary { cursor: pointer; color: var(--red); font-size: 12px; list-style: none; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--red); }

/* 出勤开关：勾选=到课，未勾选=缺勤 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #c9bfb1; transition: background .15s; flex: none; }
.switch .switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch-track { background: #3f9d56; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch .switch-text::after { content: attr(data-off); color: var(--muted); font-size: 13px; }
.switch input:checked ~ .switch-text::after { content: attr(data-on); color: #2f7d44; }
.switch .switch-label { font-size: 14px; color: var(--ink); }
.hours-input { width: 76px; text-align: center; }
.attendance-status-options { display: inline-grid; grid-template-columns: repeat(3, max-content); border: 1px solid var(--line); }
.attendance-status-choice { cursor: pointer; user-select: none; }
.attendance-status-choice + .attendance-status-choice { border-left: 1px solid var(--line); }
.attendance-status-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.attendance-status-choice span { display: block; min-width: 58px; padding: 7px 10px; text-align: center; color: var(--muted); background: #fff; font-size: 13px; }
.attendance-status-choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -2px; }
.attendance-status-choice input:disabled + span { cursor: not-allowed; opacity: .45; }
.attendance-status-choice.is-neutral input:checked + span { background: var(--paper-deep); color: var(--ink); font-weight: 700; }
.attendance-status-choice.is-present input:checked + span { background: #e2ece5; color: var(--ok); font-weight: 700; }
.attendance-status-choice.is-absent input:checked + span { background: #f7e9e6; color: var(--danger); font-weight: 700; }
.attendance-duplicate-warning { display: grid; gap: 2px; margin-top: 6px; color: #8a5a00; font-size: 12px; font-weight: 400; }
.attendance-duplicate-warning span { white-space: normal; }
.attendance-duplicate-confirm { display: flex; align-items: flex-start; gap: 5px; margin-top: 7px; max-width: 210px; color: #8a5a00; font-size: 12px; font-weight: 400; }
.attendance-duplicate-confirm input { width: 16px; height: 16px; flex: none; accent-color: var(--red); }
.table tr.attendance-row-error > td { background: #fff3f0; }
.coursehour-deduct-box { margin-top: 16px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coursehour-deduct-box .card-title { margin: 0 0 8px; }
.coursehour-deduct-box .inline-form { align-items: end; margin: 0; }
.coursehour-deduct-box label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.coursehour-deduct-box label span { line-height: 1.2; }
.coursehour-deduct-box input[type="number"] { width: 86px; }
.coursehour-deduct-note { flex: 1 1 180px; }
.coursehour-deduct-note input { width: 100%; }

/* 弹窗（原生 dialog） */
dialog.dlg { border: 1px solid var(--line); padding: 0; max-width: 560px; width: 92%; box-shadow: 0 24px 64px rgba(0,0,0,.32); }
dialog.dlg .form-card { margin: 0; }
dialog.dlg::backdrop { background: rgba(20,12,8,.45); }

/* Excel 式出勤统计表 */
.grid-wrap { overflow-x: auto; padding: 0; }
.grid-table { font-size: 12px; white-space: nowrap; border-collapse: collapse; }
.grid-table th, .grid-table td { padding: 5px 6px; text-align: center; border: 1px solid var(--line); }
.grid-table .g-sticky { position: sticky; left: 0; background: #fff; text-align: left; z-index: 1; min-width: 92px; }
.grid-table thead .g-sticky { background: var(--paper-deep); }
.grid-table .g-day { width: 26px; min-width: 26px; }
.grid-table .g-num { width: 46px; min-width: 46px; font-weight: 600; }
.grid-table .g-wd { color: var(--muted); font-size: 10px; }
.grid-table .g-weekend { background: #faf6ef; }
.grid-table .g-on { color: #2f7d44; font-weight: 600; }
.grid-table .g-ab { color: var(--red); font-weight: 700; }
.grid-table .g-ab-miss { background: #fceceb; }                       /* 缺课未补：红底凸显 */
.grid-table .g-ab-done { background: #e6f3ea; color: #2f7d44; }       /* 缺课已补：绿底 */
.grid-table .g-mk { color: #2563aa; }

/* 表格（移动端横向滚动） */
.card > .table, .table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead { background: var(--paper-deep); color: #6b6355; text-align: left; }
.table th { font-weight: 600; font-size: 12.5px; }
.table th, .table td { padding: 11px 16px; }
.table tbody tr { border-top: 1px solid var(--line); }
.table tbody tr:hover { background: #f6f1e6; }
.table tbody tr.student-row-highlight,
.table tbody tr.student-row-highlight:hover { background: #f3dfb9; box-shadow: inset 4px 0 0 var(--red); }
.student-row-highlight { scroll-margin-top: 88px; }
.table .empty { text-align: center; color: var(--muted); padding: 44px; }
.table-sm th, .table-sm td { padding: 7px 12px; font-size: 12.5px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 含表格的卡片在窄屏可横向滚动，避免撑破布局 */
.card:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 工资表：行内编辑 + 计算说明 */
.info-pop { position: relative; display: inline-block; margin-right: 6px; vertical-align: middle; }
.info-pop > summary { list-style: none; padding-inline: 8px; }
.info-pop > summary::-webkit-details-marker { display: none; }
.info-pop-body {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
    width: min(460px, 78vw); padding: 12px 14px; border: 1px solid var(--line);
    background: #fff; box-shadow: 0 16px 36px rgba(35,32,28,.16);
    color: var(--ink); font-size: 12.5px; line-height: 1.75; text-align: left; white-space: normal;
}
.payroll-edit-row > td { background: #fbf8f2; padding-top: 0; }
.pay-edit > summary { cursor: pointer; color: var(--red); font-weight: 700; padding: 8px 0; }
.payroll-inline-form { display: grid; grid-template-columns: repeat(6, minmax(116px, 1fr)); gap: 10px; align-items: end; padding: 8px 0 12px; }
.payroll-inline-form label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.payroll-inline-form input, .payroll-inline-form select, .payroll-inline-form textarea { width: 100%; }
.payroll-inline-form .wide { grid-column: span 2; }

/* 徽章 */
.badge { display: inline-block; font-size: 11.5px; padding: 1px 8px; background: var(--paper-deep); color: #6b6355; margin-left: 6px; vertical-align: middle; }
.badge-on { background: var(--red); color: var(--paper); }
.badge-ok { background: #e2ece5; color: var(--ok); }
.badge-warn { background: #f3e6cf; color: #8a5a00; }
.student-status { display: inline-flex; align-items: center; min-height: 24px; }
.student-status.is-paused { padding: 3px 10px; background: var(--red); color: #fff; font-weight: 700; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }

.bookkeeping-section { margin: 0 0 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table-scroll { overflow-x: auto; }
.package-purchase-table .btn { white-space: nowrap; }
.page-summary { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

/* 收支登记工作台：业务命令只占一行，表单按需在弹窗中出现。 */
.bookkeeping-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); background: #fff; margin-bottom: 24px; }
.bookkeeping-actions > button { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 88px; padding: 15px 16px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.bookkeeping-actions > button:last-child { border-right: 0; }
.bookkeeping-actions > button:hover, .bookkeeping-actions > button:focus-visible { background: #f4f5f3; }
.bookkeeping-actions .ico { width: 24px; height: 24px; color: var(--red); }
.bookkeeping-actions span { display: grid; gap: 3px; min-width: 0; }
.bookkeeping-actions strong { font-size: 14px; }
.bookkeeping-actions small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.recent-ledger-section .section-head { margin-bottom: 9px; }
.form-grid .wide { grid-column: 1 / -1; }
.finance-filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.finance-filter-form label { display: flex; flex: 1 1 145px; flex-direction: column; gap: 3px; min-width: 0; font-size: 12.5px; }
.finance-filter-form input, .finance-filter-form select { width: 100%; min-width: 0; }
.ledger-table { min-width: 980px; }
.finance-summary-row { margin-bottom: 18px; }

/* V2 运营工作台：先处理今日履约，再处理异常队列，经营数据退居摘要。 */
.operations-head { align-items: center; }
.dashboard-quick-actions { flex-wrap: wrap; justify-content: flex-end; }
.operations-scope {
    display: flex; align-items: center; gap: 8px; margin-top: 5px;
    color: var(--muted); font-size: 12.5px;
}
.operations-scope span + span { padding-left: 8px; border-left: 1px solid var(--line); }
.operations-metrics {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 28px; border: 1px solid var(--line); background: #fff;
}
.operations-metric {
    min-width: 0; min-height: 92px; padding: 14px 17px;
    border-right: 1px solid var(--line); color: var(--ink);
}
.operations-metric:last-child { border-right: 0; }
.operations-metric:hover { background: #f5f7f6; text-decoration: none; }
.operations-metric span, .operations-metric small { display: block; color: var(--muted); font-size: 12px; }
.operations-metric strong {
    display: block; margin: 3px 0 1px; overflow-wrap: anywhere;
    font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.operations-metric.is-accent { border-top: 3px solid var(--red); padding-top: 12px; }
.operations-section { margin: 0 0 28px; border-top: 2px solid var(--ink); }
.operations-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.operations-section-head h2 { font-size: 15px; }
.operations-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.operations-empty { padding: 24px 0; color: var(--muted); }
.lesson-flow-list { background: #fff; }
.lesson-flow-row {
    display: grid; grid-template-columns: 76px minmax(180px, 1fr) 88px auto;
    align-items: center; gap: 14px; min-height: 70px; padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.lesson-flow-row:hover { background: #f5f7f6; }
.lesson-time { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.lesson-time small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.lesson-main { display: grid; min-width: 0; gap: 2px; }
.lesson-main strong { overflow-wrap: anywhere; font-size: 14px; }
.lesson-main span { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.lesson-status {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; padding: 3px 8px; border: 1px solid #c5c9c7;
    background: #f1f3f2; color: #4b5450; font-size: 11.5px; white-space: nowrap;
}
.lesson-status.is-partial { border-color: #c59b44; background: #fbf2df; color: #79530b; }
.lesson-status.is-done { border-color: #7eaaa0; background: #e5f0ed; color: var(--ok); }
.lesson-status.is-empty { border-color: #c8c3ba; background: #f4f1eb; color: var(--muted); }
.lesson-status.is-none { border-color: #d4cec4; background: #faf8f3; color: #756d62; }
.lesson-status.is-recorded { border-color: #7eaaa0; background: #e5f0ed; color: var(--ok); }
.lesson-status.is-no_members { border-color: #d4cec4; background: #f4f1eb; color: var(--muted); }
.dashboard-visual-grid {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 18px; margin: 0 0 28px;
}
.dashboard-chart-card { min-width: 0; padding: 16px; }
.dashboard-chart-card .section-head { align-items: flex-start; }
.dashboard-chart-card .text-link { flex: none; padding-top: 2px; color: var(--red); font-size: 12px; }
.chart-shell-dashboard { height: 248px; min-height: 248px; margin-top: 10px; }
.operations-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: stretch; gap: 28px; }
.operations-columns > .operations-section { display: flex; flex-direction: column; }
.action-queue, .compact-record-list { background: #fff; }
.action-queue-row, .compact-record-list > a {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    min-height: 58px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.operations-columns .action-queue, .operations-columns .compact-record-list { flex: 1 1 auto; min-height: 310px; }
.operations-columns .action-queue-row, .operations-columns .compact-record-list > a { height: 62px; min-height: 62px; }
.action-queue-row:hover, .compact-record-list > a:hover { background: #f5f7f6; text-decoration: none; }
.action-queue-row > span { display: grid; grid-template-columns: 18px auto; align-items: center; gap: 2px 9px; min-width: 0; }
.action-queue-row > span .ico { grid-row: 1 / span 2; color: var(--red); }
.action-queue-row strong, .compact-record-list strong { overflow-wrap: anywhere; font-size: 13px; }
.action-queue-row small, .compact-record-list small { display: block; color: var(--muted); font-size: 11px; }
.action-queue-row b, .compact-record-list b { flex: none; font-size: 16px; font-variant-numeric: tabular-nums; }
.compact-record-list > a > span { min-width: 0; }
.operations-table { min-width: 680px; }

@media (max-width: 980px) {
    .dashboard-visual-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
    .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-metric:nth-child(2) { border-right: 0; }
    .operations-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .operations-columns { grid-template-columns: 1fr; gap: 0; }
    .operations-columns .action-queue, .operations-columns .compact-record-list { min-height: 0; }
}

@media (max-width: 680px) {
    .dashboard-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .dashboard-quick-actions .btn { justify-content: center; min-width: 0; }
    .operations-metrics { grid-template-columns: 1fr; }
    .operations-metric, .operations-metric:nth-child(2) { min-height: 76px; border-right: 0; border-bottom: 1px solid var(--line); }
    .operations-metric:last-child { border-bottom: 0; }
    .dashboard-chart-card { padding: 12px; }
    .chart-shell-dashboard { height: 220px; min-height: 220px; }
    .lesson-flow-row { grid-template-columns: 62px minmax(0, 1fr); gap: 8px 12px; padding: 12px 8px; }
    .lesson-status { grid-column: 2; justify-self: start; }
    .operations-columns .action-queue-row, .operations-columns .compact-record-list > a { height: auto; min-height: 58px; }
    .lesson-flow-row > .btn { grid-column: 2; justify-self: start; }
}
.item-list-table { min-width: 820px; }
.item-row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; white-space: nowrap; }
.item-row-actions form { margin: 0; }
.dlg-wide { max-width: 940px !important; }
.item-manage-dialog { max-height: min(82vh, 760px); overflow: auto; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dialog-head .card-title { margin: 0 0 3px; }
.inventory-current-line { margin: 0 0 16px; padding: 10px 12px; background: var(--paper-deep); }
.inventory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.segmented-control { display: inline-grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); border: 1px solid var(--line); background: #fff; }
.segmented-control label { cursor: pointer; }
.segmented-control input {
    position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0;
    opacity: 0; pointer-events: none;
}
.segmented-control span { display: block; min-height: 38px; padding: 9px 14px; text-align: center; font-size: 13px; font-weight: 700; }
.segmented-control label + label span { border-left: 1px solid var(--line); }
.segmented-control input:checked + span { background: var(--ink); color: #fff; }
.segmented-control a { display: block; min-height: 38px; padding: 9px 14px; color: var(--muted); text-align: center; font-size: 13px; font-weight: 700; text-decoration: none; }
.segmented-control a + a { border-left: 1px solid var(--line); }
.segmented-control a.on { background: var(--ink); color: #fff; }
.item-row-actions { flex-wrap: nowrap; }
.inventory-progress { color: var(--muted); font-size: 13px; font-weight: 600; }
.inventory-bulk-table { min-width: 700px; }
.inventory-product-row th { padding: 12px 14px 8px; background: var(--paper-deep); color: var(--ink); text-align: left; }
.inventory-product-row th span { font-size: 14px; }
.inventory-product-row th small { margin-left: 10px; color: var(--muted); font-weight: 500; }
.inventory-variant-row td:first-child { padding-left: 26px; }
.inventory-quantity-input { width: 118px; text-align: right; }
.inventory-delta { display: inline-block; min-width: 44px; text-align: right; font-weight: 700; }
.inventory-submit-bar { position: sticky; bottom: 0; z-index: 8; display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-top: 0; background: rgba(250,248,243,.97); box-shadow: 0 -8px 20px rgba(35,32,28,.06); }
.inventory-submit-bar label { flex: 1 1 360px; max-width: 620px; }
.inventory-submit-bar label span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.inventory-submit-bar input { width: 100%; }
.inventory-change-hint { margin: 10px 0 0; font-size: 12px; }
.inventory-workspace-head { align-items: flex-end; }
.inventory-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: #fff; margin-bottom: 16px; }
.inventory-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 68px; padding: 15px 18px; border-right: 1px solid var(--line); }
.inventory-metrics > div:last-child { border-right: 0; }
.inventory-metrics span { color: var(--muted); font-size: 12px; }
.inventory-metrics strong { font-size: 25px; }
.workspace-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.workspace-tabs a { min-width: 128px; padding: 10px 16px; border-bottom: 3px solid transparent; color: var(--muted); text-align: center; font-size: 13px; font-weight: 700; }
.workspace-tabs a:hover { color: var(--ink); text-decoration: none; }
.workspace-tabs a.on { border-color: var(--red); color: var(--ink); }
.workspace-panel { margin-bottom: 22px; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.workspace-toolbar input[type="search"] { width: min(360px, 100%); }
.item-catalog-table { min-width: 820px; }
.item-catalog-table td:first-child { min-width: 170px; }
.item-catalog-table td:first-child small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.variant-preview { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.variant-preview span { padding: 2px 7px; background: #f0f1ef; color: #4a4d49; font-size: 11px; }
.stock-overview-table { min-width: 720px; }
.product-core-form { align-items: end; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.product-core-form .form-actions { margin: 0; align-self: end; }
.product-variant-head { margin: 18px 0 8px; }
.product-toggle-form, .variant-toggle-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.variant-toggle-form.form-card { margin: 0; padding: 0 24px 20px; border: 0; box-shadow: none; }
.dlg-inventory { width: calc(100% - 32px) !important; max-width: 1120px !important; }
.dlg-inventory .form-card { display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.inventory-dialog-table { flex: 1 1 auto; min-height: 0; max-height: 620px; overflow: auto; border: 1px solid var(--line); }
.dlg-inventory .dialog-head, .dlg-inventory .inventory-toolbar, .dlg-inventory .inventory-submit-bar { flex: 0 0 auto; }

/* 主从工作台：对象列表固定在左，详情和当前命令在右。 */
.content-workspace { height: 100dvh; padding: 16px; overflow: hidden; }
.master-detail-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; height: calc(100dvh - 32px); min-width: 0; }
.workspace-master, .workspace-detail { min-width: 0; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.workspace-master { display: flex; flex-direction: column; overflow: hidden; }
.workspace-detail { overflow: auto; overscroll-behavior: contain; }
.workspace-master-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.workspace-master-head > div:first-child { min-width: 0; }
.workspace-master-head .page-title { font-size: 19px; }
.workspace-count { color: var(--muted); font-size: 11.5px; }
.workspace-master-actions { flex-wrap: nowrap; }
.btn-icon { width: 38px; min-width: 38px; padding-inline: 0; justify-content: center; }
.workspace-filter { padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8f2; }
.workspace-search { position: relative; display: block; }
.workspace-search .ico { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; color: var(--muted); transform: translateY(-50%); }
.workspace-search input { width: 100%; padding-left: 34px; }
.workspace-filter-row { display: flex; gap: 6px; margin-top: 8px; }
.workspace-filter-row select { min-width: 0; flex: 1 1 0; padding: 7px 28px 7px 8px; font-size: 11.5px; }
.workspace-master-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.workspace-empty, .workspace-detail-empty { color: var(--muted); text-align: center; }
.workspace-empty { padding: 32px 18px; }
.workspace-detail-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; padding: 32px; }
.workspace-detail-empty .ico { width: 34px; height: 34px; margin-bottom: 12px; color: #b5ab9c; }
.workspace-detail-empty h2 { font-size: 17px; }
.workspace-detail-empty p { max-width: 360px; margin: 6px 0 0; font-size: 12.5px; }
.workspace-master-pager { display: flex; flex: 0 0 47px; align-items: center; justify-content: center; gap: 4px; min-height: 47px; padding: 9px 12px; overflow: hidden; border-top: 1px solid var(--line); }
.workspace-master-pager a { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid var(--line); color: var(--ink); font-size: 11.5px; }
.workspace-master-pager a.on { border-color: var(--red); background: var(--red); color: var(--paper); }
.workspace-master-pager > span { display: grid; place-items: center; width: 15px; color: var(--muted); }

/* 学员工作台。 */
.student-master-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 76px; padding: 9px 13px; border-bottom: 1px solid var(--line); color: var(--ink); }
.student-master-row:hover { background: #f5f1e8; text-decoration: none; }
.student-master-row.is-selected { background: #eee5d8; }
.student-master-row.is-selected::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }
.student-master-avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); background: #eee9df; color: var(--red); font-family: var(--font-serif); font-weight: 700; }
.student-master-main { display: grid; min-width: 0; gap: 6px; line-height: 1.35; }
.student-master-title { display: flex; align-items: baseline; min-width: 0; }
.student-master-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-master-main small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-master-meta { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 4px; }
.student-meta-pill { display: inline-flex; flex: 0 1 auto; align-items: center; min-width: 0; max-width: 100%; min-height: 20px; padding: 2px 6px; background: var(--paper-deep); color: #686158; font-size: 9.5px; line-height: 1.2; white-space: nowrap; }
.student-status.student-meta-pill { min-height: 20px; padding: 2px 7px; font-weight: 700; }
.student-status.student-meta-pill.is-active { background: #e2ece5; color: var(--ok); }
.student-status.student-meta-pill.is-paused { background: var(--red); color: #fff; }
.student-branch-pill { background: #e6edf1; color: #455660; }
.student-class-pill { flex: 1 1 70px; overflow: hidden; text-overflow: ellipsis; }
.student-master-state { display: grid; justify-items: center; line-height: 1.2; }
.student-master-state strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.student-master-state small { color: var(--muted); font-size: 9.5px; }
.student-balance-card { grid-template-rows: 20px 28px; width: 54px; min-height: 48px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.student-balance-card small { display: grid; place-items: center; width: 100%; border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.student-balance-card strong { display: grid; place-items: center; width: 100%; text-align: center; }
.student-workspace-detail[aria-busy="true"] { opacity: .58; pointer-events: none; }
.warn { color: #9b6800; }

.student-detail-shell { min-height: 100%; padding: 18px; }
.student-detail-header { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -18px -18px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(244,238,225,.97); backdrop-filter: blur(8px); }
.student-detail-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.student-detail-title-row { display: flex; align-items: center; gap: 9px; }
.student-detail-title-row h2 { font-family: var(--font-serif); font-size: 21px; line-height: 1.3; }
.student-detail-identity p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.workspace-mobile-back { display: none; }
.student-detail-actions { flex-wrap: nowrap; }
.action-menu { position: relative; }
.action-menu[open] { z-index: 50; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > div { position: absolute; z-index: 51; top: calc(100% + 6px); right: 0; min-width: 170px; padding: 6px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.menu-command { width: 100%; padding: 9px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.menu-command:hover { background: #f5f1e8; }
.student-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; gap: 14px; }
.student-detail-main, .student-detail-rail { display: grid; gap: 14px; min-width: 0; }
.student-detail-rail { position: sticky; top: 60px; }
.student-profile-card, .student-purchases-card, .student-transactions-card, .student-hours-card, .parent-account-card, .student-attention-card { min-width: 0; }
.student-profile-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.student-profile-kv > div { display: grid; min-width: 0; align-content: start; gap: 3px; min-height: 62px; padding: 9px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.student-profile-kv dt { color: var(--muted); font-size: 10.5px; }
.student-profile-kv dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.4; }
.student-remark-block, .student-note-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.student-remark-block .section-head, .student-purchases-card .section-head, .parent-account-card .section-head { margin-bottom: 8px; }
.student-remark-block p { margin: 0; white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; }
.student-card-subhead { margin: 0 0 10px; }
.student-note-list { display: grid; gap: 8px; }
.student-note-list > div { display: grid; gap: 2px; padding-left: 9px; border-left: 2px solid var(--line); font-size: 12px; }
.student-purchases-card .table, .student-transactions-card .table { min-width: 680px; }
.student-purchases-card td strong, .student-purchases-card td small { display: block; }
.student-balance-list { display: grid; border: 1px solid var(--line); }
.student-balance-list > div { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 5px; min-height: 50px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.student-balance-list > div:last-child { border-bottom: 0; }
.student-balance-list span, .student-balance-list small { color: var(--muted); font-size: 11px; }
.student-balance-list strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.student-balance-actions { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 6px; margin-top: 10px; }
.student-balance-actions .btn { min-width: 0; padding-inline: 7px; font-size: 11.5px; }
.compact-kv { grid-template-columns: 70px minmax(0, 1fr); margin-bottom: 10px; }
.parent-account-kv dd { display: flex; min-height: 22px; align-items: center; }
.parent-account-kv .badge { margin-left: 0; }
.compact-copy { margin: 0 0 10px; font-size: 12px; }
.guardian-compact, .sibling-compact { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.guardian-compact > span, .sibling-compact > span { color: var(--muted); font-size: 10.5px; }
.guardian-compact small { color: var(--muted); }
.sibling-compact { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.sibling-compact > span { width: 100%; }
.sibling-compact a { padding: 2px 6px; background: var(--paper-deep); font-size: 11px; }
.student-status-list { display: grid; gap: 10px; }
.student-status-list > div { display: grid; gap: 2px; }
.student-status-list span { color: var(--muted); font-size: 10.5px; }
.student-status-list strong { font-size: 11.5px; }
.stack-form { display: grid; gap: 10px; }
.stack-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.parent-bind-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; color: var(--muted); font-size: 12px; }
.parent-bind-divider::before, .parent-bind-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.dialog-secondary-action { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.coursehour-command-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.coursehour-command-grid > section { padding: 14px; border: 1px solid var(--line); }
.coursehour-command-grid h4 { margin-bottom: 10px; font-size: 13px; }
.coursehour-extend-form + .coursehour-extend-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.attendance-saved-state { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.attendance-coach-column { min-width: 96px; white-space: nowrap; }
.renewal-followup-actions { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 4px; white-space: nowrap; }

/* 点名工作台：左侧保留当天课节，右侧只处理当前名册。 */
.attendance-date-filter { position: relative; display: flex; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #faf8f2; }
.attendance-date-filter .ico { position: absolute; left: 25px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.attendance-date-filter input { width: 100%; padding-left: 35px; }
.attendance-closure { display: grid; gap: 2px; padding: 10px 14px; border-bottom: 1px solid #e8c9be; background: #fff1ec; color: var(--red); font-size: 11.5px; }
.attendance-slot-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 72px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.attendance-slot-entry { position: relative; border-bottom: 1px solid var(--line); }
.attendance-slot-entry .attendance-slot-row { border-bottom: 0; }
.attendance-slot-row:hover { background: #f5f1e8; text-decoration: none; }
.attendance-slot-row.is-selected { background: #eee5d8; }
.attendance-slot-row.is-selected::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }
.attendance-slot-main { display: grid; min-width: 0; gap: 3px; }
.attendance-slot-main strong, .attendance-slot-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attendance-slot-main small { color: var(--muted); font-size: 10.5px; }
.attendance-slot-row .lesson-status { min-width: 52px; padding-inline: 5px; font-size: 10px; }
.attendance-slot-shortcuts { position: absolute; right: 8px; bottom: 7px; display: flex; gap: 3px; }
.attendance-slot-shortcuts a { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.attendance-slot-shortcuts a:hover { border-color: var(--red); color: var(--red); }
.attendance-slot-shortcuts .ico { width: 13px; height: 13px; }
.attendance-master-hint { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.attendance-detail-shell { min-height: 100%; padding: 16px; }
.attendance-detail-header { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -16px -16px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(244,238,225,.97); backdrop-filter: blur(8px); }
.attendance-detail-header h2 { font-family: var(--font-serif); font-size: 20px; }
.attendance-roster-form { display: grid; gap: 10px; }
.attendance-command-bar { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; }
.attendance-command-bar > div { display: grid; gap: 2px; }
.attendance-command-bar span { color: var(--muted); font-size: 10.5px; }
.attendance-command-bar strong { font-size: 12px; }
.attendance-command-bar label { display: grid; grid-template-columns: auto minmax(130px, 180px); align-items: center; gap: 8px; }
.attendance-roster-list { display: grid; border: 1px solid var(--line); background: #fff; }
.attendance-roster-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(214px, auto) 70px minmax(150px, .8fr); align-items: center; gap: 10px; min-width: 0; min-height: 86px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.attendance-roster-row:last-child { border-bottom: 0; }
.attendance-roster-row:hover { background: #faf8f2; }
.attendance-roster-row.attendance-row-error { background: #fff3f0; box-shadow: inset 3px 0 var(--red); }
.attendance-person { display: grid; min-width: 0; gap: 3px; }
.attendance-person > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.attendance-person > div:first-child strong { overflow-wrap: anywhere; }
.attendance-person > small { color: var(--muted); font-size: 10.5px; }
.attendance-person > small b { color: var(--ink); font-size: 13px; }
.attendance-inline-type { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; }
.attendance-inline-type select { max-width: 120px; padding-block: 4px; font-size: 11px; }
.badge-leave { background: #fdf0e3; color: #9a5811; }
.attendance-status-cell, .attendance-hours-cell, .attendance-feedback-cell { align-self: center; grid-template-rows: 24px 40px; gap: 5px; }
.attendance-status-cell { display: grid; min-width: 0; }
.attendance-cell-label, .attendance-feedback-cell .stars { display: flex; align-items: center; min-height: 24px; }
.attendance-cell-label { justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10.5px; }
.attendance-cell-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.attendance-status-cell .attendance-status-options { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 40px; min-height: 40px; overflow: hidden; border-bottom: 1px solid var(--line); }
.attendance-status-cell .attendance-status-choice span { box-sizing: border-box; display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; min-height: 0; padding: 7px; }
.attendance-hours-cell { display: grid; justify-items: stretch; color: var(--muted); font-size: 10.5px; }
.attendance-hours-cell > span { display: flex; align-items: center; justify-content: center; min-height: 24px; }
.attendance-hours-cell .hours-input { width: 100%; height: 40px; min-height: 40px; text-align: center; }
.attendance-hours-cell small { justify-self: center; max-width: 90px; text-align: center; }
.attendance-feedback-cell { display: grid; min-width: 0; }
.attendance-feedback-cell .stars { white-space: nowrap; }
.attendance-feedback-cell input[type="text"] { min-width: 0; width: 100%; }
.attendance-submit-bar { position: sticky; bottom: -16px; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(250,248,243,.97); box-shadow: 0 -8px 20px rgba(35,32,28,.06); }
#temporaryAttendanceDlg .form-card { max-height: min(82vh, 720px); overflow: auto; }
#temporary-attendance-table input[type="text"] { width: 100%; min-width: 190px; }
#temporary-attendance-table input[type="number"] { width: 80px; }

/* 班级工作台。 */
.class-master-row { position: relative; min-height: 86px; border-bottom: 1px solid var(--line); color: var(--ink); }
.class-master-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; min-height: 86px; padding: 10px 84px 10px 13px; color: var(--ink); }
.class-master-row:hover { background: #f5f1e8; text-decoration: none; }
.class-master-link:hover { text-decoration: none; }
.class-master-row.is-selected { background: #eee5d8; }
.class-master-row.is-selected::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }
.class-master-row.is-inactive { opacity: .58; }
.class-master-main { display: grid; min-width: 0; gap: 3px; }
.class-master-main strong, .class-master-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-master-main small, .class-master-count small { color: var(--muted); font-size: 10.5px; }
.class-master-count { grid-row: 1; grid-column: 2; display: grid; justify-items: end; }
.class-master-count strong { font-size: 11px; white-space: nowrap; }
.class-master-link > .badge { grid-column: 1 / -1; justify-self: start; }
.class-master-shortcuts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 3px; }
.class-master-shortcuts a { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.class-master-shortcuts a:hover { border-color: var(--red); color: var(--red); }
.class-master-shortcuts .ico { width: 13px; height: 13px; }
.class-order-list { display: grid; max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); }
.class-order-list label { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.class-order-list label:last-child { border-bottom: 0; }
.class-order-list input { width: 72px; text-align: center; }
.class-detail-shell { min-height: 100%; padding: 16px; }
.class-detail-header { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -16px -16px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(244,238,225,.97); backdrop-filter: blur(8px); }
.class-detail-header h2 { font-family: var(--font-serif); font-size: 20px; }
.class-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); background: #fff; }
.class-summary-strip > div { display: grid; gap: 3px; min-height: 66px; padding: 12px 14px; border-right: 1px solid var(--line); }
.class-summary-strip > div:last-child { border-right: 0; }
.class-summary-strip span { color: var(--muted); font-size: 10.5px; }
.class-summary-strip strong { overflow-wrap: anywhere; font-size: 14px; }
.class-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 12px; }
.class-detail-main { display: grid; gap: 12px; min-width: 0; }
.class-detail-rail { position: sticky; top: 62px; min-width: 0; }
.class-section-head { margin: 0; border-bottom: 1px solid var(--line); }
.class-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.class-member-list { display: grid; }
.class-member-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.class-member-row > a { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); }
.class-member-row > a:hover { text-decoration: none; }
.class-member-row > a > span:last-child { display: grid; min-width: 0; }
.class-member-row > a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-member-row > a small { color: var(--muted); font-size: 10.5px; }
.class-member-row .student-master-avatar { width: 32px; height: 32px; }
.class-member-menu { width: 220px; }
.class-member-menu form:first-child { display: grid; gap: 5px; padding: 6px; }
.class-member-menu select { width: 100%; min-width: 0; font-size: 11px; }
.class-enroll-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; background: #faf8f2; }
.class-enroll-bar input { width: 100%; min-width: 0; }
.class-meeting-list { display: grid; margin: 10px 0 12px; border: 1px solid var(--line); }
.class-meeting-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 50px; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.class-meeting-list > div:last-child { border-bottom: 0; }
.class-meeting-list span { display: grid; min-width: 0; }
.class-meeting-list small { color: var(--muted); font-size: 10.5px; }
.class-meeting-list form { flex: none; }
.class-meeting-form { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.class-meeting-form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.class-meeting-form input, .class-meeting-form select { width: 100%; min-width: 0; }
.class-sessions-card .compact-record-list { max-height: 310px; overflow-y: auto; }

/* 请假与补课：按待办、休学、历史三条队列分流。 */
.page-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.workflow-tabs { margin-bottom: 8px; }
.workflow-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.workflow-tabs a strong { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: #eeebe4; color: var(--ink); font-size: 10.5px; }
.workflow-tabs a.on strong { background: var(--red); color: #fff; }
.workflow-section + .workflow-section { margin-top: 22px; }
.workflow-section .operations-section-head { padding-inline: 2px; }
.workflow-section .operations-section-head p { margin: 0; font-size: 11px; }
.workflow-list { border: 1px solid var(--line); background: #fff; }
.workflow-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.4fr) auto; align-items: center; gap: 10px; min-height: 68px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.workflow-row:last-child { border-bottom: 0; }
.workflow-row:hover { background: #faf8f2; }
.workflow-person { display: grid; min-width: 0; gap: 3px; }
.workflow-person strong, .workflow-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-person span { color: var(--muted); font-size: 11px; }
.workflow-command { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; min-width: 0; }
.workflow-command select, .workflow-command input { width: 100%; min-width: 0; }
.suspension-row { grid-template-columns: minmax(220px, .8fr) auto minmax(280px, 1fr) auto; }
.workflow-filters { margin-bottom: 12px; }
.workflow-history .table { min-width: 780px; }
.makeup-queue-filters { margin-bottom: 12px; }
.makeup-workspace { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }
.makeup-queue-panel, .makeup-arrange-panel { min-width: 0; border: 1px solid var(--line); background: #fff; }
.makeup-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 66px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.makeup-panel-head h2 { font-size: 15px; }
.makeup-queue-panel > .makeup-panel-head > div:first-child { flex: 0 0 92px; }
.makeup-queue-panel > .makeup-panel-head h2 { white-space: nowrap; }
.makeup-panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.makeup-queue-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; color: var(--muted); font-size: 10.5px; text-align: right; }
.makeup-queue-counts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.makeup-queue-list { max-height: min(630px, calc(100dvh - 250px)); overflow-y: auto; }
.makeup-queue-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; min-height: 74px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.makeup-queue-row:last-child { border-bottom: 0; }
.makeup-queue-row:hover, .makeup-queue-row.is-selected { background: #f5f1e8; text-decoration: none; }
.makeup-queue-row.is-selected { box-shadow: inset 3px 0 0 var(--red); }
.makeup-queue-row > div { display: grid; min-width: 0; gap: 2px; }
.makeup-queue-row strong, .makeup-queue-row span, .makeup-queue-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.makeup-queue-row > div span, .makeup-queue-row small { color: var(--muted); font-size: 10.5px; }
.makeup-queue-row > small { grid-column: 1 / -1; }
.makeup-queue-state-card { display: grid; grid-template-rows: 22px 30px; align-self: center; width: 72px; min-height: 52px; overflow: hidden; border: 1px solid var(--line); background: #fff; text-align: center; }
.makeup-queue-state-card small { display: grid; place-items: center; width: 100%; padding: 0 4px; border-bottom: 1px solid var(--line); background: var(--paper-deep); color: var(--muted); font-size: 9.5px; }
.makeup-queue-state-card strong { display: grid; place-items: center; width: 100%; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.makeup-queue-state-card.is-requested { border-color: #c99ba0; }
.makeup-queue-state-card.is-requested small { background: var(--red); color: #fff; }
.makeup-parent-choice { display: grid; gap: 4px; margin: 14px; padding: 10px 12px; border-left: 3px solid var(--gold); background: #fbf7ed; }
.makeup-parent-choice strong { font-size: 11px; color: var(--muted); }
.makeup-parent-choice span { font-weight: 700; }
.makeup-parent-choice small { color: var(--muted); }
.makeup-arrange-form { padding: 14px; }
.makeup-target-filter { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(180px, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 10px; }
.makeup-target-filter label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 10.5px; }
.makeup-target-filter input, .makeup-target-filter select { width: 100%; min-width: 0; }
.makeup-target-filter output { padding-bottom: 9px; font-size: 11px; white-space: nowrap; }
.makeup-target-list { display: grid; max-height: 410px; overflow-y: auto; border: 1px solid var(--line); }
.makeup-target-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 58px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.makeup-target-option:last-child { border-bottom: 0; }
.makeup-target-option:hover { background: #faf8f2; }
.makeup-target-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--red); }
.makeup-target-option span { display: grid; min-width: 0; gap: 2px; }
.makeup-target-option strong, .makeup-target-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.makeup-target-option small { color: var(--muted); font-size: 10.5px; }
.makeup-empty-detail { min-height: 190px; display: grid; place-items: center; }

/* 财务统一工作台：统计、趋势和完整账本使用同一筛选口径。 */
.finance-analytics { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 12px; margin: 12px 0; }
.finance-cashflow, .finance-mix, .report-trend-card, .report-consumption-card { min-width: 0; padding: 16px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-head .card-title { font-size: 14px; }
.section-head p { margin: 3px 0 0; font-size: 10.5px; }
.finance-mix { display: grid; align-content: start; gap: 11px; }
.finance-mix .section-head { margin-bottom: 2px; }
.chart-shell { position: relative; width: 100%; height: 260px; min-height: 260px; margin-top: 10px; }
.chart-shell-composition { height: 260px; min-height: 260px; }
.chart-shell-report { height: 250px; min-height: 250px; }
.chart-shell canvas { display: block; width: 100% !important; height: 100% !important; }
.book-command-list { display: grid; border: 1px solid var(--line); }
.book-command-list > button { display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; align-items: center; gap: 10px; min-height: 62px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.book-command-list > button:last-child { border-bottom: 0; }
.book-command-list > button:hover { background: #f5f1e8; }
.book-command-list > button > .ico:first-child { color: var(--red); }
.book-command-list > button > .ico:last-child { color: var(--muted); }
.book-command-list span { display: grid; gap: 2px; }
.book-command-list small { color: var(--muted); font-size: 11px; }

/* 报表导航与续费工作队列。 */
.report-nav { display: flex; margin-bottom: 12px; overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.report-nav a { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 150px; min-height: 48px; padding: 8px 12px; border-right: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; }
.report-nav a:last-child { border-right: 0; }
.report-nav a:hover { background: #f5f1e8; text-decoration: none; }
.report-nav .ico { color: var(--red); }
.report-renewal-preview { width: 100%; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; border: 1px solid var(--line); background: #fff; }
.report-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 68px; padding: 14px 18px; border-right: 1px solid var(--line); }
.report-metrics > div:last-child { border-right: 0; }
.report-metrics span { color: var(--muted); font-size: 11.5px; }
.report-metrics strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.report-metrics-wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-analytics-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 12px; margin-bottom: 16px; }
.report-branch-section { margin-bottom: 16px; }
.report-branch-table { min-width: 830px; }
.renewal-row { display: grid; grid-template-columns: minmax(160px, .65fr) 100px minmax(420px, 1.35fr); align-items: center; gap: 12px; min-height: 66px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.renewal-row:last-child { border-bottom: 0; }
.renewal-row.is-done { opacity: .58; }
.renewal-person, .renewal-balance { display: grid; min-width: 0; gap: 2px; color: var(--ink); }
.renewal-person:hover { text-decoration: none; }
.renewal-person strong, .renewal-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renewal-person span, .renewal-balance span, .renewal-no-phone { color: var(--muted); font-size: 10.5px; }
.renewal-balance strong { font-size: 19px; }
.renewal-command { display: grid; grid-template-columns: 110px minmax(160px, 280px) auto auto; align-items: center; justify-content: end; gap: 6px; min-width: 0; }
.renewal-command select, .renewal-command input { width: 100%; min-width: 0; font-size: 11.5px; }
.renewal-command .renewal-note { border-color: #d8d0c4; background: #faf8f2; }
.renewal-command .btn { white-space: nowrap; }

/* 设置：固定分类导航，右侧保持单一配置流。 */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 16px; }
.settings-section-nav { position: sticky; top: 18px; display: grid; border: 1px solid var(--line); background: #fff; }
.settings-section-nav a { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; }
.settings-section-nav a:last-child { border-bottom: 0; }
.settings-section-nav a:hover { background: #f5f1e8; text-decoration: none; }
.settings-section-nav .ico { color: var(--red); }
.settings-main { display: grid; gap: 16px; min-width: 0; }
.settings-main > * { min-width: 0; }
.settings-form { max-width: none; min-width: 0; overflow: hidden; }
.settings-anchor { scroll-margin-top: 18px; }
.settings-form .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 22px -24px -24px; padding: 12px 24px; border-top: 1px solid var(--line); background: rgba(250,248,243,.97); }

/* 13-inch laptop: preserve two-pane work while reducing nonessential chrome. */
@media (max-width: 1180px) and (min-width: 981px) {
    .content-workspace { padding: 12px; }
    .master-detail-workspace { grid-template-columns: 280px minmax(0, 1fr); gap: 10px; height: calc(100dvh - 24px); }
    .workspace-master-head { padding: 13px 12px; }
    .workspace-filter { padding: 10px 11px; }
    .student-master-row { padding-inline: 10px; }
    .student-detail-shell { padding: 14px; }
    .student-detail-header { margin: -14px -14px 12px; padding: 11px 14px; }
    .student-detail-layout { grid-template-columns: minmax(0, 1fr) 244px; gap: 10px; }
    .student-detail-main, .student-detail-rail { gap: 10px; }
    .student-detail-actions .btn { padding-inline: 8px; }
    .student-detail-actions .btn span { display: none; }
    .finance-analytics, .report-analytics-grid { grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); }
    .report-metrics-wide { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
}

/* Below laptop width, the master and detail become one focused panel. */
@media (max-width: 980px) {
    .content-workspace { height: auto; min-height: 100dvh; overflow: visible; padding: 12px; }
    .master-detail-workspace { display: block; height: auto; min-height: calc(100dvh - 24px); }
    .workspace-master, .workspace-detail { min-height: calc(100dvh - 24px); }
    .workspace-master-list { max-height: none; overflow: visible; }
    .student-workspace:not(.has-selection) .workspace-detail { display: none; }
    .student-workspace.has-selection .workspace-master { display: none; }
    .attendance-workspace:not(.has-selection) .workspace-detail { display: none; }
    .attendance-workspace.has-selection .workspace-master { display: none; }
    .class-workspace:not(.has-selection) .workspace-detail { display: none; }
    .class-workspace.has-selection .workspace-master { display: none; }
    .workspace-mobile-back { display: inline-flex; }
    .student-detail-layout { grid-template-columns: minmax(0, 1fr) 260px; }
    .makeup-workspace { grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); }
}

@media (max-width: 760px) {
    .workspace-master-head { align-items: flex-start; flex-wrap: wrap; }
    .workspace-master-head > div:first-child { flex: 1 1 120px; min-width: 120px; }
    .workspace-master-actions { width: auto; flex: 0 0 auto; }
    .workspace-master-actions .btn { flex: 0 0 auto; }
    .student-detail-layout { grid-template-columns: 1fr; }
    .student-detail-rail { position: static; grid-row: 1; }
    .student-detail-main { grid-row: 2; }
    .student-detail-header { align-items: flex-start; flex-direction: column; }
    .student-detail-actions { width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .student-detail-actions .btn { flex: 0 0 auto; }
    .coursehour-command-grid { grid-template-columns: 1fr; }
    .attendance-detail-header { align-items: flex-start; }
    .attendance-command-bar { align-items: stretch; flex-direction: column; }
    .attendance-command-bar label { grid-template-columns: 1fr; }
    .attendance-roster-row { grid-template-columns: minmax(0, 1fr) 68px; align-items: start; padding: 12px; }
    .attendance-person { grid-column: 1; }
    .attendance-status-cell { grid-column: 1 / -1; grid-row: 2; }
    .attendance-hours-cell { grid-column: 2; grid-row: 1; }
    .attendance-feedback-cell { grid-column: 1 / -1; grid-row: 3; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
    .class-summary-strip { grid-template-columns: 1fr 1fr; }
    .class-summary-strip > div:nth-child(2) { border-right: 0; }
    .class-summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .class-detail-layout { grid-template-columns: 1fr; }
    .class-detail-rail { position: static; grid-row: 1; }
    .class-detail-main { grid-row: 2; }
    .workflow-page-head { align-items: flex-start; }
    .workflow-row, .suspension-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 12px; }
    .workflow-person { grid-column: 1 / -1; }
    .workflow-command, .suspension-command { grid-column: 1 / -1; }
    .workflow-row > form:last-child { grid-column: 2; grid-row: 1; }
    .report-metrics { grid-template-columns: 1fr; }
    .report-metrics > div { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
    .report-metrics > div:last-child { border-bottom: 0; }
    .renewal-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
    .renewal-command { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
    .makeup-workspace, .finance-analytics, .report-analytics-grid { grid-template-columns: 1fr; }
    .makeup-queue-list { max-height: 330px; }
    .makeup-target-filter { grid-template-columns: 1fr 1fr; }
    .makeup-target-filter output { grid-column: 1 / -1; padding: 0; }
    .report-metrics-wide { grid-template-columns: 1fr 1fr; }
    .report-metrics-wide > div { border-right: 0; }
    .chart-shell, .chart-shell-composition, .chart-shell-report { height: 230px; min-height: 230px; }
}

@media (max-width: 760px) {
    .finance-filter-form { align-items: stretch; }
    .finance-filter-form label, .finance-filter-form input, .finance-filter-form select { width: 100%; min-width: 0; }
    .dialog-head { align-items: flex-start; flex-direction: column; }
    .dialog-head .actions { width: 100%; }
    .inventory-toolbar { align-items: stretch; flex-direction: column; }
    .segmented-control { width: 100%; }
    .item-variant-table, .inventory-bulk-table { display: block; min-width: 0; width: 100%; }
    .item-variant-table thead, .inventory-bulk-table thead { display: none; }
    .item-variant-table tbody, .inventory-bulk-table tbody { display: block; }
    .item-variant-table tr, .inventory-bulk-table .inventory-variant-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .item-variant-table td, .inventory-bulk-table .inventory-variant-row td { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; text-align: right; }
    .item-variant-table td::before, .inventory-bulk-table .inventory-variant-row td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 500; }
    .item-variant-table .item-row-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 4px; }
    .item-variant-table .item-row-actions::before { margin-right: auto; }
    .inventory-bulk-table .inventory-product-row { display: block; border-bottom: 0; }
    .inventory-bulk-table .inventory-product-row th { display: block; width: 100%; }
    .inventory-bulk-table .inventory-variant-row td:first-child { padding-left: 0; }
    .inventory-bulk-table .inventory-variant-row td:nth-child(4), .inventory-bulk-table .inventory-variant-row td:nth-child(5) { grid-column: span 1; }
    .inventory-quantity-input { width: min(130px, 56%); }
    .inventory-submit-bar { position: static; align-items: stretch; flex-direction: column; }
    .inventory-submit-bar label { flex: 0 0 auto; width: 100%; max-width: none; }
    .inventory-submit-bar .btn { width: 100%; }
    .bookkeeping-actions { grid-template-columns: 1fr 1fr; }
    .bookkeeping-actions > button { min-height: 76px; border-right: 0; border-bottom: 1px solid var(--line); }
    .bookkeeping-actions > button:nth-child(odd) { border-right: 1px solid var(--line); }
    .bookkeeping-actions > button:last-child { border-bottom: 0; }
    .inventory-metrics { grid-template-columns: 1fr 1fr; }
    .inventory-metrics > div { border-bottom: 1px solid var(--line); }
    .inventory-metrics > div:nth-child(2) { border-right: 0; }
    .inventory-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
    .workspace-tabs { overflow-x: auto; }
    .workspace-tabs a { min-width: 112px; }
    .workspace-toolbar { align-items: stretch; flex-direction: column; }
    .workspace-toolbar input[type="search"] { width: 100%; }
    .coursehour-balance-strip { grid-template-columns: 1fr; }
    .coursehour-balance-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .coursehour-balance-strip > div:last-child { border-bottom: 0; }
}
.pages { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pages a { padding: 5px 12px; border: 1px solid var(--line); color: var(--ink); }
.pages a.on { background: var(--red); border-color: var(--red); color: var(--paper); }
.pages a:hover { border-color: var(--ink); text-decoration: none; }

/* 提示条 */
.flash { display: flex; align-items: center; gap: 9px; background: #f1ecdd; border: 1px solid #d9cba6; border-left: 3px solid var(--imperial); color: #6b5416; padding: 10px 14px; margin-bottom: 20px; font-size: 13.5px; }
.flash .ico { color: var(--ok); }

/* 星级评分 */
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.stars > input { position: absolute; width: 0; height: 0; opacity: 0; }
.stars > label { color: #dcd5c8; cursor: pointer; padding: 0 1px; line-height: 1; }
.stars > label .ico.star { width: 20px; height: 20px; }
.stars > label:hover, .stars > label:hover ~ label, .stars > input:checked ~ label { color: var(--gold); }
.stars-show { color: var(--gold); display: inline-flex; vertical-align: middle; }
.stars-show .ico.star { width: 15px; height: 15px; }

/* 家长月度问卷 */
.survey-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #f0ebe1; }
.rate-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; }
.rate-row label { white-space: nowrap; color: #5c554c; }

/* 登录：官网 V8 的品牌开场语言 */
.login-stage { width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: var(--ink); color: var(--paper); }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 8vh 7vw; }
.login-brand-panel .watermark { position: absolute; right: -12%; bottom: -6%; width: 62%; opacity: .1; filter: invert(92%) sepia(8%); pointer-events: none; }
.login-kicker { position: relative; z-index: 1; margin-bottom: 18px; color: var(--red-bright); font-size: 11.5px; letter-spacing: .2em; }
.login-slogan { position: relative; z-index: 1; max-width: 11em; font-family: var(--font-serif); font-size: clamp(28px, 3.2vw, 42px); font-weight: 700; line-height: 1.4; }
.login-slogan em { color: var(--red-bright); font-style: normal; }
.login-note { position: relative; z-index: 1; max-width: 34em; margin-top: 20px; color: rgba(244,238,225,.6); font-size: 13.5px; letter-spacing: .05em; }
.login-form-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 40px; background: var(--paper); color: var(--ink); }
.login-shell { width: 100%; max-width: 360px; }
.login-card { width: 100%; max-width: 360px; padding: 0; border: 0; background: none; box-shadow: none; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label > span { display: block; font-size: 13px; color: #5c554c; margin-bottom: 5px; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); font-size: 14px; background: #fff; }
.login-card .btn-block { margin-top: 8px; padding: 11px; letter-spacing: .16em; }
.login-tools { position: absolute; top: 24px; right: 28px; display: flex; justify-content: flex-end; }
.login-lang-select label { margin: 0; }
.login-lang-select select { min-width: 132px; padding: 7px 30px 7px 10px; font-size: 12.5px; background-color: #fff; box-shadow: 0 1px 2px rgba(40,33,24,.04); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.login-head { text-align: left; margin-bottom: 30px; }
.login-head .seal { margin: 0 auto 12px; width: 46px; height: 46px; font-size: 24px; border-radius: 12px; }
.login-head .brand-logo { width: 56px; height: 56px; margin-bottom: 14px; }
.login-title { font-family: var(--font-serif); font-size: 20px; color: var(--ink); }
.login-sub { color: var(--muted); font-size: 12px; letter-spacing: .12em; margin: 5px 0 0; }
.login-legal { margin-top: 16px; text-align: center; font-size: 12px; }
.login-legal a { color: var(--muted); }

/* 隐私政策 */
.privacy-page { max-width: 980px; margin: 0 auto; padding: 32px 38px; line-height: 1.75; }
.privacy-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.privacy-head .brand-logo { width: 48px; height: 48px; }
.privacy-head h1 { font-size: 22px; margin: 0 0 4px; }
.privacy-head p { margin: 0; color: var(--muted); }
.privacy-page section { margin-top: 24px; }
.privacy-page h2 { font-size: 17px; margin-bottom: 10px; }
.privacy-page p { margin: 0 0 10px; }
.privacy-page ol { margin: 0; padding-left: 22px; }
.privacy-page li { margin: 8px 0; }
.privacy-contact { padding: 18px; background: var(--paper-deep); border: 1px solid var(--line); }
.privacy-actions { margin-top: 24px; }

/* 错误页 */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-code { font-size: 64px; font-weight: 800; color: #d6cfc3; }

/* 桌面端紧凑侧栏：仅保留图标，把宽度让给数据表和主体内容。 */
@media (min-width: 861px) {
    html.sidebar-compact .sidebar { width: 72px; }
    html.sidebar-compact .content { margin-left: 72px; }
    html.sidebar-compact .brand { justify-content: center; padding-inline: 16px; }
    html.sidebar-compact .brand .brand-text { display: none; }
    html.sidebar-compact .side-nav { padding-inline: 8px; }
    html.sidebar-compact .nav-item { justify-content: center; gap: 0; padding-inline: 10px; }
    html.sidebar-compact .nav-item > span { display: none; }
    html.sidebar-compact .nav-item .ico { margin: 0; }
    html.sidebar-compact .nav-sep { height: 1px; margin: 12px 10px 6px; font-size: 0; gap: 0; }
    html.sidebar-compact .kid-switch { display: none; }
    html.sidebar-compact .side-foot { padding-inline: 8px; }
    html.sidebar-compact .lang-row { justify-content: center; padding-inline: 0; }
    html.sidebar-compact .lang-row a { display: none; }
    html.sidebar-compact .legal-row,
    html.sidebar-compact .who-row .who,
    html.sidebar-compact .who-row .logout span { display: none; }
    html.sidebar-compact .who-row { justify-content: center; padding: 0; }
    html.sidebar-compact .who-row .logout { padding: 8px; }
    html.sidebar-compact .sidebar-compact-toggle { justify-content: center; padding-inline: 0; }
    html.sidebar-compact .sidebar-compact-label { display: none; }
    html.sidebar-compact .sidebar-compact-toggle .ico { transform: rotate(180deg); }
}

/* ============ 响应式：平板 ============ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 26px 24px 56px; }
    .payroll-inline-form { grid-template-columns: repeat(3, minmax(116px, 1fr)); }
}

@media (max-width: 900px) {
    body.guest { background: var(--paper); }
    .content-guest { display: block; padding: 0; }
    .login-stage { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 34vh; padding: 10vh 8vw 6vh; }
    .login-form-panel { min-height: 66vh; padding: 64px 8vw 48px; }
}

/* ============ 响应式：手机（抽屉） ============ */
@media (max-width: 860px) {
    .sidebar-compact-toggle { display: none; }
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 6px 0 28px rgba(0,0,0,.35); width: 256px; }
    .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
    .backdrop { display: block; position: fixed; inset: 0; background: rgba(20,16,12,.45); z-index: 35; opacity: 0; visibility: hidden; transition: opacity .25s; }
    .nav-toggle:checked ~ .backdrop { opacity: 1; visibility: visible; }
    .topbar-m {
        display: flex; align-items: center; gap: 12px;
        position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 30;
        background: var(--ink); color: var(--paper); padding: 0 14px;
    }
    .topbar-m .brand-text { font-family: var(--font-serif); font-size: 15px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hamburger { display: grid; place-items: center; width: 38px; height: 38px; cursor: pointer; color: var(--paper); }
    .hamburger:hover { background: var(--sb-soft); }
    .content { margin-left: 0; padding: 72px 16px 48px; }
    .content-workspace { padding: 66px 10px 10px; }
    .master-detail-workspace { min-height: calc(100dvh - 76px); }
    .workspace-master, .workspace-detail { min-height: calc(100dvh - 76px); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid.feedback-meta { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; }
    .portal-hero { align-items: flex-start; flex-direction: column; }
    .child-switch-panel { width: 100%; min-width: 0; text-align: left; }
    .child-switch-list { justify-content: flex-start; }
    .table th, .table td { padding: 10px 12px; }
    .privacy-page { padding: 24px 20px; }
    .privacy-head { align-items: flex-start; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-section-nav { position: sticky; top: 54px; z-index: 20; display: flex; overflow-x: auto; }
    .settings-section-nav a { flex: 0 0 auto; min-width: 128px; justify-content: center; border-right: 1px solid var(--line); border-bottom: 0; }
    .settings-section-nav a:last-child { border-right: 0; }
    .settings-anchor { scroll-margin-top: 112px; }
    #settings-closures { overflow: hidden; }
    #settings-closures .table { min-width: 0; }
}

@media (max-width: 680px) {
    .payroll-inline-form { grid-template-columns: 1fr; }
    .payroll-inline-form .wide { grid-column: auto; }
}

@media (max-width: 560px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .table { min-width: 640px; }
    .item-variant-table, .inventory-bulk-table { min-width: 0; }
    .item-variant-table .item-row-actions { flex-wrap: wrap; }
    .page-title { font-size: 21px; }
    .actions { width: 100%; }
    .actions .btn { flex: 1; justify-content: center; }
    .class-list-actions { width: auto; }
    .class-list-actions .btn { flex: 0 0 auto; }
    .actions.student-detail-actions .btn { flex: 0 0 auto; white-space: nowrap; }
    .student-detail-shell { padding: 12px; }
    .student-detail-header { margin: -12px -12px 10px; padding: 10px 12px; }
    .student-detail-title-row h2 { font-size: 18px; }
    .student-detail-identity p { overflow-wrap: anywhere; }
    .student-balance-actions { grid-template-columns: 1fr 1fr 38px; }
    .attendance-detail-shell { padding: 10px; }
    .attendance-detail-header { margin: -10px -10px 10px; padding: 10px; }
    .attendance-submit-bar { bottom: -10px; }
    .class-detail-shell { padding: 10px; }
    .class-detail-header { margin: -10px -10px 10px; padding: 10px; }
    .class-summary-strip > div { min-height: 58px; padding: 9px 10px; }
    .renewal-command { grid-template-columns: 1fr 1fr; }
    .renewal-command .btn { width: 100%; }
    .settings-section-nav { position: static; display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
    .settings-section-nav a { min-width: 0; justify-content: flex-start; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .settings-section-nav a:nth-child(even) { border-right: 0; }
    .settings-section-nav a:last-child { border-bottom: 0; }
    .phone-region-list { overflow: visible; }
    .phone-region-head { display: none; }
    .phone-region-row { grid-template-columns: 78px minmax(0, 1fr) 38px 38px 38px; min-width: 0; gap: 6px; padding: 10px 0; }
    .phone-region-row > input:nth-child(1) { grid-column: 1; grid-row: 1; }
    .phone-region-row > input:nth-child(2) { grid-column: 2; grid-row: 1; }
    .phone-region-row > input:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
    .phone-region-row > .phone-region-toggle:nth-child(4) { grid-column: 3; grid-row: 1; }
    .phone-region-row > .phone-region-toggle:nth-child(5) { grid-column: 4; grid-row: 1; }
    .phone-region-row > .phone-region-remove { grid-column: 5; grid-row: 1; }
    .pad { padding: 18px; }
    .form-card { padding: 20px; }
    .phone-input-row { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 30vh; padding: 72px 24px 36px; }
    .login-slogan { font-size: 27px; }
    .login-note { margin-top: 14px; font-size: 12.5px; }
    .login-form-panel { min-height: 70vh; padding: 68px 24px 40px; }
    .login-tools { top: 18px; right: 20px; }
}
