:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #23342b;
  background: #f5f7f3;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 34px 17px 27px; color: #e5f0e8; background: #193229; }
.admin-brand { display: flex; align-items: center; gap: 11px; margin: 0 12px 76px; color: inherit; text-decoration: none; }
.brand-symbol, .gateway-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: #193229; background: #cbe5bf; font-size: 19px; font-weight: 800; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 20px; letter-spacing: .06em; }
.admin-brand small { margin-top: 1px; color: #8bab98; font-size: 8px; font-weight: 750; letter-spacing: .18em; }
.sidebar-label { margin: 0 13px 15px; color: #81a18d; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.admin-nav { display: grid; gap: 5px; }
.nav-link { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px; color: #d1e2d4; font-size: 13px; font-weight: 680; text-decoration: none; transition: background .2s ease, color .2s ease; }
.nav-link:first-child, .nav-link:hover, .nav-link:focus-visible { color: #fff; background: #315342; }
.nav-link span { width: 19px; color: #b6d1b5; text-align: center; font-size: 17px; }
.sidebar-bottom { display: grid; gap: 15px; margin: auto 13px 0; padding-top: 22px; border-top: 1px solid #365446; color: #86a28f; font-size: 11px; }
.monitor-link { color: #e6f2e5; font-size: 12px; font-weight: 700; text-decoration: none; }
.monitor-link:hover { text-decoration: underline; }

.admin-main { width: min(1240px, 100%); margin: 0 auto; padding: 50px clamp(26px, 4.7vw, 76px) 90px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow, .section-index { color: #578467; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.admin-header h1 { margin: 8px 0 0; color: #20352a; font-size: clamp(29px, 3.1vw, 39px); line-height: 1.15; letter-spacing: -.05em; }
.header-actions { display: flex; align-items: center; gap: 11px; }
.current-user { max-width: 180px; padding: 9px 14px; overflow: hidden; border: 1px solid #dce7db; border-radius: 99px; color: #42654b; background: #edf5eb; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.page-description { margin: 18px 0 48px; color: #829187; font-size: 13px; line-height: 1.7; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading h2 { margin: 7px 0 0; color: #263b2d; font-size: 23px; letter-spacing: -.035em; }
.accounts-section, .create-section { scroll-margin-top: 26px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { min-height: 120px; padding: 22px 23px; border: 1px solid #e0e9dd; border-radius: 16px; background: #fff; box-shadow: 0 8px 32px #2a4b3310; }
.summary-card span { display: block; color: #829388; font-size: 12px; font-weight: 650; }
.summary-card strong { display: block; margin-top: 13px; color: #2e6849; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid #e0e9dd; border-radius: 16px; background: #fff; box-shadow: 0 8px 32px #2a4b3310; }
.users-table { width: 100%; min-width: 580px; border-collapse: collapse; }
.users-table th { padding: 18px 22px; border-bottom: 1px solid #e7eee5; color: #7c907e; background: #f8faf7; text-align: left; font-size: 11px; font-weight: 750; }
.users-table td { padding: 18px 22px; border-bottom: 1px solid #edf2eb; color: #3b5140; font-size: 12px; overflow-wrap: anywhere; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table td:first-child { color: #263e2d; font-weight: 750; }
.users-table .empty-cell { padding: 28px 22px; color: #859487; text-align: center; font-weight: 500; }
.role-tag { display: inline-block; padding: 5px 9px; border-radius: 99px; color: #497052; background: #eaf4e8; font-size: 10px; font-weight: 750; }
.role-tag.is-admin { color: #755a2e; background: #f9f1df; }
.create-section { margin-top: 62px; }
.create-card { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(250px, 1.2fr); gap: 27px 45px; padding: 30px; border: 1px solid #e0e9dd; border-radius: 17px; background: #fff; box-shadow: 0 8px 32px #2a4b3310; }
.create-copy h3 { margin: 0 0 10px; font-size: 18px; }
.create-copy p { max-width: 285px; margin: 0; color: #839286; font-size: 12px; line-height: 1.8; }
.stacked-form { display: grid; gap: 9px; }
.stacked-form label { margin-top: 7px; color: #394c3d; font-size: 12px; font-weight: 750; }
.stacked-form label:first-child { margin-top: 0; }
.stacked-form input { width: 100%; min-height: 43px; padding: 10px 13px; border: 1px solid #dce7db; border-radius: 9px; outline: none; color: #253c2b; background: #fcfdfb; font-size: 13px; }
.stacked-form input:focus { border-color: #6b9d78; box-shadow: 0 0 0 3px #7dad8626; }
.field-help { margin: -2px 0 5px; color: #89988b; font-size: 11px; line-height: 1.55; }
.stacked-form .button { justify-self: start; margin-top: 11px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 750; transition: background .2s ease, border-color .2s ease; }
.button:disabled { opacity: .62; cursor: default; }
.button-primary { color: #fff; background: #316d4f; }
.button-primary:not(:disabled):hover { background: #255e42; }
.button-secondary { color: #376d4c; border-color: #dce8d9; background: #fff; }
.button-secondary:not(:disabled):hover { background: #edf5eb; }
.button-quiet { color: #607364; border-color: #dce7db; background: #fff; }
.button-quiet:not(:disabled):hover { color: #2a6546; background: #f3f8f0; }
.form-message { margin: 13px 0 0; padding: 10px 13px; border-radius: 9px; color: #995a4e; background: #fff0eb; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.form-message.is-success { color: #2e754b; background: #eaf5e9; }
.create-card > .form-message { grid-column: 1 / -1; margin: 0; }

.gateway-state { width: min(440px, calc(100% - 32px)); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; margin: 0 auto; padding: 50px 16px; }
.gateway-back { margin-bottom: 52px; color: #426c50; font-size: 12px; font-weight: 700; text-decoration: none; }
.gateway-back:hover { text-decoration: underline; }
.gateway-state .gateway-mark { width: 54px; height: 54px; margin-bottom: 25px; font-size: 24px; }
.gateway-mark-muted { color: #ae694d; background: #fbebdf; }
.gateway-state h1 { margin: 11px 0 0; color: #1e3628; font-size: 32px; letter-spacing: -.05em; }
.gateway-state > p:not(.form-message) { margin: 13px 0 28px; color: #829185; font-size: 13px; line-height: 1.8; }
.gateway-state .stacked-form { width: 100%; }
.gateway-state .button { margin-top: 15px; }
.gateway-state .form-message { width: 100%; }

@media (max-width: 850px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; padding: 14px 22px; }
  .admin-brand { margin: 0 0 12px; }
  .sidebar-label, .sidebar-bottom span { display: none; }
  .admin-nav { display: flex; }
  .nav-link { min-height: 40px; }
  .sidebar-bottom { margin: 12px 0 0; padding-top: 11px; }
  .admin-main { padding: 35px 22px 70px; }
  .page-description { margin-bottom: 34px; }
}

@media (max-width: 620px) {
  .admin-header { align-items: flex-start; }
  .header-actions { flex-direction: column; align-items: end; }
  .current-user { max-width: 120px; }
  .summary-grid { gap: 7px; }
  .summary-card { min-height: 104px; padding: 15px 12px; }
  .summary-card span { font-size: 10px; }
  .summary-card strong { font-size: 26px; }
  .create-card { grid-template-columns: 1fr; padding: 22px 18px; }
  .create-copy p { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
