/* IELTS OS · 雅思教务软件 — 管理后台样式 */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0891b2;
  --info-bg: #ecfeff;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, "PingFang SC", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%); }
.login-card { width: 400px; background: #fff; border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow-lg); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo .logo-badge { width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.login-card h1 { font-size: 22px; }
.login-card .sub { color: var(--text-2); font-size: 13px; margin: 6px 0 24px; }
.login-tip { margin-top: 18px; background: var(--primary-light); border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--primary-dark); line-height: 1.8; }

/* 登录/注册 Tab */
.login-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #f1f5f9; border-radius: 10px; padding: 4px; }
.login-tab { flex: 1; padding: 9px 0; border: none; border-radius: 8px; background: transparent; color: #64748b; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; }
.login-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15,23,42,.08); }

/* 考勤明细分类筛选标签 */
.filter-label { font-size: 12px; color: #94a3b8; margin: 0 2px 0 10px; white-space: nowrap; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #0f172a; color: #cbd5e1; flex-shrink: 0; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .logo-badge { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.sidebar .brand b { color: #fff; font-size: 15px; }
.sidebar .brand small { display: block; color: #64748b; font-size: 11px; font-weight: 400; }
.sidebar nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar nav::-webkit-scrollbar { width: 4px; }
.sidebar nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.nav-group { color: #475569; font-size: 11px; padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #cbd5e1; cursor: pointer; margin-bottom: 2px; transition: all .15s; font-size: 13.5px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar .user-box { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar .user-box .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.sidebar .user-box b { color: #fff; font-size: 13px; display: block; }
.sidebar .user-box span { color: #64748b; font-size: 11px; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 60px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 40; }
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .page-title small { color: var(--text-2); font-weight: 400; font-size: 12px; margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.badge-dot { position: relative; cursor: pointer; }
.badge-dot .dot { position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 5px; }
.content { padding: 24px; flex: 1; }

/* ===== 通用组件 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12px; color: var(--primary); cursor: pointer; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-card .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-card .label { color: var(--text-2); font-size: 12.5px; }
.stat-card .value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-card .trend { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.bg-primary { background: var(--primary-light); } .bg-success { background: var(--success-bg); }
.bg-warning { background: var(--warning-bg); } .bg-info { background: var(--info-bg); } .bg-danger { background: var(--danger-bg); }
.text-primary { color: var(--primary); } .text-success { color: var(--success); }
.text-warning { color: var(--warning); } .text-danger { color: var(--danger); } .text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 1200px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-size: 13.5px; transition: all .15s; font-family: inherit; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 12px; color: var(--text-2); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; vertical-align: middle; }
.table tr:hover td { background: #f8fafc; }
.table .empty { text-align: center; color: var(--text-3); padding: 40px 0; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-orange { background: var(--warning-bg); color: var(--warning); }
.tag-blue { background: var(--info-bg); color: var(--info); }
.tag-purple { background: var(--primary-light); color: var(--primary-dark); }
.tag-gray { background: #f1f5f9; color: var(--text-2); }

.input, .select, .textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; outline: none; transition: border .15s; background: #fff; color: var(--text); font-family: inherit; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.form-item label .req { color: var(--danger); }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: 94vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-lg { width: 760px; }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-head .x { cursor: pointer; color: var(--text-3); font-size: 18px; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-input { width: 240px; }

/* ===== 排课日历 ===== */
.schedule-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.schedule-grid .cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 72px; padding: 4px; position: relative; }
.schedule-grid .cell.head { background: #f8fafc; font-weight: 600; font-size: 12.5px; text-align: center; padding: 10px 4px; min-height: 40px; }
.schedule-grid .cell.time { background: #f8fafc; color: var(--text-2); font-size: 11.5px; display: flex; align-items: center; justify-content: center; }
.schedule-grid .cell.today { background: var(--primary-light); }
.sched-card { background: var(--primary); color: #fff; border-radius: 6px; padding: 4px 6px; font-size: 11px; margin-bottom: 4px; cursor: pointer; transition: all .15s; }
.sched-card:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sched-card.cancel { background: #e2e8f0; color: var(--text-2); text-decoration: line-through; }
.sched-card.finish { background: var(--success); }

/* ===== 消息中心 ===== */
.noti-list .noti-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.noti-list .noti-item:last-child { border-bottom: none; }
.noti-item .n-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.noti-item b { font-size: 13px; display: block; }
.noti-item p { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.noti-item time { color: var(--text-3); font-size: 11px; }

/* ===== 图表 ===== */
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }

/* ===== 排课模拟方案卡片 ===== */
.plan-card { border: 2px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: all .15s; background: #fff; }
.plan-card:hover, .plan-card.selected { border-color: var(--primary); background: var(--primary-light); }
.plan-card .score { font-size: 22px; font-weight: 800; color: var(--primary); }
.plan-card .meta { color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* ===== 其他 ===== */
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; } .wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.progress { height: 8px; background: #e2e8f0; border-radius: 8px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 8px; }
.progress.green > div { background: var(--success); } .progress.orange > div { background: var(--warning); }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; margin-right: 6px; }
.text-right { text-align: right; }
.kbd { background: #f1f5f9; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: monospace; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* 扫码考勤落地页 */
.att-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.att-header .att-logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #9333ea); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }

/* 二维码卡片 */
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.qr-card canvas { border: 8px solid #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(15,23,42,.12); }
.qr-card .qr-url { background: #f8fafc; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: #475569; word-break: break-all; text-align: center; user-select: all; }

/* 开关 */
.switch { position: relative; width: 44px; height: 24px; background: #cbd5e1; border-radius: 24px; cursor: pointer; transition: background .2s; flex-shrink: 0; display: inline-block; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--success); }
.switch.on .knob { left: 22px; }

/* 月历格子：＋快速添加 + 内容滚动（人多课多不溢出） */
.cell-add { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: background .15s, transform .1s; }
.cell-add:hover { background: var(--primary-dark); transform: scale(1.12); }
.cell-add-sm { width: 17px; height: 17px; font-size: 12px; }
.cell-body { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; margin-top: 3px; }
.cell-body::-webkit-scrollbar { width: 4px; }
.cell-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.cell-body-sm { max-height: 52px; margin-top: 2px; }

/* 排课卡片删除按钮（－） */
.sched-del { width: 17px; height: 17px; border-radius: 50%; background: #fee2e2; color: #dc2626; border: none; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: background .15s, transform .1s; }
.sched-del:hover { background: #dc2626; color: #fff; transform: scale(1.15); }
