  :root {
    --green: #1c9548;
    --green-dark: #0f6a35;
    --ink: #14301f;
    --muted: #6d8574;
    --line: #e1eade;
    --bg: #eef4ea;
    --card: #ffffff;
    --danger: #b42318;
    --warn: #b54708;
    --ok: #087443;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  }
  header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 16px 22px; background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.2px; }
  .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #1c9548, #35b06a); }
  .headerRight { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #f2f5f0; color: var(--muted); }
  .pill.on { background: #e7f6ec; color: var(--ok); }
  .pill.role { background: #eef4ff; color: #3449a3; }
  main { max-width: 1180px; margin: 0 auto; padding: 22px; }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 10px 30px -24px rgba(20,70,35,.5); }
  .auth { max-width: 460px; margin: 8vh auto 0; }
  h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.4px; }
  h2 { font-size: 17px; margin: 0 0 4px; }
  p { margin: 0 0 14px; }
  .muted { color: var(--muted); }
  label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 0; }
  input, select, textarea {
    width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 9px; background: #f8fbf6; color: var(--ink); font: inherit; outline: none;
  }
  input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(28,149,72,.14); }
  button {
    cursor: pointer; border: 0; border-radius: 9px; padding: 9px 14px;
    font: inherit; font-weight: 700; background: var(--green); color: #fff;
  }
  button:hover { background: var(--green-dark); }
  button:disabled { opacity: .55; cursor: default; }
  button.ghost { background: #f2f7ef; color: var(--green-dark); border: 1px solid var(--line); }
  button.ghost:hover { background: #e7f0e2; }
  button.small { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
  button.danger { background: #b42318; }
  button.danger:hover { background: #8f1c13; }
  .error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 12px 0 0; }
  .hidden { display: none !important; }
  .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
  .stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
  .stat b { display: block; font-size: 24px; line-height: 1.2; letter-spacing: -0.6px; }
  .stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
  .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
  .toolbar input { width: min(360px, 100%); margin: 0; }
  .tabs { display: flex; gap: 4px; background: #e5eee0; padding: 3px; border-radius: 9px; }
  .tabs button { background: transparent; color: var(--muted); padding: 7px 11px; border-radius: 7px; font-size: 12px; }
  .tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(20,70,35,.12); }
  .tabs button:hover { background: rgba(255,255,255,.6); }
  .authTabs { margin: 2px 0 4px; }
  .tableWrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
  table { width: 100%; border-collapse: collapse; min-width: 760px; }
  th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
  td { padding: 12px 14px; border-bottom: 1px solid #f1f5ee; vertical-align: top; }
  tr:last-child td { border-bottom: 0; }
  .uname { font-weight: 700; }
  .uemail { color: var(--muted); font-size: 12.5px; }
  .uuid { color: #9aab9f; font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; margin-top: 2px; word-break: break-all; }
  .badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
  .badge.on { background: #e7f6ec; color: var(--ok); }
  .badge.off { background: #fdf0ee; color: var(--danger); }
  .badge.exp { background: #fff6e8; color: var(--warn); }
  .badge.role { background: #eef4ff; color: #3449a3; }
  .subline { font-size: 12px; color: var(--muted); margin-top: 5px; }
  .owner { font-size: 12.5px; font-weight: 700; }
  .owner.you { color: var(--green-dark); }
  .owner.none { color: var(--warn); font-weight: 600; }
  .actions { white-space: nowrap; }
  .actions button { margin-right: 6px; margin-bottom: 4px; }
  .empty { padding: 40px 20px; text-align: center; color: var(--muted); }
  .more { padding: 12px; text-align: center; border-top: 1px solid var(--line); }
  dialog {
    border: 0; border-radius: 16px; padding: 22px; width: min(520px, calc(100vw - 32px));
    box-shadow: 0 30px 80px -20px rgba(10,40,20,.5);
  }
  dialog.wide { width: min(880px, calc(100vw - 32px)); }
  dialog::backdrop { background: rgba(14,40,24,.42); }
  .modalActions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
  .detailHead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
  .detailHead .who { min-width: 0; }
  .detailHead .who h2 { word-break: break-word; }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 16px 0; }
  .kv { background: #f7faf5; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
  .kv span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
  .kv b { font-weight: 600; font-size: 13px; word-break: break-word; }
  .sectionTitle { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 20px 0 8px; }
  .mini { width: 100%; border-collapse: collapse; min-width: 0; font-size: 12.5px; }
  .mini th, .mini td { padding: 8px 10px; }
  .audit { margin: 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; }
  .audit li { padding: 9px 0; border-bottom: 1px solid #f1f5ee; }
  .audit li:last-child { border-bottom: 0; }
  .audit .meta { color: var(--muted); font-size: 12px; }
  .audit code { display: block; margin-top: 4px; font-size: 11px; color: #4d6355; white-space: pre-wrap; word-break: break-word; }
  .notice { background: #fff8e9; border: 1px solid #f1dfb6; color: #7a5310; border-radius: 9px; padding: 10px 12px; font-size: 12.5px; margin: 0 0 12px; }
  .toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
    background: #14301f; color: #fff; padding: 11px 16px; border-radius: 10px;
    font-weight: 600; opacity: 0; pointer-events: none; transition: .2s ease;
    max-width: calc(100vw - 32px); z-index: 20;
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }
  .toast.bad { background: #8f1c13; }
  @media (max-width: 860px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid2 { grid-template-columns: 1fr; }
    main { padding: 14px; }
  }
