:root{
  --green:#0d9488;
  --green-dark:#0f766e;
  --green-deep:#115e59;
  --green-soft:#e8f7f4;
  --blue:#3b82f6;
  --blue-dark:#2563eb;
  --blue-soft:#ecf3ff;
  --amber:#f59e0b;
  --amber-soft:#fff5e6;
  --red:#ef4444;
  --red-soft:#fff0f0;
  --purple:#8b5cf6;
  --purple-soft:#f3eeff;
  --bg:#f4f7f8;
  --card:#ffffff;
  --text:#1f2937;
  --text-2:#4b5563;
  --muted:#8a97a5;
  --border:#e8edf0;
  --shadow:0 2px 12px rgba(15,23,42,.05);
  --shadow-lg:0 18px 50px rgba(15,23,42,.18);
  --radius:14px;
  --radius-sm:10px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg);color:var(--text);
  font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased;
}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
svg{width:18px;height:18px;flex:none}
a{color:var(--green-dark);text-decoration:none}

.app-shell{min-height:100vh}

/* ---------- Sidebar ---------- */
.sidebar{
  position:fixed;inset:0 auto 0 0;width:246px;z-index:60;
  display:flex;flex-direction:column;
  background:linear-gradient(165deg,#0f9c8d 0%,#0f766e 52%,#115e59 100%);
  color:#fff;padding:22px 14px 16px;overflow-y:auto;
}
.sidebar::after{
  content:"";position:absolute;right:-70px;top:-90px;width:240px;height:240px;
  border-radius:50%;background:rgba(255,255,255,.05);pointer-events:none;
}
.brand{display:flex;align-items:center;gap:11px;padding:0 8px 22px;position:relative;z-index:1}
.brand-mark{
  width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.18);
  display:grid;place-items:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark svg{width:22px;height:22px}
.brand-text{display:flex;flex-direction:column;line-height:1.3}
.brand-text strong{font-size:17px;letter-spacing:.4px}
.brand-text span{font-size:11px;color:rgba(255,255,255,.7);margin-top:2px}
.sidebar-class{
  margin:0 4px 16px;padding:11px 12px;border-radius:11px;
  background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.13);position:relative;z-index:1;
}
.sidebar-class label{display:block;font-size:11px;color:rgba(255,255,255,.65);margin-bottom:5px}
.sidebar-class select{
  width:100%;border:0;background:transparent;color:#fff;font-size:14px;font-weight:600;
  outline:none;cursor:pointer;appearance:none;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right center;padding-right:18px;
}
.sidebar-class option{color:#1f2937}
.nav{display:flex;flex-direction:column;gap:3px;position:relative;z-index:1;flex:1}
.nav-label{font-size:10px;letter-spacing:1.6px;color:rgba(255,255,255,.45);padding:10px 12px 6px;font-weight:600}
.nav-item{
  display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:rgba(255,255,255,.82);
  padding:10px 12px;border-radius:10px;text-align:left;font-size:13.5px;transition:.18s ease;
}
.nav-item svg{width:17px;height:17px;opacity:.9}
.nav-item:hover{background:rgba(255,255,255,.1);color:#fff}
.nav-item.active{background:rgba(255,255,255,.2);color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.nav-item .nav-badge{margin-left:auto;background:#fff;color:var(--green-dark);font-size:10px;font-weight:700;padding:1px 7px;border-radius:10px}
.sidebar-foot{position:relative;z-index:1;padding-top:12px}
.sidebar-tip{display:flex;gap:9px;align-items:flex-start;padding:10px 11px;border-radius:10px;background:rgba(255,255,255,.09);margin-bottom:9px}
.tip-dot{width:7px;height:7px;border-radius:50%;background:#7ee0c6;margin-top:6px;box-shadow:0 0 0 3px rgba(126,224,198,.18)}
.sidebar-tip b{display:block;font-size:11.5px;font-weight:600}
.sidebar-tip small{display:block;font-size:10px;color:rgba(255,255,255,.6);margin-top:1px}
.side-setting{
  display:flex;align-items:center;gap:9px;width:100%;padding:9px 11px;border:0;border-radius:9px;
  background:transparent;color:rgba(255,255,255,.7);font-size:12px;
}
.side-setting:hover{background:rgba(255,255,255,.1);color:#fff}
.side-setting svg{width:15px;height:15px}
.sidebar-overlay{display:none}

/* ---------- Main ---------- */
.main-wrap{margin-left:246px;min-height:100vh}
.topbar{
  position:sticky;top:0;z-index:40;height:70px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;padding:0 28px;
}
.menu-btn{display:none}
.topbar-title h1{font-size:18px;font-weight:700;letter-spacing:.2px}
.topbar-title span{font-size:11.5px;color:var(--muted)}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:14px}
.today-chip{font-size:12px;color:var(--text-2);background:var(--bg);border:1px solid var(--border);padding:6px 12px;border-radius:20px;white-space:nowrap}
.avatar{
  width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-weight:700;font-size:14px;
  background:linear-gradient(135deg,var(--green),var(--blue));color:#fff;
}
.icon-btn{
  width:36px;height:36px;border:1px solid var(--border);background:#fff;border-radius:9px;
  display:grid;place-items:center;color:var(--text-2);
}
.icon-btn:hover{background:var(--bg)}
.topbar .menu-btn{display:none}
.content{padding:26px 28px 48px;max-width:1500px;margin:0 auto}

/* ---------- Common ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-head h2{font-size:19px;font-weight:700}
.page-head p{color:var(--muted);font-size:12.5px;margin-top:3px}
.head-actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--border);background:#fff;color:var(--text-2);
  padding:8px 13px;border-radius:9px;font-size:12.5px;font-weight:600;transition:.16s ease;white-space:nowrap;
}
.btn svg{width:15px;height:15px}
.btn:hover{border-color:#cfd9de;background:#fafcfc}
.btn-primary{background:var(--green);border-color:var(--green);color:#fff;box-shadow:0 3px 10px rgba(13,148,136,.2)}
.btn-primary:hover{background:var(--green-dark);border-color:var(--green-dark)}
.btn-blue{background:var(--blue);border-color:var(--blue);color:#fff;box-shadow:0 3px 10px rgba(59,130,246,.18)}
.btn-blue:hover{background:var(--blue-dark);border-color:var(--blue-dark)}
.btn-danger{color:var(--red);border-color:#f8d7d7;background:#fff}
.btn-danger:hover{background:var(--red-soft);border-color:#f3baba}
.btn-sm{padding:5px 9px;font-size:11.5px;border-radius:7px}
.btn-sm svg{width:13px;height:13px}
.btn-ghost{border-color:transparent;background:transparent;color:var(--muted)}
.btn-ghost:hover{background:var(--bg);color:var(--text)}

.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-head{padding:16px 18px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-head h3{font-size:14.5px;font-weight:700;display:flex;align-items:center;gap:8px}
.card-head .sub{font-size:11.5px;color:var(--muted)}
.card-body{padding:2px 18px 18px}

.grid{display:grid;gap:16px}
.grid>*{min-width:0}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.mb16{margin-bottom:16px}
.mt16{margin-top:16px}

.stat{
  background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:17px 18px;
  box-shadow:var(--shadow);display:flex;gap:14px;align-items:flex-start;position:relative;overflow:hidden;
}
.stat::after{content:"";position:absolute;right:-24px;top:-24px;width:90px;height:90px;border-radius:50%;background:var(--tint,#e8f7f4);opacity:.55}
.stat-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--tint,#e8f7f4);color:var(--tone,var(--green));position:relative;z-index:1}
.stat-icon svg{width:20px;height:20px}
.stat-main{position:relative;z-index:1;min-width:0}
.stat-label{font-size:12px;color:var(--muted)}
.stat-value{font-size:25px;font-weight:750;line-height:1.25;margin-top:2px;letter-spacing:-.5px}
.stat-foot{font-size:11px;color:var(--muted);margin-top:3px}
.stat-foot b{color:var(--tone,var(--green));font-weight:700}

.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:640px}
thead th{
  text-align:left;padding:10px 12px;background:#f8fafb;color:var(--muted);font-weight:600;font-size:11.5px;
  border-bottom:1px solid var(--border);white-space:nowrap;
}
tbody td{padding:11px 12px;border-bottom:1px solid #f0f3f5;vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fbfdfd}
.row-actions{display:flex;gap:5px;white-space:nowrap}

.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap}
.badge-green{background:var(--green-soft);color:var(--green-dark)}
.badge-blue{background:var(--blue-soft);color:var(--blue-dark)}
.badge-amber{background:var(--amber-soft);color:#b45309}
.badge-red{background:var(--red-soft);color:#dc2626}
.badge-purple{background:var(--purple-soft);color:#7c3aed}
.badge-gray{background:#f1f4f6;color:#6b7280}

.empty{padding:40px 16px;text-align:center;color:var(--muted)}
.empty svg{width:36px;height:36px;opacity:.35;margin-bottom:10px}
.empty p{font-size:12.5px}

.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;min-width:0}
.field label{font-size:12px;font-weight:600;color:var(--text-2)}
.field label .req{color:var(--red);margin-left:2px}
.field input,.field select,.field textarea,.form-input{
  width:100%;border:1px solid var(--border);background:#fff;border-radius:9px;padding:9px 11px;font-size:13px;
  outline:none;transition:.16s ease;
}
.field textarea{min-height:86px;resize:vertical;line-height:1.6}
.field input:focus,.field select:focus,.field textarea:focus,.form-input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(13,148,136,.1)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.form-grid .full{grid-column:1/-1}

.toolbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.search-box{position:relative;flex:1;min-width:190px;max-width:320px}
.search-box svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:15px;height:15px;color:var(--muted)}
.search-box input{width:100%;border:1px solid var(--border);border-radius:9px;padding:9px 12px 9px 34px;font-size:12.5px;outline:none;background:#fff}
.search-box input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(13,148,136,.1)}
select.form-input{cursor:pointer;min-width:130px}

.quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.quick-btn{
  display:flex;align-items:center;gap:10px;padding:13px;border:1px solid var(--border);border-radius:11px;
  background:#fff;color:var(--text);text-align:left;font-size:12.5px;font-weight:600;transition:.18s ease;
}
.quick-btn:hover{transform:translateY(-2px);border-color:#cfe7e2;box-shadow:0 6px 16px rgba(15,23,42,.07)}
.quick-btn span{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none}

.list-row{display:flex;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid #f0f3f5}
.list-row:last-child{border-bottom:0}
.list-row:hover{background:#fbfdfd}
.list-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none}
.list-icon svg{width:16px;height:16px}
.list-main{flex:1;min-width:0}
.list-main b{display:block;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-main small{display:block;color:var(--muted);font-size:11.5px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-side{display:flex;align-items:center;gap:8px;flex:none}

.chart-box{width:100%;overflow:hidden}
.chart-box svg{width:100%;height:auto;display:block}
.legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:8px;font-size:11px;color:var(--text-2)}
.legend i{width:8px;height:8px;border-radius:3px;display:inline-block;margin-right:5px}

.status-pills{display:flex;gap:5px;flex-wrap:wrap}
.status-pill{
  border:1px solid var(--border);background:#fff;border-radius:7px;padding:5px 11px;font-size:11.5px;font-weight:600;color:var(--text-2);
}
.status-pill:hover{border-color:#cbd5da}
.status-pill.on[data-status="出勤"]{background:var(--green-soft);border-color:#a9dfd3;color:var(--green-dark)}
.status-pill.on[data-status="迟到"]{background:var(--amber-soft);border-color:#f6d79c;color:#b45309}
.status-pill.on[data-status="请假"]{background:var(--blue-soft);border-color:#bfd6ff;color:var(--blue-dark)}
.status-pill.on[data-status="缺勤"]{background:var(--red-soft);border-color:#f6c5c5;color:#dc2626}

.att-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:14px}
.att-stat{background:#f8fafb;border:1px solid var(--border);border-radius:10px;padding:10px;text-align:center}
.att-stat b{display:block;font-size:19px;font-weight:700;line-height:1.3}
.att-stat span{font-size:11px;color:var(--muted)}

.todo-item{display:flex;align-items:flex-start;gap:11px;padding:12px 18px;border-bottom:1px solid #f0f3f5}
.todo-item:last-child{border-bottom:0}
.tick{
  width:18px;height:18px;border-radius:6px;border:1.5px solid #cbd5da;background:#fff;flex:none;margin-top:2px;
  display:grid;place-items:center;color:#fff;
}
.tick.done{background:var(--green);border-color:var(--green)}
.tick.done svg{width:12px;height:12px}
.todo-item.done .todo-title{text-decoration:line-through;color:var(--muted)}
.todo-title{font-size:13px;font-weight:600}
.todo-meta{font-size:11px;color:var(--muted);margin-top:3px;display:flex;gap:9px;flex-wrap:wrap}

.activity-card{padding:16px 18px;border-bottom:1px solid #f0f3f5;display:flex;gap:14px;align-items:flex-start}
.activity-card:last-child{border-bottom:0}
.activity-date{
  width:52px;flex:none;text-align:center;border-radius:10px;background:var(--blue-soft);color:var(--blue-dark);padding:7px 2px;
}
.activity-date b{display:block;font-size:19px;line-height:1.2}
.activity-date span{font-size:10px}
.activity-info{flex:1;min-width:0}
.activity-info h4{font-size:13.5px;font-weight:700;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.activity-info p{font-size:11.5px;color:var(--muted);margin-top:4px}

.notice-item{padding:14px 18px;border-bottom:1px solid #f0f3f5}
.notice-item:last-child{border-bottom:0}
.notice-item h4{font-size:13.5px;font-weight:700;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.notice-item p{font-size:12px;color:var(--text-2);margin:6px 0;white-space:pre-wrap;line-height:1.65}
.notice-item .meta{font-size:11px;color:var(--muted)}

.comm-card{padding:15px 18px;border-bottom:1px solid #f0f3f5}
.comm-card:last-child{border-bottom:0}
.comm-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.comm-head b{font-size:13.5px}
.comm-card p{font-size:12.5px;color:var(--text-2);margin:8px 0 0;white-space:pre-wrap;line-height:1.65}

.seg{display:inline-flex;background:#f1f4f6;border-radius:9px;padding:3px;gap:2px}
.seg button{border:0;background:transparent;padding:5px 11px;border-radius:7px;font-size:11.5px;font-weight:600;color:var(--muted)}
.seg button.active{background:#fff;color:var(--green-dark);box-shadow:0 1px 4px rgba(15,23,42,.09)}

/* ---------- Modal / Toast ---------- */
.modal-overlay{
  position:fixed;inset:0;z-index:100;background:rgba(15,23,42,.45);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;padding:18px;
}
.modal{
  width:min(560px,100%);max-height:88vh;overflow:auto;background:#fff;border-radius:16px;box-shadow:var(--shadow-lg);
  animation:pop .18s ease-out;
}
.modal.wide{width:min(720px,100%)}
@keyframes pop{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.modal-head{padding:18px 20px 14px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px}
.modal-head h3{font-size:16px;font-weight:700}
.modal-body{padding:18px 20px}
.modal-foot{padding:14px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:9px;background:#fafcfc;border-radius:0 0 16px 16px}
.modal-note{background:var(--blue-soft);border-radius:9px;padding:10px 12px;font-size:12px;color:var(--blue-dark);margin-bottom:14px;line-height:1.6}
.modal-list{display:flex;flex-direction:column;gap:8px}
.modal-list-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:9px}
.modal-list-item .grow{flex:1;min-width:0}
.modal-list-item b{font-size:13px}
.modal-list-item small{display:block;color:var(--muted);font-size:11px}

.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;opacity:0}
.toast-root{position:fixed;top:18px;right:18px;z-index:200;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.toast{
  background:#fff;border:1px solid var(--border);border-left:3px solid var(--green);border-radius:10px;
  padding:10px 14px;box-shadow:0 8px 26px rgba(15,23,42,.14);font-size:12.5px;font-weight:600;min-width:210px;
  animation:slideIn .2s ease-out;
}
.toast.error{border-left-color:var(--red)}
.toast.info{border-left-color:var(--blue)}
@keyframes slideIn{from{opacity:0;transform:translateX(14px)}to{opacity:1;transform:none}}

/* ---------- Responsive ---------- */
@media (max-width:1180px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-actions{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:960px){
  .sidebar{transform:translateX(-100%);transition:transform .24s ease;box-shadow:12px 0 30px rgba(15,23,42,.2)}
  .sidebar.open{transform:none}
  .sidebar-overlay.show{display:block;position:fixed;inset:0;z-index:50;background:rgba(15,23,42,.4)}
  .main-wrap{margin-left:0}
  .topbar .menu-btn{display:grid}
  .topbar{padding:0 18px;height:62px}
  .content{padding:20px 18px 40px}
  .grid-3,.grid-2{grid-template-columns:1fr}
  .att-stats{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:600px){
  body{font-size:13px}
  .topbar-title h1{font-size:16px}
  .topbar-title span{display:none}
  .today-chip{display:none}
  .content{padding:16px 12px 36px}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stat{padding:13px;gap:10px}
  .stat-icon{width:34px;height:34px;border-radius:10px}
  .stat-icon svg{width:17px;height:17px}
  .stat-label{font-size:11px}
  .stat-value{font-size:21px}
  .stat-foot{font-size:10px}
  .card-head{padding:14px 14px 10px}
  .card-body{padding:2px 14px 14px}
  .page-head h2{font-size:17px}
  .head-actions{width:100%}
  .head-actions .btn{flex:1}
  .quick-actions{gap:8px}
  .quick-btn{padding:11px;font-size:12px}
  .att-stats{grid-template-columns:repeat(2,1fr)}
  .form-grid{grid-template-columns:1fr}
  .list-row,.todo-item,.activity-card,.notice-item,.comm-card{padding-left:14px;padding-right:14px}
  .modal-overlay{padding:10px;align-items:flex-end}
  .modal{max-height:92vh;border-radius:16px 16px 10px 10px}
  .toast-root{left:12px;right:12px;top:12px}
  .toast{min-width:0}
  .seg button{padding:5px 8px}
}
