:root { font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif; color: #20242b; background: #f6f7f9; font-size: 14px; letter-spacing: 0; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { min-height: 36px; padding: 7px 12px; border: 1px solid #cbd1d8; border-radius: 4px; background: #fff; color: #27313d; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; white-space: nowrap; }
button:hover { background: #eef1f4; }
button:disabled { opacity: .45; cursor: default; }
button svg { width: 17px; height: 17px; flex-shrink: 0; }
button.primary { border-color: #14805f; background: #14805f; color: #fff; }
button.primary:hover { background: #0b6b4e; }
.icon-button { width: 36px; height: 36px; min-width: 36px; padding: 0; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #cbd1d8; border-radius: 4px; background: #fff; color: #20242b; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: #14805f; flex-shrink: 0; }
input[type="file"] { padding: 7px; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid #56b89e; outline-offset: 2px; }
textarea { resize: vertical; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
h2 { font-size: 17px; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 20px 0 10px; font-weight: 650; }
.topbar { height: 62px; padding: 0 24px; background: #fff; border-bottom: 1px solid #dce0e5; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: inherit; font-size: 17px; }
.brand img { border-radius: 6px; object-fit: contain; }
#account { display: flex; align-items: center; gap: 10px; }
#admin-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace { display: grid; grid-template-columns: 182px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.sidebar { padding: 20px 12px; background: #eceff2; border-right: 1px solid #dce0e5; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.nav-button { justify-content: flex-start; border: none; background: transparent; padding: 11px 12px; min-height: 42px; }
.nav-button.active { color: #0b6b4e; background: #dceee8; font-weight: 600; }
.server-status { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 24px 8px 0; font-size: 12px; color: #636c78; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #14805f; }
.content { min-width: 0; padding: 24px 28px; max-width: 1440px; width: 100%; }
.overview { color: #626c79; font-size: 13px; padding-bottom: 22px; }
.page-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.commands { display: flex; align-items: center; gap: 8px; }
.search-row { display: flex; gap: 8px; align-items: center; width: min(100%, 380px); margin-bottom: 18px; }
.table-scroll { width: 100%; overflow-x: auto; border-top: 1px solid #dce0e5; border-bottom: 1px solid #dce0e5; }
table { width: 100%; border-collapse: collapse; min-width: 680px; table-layout: fixed; }
th { font-size: 12px; font-weight: 600; color: #636c78; text-align: left; background: #eef1f4; }
td, th { padding: 13px 12px; border-bottom: 1px solid #e2e5e9; overflow-wrap: anywhere; }
td { background: #fff; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.actions-column { width: 98px; }
.cell-commands { display: flex; gap: 7px; }
.cell-commands button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
.cell-subtext { font-size: 12px; color: #717a86; margin-top: 4px; line-height: 1.5; }
.badge { display: inline-block; font-size: 12px; color: #58705d; background: #e6f0e7; padding: 3px 7px; border-radius: 3px; white-space: nowrap; }
.badge.pending { color: #66677b; background: #eeeef4; }
.badge.off { color: #9d3948; background: #f7e8ea; }
.empty-row { text-align: center; padding: 34px 12px; color: #7b8390; }
.table-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: #626c79; font-size: 13px; }
.pager { display: flex; gap: 10px; align-items: center; }
.pager span { min-width: 45px; text-align: center; }
.auth-screen { max-width: 370px; margin: 72px auto 40px; padding: 0 20px; }
.auth-form { display: grid; gap: 20px; }
.auth-form h1 { margin-bottom: 4px; }
.form-error { color: #ac3044; font-size: 13px; min-height: 20px; margin: 0; }
.settings-form { width: min(100%, 420px); display: grid; gap: 18px; }
.settings-form h2 { margin-bottom: 6px; }
.settings-form button { justify-self: start; }
dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #cbd1d8; border-radius: 6px; color: #20242b; box-shadow: 0 12px 50px #20242b30; }
dialog::backdrop { background: #17212966; }
dialog.small-dialog { width: min(440px, calc(100% - 28px)); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 36px); }
.dialog-heading { padding: 14px 18px; border-bottom: 1px solid #dce0e5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.dialog-heading h2 { overflow-wrap: anywhere; }
.dialog-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.dialog-footer { padding: 12px 18px; border-top: 1px solid #dce0e5; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.binary-row { display: flex; gap: 20px; flex-wrap: wrap; }
.checkbox-label { display: flex; gap: 9px; align-items: center; font-weight: 400; }
.subheading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.subheading h3 { margin: 5px 0; }
.expiry-heading { display: flex; justify-content: space-between; color: #717a86; font-size: 12px; }
.permission-row { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid #e8ebef; }
.permission-row label { min-width: 0; overflow-wrap: anywhere; }
.expiry-input { display: flex; align-items: center; gap: 6px; }
.expiry-input input { min-width: 0; font-size: 12px; }
.expiry-input span { width: 28px; flex-shrink: 0; color: #7b8390; font-size: 12px; }
.recipient-row { display: grid; grid-template-columns: minmax(100px, 1fr) 218px 32px; align-items: center; gap: 10px; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; }
.code-input { font-family: Consolas, ui-monospace, monospace; font-size: 13px; tab-size: 2; line-height: 1.5; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(460px, calc(100% - 40px)); padding: 12px 16px; background: #26352e; color: #fff; border-radius: 4px; box-shadow: 0 4px 16px #20242b20; overflow-wrap: anywhere; z-index: 100; }
.toast.error { background: #91394a; }
@media (max-width: 700px) {
  .topbar { padding: 0 14px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  #admin-name { max-width: 80px; font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; padding: 8px; gap: 3px; border-right: none; border-bottom: 1px solid #dce0e5; }
  .nav-button { padding: 8px 4px; justify-content: center; font-size: 12px; flex: 1; min-width: 0; gap: 4px; flex-direction: column; }
  .nav-button svg { width: 15px; height: 15px; }
  .server-status { display: none; }
  .content { padding: 20px 14px; }
  #page-users th:first-child, #page-users td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 #dce0e5; }
  #page-users th:first-child { z-index: 2; }
  .overview { font-size: 12px; }
  h1 { font-size: 18px; }
  .page-heading { gap: 6px; }
  .commands { gap: 6px; }
  .commands .primary { padding: 7px 9px; font-size: 13px; }
  .dialog-body { padding: 14px; }
  .permission-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .expiry-input { width: 100%; }
  .expiry-input input { flex: 1; }
  .expiry-heading { flex-wrap: wrap; gap: 5px; }
  .recipient-row { grid-template-columns: minmax(0, 1fr) 32px; gap: 7px; }
  .recipient-row .expiry-input { grid-column: 1; grid-row: 2; }
  .recipient-row > button { grid-column: 2; grid-row: 1 / 3; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .auth-screen { margin-top: 48px; }
}
