:root{
  --bg:#eef0f3;
  --panel:#ffffff;
  --sidebar:#050505;
  --text:#16181d;
  --muted:#8d93a1;
  --primary:#7b61ff;
  --primary-dark:#6248ef;
  --danger:#ff5d5d;
  --line:#ececf2;
  --shadow:0 8px 24px rgba(15, 23, 42, 0.08);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text)}
.hidden{display:none!important}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:200px;background:var(--sidebar);padding:24px 14px;display:flex;flex-direction:column;gap:18px;position:fixed;left:0;top:0;bottom:0;z-index:30}
.logo{color:#fff;font-size:20px;text-align:center;margin-bottom:8px;opacity:.9}
.nav-item{display:flex;align-items:center;gap:12px;color:#fff;padding:18px 18px;border-radius:14px;cursor:pointer;transition:.2s;background:transparent}
.nav-item.active{background:linear-gradient(180deg,rgba(86,67,255,.7),rgba(65,35,161,.8));box-shadow:0 0 18px rgba(123,97,255,.35) inset,0 0 16px rgba(123,97,255,.25)}
.nav-item:hover{background:rgba(255,255,255,.06)}
.nav-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);border-radius:8px;font-size:16px}
.nav-text{font-size:16px;font-weight:700}
.main-content{margin-left:200px;padding:24px 26px 34px;flex:1;min-width:0}
.topbar{display:flex;align-items:center;gap:12px;padding:6px 0 14px}
.spacer{flex:1}
.icon-btn{width:42px;height:42px;border:none;border-radius:12px;background:transparent;font-size:22px;cursor:pointer;color:#4c4f57}
.avatar{width:40px;height:40px;display:flex;align-items:center;justify-content:center}
.avatar-wrap{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:#fff;box-shadow:0 4px 12px rgba(45,21,79,.12)}
.avatar-img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.topbar-avatar{width:40px;height:40px}
.mini-avatar{width:32px;height:32px;flex:0 0 32px}
.profile-avatar{width:84px;height:84px;box-shadow:0 8px 24px rgba(45,21,79,.18)}
.staff-name-cell{display:flex;align-items:center;gap:10px}
.card-title.with-avatar{display:flex;align-items:center;gap:10px}
.staff-view-avatar{display:flex;justify-content:center;margin-bottom:16px}
.staff-avatar-editor{display:flex;align-items:center;gap:18px;margin-bottom:16px}
.staff-avatar-preview{flex:0 0 auto}
.staff-avatar-actions{display:flex;flex-direction:column;gap:10px;min-width:0}
.file-btn{position:relative;overflow:hidden}
.role-badge{background:#fff;border:1px solid var(--line);padding:7px 12px;border-radius:999px;font-size:13px;color:#555}

.attendance-topbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.attendance-status{height:34px;display:flex;align-items:center;padding:0 12px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:13px;color:#555;white-space:nowrap}

.attendance-live-box{min-width:136px;display:flex;flex-direction:column;justify-content:center;padding:8px 14px;border-radius:16px;background:linear-gradient(135deg,#6f5ef7 0%,#8c6dff 100%);color:#fff;box-shadow:0 8px 20px rgba(111,94,247,.18)}
.attendance-live-label{font-size:12px;line-height:1;opacity:.86}
.attendance-live-time{margin-top:6px;font-size:24px;line-height:1;font-weight:800;letter-spacing:1px}
.attendance-live-box.hidden{display:none}

.tag-success{background:#eefbf3;color:#1f9d55}
.attendance-running-bar{margin:0 0 14px;padding:10px 12px;border-radius:12px;background:#f3f7ff;color:#4763d8;font-size:13px;font-weight:700}
.attendance-running-bar.muted{background:#f6f7fb;color:#8b93a5}
.page-title{font-size:22px;margin:6px 0 18px;font-weight:800}
.toolbar,.top-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar.compact{margin-bottom:22px}
.right-only{justify-content:flex-end}
.stretch{flex:1;min-width:280px}
.input,.select{height:40px;border:1px solid #dfe3ec;border-radius:2px;background:#fff;padding:0 14px;font-size:15px;outline:none;min-width:220px}
.input:focus,.select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(123,97,255,.08)}
.btn{height:40px;padding:0 16px;border:1px solid var(--line);background:#fff;color:#444;border-radius:2px;cursor:pointer;font-size:15px;font-weight:600;transition:.2s}
.btn:hover{transform:translateY(-1px)}
.btn-sm{height:34px;padding:0 12px;font-size:13px}
.btn-full{width:100%}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-primary-outline{background:#fff;border-color:var(--primary);color:var(--primary)}
.btn-light{background:#fff}
.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-ghost-danger{border-color:#ffb6b6;color:var(--danger);background:#fff}
.panel{background:var(--panel);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px 24px}
.table-panel{padding:0;border-radius:0;box-shadow:none;background:transparent}
.team-top-table{background:var(--panel);border-radius:0;overflow:hidden}
.table{width:100%;border-collapse:collapse;background:var(--panel)}
.table thead th{font-size:15px;text-align:left;padding:18px 16px;border-bottom:1px solid var(--line);background:#fff;font-weight:800;white-space:nowrap}
.table tbody td{padding:18px 16px;border-bottom:1px solid #f1f2f7;vertical-align:middle}
.table tbody tr:last-child td{border-bottom:none}
.empty-state{text-align:center;color:#c4c9d4;padding:70px 16px;font-size:26px;background:#fff}
.view{display:none}
.view.active{display:block}

.stat-line{margin:6px 0 12px;font-size:16px}
.search-panel{margin-top:30px;min-height:198px}
.search-result-table{margin-top:14px;background:#fff;border-radius:12px;overflow:hidden}
.tag{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;font-size:12px;background:#f4f2ff;color:#6d56ef;font-weight:700}
.action-group{display:flex;gap:8px;flex-wrap:wrap}
.timer-box{display:flex;flex-direction:column;gap:8px}
.timer-label{font-size:14px;color:#777}
.timer-value{font-size:22px;font-weight:800;color:#333}
.modal-mask{position:fixed;inset:0;background:rgba(10,11,15,.45);z-index:80}
.modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(760px,calc(100vw - 28px));background:#fff;border-radius:18px;box-shadow:0 20px 80px rgba(0,0,0,.24);z-index:81;overflow:hidden}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line)}
.modal-title{font-size:18px;font-weight:800}
.modal-close{background:transparent;border:none;font-size:26px;cursor:pointer;color:#999}
.modal-body{padding:20px;max-height:70vh;overflow:auto}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-item label{display:block;margin:0 0 8px;font-weight:700;font-size:14px}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:18px 20px;border-top:1px solid var(--line)}
.toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:#fff;color:#333;box-shadow:var(--shadow);border-radius:12px;padding:12px 18px;z-index:99;font-weight:700}
.login-screen{position:fixed;inset:0;background:#f4effa url('login-bg.png') center center/cover no-repeat;display:flex;align-items:center;justify-content:flex-end;padding:24px 17vw 24px 24px;overflow:hidden}
.login-card{width:min(420px,100%);background:rgba(255,250,255,.92);border:1px solid rgba(255,255,255,.78);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-radius:18px;box-shadow:0 20px 80px rgba(41,54,88,.14);padding:28px 30px}
.login-title{font-size:30px;font-weight:900;margin-bottom:8px;letter-spacing:1px;color:#58496f;text-shadow:0 2px 10px rgba(81,68,135,.08)}
.login-subtitle{color:#7d728f;margin-bottom:20px;line-height:1.6}
.form-row{margin-bottom:16px}
.login-tips{margin-top:14px;color:#8c94a2;font-size:13px;line-height:1.65}
.mobile-sidebar-open .sidebar{transform:translateX(0)}
.mobile-sidebar-open::after{content:"";position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:25}
.hint-text{font-size:13px;color:#999;margin-top:8px}
.kv-line{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;padding:14px 16px;background:#fff;border-top:1px solid var(--line)}
.kv-line div{font-size:14px}
.permission-note{font-size:13px;color:#7b61ff;font-weight:700}
@media (max-width: 920px){
  .sidebar{transform:translateX(-100%);transition:.25s}
  .attendance-topbar{order:3;width:100%;margin-top:8px}
  .attendance-status{flex:1;min-width:0}
  .main-content{margin-left:0;padding:18px 14px 24px}
  .toolbar,.top-actions{gap:8px}
  .stretch{min-width:0;width:100%}
  .input,.select,.btn{width:100%}
  .toolbar .btn,.top-actions .btn{width:auto}
  .table{display:block;overflow-x:auto;white-space:nowrap}
  .panel{padding:16px}
  .search-panel{min-height:auto}
  .form-grid{grid-template-columns:1fr}
  .role-badge{display:none}
}
@media (max-width: 640px){
  .staff-avatar-editor{flex-direction:column;align-items:flex-start}
  .profile-avatar{width:72px;height:72px}

  .topbar{padding-top:0}
  .attendance-topbar{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .attendance-status{grid-column:1 / -1;height:auto;min-height:36px;padding:8px 12px;line-height:1.4}
  .attendance-live-box{grid-column:1 / -1;min-width:0}
  .page-title{font-size:20px}
  .panel{border-radius:16px}
  .toolbar,.top-actions{flex-direction:column;align-items:stretch}
  .toolbar .btn,.top-actions .btn{width:100%}
  .action-group{flex-direction:column}
  .timer-value{font-size:20px}
  .kv-line{grid-template-columns:1fr 1fr;gap:10px}
}


.login-screen::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(255,255,255,.06),rgba(255,255,255,0) 55%);pointer-events:none}
.login-stage{position:relative;z-index:2;display:flex;justify-content:flex-end;width:100%}
.login-badge{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:0 14px;border-radius:999px;background:rgba(123,97,255,.08);color:#7b61ff;font-size:13px;font-weight:700;margin-bottom:12px}
.login-label{display:block;margin:0 0 8px;font-size:14px;font-weight:700;color:#5d4b73}
.login-card .input{height:42px;border-radius:2px;background:rgba(255,255,255,.78)}
.login-card .btn{height:42px}
.login-footer-left,.login-footer-right{position:fixed;bottom:8px;z-index:2;font-size:12px;color:rgba(80,77,88,.85)}
.login-footer-left{left:16px}
.login-footer-right{right:16px}
.timer-sub{font-size:12px;color:#8a7db0}
@media (max-width: 920px){
  .login-screen{justify-content:center;padding:18px;background-position:35% center}
  .login-stage{justify-content:center}
  .login-card{width:min(420px,100%);padding:24px 20px}
}
@media (max-width: 640px){
  .staff-avatar-editor{flex-direction:column;align-items:flex-start}
  .profile-avatar{width:72px;height:72px}

  .login-screen{padding:16px;background-position:32% center}
  .login-title{font-size:24px}
  .login-subtitle{font-size:13px}
  .login-footer-left,.login-footer-right{display:none}
}


/* v4: 电脑版保持v2布局，手机端单独App化 */

.desktop-only{display:block}
.mobile-only{display:none}
.topbar-left{display:flex;align-items:center;gap:12px}
.mobile-brand{display:none}
.mobile-brand-title{font-size:17px;font-weight:900;line-height:1.2}
.mobile-brand-sub{font-size:12px;color:#8c92a3;margin-top:2px}
.logout-btn{min-width:72px}
.desktop-toolbar-fix .btn,.desktop-toolbar-fix .input,.desktop-toolbar-fix .select{border-radius:2px}
.desktop-toolbar-fix .btn{height:40px;font-weight:600}
.desktop-toolbar-fix .input,.desktop-toolbar-fix .select{height:40px}

.mobile-card-list{display:flex;flex-direction:column;gap:12px}
.app-card{background:#fff;border-radius:20px;padding:16px;box-shadow:0 10px 28px rgba(39,48,80,.08);border:1px solid rgba(123,97,255,.06)}
.app-card.compact{padding:14px}
.app-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-title{font-size:17px;font-weight:900;line-height:1.3;color:#202330}
.card-sub{margin-top:4px;font-size:12px;color:#9096a6}
.card-text{font-size:13px;color:#687086;margin-bottom:12px}
.metric-chip{padding:8px 10px;border-radius:12px;background:#f5f1ff;color:#6a55ef;font-size:13px;font-weight:800;white-space:nowrap}
.app-card-grid{display:grid;gap:10px;margin-bottom:14px}
.app-card-grid.two{grid-template-columns:1fr 1fr}
.compact-grid{margin-bottom:12px}
.metric-box{padding:12px;border-radius:16px;background:#f7f8fc;border:1px solid #eef0f6}
.metric-highlight{background:linear-gradient(135deg,#f7f1ff,#f2f5ff)}
.metric-label{font-size:12px;color:#8f96a8;margin-bottom:8px}
.metric-value{font-size:20px;font-weight:900;color:#212433;line-height:1.2}
.metric-value.small{font-size:14px;font-weight:700}
.metric-inline{font-size:12px;color:#887db0;margin:-4px 0 12px}
.app-action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.app-action-row.grid4{grid-template-columns:repeat(4,minmax(0,1fr))}
.app-action-row.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}
.app-action-row.single{grid-template-columns:1fr}
.soft-btn{height:44px;border:none;border-radius:14px;background:#f4f5f9;color:#394053;font-size:14px;font-weight:800}
.soft-btn.primary{background:linear-gradient(135deg,#7b61ff,#6b55ee);color:#fff}
.soft-btn.danger{background:#fff1f1;color:#ff5d5d;border:1px solid #ffd2d2}
.soft-btn.warning{background:#fff3eb;color:#ff7f4d;border:1px solid #ffd9c8}
.timer-mini{text-align:right}
.timer-mobile{font-size:24px}
.app-empty{padding:40px 16px;border-radius:18px;background:#fff;text-align:center;color:#b4bac8;box-shadow:0 10px 28px rgba(39,48,80,.08)}
.mobile-bottom-nav{display:none}
.mobile-app-actions{justify-content:stretch}
.mobile-app-actions .btn{width:100%}
.mobile-search-panel{padding:16px}

@media (min-width: 921px){
  .sidebar{transform:none!important}
  .mobile-brand,.mobile-bottom-nav,.mobile-only{display:none!important}
  .desktop-only{display:block!important}
  .mobile-app-toolbar{display:flex!important;grid-template-columns:none!important}
  .mobile-app-toolbar .stretch{width:auto!important;grid-column:auto!important}
  .mobile-app-actions{justify-content:flex-end!important}
  .search-panel{padding:22px 24px}
}

@media (max-width: 920px){
  .desktop-only{display:none!important}
  .mobile-only{display:block}
  body{background:#f4f5f8}
  .sidebar{transform:translateX(-100%);transition:.25s;width:min(78vw,280px);padding-top:calc(env(safe-area-inset-top, 0px) + 20px)}
  .main-content{margin-left:0;padding:calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 96px)}
  .topbar{position:sticky;top:0;z-index:20;background:rgba(244,245,248,.92);backdrop-filter:blur(10px);padding:10px 0 14px;margin:0 0 4px}
  .mobile-brand{display:block}
  .role-badge{display:none}
  .toolbar,.top-actions{gap:8px}
  .mobile-app-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .mobile-app-toolbar .stretch{grid-column:1 / -1;min-width:0;width:100%}
  .mobile-app-toolbar .btn,.mobile-app-toolbar .select{width:100%}
  .search-panel{min-height:auto}
  .form-grid{grid-template-columns:1fr}
  .panel{padding:16px;border-radius:20px}
  .team-top-table{display:none}
  .mobile-bottom-nav{display:grid;grid-template-columns:repeat(3,1fr);position:fixed;left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom, 0px) + 10px);background:rgba(255,255,255,.96);backdrop-filter:blur(14px);border:1px solid rgba(121,102,255,.08);border-radius:22px;padding:8px;box-shadow:0 10px 30px rgba(40,47,79,.14);z-index:50}
  .bottom-nav-item{border:none;background:transparent;border-radius:16px;padding:10px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#747b8c;font-weight:800}
  .bottom-nav-item span{font-size:18px}
  .bottom-nav-item.active{background:linear-gradient(135deg,rgba(123,97,255,.14),rgba(123,97,255,.05));color:#6a55ef}
  .search-result-table{margin-top:0}
}

@media (max-width: 640px){
  .staff-avatar-editor{flex-direction:column;align-items:flex-start}
  .profile-avatar{width:72px;height:72px}

  .login-screen{justify-content:center;padding:16px;background-position:32% center}
  .login-stage{justify-content:center}
  .login-card{width:min(420px,100%);padding:24px 20px}
  .login-title{font-size:24px}
  .login-subtitle{font-size:13px}
  .login-footer-left,.login-footer-right{display:none}
  .topbar-left{gap:10px}
  .icon-btn{width:40px;height:40px;background:#fff;border:1px solid #eceef3;box-shadow:0 6px 18px rgba(42,52,84,.06)}
  .avatar{width:38px;height:38px;font-size:14px}
  .logout-btn{padding:0 14px;height:38px;font-size:14px}
  .page-title{font-size:18px;margin-top:2px}
  .mobile-app-toolbar{grid-template-columns:1fr}
  .mobile-app-toolbar .stretch{grid-column:auto}
  .app-card{border-radius:18px;padding:14px}
  .app-card-grid.two{grid-template-columns:1fr 1fr}
  .metric-value{font-size:18px}
  .app-action-row,.app-action-row.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .soft-btn{height:42px;font-size:14px}
  .timer-mobile{font-size:22px}
  .modal{left:0;right:0;top:auto;bottom:0;transform:none;width:100%;max-width:none;border-radius:20px 20px 0 0;max-height:88vh}
  .modal-body{max-height:calc(88vh - 134px);padding:16px}
  .modal-footer{padding:14px 16px calc(env(safe-area-inset-bottom, 0px) + 14px)}
  .kv-line{grid-template-columns:1fr 1fr;gap:10px}
}


.sheet-meta{margin:6px 0 12px;}
.sheet-meta-line{display:flex;flex-wrap:wrap;gap:10px 18px;font-size:13px;color:#666;}
.month-sheet-scroll{max-height:56vh;overflow:auto;padding-bottom:6px;}
.month-sheet-grid{display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));gap:10px;}
.month-sheet-cell{background:#faf8ff;border:1px solid #e6dcff;border-radius:14px;padding:10px;}
.month-sheet-day{font-weight:700;color:#5a47d6;margin-bottom:8px;}
.day-input{height:40px;padding:8px 10px;font-size:13px;}
.month-input{min-width:160px;}
@media (max-width: 768px){
  .month-sheet-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .sheet-meta-line{font-size:12px;gap:6px 12px;}
}


.team-group-row td{background:#f3efff!important;color:#5e4fd8;font-weight:800;border-top:1px solid #e8e0ff;border-bottom:1px solid #e8e0ff}
.team-group-title{margin:8px 0 2px;padding:8px 4px 2px;font-size:13px;font-weight:900;color:#5e4fd8}
.balance-live{font-weight:800;color:#202330}
.balance-hint{margin-top:6px;font-size:12px;color:#8a92a6}
.balance-danger{color:#ff4d4f!important}
.balance-warning{color:#d48806!important;font-weight:800}

.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0 16px}
.summary-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.summary-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.summary-grid.five{grid-template-columns:repeat(5,minmax(0,1fr))}
.summary-card{background:#fff;border:1px solid #ececf3;border-radius:14px;padding:12px 14px}
.balance-danger{color:#ff4d4f !important;font-weight:800}
@media (max-width:768px){.summary-grid,.summary-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}.app-action-row.grid3{grid-template-columns:1fr}}


.modal.worklog-modal{width:min(1360px,calc(100vw - 48px));max-height:92vh;border-radius:0;background:var(--bg)}
.modal.worklog-modal .modal-header,.modal.worklog-modal .modal-footer{display:none}
.modal.worklog-modal .modal-body{padding:0;max-height:none;overflow:visible}
.modal.worklog-modal .worklog-page{max-height:92vh;overflow:auto}
.worklog-page{padding:20px 26px 28px;background:var(--bg)}
.worklog-page-header{position:relative;padding:4px 0 18px;text-align:center}
.worklog-page-title{font-size:22px;font-weight:900;letter-spacing:1px}
.worklog-page-sub{margin-top:6px;color:#8f96a8;font-size:13px}
.worklog-close{position:absolute;right:0;top:-4px;width:42px;height:42px;border-radius:12px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow)}
.worklog-filter-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.worklog-date-range{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.worklog-date-range .input{min-width:170px}
.worklog-sep{color:#8f96a8;font-weight:700}
.worklog-btns{display:flex;gap:10px;flex-wrap:wrap}
.worklog-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 18px}
.worklog-summary-grid.six{grid-template-columns:repeat(6,minmax(0,1fr))}
.worklog-summary-card{background:#fff;border:1px solid var(--line);padding:14px 18px;border-radius:4px;min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 4px 16px rgba(16,24,40,.04)}
.worklog-summary-card span{color:#4d5566;font-size:14px}
.worklog-summary-card b{font-size:18px;color:#141821}
.worklog-section-title{margin:4px 0 10px;font-size:15px;font-weight:900;color:#111827}
.worklog-type-stats{margin:0 0 18px}
.worklog-type-mobile{display:flex;flex-direction:column;gap:10px}
.worklog-type-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;line-height:1.8;color:#4d5566}
.worklog-type-card-head{display:flex;align-items:center;justify-content:space-between;color:#111827}
.worklog-table-wrap{background:#fff;border:1px solid var(--line);border-radius:4px;overflow:hidden;box-shadow:0 4px 16px rgba(16,24,40,.04)}
.worklog-table thead th{background:#fff}
.worklog-table td,.worklog-table th{white-space:nowrap}
.worklog-fee{color:#d94841;font-weight:700}
.worklog-income{color:#1f7a4d;font-weight:700}
.worklog-empty{padding:60px 20px;text-align:center;color:#b8becb;background:#fff;border:1px solid var(--line);border-radius:4px}
.worklog-mobile-list{display:flex;flex-direction:column;gap:12px}
.worklog-mobile-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;box-shadow:0 4px 16px rgba(16,24,40,.04)}
.worklog-mobile-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:10px}
.worklog-mobile-name{font-size:16px;font-weight:800}
.worklog-mobile-sub,.worklog-mobile-meta{font-size:12px;color:#7f8798;line-height:1.6}
.worklog-mobile-income{font-size:14px;font-weight:800;color:#1f7a4d}
@media (max-width:920px){
  .modal.worklog-modal{width:100vw;height:100vh;max-height:none;border-radius:0}
  .worklog-page{padding:14px 14px calc(env(safe-area-inset-bottom,0px) + 20px)}
  .worklog-page-header{padding-top:0}
  .worklog-close{right:0;top:0}
  .worklog-filter-bar{flex-direction:column;align-items:stretch}
  .worklog-date-range,.worklog-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .worklog-date-range .input,.worklog-btns .btn{width:100%;min-width:0}
  .worklog-sep{display:none}
  .worklog-summary-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .worklog-page-title{font-size:20px}
  .worklog-summary-grid{grid-template-columns:1fr}
  .worklog-date-range,.worklog-btns{grid-template-columns:1fr}
}

.oplog-group{margin-bottom:16px}
.oplog-day{font-size:15px;font-weight:800;color:#4b5565;margin:10px 0}
.pager-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:16px}
.pager-info{color:#7f8798;font-size:13px}
.pager-actions{display:flex;gap:8px;flex-wrap:wrap}
.op-search-row{margin-bottom:16px}
.op-search-row .input{min-width:180px}
@media (max-width:768px){.summary-grid.five{grid-template-columns:repeat(2,minmax(0,1fr))}.pager-bar{flex-direction:column;align-items:flex-start}.op-search-row .input{min-width:0}}

/* Commercial admin refresh */
:root{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --sidebar:#111827;
  --text:#111827;
  --muted:#667085;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --danger:#dc2626;
  --line:#e4e7ec;
  --shadow:0 1px 2px rgba(16,24,40,.06),0 8px 24px rgba(16,24,40,.06);
  --radius:8px;
}

body{background:var(--bg);color:var(--text)}
.app-shell{background:var(--bg)}
.sidebar{width:232px;background:var(--sidebar);padding:18px 12px;gap:6px;border-right:1px solid rgba(255,255,255,.08)}
.logo{height:54px;margin:0 0 8px;padding:0 12px;display:flex;align-items:center;gap:10px;color:#fff;font-size:0;text-align:left}
.logo::before{content:"";width:10px;height:28px;border-radius:3px;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.logo::after{content:"梦启管理台";font-size:17px;font-weight:800}
.sidebar .nav-item{position:relative;min-height:48px;border-radius:10px;padding:0 12px;color:#b7c0d1;gap:12px;font-weight:700;border:1px solid transparent;background:transparent}
.sidebar .nav-item::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:0 999px 999px 0;background:transparent}
.sidebar .nav-item:hover{background:#172033;color:#fff;border-color:rgba(148,163,184,.18)}
.sidebar .nav-item.active{background:#1d2939;color:#fff;border-color:rgba(148,163,184,.18);box-shadow:none}
.sidebar .nav-item.active::before{background:#22c55e}
.sidebar .nav-icon{position:relative;width:30px;height:30px;flex:0 0 30px;border-radius:8px;background:#111827;border:1px solid rgba(148,163,184,.24);box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
.sidebar .nav-item.active .nav-icon{background:#0f172a;border-color:rgba(34,197,94,.55)}
.sidebar .nav-icon::before,.sidebar .nav-icon::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-sizing:border-box}
.sidebar .nav-icon-dashboard::before{width:13px;height:13px;border:2px solid currentColor;border-radius:3px;box-shadow:8px 0 0 -5px currentColor,0 8px 0 -5px currentColor,8px 8px 0 -5px currentColor}
.sidebar .nav-icon-team::before{width:15px;height:12px;border:2px solid currentColor;border-radius:3px}
.sidebar .nav-icon-team::after{width:8px;height:2px;background:currentColor;border-radius:999px;transform:translate(-50%,7px)}
.sidebar .nav-icon-users::before{width:9px;height:9px;border:2px solid currentColor;border-radius:50%;transform:translate(-50%,-62%)}
.sidebar .nav-icon-users::after{width:15px;height:8px;border:2px solid currentColor;border-top:none;border-radius:0 0 9px 9px;transform:translate(-50%,24%)}
.sidebar .nav-icon-staff::before{width:12px;height:12px;border:2px solid currentColor;border-radius:3px;transform:translate(-50%,-50%) rotate(45deg)}
.nav-text{font-size:14px;font-weight:800;letter-spacing:0}
.main-content{margin-left:232px;padding:0 28px 36px}
.topbar{position:sticky;top:0;z-index:24;margin:0 -28px 24px;padding:14px 28px;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}
.page-title{font-size:22px;margin:0 0 18px;font-weight:800}
.role-badge{border-radius:999px;background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.attendance-status{border-radius:8px;background:#f8fafc;color:#344054}
.attendance-live-box{border-radius:8px;background:#0f766e;box-shadow:none}
.btn{border-radius:6px;border-color:#d0d5dd;color:#344054;background:#fff;font-weight:700;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.btn:hover{transform:none;border-color:#98a2b3}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.btn-primary-outline{border-color:#93c5fd;color:#1d4ed8;background:#eff6ff}
.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-ghost-danger{border-color:#fecaca;color:#b91c1c;background:#fff}
.input,.select{border-radius:6px;border-color:#d0d5dd;background:#fff;color:#111827}
.input:focus,.select:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.panel,.summary-card,.worklog-summary-card,.worklog-table-wrap{border:1px solid var(--line);border-radius:8px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.table-panel{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.team-top-table{border-radius:8px;border:1px solid var(--line)}
.table{background:#fff}
.table thead th{background:#f8fafc;color:#475467;font-size:13px;padding:13px 16px;border-bottom:1px solid var(--line)}
.table tbody td{padding:14px 16px;border-bottom:1px solid #eef2f6;color:#1f2937}
.table tbody tr:hover td{background:#f9fafb}
.empty-state{font-size:16px;color:#98a2b3;background:#fff}
.tag{border-radius:6px;background:#ecfdf3;color:#027a48}
.tag-success{background:#ecfdf3;color:#027a48}
.timer-value{font-size:20px;color:#111827}
.modal{border-radius:10px;box-shadow:0 24px 64px rgba(16,24,40,.2)}
.modal-header,.modal-footer{background:#fff}
.modal-title{font-size:17px}
.kv-line{border:1px solid var(--line);border-radius:8px;background:#f8fafc}
.toast{border:1px solid var(--line);border-radius:8px}
.app-card{border-radius:8px;border:1px solid var(--line);box-shadow:0 1px 2px rgba(16,24,40,.05)}
.metric-box{border-radius:8px;background:#f8fafc;border-color:#eef2f6}
.metric-chip{border-radius:6px;background:#eff6ff;color:#1d4ed8}
.soft-btn{border-radius:6px;background:#f2f4f7;color:#344054}
.soft-btn.primary{background:#2563eb;color:#fff}
.soft-btn.danger{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
.soft-btn.warning{background:#fffbeb;color:#b45309;border-color:#fde68a}
.soft-btn:disabled{opacity:.55;cursor:not-allowed}
.login-screen{background:#eef2f6 url('login-bg.png') center center/cover no-repeat;justify-content:flex-end}
.login-screen::before{background:rgba(17,24,39,.22)}
.login-card{border-radius:10px;border:1px solid rgba(255,255,255,.82);box-shadow:0 24px 64px rgba(16,24,40,.18);background:rgba(255,255,255,.94)}
.login-title{color:#111827;font-size:28px;letter-spacing:0;text-shadow:none}
.login-label{color:#344054}
.login-card .input,.login-card .btn{border-radius:6px}
.login-footer-left,.login-footer-right{color:rgba(255,255,255,.88)}
.worklog-page{background:var(--bg)}
.worklog-page-title{letter-spacing:0}
.worklog-empty{border-radius:8px}
.oplog-day{color:#344054}
.nav-section-label{padding:14px 12px 7px;color:#718096;font-size:12px;font-weight:900}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 16px}
.page-subtitle{font-size:14px;color:#667085;margin-top:6px}
.page-head-actions{display:flex;gap:10px;flex-wrap:wrap}
.summary-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}
.summary-tile{min-height:82px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.summary-tile span{display:block;font-size:12px;font-weight:900;color:#667085}
.summary-tile b{display:block;margin-top:10px;font-size:22px;line-height:1;font-weight:900;color:#101828;font-variant-numeric:tabular-nums}
.summary-tile em{display:block;margin-top:9px;font-style:normal;font-size:12px;color:#98a2b3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.summary-tile-danger{border-color:#fecaca;background:#fffafa}
.summary-tile-danger b{color:#b42318}
.summary-tile-warning{border-color:#fedf89;background:#fffdf5}
.summary-tile-warning b{color:#b54708}
.role-scope-panel{display:grid;grid-template-columns:minmax(140px,180px) 1fr auto;gap:14px;align-items:center;margin:0 0 16px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.scope-title{font-size:16px;font-weight:900;color:#111827}
.scope-body{font-size:13px;color:#667085;line-height:1.6}
.scope-tags{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.scope-tags span{display:inline-flex;align-items:center;height:28px;padding:0 10px;border-radius:999px;background:#f2f4f7;color:#344054;font-size:12px;font-weight:800}
.dashboard-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:16px}
.dashboard-card{min-height:118px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:16px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
button.dashboard-card{font:inherit;text-align:left;color:inherit;cursor:pointer;width:100%;appearance:none;-webkit-appearance:none}
.dashboard-card-clickable{transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.dashboard-card-clickable:hover{border-color:#bfdbfe;box-shadow:0 8px 24px rgba(37,99,235,.12);transform:translateY(-1px)}
.dashboard-card-clickable:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.dashboard-card-clickable .dashboard-card-note::after{content:" · 点击查看明细";color:#2563eb;font-weight:800}
.dashboard-card.danger{border-color:#fecaca;background:#fffafa}
.dashboard-card-label{font-size:13px;color:#667085;font-weight:800}
.dashboard-card-value{margin-top:12px;font-size:24px;line-height:1;font-weight:900;color:#111827}
.dashboard-card.danger .dashboard-card-value{color:#b91c1c}
.dashboard-card-note{margin-top:10px;font-size:12px;color:#98a2b3}
.dashboard-columns{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);gap:16px}
.dashboard-panel{padding:0;overflow:hidden}
.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid var(--line)}
.panel-head h2{margin:0;font-size:16px}
.panel-head p{margin:6px 0 0;font-size:12px;color:#667085}
.dashboard-list{padding:8px 0}
.dashboard-list-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid #f2f4f7}
.dashboard-list-row:last-child{border-bottom:none}
.dashboard-list-row b{display:block;font-size:14px;color:#111827}
.dashboard-list-row span{display:block;margin-top:4px;font-size:12px;color:#667085}
.dashboard-list-row strong{font-size:14px;color:#1d4ed8;white-space:nowrap}
.dashboard-empty{padding:28px 16px;color:#98a2b3;text-align:center}
.quick-action-grid{display:grid;gap:10px;padding:16px}
.quick-action{width:100%;text-align:left;border:1px solid var(--line);border-radius:8px;background:#fff;padding:14px;cursor:pointer;transition:.16s}
.quick-action:hover{border-color:#93c5fd;background:#eff6ff}
.quick-action b{display:block;font-size:14px;color:#111827}
.quick-action span{display:block;margin-top:6px;font-size:12px;color:#667085;line-height:1.5}
.list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 16px;padding:14px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.toolbar-main{display:flex;align-items:center;gap:10px;flex:1;min-width:0}
.toolbar-main .input{height:38px;min-width:260px}
.toolbar-main .btn{height:38px;min-width:72px}
.toolbar-meta{margin:0;white-space:nowrap;color:#667085;font-size:13px}
.toolbar-meta span{font-weight:900;color:#111827}
.table-panel{background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.table thead th{height:44px;padding:0 16px;font-size:12px;letter-spacing:0;color:#475467;background:#f9fafb}
.table tbody td{height:56px;padding:10px 16px;font-size:14px;color:#101828}
.table tbody tr:nth-child(even) td{background:#fcfcfd}
.table tbody tr:hover td{background:#f8fbff}
.table .avatar-wrap.mini-avatar{width:28px;height:28px;flex-basis:28px}
.action-group{gap:6px;align-items:center}
.action-group .btn-sm{height:30px;min-width:48px;padding:0 10px;border-radius:6px;font-size:12px;box-shadow:none}
.action-group .btn-sm.btn-primary{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.action-group .btn-sm.btn-danger{background:#fef2f2;border-color:#fecaca;color:#b91c1c}
.action-group .btn-sm.btn-ghost-danger{background:#fff;border-color:#fecaca;color:#b91c1c}
.balance-live{font-size:14px}
.balance-hint{font-size:11px;margin-top:4px}
.timer-box{gap:3px}
.timer-label{font-size:12px;color:#667085}
.timer-value{font-size:18px;font-variant-numeric:tabular-nums}
.timer-sub{font-size:11px;color:#667085}
.team-top-table{margin-bottom:18px}
.team-group-row td{height:38px!important;padding:0 16px!important;background:#f8fafc!important;color:#344054!important;font-size:13px!important;font-weight:900!important;border-top:1px solid var(--line)!important;border-bottom:1px solid var(--line)!important}
.team-group-row td::before{content:"";display:inline-block;width:6px;height:6px;margin-right:8px;border-radius:999px;background:#22c55e;vertical-align:middle}
.team-search-panel{margin-top:0;min-height:0;padding:0;overflow:hidden}
.compact-head{padding:14px 16px;background:#fff}
.team-search-toolbar{margin:0;padding:14px 16px;border-bottom:1px solid var(--line)}
.team-search-toolbar .input{height:38px}
.team-search-toolbar .btn{height:38px}
#teamSearchResult{padding:0 16px 16px}
#teamSearchResult:empty{display:none}
.search-result-table{border:1px solid var(--line);border-radius:8px;box-shadow:none}
.truncate-cell{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#view-staff .truncate-cell{max-width:360px}
#view-staff .staff-actions{max-width:280px}
#view-staff .staff-actions .btn-sm{text-align:center}
#view-users .table th:nth-child(1),#view-users .table td:nth-child(1){width:70px}
#view-users .table th:nth-child(4),#view-users .table td:nth-child(4){width:150px}
#view-users .table th:nth-child(5),#view-users .table td:nth-child(5){width:120px}
#view-users .table th:nth-child(6),#view-users .table td:nth-child(6){width:360px}
#view-staff .table th:nth-child(2),#view-staff .table td:nth-child(2){width:110px}
#view-staff .table th:nth-child(4),#view-staff .table td:nth-child(4){width:100px}
#view-staff .table th:nth-child(5),#view-staff .table td:nth-child(5){width:110px}
#view-staff .table th:nth-child(9),#view-staff .table td:nth-child(9){width:300px}
#view-team .table th:nth-child(1),#view-team .table td:nth-child(1){width:20%}
#view-team .table th:nth-child(2),#view-team .table td:nth-child(2){width:15%}
#view-team .table th:nth-child(3),#view-team .table td:nth-child(3){width:15%}
#view-team .table th:nth-child(4),#view-team .table td:nth-child(4){width:10%}
#view-team .table th:nth-child(5),#view-team .table td:nth-child(5){width:18%}
#view-team .table th:nth-child(6),#view-team .table td:nth-child(6){width:22%}
.daily-detail-card .metric-chip{white-space:nowrap}
.daily-detail-empty{margin-top:14px;padding:32px 16px;font-size:15px}

@media (max-width:920px){
  .sidebar{width:min(78vw,280px)}
  .main-content{margin-left:0;padding:calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 96px)}
  .topbar{margin:0 0 12px;padding:10px 0 14px;background:rgba(245,247,251,.94)}
  .mobile-bottom-nav{border-radius:12px;border-color:var(--line)}
  .mobile-bottom-nav{grid-template-columns:repeat(auto-fit,minmax(0,1fr))}
  .bottom-nav-item{border-radius:8px}
  .bottom-nav-item.active{background:#eff6ff;color:#1d4ed8}
  .page-head{flex-direction:column}
  .page-head-actions{width:100%}
  .page-head-actions .btn{flex:1}
  .role-scope-panel{grid-template-columns:1fr}
  .scope-tags{justify-content:flex-start}
  .summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-columns{grid-template-columns:1fr}
  .list-toolbar{display:block}
  .toolbar-main{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .toolbar-main .input{grid-column:1 / -1;min-width:0;width:100%}
  .toolbar-main .btn{width:100%}
  .toolbar-meta{margin-top:10px}
  .team-search-toolbar{display:grid!important;grid-template-columns:1fr 1fr}
  .team-search-toolbar .stretch{grid-column:1 / -1}
}

@media (max-width:640px){
  .modal{border-radius:16px 16px 0 0}
  .login-title{font-size:24px}
  .summary-strip{grid-template-columns:1fr}
  .dashboard-grid{grid-template-columns:1fr}
  .dashboard-card{min-height:auto}
}


/* Scroll and paging fixes for billing/log modals */
.search-result-table,
.worklog-table-wrap{
  max-width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.modal-body,
.worklog-page,
.month-sheet-scroll{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
.month-sheet-scroll{
  max-height:min(62vh, 620px);
  overflow:auto;
  touch-action:pan-x pan-y;
}
.modal.sheet-modal{
  width:min(1040px,calc(100vw - 28px));
}
.modal.sheet-modal .modal-body{
  overflow:auto;
}
.modal.sheet-modal #rechargeSheetWrap{
  min-height:0;
}
.pager-bar{
  position:sticky;
  bottom:0;
  z-index:5;
  padding:10px 0;
  background:rgba(255,255,255,.96);
  border-top:1px solid var(--line);
}
.modal.worklog-modal .pager-bar{
  background:var(--bg);
}
@media (max-width:920px){
  .month-sheet-scroll{max-height:calc(100vh - 270px)}
  .modal.sheet-modal .month-sheet-scroll{max-height:calc(88vh - 300px);min-height:240px}
  .modal.worklog-modal .worklog-page{height:100vh;max-height:none;overflow:auto}
}
