:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #202923;
  background: #f5f7f5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.topbar { height: 58px; display: flex; align-items: center; gap: 11px; padding: 0 24px; background: #fff; border-bottom: 1px solid #e2e8e2; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #387849; color: white; font-size: 17px; font-weight: 700; }
.brand-name { font-weight: 650; font-size: 15px; }
.brand-name span { margin-left: 9px; padding-left: 10px; border-left: 1px solid #dfe5df; color: #728077; font-weight: 450; }
.topbar-spacer { flex: 1; }
.connection-state { color: #79857d; font-size: 12px; }
.connection-state.online { color: #2f7c45; }
.page { max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; }
.access-row { display: grid; grid-template-columns: auto minmax(200px, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0 18px; border-bottom: 1px solid #e0e6e0; }
label { display: grid; gap: 6px; color: #58665d; font-size: 12px; }
.access-row label { display: block; white-space: nowrap; }
input, select, textarea { width: 100%; min-height: 36px; border: 1px solid #d4ddd5; border-radius: 5px; background: #fff; color: #202923; padding: 7px 10px; font: inherit; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8d3bd; outline-offset: 1px; border-color: #5e956b; }
.button { min-height: 34px; border: 1px solid #d4ddd5; border-radius: 5px; padding: 0 12px; background: #fff; color: #435247; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.button:hover:not(:disabled) { background: #f1f6f1; }
.button.primary { color: #fff; background: #397a49; border-color: #397a49; }
.button.primary:hover:not(:disabled) { background: #2f693e; }
.button.danger { color: #a94343; border-color: #e7caca; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.section { padding: 22px 0; border-bottom: 1px solid #e0e6e0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
h1, h2 { margin: 0; font-weight: 650; font-size: 18px; }
.section-heading p { margin: 5px 0 0; color: #78837b; font-size: 12px; }
.issue-form { display: grid; grid-template-columns: minmax(150px, 220px) minmax(110px, 160px) auto; align-items: end; justify-content: start; gap: 12px; }
.issued-result { margin-top: 16px; padding: 14px; border: 1px solid #cfdfd1; border-radius: 6px; background: #f9fcf9; }
.result-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 9px; font-size: 13px; }
.result-heading span { color: #77847a; font-size: 12px; }
.issued-result textarea { display: block; margin-bottom: 9px; font-family: Consolas, monospace; line-height: 1.7; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 9px 10px; background: #eef2ee; color: #66736a; font-weight: 600; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #e9ede9; vertical-align: middle; }
td.code { font-family: Consolas, monospace; color: #506054; }
td.actions { white-space: nowrap; }
td.actions .button + .button { margin-left: 5px; }
.state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a5afa7; }
.state.active::before { background: #429153; }
.state.unused::before { background: #d09b33; }
.state.revoked::before, .state.expired::before { background: #c45c5c; }
.empty { padding: 26px; text-align: center; color: #89958c; }
.notice { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 11px 14px; border: 1px solid #cfdfd1; border-radius: 6px; background: #fff; box-shadow: 0 4px 18px #2033241a; font-size: 13px; }
.notice.error { color: #aa4141; border-color: #e3c2c2; }
@media (max-width: 650px) {
  .topbar { padding: 0 14px; }
  .page { padding: 14px 14px 36px; }
  .access-row { grid-template-columns: 1fr auto; }
  .access-row label { grid-column: 1 / -1; }
  .issue-form { grid-template-columns: 1fr 1fr; }
  .issue-form button { grid-column: 1 / -1; }
}
