:root {
  --ink: #152321;
  --muted: #74817f;
  --primary: #a98443;
  --primary-dark: #6f5528;
  --lime: #d4b36a;
  --danger: #c65a4c;
  --line: #e3e9e6;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #0e1624;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.auth-page {
  overflow-x: hidden;
}

.auth-glow {
  position: fixed;
  z-index: 0;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.auth-glow-one {
  top: -300px;
  right: -120px;
  background: radial-gradient(circle, rgba(212, 179, 106, 0.2), transparent 65%);
}

.auth-glow-two {
  bottom: -350px;
  left: 30%;
  background: radial-gradient(circle, rgba(104, 145, 210, 0.12), transparent 65%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: min(740px, calc(100vh - 48px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  background: #f7f8fa;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 35px 95px rgba(3, 9, 20, 0.42);
}

.login-story {
  position: relative;
  min-height: 690px;
  padding: 45px 52px 38px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f2f8f5;
  background:
    radial-gradient(circle at 18% 110%, rgba(188, 147, 72, 0.24), transparent 38%),
    radial-gradient(circle at 90% 4%, rgba(104, 145, 210, 0.16), transparent 28%),
    linear-gradient(145deg, #1a253a 0%, #0d1524 64%, #152036 100%);
}

.login-story::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -220px;
  bottom: -210px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.02),
    0 0 0 92px rgba(255, 255, 255, 0.015);
}

.login-story::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent 20%, #000 100%);
}

.auth-brand,
.story-copy,
.story-metrics,
.story-footer {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #18202e;
  background: var(--lime);
  border-radius: 13px 13px 13px 4px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.auth-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-brand strong {
  font-size: 17px;
  letter-spacing: 0.07em;
}

.auth-brand small {
  color: #8fa29c;
  font-size: 8px;
  letter-spacing: 0.22em;
}

.story-copy {
  margin: auto 0;
}

.story-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 25px;
  color: #aabbb5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.story-kicker span {
  width: 28px;
  height: 1px;
  background: var(--lime);
}

.story-copy h1 {
  max-width: 540px;
  margin: 0 0 24px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(40px, 4.5vw, 62px);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1.18;
}

.story-copy > p:last-child {
  max-width: 430px;
  margin: 0;
  color: #9cafaa;
  font-size: 13px;
  line-height: 1.85;
}

.story-metrics {
  display: flex;
  gap: 35px;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.story-metrics div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-metrics strong {
  color: #e8f1ed;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 24px;
}

.story-metrics span {
  color: #82958f;
  font-size: 9px;
}

.story-footer {
  margin: 35px 0 0;
  color: #687d77;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.login-panel {
  min-height: 690px;
  padding: 35px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(rgba(30, 112, 95, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 112, 95, 0.022) 1px, transparent 1px),
    #fbfcfb;
  background-size: 30px 30px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

.login-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #e9f2ee;
  border-radius: 14px;
}

.login-icon svg,
.auth-input-wrap svg,
.login-security svg,
.login-submit svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-icon svg {
  width: 23px;
  height: 23px;
}

.login-kicker {
  margin: 25px 0 8px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.login-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.login-intro {
  margin: 10px 0 30px;
  color: var(--muted);
  font-size: 12px;
}

#loginForm {
  display: flex;
  flex-direction: column;
}

#loginForm > label {
  margin: 0 0 8px;
  color: #40504c;
  font-size: 11px;
  font-weight: 650;
}

.auth-input-wrap {
  position: relative;
  margin-bottom: 18px;
}

.auth-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #8b9995;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  height: 49px;
  padding: 0 54px 0 43px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input-wrap input::placeholder {
  color: #aab4b1;
}

.auth-input-wrap input:focus {
  border-color: rgba(30, 112, 95, 0.55);
  box-shadow: 0 0 0 4px rgba(30, 112, 95, 0.08);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 6px;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 10px;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 20px;
}

.remember-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.remember-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.text-link {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 10px;
  cursor: pointer;
}

.login-message {
  min-height: 18px;
  margin: -8px 0 9px;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.6;
}

.login-message[data-type="info"] {
  color: #8a6c2a;
}

.login-message[data-type="success"] {
  color: var(--primary);
}

.login-submit {
  height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, #b69250, #80622e);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(169, 132, 67, 0.24);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 30px rgba(169, 132, 67, 0.3);
}

.login-submit:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.login-submit svg {
  width: 17px;
  height: 17px;
}

.login-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 11px 12px;
  color: #63736e;
  background: #f1f6f3;
  border: 1px solid #e4ece8;
  border-radius: 9px;
  font-size: 9px;
}

.login-security svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--primary);
}

.login-help {
  margin: 18px 0 0;
  color: #98a29f;
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
}

.login-copyright {
  margin: 28px 0 0;
  color: #9ba6a2;
  font-size: 8px;
  text-align: center;
}

.account-page {
  display: grid;
  place-items: center;
}

.account-shell {
  width: min(470px, calc(100% - 32px));
  margin: 24px auto;
}

.account-card {
  padding: 34px;
  color: var(--ink);
  background: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(2, 8, 18, 0.4);
}

.account-brand {
  margin-bottom: 32px;
  color: var(--ink);
}

.account-card > .login-kicker {
  margin-top: 0;
}

.account-card h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.account-card form {
  display: flex;
  flex-direction: column;
  margin-top: 25px;
}

.account-card form > label {
  margin: 0 0 8px;
  color: #40504c;
  font-size: 11px;
  font-weight: 650;
}

.account-card .auth-input-wrap input {
  padding-left: 14px;
}

.password-hint {
  margin: -5px 0 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.account-back {
  display: block;
  margin-top: 18px;
  color: var(--primary-dark);
  font-size: 10px;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 880px) {
  .login-shell {
    width: min(520px, calc(100% - 28px));
    min-height: calc(100vh - 28px);
    margin: 14px auto;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .login-story {
    min-height: 220px;
    padding: 28px 30px;
  }

  .story-copy {
    margin: 40px 0 0;
  }

  .story-copy h1 {
    margin-bottom: 0;
    font-size: 34px;
  }

  .story-copy > p:last-child,
  .story-metrics,
  .story-footer,
  .story-kicker {
    display: none;
  }

  .login-panel {
    min-height: 570px;
    padding: 36px 28px 28px;
  }
}

@media (max-width: 420px) {
  .login-story {
    min-height: 190px;
    padding: 24px;
  }

  .story-copy {
    margin-top: 30px;
  }

  .story-copy h1 {
    font-size: 29px;
  }

  .login-panel {
    min-height: 545px;
    padding: 32px 22px 22px;
  }
}

.admin-page {
  min-width: 1040px;
  background:
    linear-gradient(rgba(30, 112, 95, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 112, 95, 0.022) 1px, transparent 1px),
    #f2f4f3;
  background-size: 32px 32px;
}

.admin-topbar {
  height: 76px;
  padding: 0 max(28px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.admin-brand > span {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: #1a2a20;
  background: var(--lime);
  border-radius: 11px 11px 11px 4px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.admin-brand div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-brand strong {
  font-size: 14px;
  letter-spacing: 0.06em;
}

.admin-brand small {
  color: var(--muted);
  font-size: 9px;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-current {
  margin-right: 10px;
  color: var(--muted);
  font-size: 10px;
}

.admin-back,
.admin-logout {
  height: 35px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  text-decoration: none;
  cursor: pointer;
}

.admin-back {
  color: var(--ink);
  background: var(--surface);
}

.admin-logout {
  color: #a65447;
  background: #fff8f6;
  border-color: #f2ddd8;
}

.admin-main {
  width: min(1280px, calc(100% - 56px));
  margin: 0 auto;
  padding: 40px 0 60px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.admin-heading p {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.admin-heading h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 38px;
  letter-spacing: -0.05em;
}

.admin-heading > div > span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.admin-primary,
.admin-secondary {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.admin-primary {
  color: #fff;
  background: linear-gradient(135deg, #216f5f, #164f44);
  border: 0;
  box-shadow: 0 9px 20px rgba(30, 112, 95, 0.16);
}

.admin-secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.admin-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 15px;
}

.admin-stats article {
  min-height: 92px;
  padding: 19px 21px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid rgba(224, 231, 227, 0.9);
  border-radius: 14px;
  box-shadow: 0 9px 30px rgba(25, 49, 43, 0.035);
}

.admin-stats span {
  color: var(--muted);
  font-size: 9px;
}

.admin-stats strong {
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 27px;
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 15px;
  align-items: start;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid rgba(224, 231, 227, 0.9);
  border-radius: 15px;
  box-shadow: 0 9px 30px rgba(25, 49, 43, 0.035);
}

.users-panel {
  min-width: 0;
  overflow: hidden;
}

.admin-panel-head {
  min-height: 70px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-panel-head h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.admin-panel-head span {
  color: var(--muted);
  font-size: 9px;
}

.admin-search {
  position: relative;
  width: 205px;
}

.admin-search svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #8d9996;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.admin-search input {
  width: 100%;
  height: 35px;
  padding: 0 10px 0 35px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 10px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.admin-table th {
  height: 38px;
  padding: 0 14px;
  color: #7e8a87;
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  height: 67px;
  padding: 9px 14px;
  color: #465651;
  border-bottom: 1px solid #edf1ef;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-cell > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: #315d4c;
  background: #e7f1ed;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.member-cell > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.member-cell strong {
  color: var(--ink);
  font-size: 10px;
}

.member-cell small {
  color: #98a29f;
  font-size: 8px;
}

.role-badge,
.account-status,
.permission-count {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 8px;
  white-space: nowrap;
}

.role-super_admin {
  color: #245846;
  background: #e5f2ec;
}

.role-finance_manager {
  color: #4c6097;
  background: #edf0f8;
}

.role-analyst {
  color: #8a682a;
  background: #faf2e3;
}

.role-viewer {
  color: #667470;
  background: #f0f3f2;
}

.permission-count {
  color: #566b64;
  background: #f5f8f6;
  border: 1px solid #e8eeeb;
}

.account-status::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
}

.account-status.active {
  color: #27765e;
  background: #edf6f2;
}

.account-status.active::before {
  background: #4bae8a;
}

.account-status.disabled {
  color: #a5574d;
  background: #fbf0ee;
}

.account-status.disabled::before {
  background: #cb7164;
}

.time-cell {
  color: #87938f !important;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.row-link {
  padding: 5px 7px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 8px;
  cursor: pointer;
}

.row-link:hover {
  background: #edf5f2;
}

.table-empty {
  margin: 0;
  padding: 40px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.role-panel {
  position: sticky;
  top: 16px;
}

.role-list {
  padding: 7px;
}

.role-list article {
  padding: 14px;
  border-radius: 10px;
}

.role-list article:hover {
  background: var(--surface-soft);
}

.role-list article > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-list article > div span {
  color: #9ba6a2;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 9px;
}

.role-list strong {
  color: var(--ink);
  font-size: 10px;
}

.role-list p {
  margin: 8px 0 7px 22px;
  color: #82908c;
  font-size: 8.5px;
  line-height: 1.6;
}

.role-list small {
  margin-left: 22px;
  color: #a3adaa;
  font-size: 7.5px;
}

.audit-panel {
  margin-top: 15px;
}

.audit-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}

.audit-list article {
  min-height: 63px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
}

.audit-list i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #52ae8c;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #edf7f3;
}

.audit-list i[data-tone="warning"] {
  background: #d69345;
  box-shadow: 0 0 0 4px #fbf4e9;
}

.audit-list article > div {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.audit-list strong {
  color: var(--ink);
  font-size: 9px;
}

.audit-list span {
  overflow: hidden;
  color: #929e9a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-list time {
  color: #9ba5a2;
  font-size: 8px;
  white-space: nowrap;
}

.audit-empty {
  margin: 0;
  padding: 28px;
  grid-column: 1 / -1;
  color: var(--muted);
  background: #fff;
  font-size: 9px;
  text-align: center;
}

.admin-dialog {
  width: min(660px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 35px 100px rgba(18, 38, 32, 0.26);
}

.admin-dialog::backdrop {
  background: rgba(14, 31, 27, 0.48);
  backdrop-filter: blur(4px);
}

.admin-dialog form {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.compact-dialog {
  width: min(430px, calc(100vw - 40px));
}

.admin-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.admin-dialog-head span {
  color: var(--primary);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.admin-dialog-head h2 {
  margin: 5px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 24px;
}

.admin-dialog-close {
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 0;
  border-radius: 9px;
  font-size: 21px;
  cursor: pointer;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.admin-dialog label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #43534f;
  font-size: 10px;
  font-weight: 650;
}

.admin-dialog input,
.admin-dialog select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 11px;
}

.admin-dialog input:focus,
.admin-dialog select:focus {
  border-color: rgba(30, 112, 95, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 112, 95, 0.08);
}

.admin-dialog label small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.admin-dialog fieldset {
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.admin-dialog legend {
  padding: 0 7px;
  color: #40504c;
  font-size: 10px;
  font-weight: 650;
}

.admin-dialog fieldset > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.permission-grid label {
  min-height: 36px;
  padding: 8px 10px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: #f8faf9;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
}

.permission-grid label:has(input:checked) {
  color: #215f4e;
  background: #edf6f2;
  border-color: #d8ebe3;
}

.permission-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.admin-form-error {
  min-height: 16px;
  margin: -5px 0;
  color: var(--danger);
  font-size: 9px;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 3px;
}

.reset-target {
  margin: 0;
  padding: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 9px;
  font-size: 9px;
}

.reset-target strong {
  color: var(--ink);
}

.admin-toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 17px;
  color: #fff;
  background: #203b32;
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(18, 39, 31, 0.24);
  font-size: 10px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast[data-error="true"] {
  background: #8c473c;
}

.admin-load-error {
  min-height: 60vh;
  display: grid;
  place-content: center;
  gap: 9px;
  text-align: center;
}

.admin-load-error h1 {
  margin: 0;
  font-size: 25px;
}

.admin-load-error p {
  color: var(--muted);
}

.admin-load-error a {
  color: var(--primary);
}

@media (max-width: 1100px) {
  .admin-page {
    min-width: 0;
  }

  .admin-main {
    width: calc(100% - 32px);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .role-panel {
    position: static;
  }

  .role-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .admin-topbar {
    height: auto;
    min-height: 70px;
    padding: 14px 18px;
  }

  .admin-current {
    display: none;
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-heading h1 {
    font-size: 31px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-search {
    width: 100%;
  }

  .audit-list,
  .role-list,
  .admin-form-row,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .admin-dialog {
    width: calc(100vw - 22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
