/* 班主任工作台 - 视觉系统 */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --pink: #ec4899;
  --pink-soft: #fdf2f8;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --yellow: #f59e0b;
  --yellow-soft: #fffbeb;
  --purple: #8b5cf6;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sidebar-w: 252px;
  --header-h: 74px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
  --blue: #60a5fa;
  --blue-dark: #93c5fd;
  --blue-soft: rgba(37, 99, 235, .16);
  --pink: #f472b6;
  --pink-soft: rgba(236, 72, 153, .14);
  --green: #34d399;
  --green-soft: rgba(16, 185, 129, .14);
  --yellow: #fbbf24;
  --yellow-soft: rgba(245, 158, 11, .14);
  --purple: #a78bfa;
  --red: #f87171;
  --red-soft: rgba(239, 68, 68, .14);
  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;
  --ink-4: #64748b;
  --line: #334155;
  --line-soft: #1e293b;
  --surface: #111827;
  --surface-2: #0f172a;
  --surface-3: #1e293b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 16px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 23px; background: linear-gradient(135deg, var(--blue), #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.sidebar-class {
  margin: 0 14px 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-soft), var(--pink-soft));
  border: 1px solid color-mix(in srgb, var(--blue) 14%, transparent);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-class .class-emoji { font-size: 22px; }
.sidebar-class strong { display: block; font-size: 13px; }
.sidebar-class span { font-size: 11px; color: var(--ink-3); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 18px; scrollbar-width: thin; }
.nav-group-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.3px; color: var(--ink-4);
  padding: 14px 12px 7px; text-transform: uppercase;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--ink-2);
  text-align: left; font-size: 13px; font-weight: 500; margin-bottom: 2px;
  transition: background .16s, color .16s, transform .16s;
}
.nav-item:hover { background: var(--surface-3); transform: translateX(2px); }
.nav-item.active { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .24); }
.nav-item .nav-emoji { font-size: 16px; width: 20px; text-align: center; }
.nav-item .nav-badge { margin-left: auto; font-size: 10px; background: var(--yellow-soft); color: #b45309; padding: 1px 6px; border-radius: 999px; }
html[data-theme="dark"] .nav-item .nav-badge { color: var(--yellow); }
.sidebar-footer { padding: 12px 14px 18px; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.sidebar-mini-btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; text-align: left;
}
.sidebar-mini-btn:hover { border-color: var(--blue); color: var(--blue); }
.sidebar-overlay { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  height: var(--header-h); position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 26px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.page-heading { line-height: 1.2; }
.page-kicker { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.page-heading h1 { font-size: 19px; margin: 2px 0 0; letter-spacing: -.3px; }
.topbar-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.menu-btn { display: none; }
.primary-btn, .ghost-btn, .soft-btn, .danger-btn {
  border-radius: 11px; padding: 9px 14px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  justify-content: center; white-space: nowrap;
}
.primary-btn { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .2); }
.primary-btn:hover { background: var(--blue-dark); }
.primary-btn.small { padding: 7px 12px; font-size: 12px; }
.ghost-btn { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.ghost-btn:hover { border-color: var(--blue); color: var(--blue); }
.soft-btn { background: var(--blue-soft); color: var(--blue); }
.soft-btn:hover { filter: brightness(.97); }
.danger-btn { background: var(--red-soft); color: var(--red); }
.danger-btn:hover { background: var(--red); color: #fff; }
.user-chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px;
}
.user-avatar { width: 27px; height: 27px; border-radius: 50%; background: var(--pink-soft); display: grid; place-items: center; font-size: 14px; }

.view-wrap { padding: 24px 26px 44px; max-width: 1480px; margin: 0 auto; }
.page-section { margin-bottom: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head p { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.auto-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.pad-lg { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.card-head .sub { font-size: 11px; color: var(--ink-3); }
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px 26px;
  background: linear-gradient(115deg, #2563eb, #4f80f5 52%, #818cf8);
  color: #fff; box-shadow: 0 16px 36px rgba(37, 99, 235, .24);
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -70px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(255,255,255,.12);
}
.hero::before {
  content: ""; position: absolute; right: 70px; bottom: -90px; width: 170px; height: 170px;
  border-radius: 50%; background: rgba(244,114,182,.22);
}
.hero-content { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero h2 { margin: 7px 0 8px; font-size: 24px; letter-spacing: -.5px; }
.hero p { margin: 0; opacity: .9; font-size: 13px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-tag { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.22); padding: 5px 10px; border-radius: 999px; font-size: 12px; }
.hero-decoration { font-size: 54px; align-self: center; opacity: .95; }

.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; }
.stat-icon.blue { background: var(--blue-soft); }
.stat-icon.pink { background: var(--pink-soft); }
.stat-icon.green { background: var(--green-soft); }
.stat-icon.yellow { background: var(--yellow-soft); }
.stat-icon.purple { background: color-mix(in srgb, var(--purple) 12%, transparent); }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-value { font-size: 25px; font-weight: 750; line-height: 1.2; margin-top: 2px; letter-spacing: -.5px; }
.stat-foot { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.stat-foot.up { color: var(--green); }
.stat-foot.down { color: var(--red); }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.quick-item {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 13px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.quick-item:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: var(--shadow); }
.quick-item span { font-size: 22px; }

.todo-item, .list-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.todo-item:last-child, .list-item:last-child { border-bottom: 0; }
.todo-check { width: 19px; height: 19px; accent-color: var(--blue); flex: none; }
.todo-text { flex: 1; font-size: 13px; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--ink-4); }
.todo-meta { font-size: 11px; color: var(--ink-3); }
.icon-btn.tiny { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.yellow { background: var(--yellow-soft); color: #b45309; }
html[data-theme="dark"] .tag.yellow { color: var(--yellow); }
.tag.pink { background: var(--pink-soft); color: var(--pink); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.purple { background: color-mix(in srgb, var(--purple) 12%, transparent); color: var(--purple); }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 16px 26px; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: 0; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); }
.timeline-item.pink .timeline-dot { border-color: var(--pink); }
.timeline-item.green .timeline-dot { border-color: var(--green); }
.timeline-item.yellow .timeline-dot { border-color: var(--yellow); }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.timeline-time { font-size: 11px; color: var(--ink-4); margin-top: 3px; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-box, .input, .select, .textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; outline: none; min-height: 38px;
}
.input:focus, .select:focus, .textarea:focus, .search-box:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-box { min-width: 210px; flex: 1; max-width: 340px; }
.select { padding-right: 26px; }
.textarea { width: 100%; min-height: 90px; resize: vertical; line-height: 1.6; }
.input[type="file"] { padding: 7px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.check-label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .3px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 5px; white-space: nowrap; }
.text-btn { border: 0; background: transparent; color: var(--blue); font-size: 12px; padding: 3px 5px; border-radius: 6px; }
.text-btn:hover { background: var(--blue-soft); }
.text-btn.danger { color: var(--red); }
.text-btn.danger:hover { background: var(--red-soft); }

.student-card { position: relative; overflow: hidden; }
.student-card .card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.avatar { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; flex: none; }
.avatar.male { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.avatar.female { background: linear-gradient(135deg, #ec4899, #f472b6); }
.student-card h3 { margin: 0; font-size: 15px; }
.student-card .sid { font-size: 11px; color: var(--ink-3); }
.info-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { color: var(--ink-3); }
.info-row span:last-child { text-align: right; font-weight: 500; }

.status-group { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; }
.status-btn { border: 0; background: transparent; padding: 5px 9px; border-radius: 7px; font-size: 11px; color: var(--ink-3); }
.status-btn.active[data-status="present"] { background: var(--green); color: #fff; }
.status-btn.active[data-status="leave"] { background: var(--yellow); color: #fff; }
.status-btn.active[data-status="absent"] { background: var(--red); color: #fff; }
.status-btn.active[data-status="late"] { background: var(--purple); color: #fff; }

.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg { display: block; width: 100%; height: auto; min-width: 260px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 9px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.empty { text-align: center; padding: 38px 16px; color: var(--ink-3); }
.empty .empty-icon { font-size: 38px; display: block; margin-bottom: 8px; opacity: .75; }
.empty strong { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.empty p { margin: 0 0 12px; font-size: 12px; }

.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.progress.green > i { background: var(--green); }
.progress.yellow > i { background: var(--yellow); }
.progress.pink > i { background: var(--pink); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--surface-3); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .photo-del { position: absolute; right: 6px; top: 6px; border: 0; border-radius: 8px; background: rgba(15,23,42,.65); color: #fff; font-size: 11px; padding: 3px 7px; }
.photo-item .photo-caption { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(15,23,42,.7)); color: #fff; font-size: 11px; padding: 16px 8px 7px; }

.seating-wrap { overflow-x: auto; padding-bottom: 8px; }
.seating-grid { display: grid; gap: 8px; min-width: max-content; }
.seat {
  min-width: 82px; height: 64px; border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 12px;
  padding: 5px; text-align: center; cursor: pointer; transition: .16s;
}
.seat.filled { border-style: solid; border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); background: var(--blue-soft); font-weight: 600; }
.seat.selected { outline: 3px solid var(--blue); outline-offset: 1px; }
.seat.teacher { background: var(--yellow-soft); border-color: var(--yellow); color: #b45309; font-weight: 700; }
html[data-theme="dark"] .seat.teacher { color: var(--yellow); }
.podium { text-align: center; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: var(--yellow-soft); color: #b45309; font-weight: 700; font-size: 13px; }
html[data-theme="dark"] .podium { color: var(--yellow); }

.timetable { display: grid; grid-template-columns: 74px repeat(5, minmax(110px, 1fr)); gap: 6px; min-width: 680px; }
.tt-head { background: var(--surface-2); border-radius: 9px; padding: 9px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.tt-cell { min-height: 62px; border: 1px solid var(--line); border-radius: 9px; padding: 7px; font-size: 11px; background: var(--surface); cursor: pointer; }
.tt-cell:hover { border-color: var(--blue); }
.tt-cell .subject { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.tt-cell .meta { color: var(--ink-3); font-size: 10px; }
.tt-period { display: grid; place-items: center; font-size: 11px; color: var(--ink-3); background: var(--surface-2); border-radius: 9px; }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekday { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 700; padding: 5px 0; }
.calendar-day { min-height: 84px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 11px; background: var(--surface); }
.calendar-day.muted { opacity: .42; }
.calendar-day.today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.calendar-day .day-num { font-weight: 700; margin-bottom: 4px; }
.calendar-event { font-size: 10px; padding: 2px 5px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-root {
  position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .46);
  display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px);
}
.modal-root[hidden] { display: none; }
.modal {
  width: min(680px, 100%); max-height: min(86vh, 760px); overflow: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: pop .18s ease-out;
}
.modal.wide { width: min(940px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 20px 20px; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; }
.toast {
  background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 14px;
  font-size: 12px; box-shadow: var(--shadow-lg); animation: slideIn .2s ease-out; max-width: 340px;
}
html[data-theme="dark"] .toast { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.muted { color: var(--ink-3); }
.small { font-size: 11px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mb-0 { margin-bottom: 0; }
.font-bold { font-weight: 700; }
.color-blue { color: var(--blue); }
.color-green { color: var(--green); }
.color-pink { color: var(--pink); }
.color-yellow { color: var(--yellow); }
.color-red { color: var(--red); }

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .view-wrap { padding: 18px 16px 36px; }
  .topbar-date { display: none; }
}
@media (max-width: 640px) {
  .topbar-right .icon-btn[data-action="global-search"], .user-chip { display: none; }
  .primary-btn.small { padding: 7px 9px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 20px; }
  .hero-decoration { display: none; }
  .search-box { max-width: none; width: 100%; }
  .toolbar .search-box { flex-basis: 100%; }
  .card { padding: 15px; }
  .modal-foot .primary-btn, .modal-foot .ghost-btn, .modal-foot .danger-btn { flex: 1; }
}
@media print {
  .sidebar, .topbar, .section-actions, .toolbar, .modal-root, .toast-root { display: none !important; }
  .main { margin: 0; }
  .view-wrap { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}
