:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #68727d;
  --line: #dfe3e8;
  --brand: #176b4d;
  --brand-dark: #0f5139;
  --danger: #b42318;
  --warn: #9a6700;
  --soft: #eef3f0;
  --radius: 10px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #dfece5, transparent 40%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 18px 50px rgba(20, 35, 25, .08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.login-card h1 { font-size: 22px; margin: 24px 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 22px; line-height: 1.6; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 107, 77, .12); }
.field small { color: var(--muted); line-height: 1.4; }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; background: var(--brand); color: #fff; font-weight: 600; }
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.secondary:hover { background: #f1f3f5; }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--danger); border-color: #efc6c2; }
.btn.small { padding: 6px 9px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }
.login-card .btn { width: 100%; margin-top: 4px; }
.error-text { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 13px; }
.app-shell { min-height: 100vh; }
.topbar { height: 62px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: flex; align-items: center; gap: 12px; color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 22px 24px 60px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 21px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 10px 13px; font-weight: 600; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.toolbar input[type="search"] { min-width: 220px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 600; background: #fafbfc; }
tbody tr:hover { background: #fbfcfd; }
td.wrap { white-space: normal; min-width: 180px; }
.role, .status, .pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: #eef1f4; color: #4c5966; }
.role.admin { background: #fdf1d8; color: #7a4c00; }
.status.active, .pill.on { background: #e5f4ec; color: #176b4d; }
.status.disabled, .pill.off { background: #fde8e6; color: var(--danger); }
.muted { color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.summary-line { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 16px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.summary-line strong { color: var(--ink); }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .42); display: grid; place-items: center; padding: 20px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; color: var(--muted); }
.checkbox-row input { width: auto; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: min(420px, calc(100vw - 40px)); background: #17202a; color: #fff; padding: 11px 14px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 13px; line-height: 1.5; }
.toast.error { background: #7a271a; }
.toast.success { background: #176b4d; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .topbar { padding: 0 14px; } main { padding: 16px 12px 50px; } .topbar-user .name { display: none; } .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

.project-select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); max-width: 220px; }
