:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: #f4f6f8;
  font-size: 14px;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.muted { color: #68737d; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f4; }
.login-panel { width: min(380px, 100%); padding: 32px; background: #fff; border: 1px solid #dfe4e8; border-radius: 6px; box-shadow: 0 12px 36px rgba(31, 41, 51, .08); }
.login-panel h1 { margin: 18px 0 4px; font-size: 22px; }
.login-panel .muted { margin: 0 0 24px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #174a5c; color: white; font-weight: 700; border-radius: 6px; }
.brand-mark.small { width: 30px; height: 30px; }
label { display: grid; gap: 7px; margin: 14px 0; font-weight: 600; }
input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #c9d1d7; border-radius: 4px; color: #1f2933; background: white; outline: none; }
input:focus { border-color: #1b6b7d; box-shadow: 0 0 0 3px rgba(27,107,125,.12); }
button { min-height: 36px; padding: 0 14px; border: 1px solid #c9d1d7; border-radius: 4px; background: #fff; color: #25313b; }
button:hover { background: #f4f7f8; }
.primary { border-color: #174a5c; background: #174a5c; color: #fff; }
.primary:hover { background: #103d4c; }
.full { width: 100%; }
.form-error { min-height: 18px; margin: 8px 0; color: #b42318; font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; color: #e9f0f2; background: #19333d; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
nav { display: grid; gap: 4px; }
.nav-item { width: 100%; text-align: left; border: 0; color: #c9d6da; background: transparent; }
.nav-item:hover, .nav-item.active { color: white; background: #28505e; }
.account-block { margin-top: auto; display: grid; gap: 4px; padding: 14px 8px 0; border-top: 1px solid #35515b; }
.account-block small { color: #aebdc2; }
.text-button { padding: 0; min-height: 28px; border: 0; text-align: left; color: #b9d3dc; background: transparent; }
.content { min-width: 0; padding: 28px 32px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header h2 { margin: 0; font-size: 22px; }
.page-header p { margin: 5px 0 0; color: #68737d; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar input { max-width: 320px; }
.icon-button { width: 38px; min-width: 38px; padding: 0; font-size: 18px; }
.notice { margin-bottom: 12px; padding: 10px 12px; border-left: 3px solid #d6a23a; background: #fff8e8; color: #6b531d; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid #dfe4e8; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e8ecef; text-align: left; vertical-align: middle; }
th { background: #f8fafb; color: #52606a; font-size: 12px; font-weight: 700; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2), th:nth-child(5), td:nth-child(5) { white-space: nowrap; }
th.actions, td.actions { text-align: right; white-space: nowrap; }
td.actions button { margin-left: 5px; min-height: 30px; padding: 0 9px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 23px; margin: 2px 4px 2px 0; padding: 0 7px; border-radius: 3px; background: #edf1f3; color: #34434d; font-size: 12px; }
.badge.active { background: #e8f5ec; color: #26733d; }
.badge.inactive { background: #f1f2f3; color: #727b82; }
.badge.error { background: #fdecec; color: #a52a21; }
.empty { padding: 44px; text-align: center; color: #7b858c; }
dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid #d8dee3; border-radius: 6px; box-shadow: 0 18px 60px rgba(22,34,42,.22); }
dialog::backdrop { background: rgba(20, 32, 39, .44); }
dialog form, dialog section { padding: 20px; }
dialog header, dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
dialog header h3 { margin: 0; font-size: 18px; }
dialog footer { justify-content: flex-end; margin-top: 20px; }
.close-button { min-width: 34px; padding: 0; border: 0; font-size: 24px; background: transparent; }
fieldset { margin: 16px 0; padding: 12px; border: 1px solid #d8dee3; border-radius: 4px; }
legend { padding: 0 5px; font-weight: 600; }
.role-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-options label, .check-row { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.role-options input, .check-row input { width: 16px; height: 16px; }
.token-value { display: flex; align-items: center; gap: 8px; margin: 18px 0; padding: 10px; border: 1px solid #d8dee3; background: #f8fafb; }
.token-value code { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 360px; padding: 11px 14px; border-radius: 4px; color: white; background: #243b45; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .brand-row { padding: 0; }
  nav { display: flex; }
  .account-block { margin: 0 0 0 auto; padding: 0; border: 0; min-width: max-content; }
  .content { padding: 20px 14px; }
  .page-header { align-items: flex-start; }
  .role-options { grid-template-columns: 1fr; }
}
