:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --primary: #ff9900;
  --primary-2: #ffb547;
  --primary-ink: #6b3d00;
  --accent: #3b82f6;
  --sidebar-1: #0f172a;
  --sidebar-2: #1e293b;
  --text: #1e293b;
  --muted: #7a869a;
  --border: #eaeef4;
  --ok: #16a34a;
  --danger: #ef4444;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
  --shadow-lg: 0 22px 55px rgba(16, 24, 40, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4dbe6; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b9c3d2; }

/* ============ 登录（分屏） ============ */
.login {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  min-height: 100vh;
}
.login-aside {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #0f172a 0%, #1e293b 55%, #3a2c12 100%);
  color: #fff;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-aside::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -140px; top: -120px;
  background: radial-gradient(circle, rgba(255, 153, 0, .30), transparent 70%);
  filter: blur(8px);
}
.login-aside > div { position: relative; z-index: 1; }
.brand-mark {
  width: 66px; height: 66px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 12px 30px rgba(255, 153, 0, .35);
}
.aside-title { font-size: 32px; font-weight: 800; line-height: 1.32; margin-top: 30px; letter-spacing: -.5px; }
.aside-sub { color: rgba(255, 255, 255, .66); margin-top: 16px; line-height: 1.8; max-width: 330px; font-size: 14px; }
.aside-foot { position: relative; z-index: 1; color: rgba(255, 255, 255, .42); font-size: 12px; }

.login-main {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 75% 15%, #ffffff, #eef2f8);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 38px 34px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 23px; color: var(--text); margin-top: 4px; font-weight: 800; }
.login-sub { color: var(--muted); font-size: 13px; margin: 8px 0 26px; }
.login-card label { display: block; font-size: 13px; color: #56627a; margin: 14px 0 7px; font-weight: 600; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: #fcfdff;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 153, 0, .14); background: #fff; }
#login-btn {
  width: 100%; margin-top: 24px; padding: 13px; border: none; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #5a3500; font-weight: 800; font-size: 15px; letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(255, 153, 0, .30);
  transition: transform .12s, box-shadow .12s;
}
#login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 153, 0, .38); }
#login-btn:active { transform: translateY(0); }
#login-btn:disabled { opacity: .6; cursor: default; }
.login-tip {
  margin-top: 18px; font-size: 12.5px; color: var(--muted);
  background: #fff7ec; border: 1px solid #ffe7c2; border-radius: 10px;
  padding: 9px 12px; text-align: center;
}
.login-tip b { color: var(--primary-ink); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 16px; text-align: center; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-1), var(--sidebar-2));
  color: #cfd8e3;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  position: fixed; top: 0; bottom: 0; left: 0;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-size: 16px; font-weight: 800; color: #fff;
  padding: 4px 12px 20px; letter-spacing: .3px;
}
.brand .dot {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 6px 16px rgba(255, 153, 0, .35);
}

/* 侧边栏公司切换块（桌面端始终可见） */
.company-block {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 153, 0, .28);
  border-radius: 13px;
  padding: 11px 12px 12px;
  margin: 0 4px 14px;
}
.company-block-label {
  font-size: 11.5px; font-weight: 700; color: var(--primary-2);
  letter-spacing: .4px; margin-bottom: 8px;
}
.company-row { display: flex; align-items: center; gap: 8px; }
.company-select {
  flex: 1; min-width: 0;
  appearance: none; -webkit-appearance: none;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(255, 153, 0, .45);
  border-radius: 10px;
  padding: 9px 30px 9px 12px;
  font-size: 13.5px; font-weight: 700; color: #ffce8a;
  cursor: pointer; max-width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23ffb547' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.company-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 153, 0, .2); }
.company-select:disabled {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .12);
  color: #8b97a8; cursor: default;
}
.company-select option { color: #1e293b; }
.company-add {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border: none; font-size: 20px; line-height: 1; font-weight: 700;
  cursor: pointer; box-shadow: 0 6px 14px rgba(255, 153, 0, .3);
  transition: transform .12s, filter .15s;
}
.company-add:hover { filter: brightness(1.07); transform: translateY(-1px); }
.company-add:active { transform: translateY(0); }

/* 工作台标题中的公司名 pill */
.company-pill {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  padding: 4px 13px; border-radius: 999px; margin-left: 10px;
  vertical-align: middle; letter-spacing: .3px;
  box-shadow: 0 4px 12px rgba(255, 153, 0, .3);
}
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 11px;
  color: #aeb9c9; font-size: 14px; background: none; border: none; text-align: left; width: 100%;
  transition: background .15s, color .15s, transform .12s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 153, 0, .18), rgba(255, 181, 71, .08));
  color: #ffce8a; font-weight: 700;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--primary);
}

.user-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 12px;
}
.user-meta { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; box-shadow: 0 6px 14px rgba(255, 153, 0, .3);
}
.user-info { min-width: 0; }
.user-name { font-size: 14px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--primary-2); margin-top: 2px; }
.logout-btn {
  padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 9px;
  background: none; color: #cfd8e3; font-size: 13px; transition: all .15s; flex-shrink: 0;
}
.logout-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.content { margin-left: 244px; flex: 1; padding: 30px 38px; max-width: 1280px; }
.panel { animation: slideUp .32s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.panel-head .actions { display: flex; gap: 10px; align-items: center; }

/* ============ 卡片 ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s; border: 1px solid var(--border);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: ""; position: absolute; right: -28px; bottom: -28px;
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 153, 0, .10), transparent 70%);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: linear-gradient(135deg, #fff3df, #ffe2b8);
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 5px; }
.welcome {
  margin-top: 26px; background: var(--panel); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow); line-height: 1.8; color: #475569;
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
}
.welcome b { color: var(--text); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:active { transform: translateY(-1px) scale(.99); }

/* 薪资统计卡片 */
.salary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 14px 0 4px;
}
.salary-stats .stat-card { padding: 18px 20px; box-shadow: none; }
.salary-stats .stat-num { font-size: 25px; }
.salary-stats .net-stat { border-left: 4px solid #16a34a; }
.salary-stats .net-stat .stat-num { color: #16a34a; }
.salary-stats .cost-stat { border-left: 4px solid #2563eb; }
.salary-stats .cost-stat .stat-num { color: #2563eb; }
.link {
  color: var(--primary-ink); font-weight: 700; cursor: pointer;
  border-bottom: 1.5px dashed var(--primary); padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.link:hover { color: var(--primary); border-bottom-color: var(--primary-2); }

/* ============ 表格 ============ */
.table-wrap {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: #f8fafc; color: #94a3b8; font-weight: 700; font-size: 12px;
  letter-spacing: .4px; white-space: nowrap;
}
tbody tr { transition: background .13s; }
tbody tr:hover { background: #f9fbfe; }
tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.tag.active { background: #e7f8ee; color: var(--ok); }
.tag.active::before { background: var(--ok); }
.tag.disabled { background: #fdecec; color: var(--danger); }
.tag.disabled::before { background: var(--danger); }
.tag.admin { background: #fff1e0; color: var(--primary); font-weight: 700; }
.tag.admin::before { background: var(--primary); }
.tag.pending { background: #fff4e0; color: #d97706; }
.tag.pending::before { background: #d97706; }
.tag.approved { background: #e7f8ee; color: var(--ok); }
.tag.approved::before { background: var(--ok); }
.tag.rejected { background: #fdecec; color: var(--danger); }
.tag.rejected::before { background: var(--danger); }

/* ============ 按钮 ============ */
.btn-primary {
  padding: 10px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #5a3500; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 16px rgba(255, 153, 0, .28);
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(255, 153, 0, .36); }
.btn-primary:active { transform: translateY(0); }
.btn-sm {
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; color: #475569;
  margin-right: 6px; transition: all .13s;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary-ink); background: #fffaf2; }
.btn-sm.danger { color: var(--danger); border-color: #f7ccca; }
.btn-sm.danger:hover { background: #fdeded; border-color: var(--danger); }
.btn-sm.ok { color: var(--ok); border-color: #bfe9cd; }
.btn-sm.ok:hover { background: #eafaf0; border-color: var(--ok); }
.btn-sm:disabled { opacity: .45; cursor: default; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  z-index: 50; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; background: #fff; width: 480px; max-width: 94vw;
  border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1.1); overflow: hidden;
}
.modal-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-close {
  border: none; background: #f1f5f9; width: 30px; height: 30px; border-radius: 8px;
  font-size: 20px; color: #64748b; line-height: 1; transition: all .15s;
}
.modal-close:hover { background: #e2e8f0; color: #334155; }
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 13px; color: #56627a; margin-bottom: 7px; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px; outline: none; background: #fcfdff;
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 153, 0, .13); background: #fff;
}
.form-row textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-row div:not(.form-row) { color: var(--text); line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* ============ toast ============ */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 12px 22px; border-radius: 11px;
  font-size: 14px; box-shadow: var(--shadow-lg); z-index: 100; animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.ok { background: linear-gradient(135deg, #18a558, #16a34a); }
.toast.err { background: linear-gradient(135deg, #f05252, #ef4444); }

.empty { padding: 40px; text-align: center; color: var(--muted); }
.pos-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 11px;
  margin-bottom: 9px; font-size: 14px; background: #fcfdff;
}

/* ============ 筛选栏 ============ */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 11px;
  background: var(--panel); border-radius: 13px; padding: 15px 18px;
  box-shadow: var(--shadow); margin-bottom: 18px; border: 1px solid var(--border);
}
.filter-bar select, .filter-bar input {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; outline: none; background: #fcfdff; transition: border-color .15s, box-shadow .15s;
}
.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 153, 0, .13); background: #fff;
}
.filter-bar #f-keyword { flex: 1; min-width: 170px; }
.filter-sep { color: var(--muted); font-size: 13px; }

/* ============ 薪资模块 ============ */
.salary-scroll { overflow-x: auto; }
#salaries-table { min-width: 1000px; }
.salary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.salary-grid .salary-field { margin-bottom: 13px; }
.salary-net {
  margin-top: 8px; padding: 13px 16px; border-radius: 12px;
  background: linear-gradient(135deg, #fff3df, #ffe2b8);
  color: var(--primary-ink); font-size: 15px;
}
.salary-net b { font-size: 21px; }
.salary-cost { margin-top: 8px; padding: 13px 16px; border-radius: 12px;
  background: linear-gradient(135deg, #e7f0ff, #cfe0ff); color: var(--primary-ink); font-size: 15px; }
.salary-cost b { font-size: 21px; }
.net-cell { font-weight: 800; color: var(--ok); white-space: nowrap; }

/* ============ 响应式（移动端 / 平板） ============ */
.topbar { display: none; }
.nav-backdrop { display: none; }
.login-mobile-head { display: none; }

@media (max-width: 860px) {
  /* 登录：单列，隐藏品牌侧栏，顶部显示精简品牌 */
  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { padding: 30px 18px; align-items: flex-start; }
  .login-card { padding: 26px 22px; box-shadow: none; border: 1px solid var(--border); }
  .login-mobile-head {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    margin-bottom: 20px; text-align: center;
  }
  .login-mobile-head .lm-mark {
    width: 54px; height: 54px; border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex; align-items: center; justify-content: center; font-size: 26px;
    box-shadow: 0 10px 24px rgba(255, 153, 0, .35);
  }
  .login-mobile-head .lm-title { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.4; }

  /* 顶栏（手机固定） */
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 46;
    padding: 0 14px;
    background: linear-gradient(180deg, var(--sidebar-1), var(--sidebar-2));
    color: #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
  }
  .menu-btn {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
    color: #fff; font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
  }
  .menu-btn:active { background: rgba(255, 255, 255, .14); }
  .topbar-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; }
  .topbar-brand .dot { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; box-shadow: none; }
  .company-switch { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
  .company-switch select {
    appearance: none; -webkit-appearance: none;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 6px 28px 6px 12px; font-size: 13px; font-weight: 600; color: var(--text);
    cursor: pointer; max-width: 180px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%237a869a' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center;
  }
  .company-switch select:disabled { background-color: #f3f5f9; color: var(--muted); cursor: default; }
  .company-switch #add-company-btn { padding: 6px 10px; font-size: 14px; line-height: 1; border-radius: 10px; }
  .topbar-avatar {
    margin-left: auto; width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
  }

  /* 侧边栏改为抽屉 */
  .sidebar {
    width: 250px; top: 0; bottom: 0; left: 0;
    position: fixed; z-index: 45; padding-top: 72px;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .app.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .nav-backdrop {
    display: none; position: fixed; inset: 0; z-index: 44;
    background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
  }
  .app.nav-open .nav-backdrop { display: block; }
  .content { margin-left: 0; padding: 74px 16px 28px; max-width: none; }
  .panel-head { gap: 10px; }
  .panel-head h2 { font-size: 19px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .stat-card { padding: 18px; }
  .stat-icon { width: 38px; height: 38px; font-size: 18px; }
  .stat-num { font-size: 26px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 640px; }
  th, td { padding: 12px 14px; }
  .filter-bar { gap: 9px; padding: 12px 14px; }
  .filter-bar select, .filter-bar input { flex: 1 1 100%; min-width: 0; }
  .filter-bar .btn-primary, .filter-bar .btn-sm { flex: 1 1 auto; }
  .modal-card { padding: 22px 18px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn-primary, .modal-actions .btn-sm { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  body { font-size: 13.5px; }
  .topbar { height: 52px; }
  .content { padding: 68px 12px 22px; }
  .login-card { padding: 24px 18px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 15px; }
  .stat-num { font-size: 23px; }
  .btn-primary { padding: 11px 16px; }
}
