/* ============================================================
   方寸 · 管理台
   Warm paper, ink and pine. No external assets or fonts.
   ============================================================ */

:root {
  --paper: #F5F3EE;
  --paper-raised: #FBFAF6;
  --paper-sunken: #EDE9E0;
  --paper-deep: #E2DDD1;
  --ink: #17181A;
  --ink-soft: #353934;
  --ink-muted: #63665F;
  --ink-faint: #72756D;
  --line: rgba(23, 24, 26, 0.12);
  --line-strong: rgba(23, 24, 26, 0.22);
  --pine: #3D5A4C;
  --pine-deep: #2C4438;
  --pine-tint: #E5EBE4;
  --pine-light: #9DB5A4;
  --ink-panel: #1B221E;
  --ink-panel-2: #232C26;
  --cream: #F5F3EE;
  --cream-muted: #B9BEB6;
  --danger: #8E3F32;
  --danger-deep: #733126;
  --danger-tint: #F2E3DE;
  --amber: #8A6527;
  --amber-tint: #F2E9D7;
  --blue: #3E5B67;
  --blue-tint: #E6ECEE;
  --radius: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Georgia, "Songti SC", "STSong", "SimSun", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --shadow-dialog: 0 28px 90px rgba(18, 23, 20, 0.26);
  --shadow-drawer: -24px 0 70px rgba(18, 23, 20, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-layer {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, p, dl, dd, figure {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

img, svg {
  display: block;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(61, 90, 76, 0.2);
}

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

.sidebar :focus-visible,
.login__aside :focus-visible {
  outline-color: var(--cream);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-muted);
}

.nowrap {
  white-space: nowrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--pine);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--pine-light);
}

.hairline {
  display: block;
  width: 44px;
  height: 1px;
  background: rgba(245, 243, 238, 0.32);
}

/* ------------------------------------------------------------
   Boot
   ------------------------------------------------------------ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--ink-panel);
  color: var(--cream);
}

.boot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 32px;
}

.boot__mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(245, 243, 238, 0.14);
}

.boot__name {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.04em;
}

.boot__name span {
  display: block;
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--cream-muted);
}

.boot__rule {
  display: block;
  width: 96px;
  height: 1px;
  background: rgba(245, 243, 238, 0.2);
  overflow: hidden;
  position: relative;
}

.boot__rule::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: var(--pine-light);
  animation: boot-slide 1.4s ease-in-out infinite;
}

.boot__hint {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(245, 243, 238, 0.5);
}

@keyframes boot-slide {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(300%); }
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 600;
  padding: 14px 18px;
  border: 1px solid var(--danger);
  background: var(--danger-tint);
  color: var(--danger-deep);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------
   Login
   ------------------------------------------------------------ */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(440px, 0.94fr);
  min-height: 100vh;
  background: var(--paper);
}

.login__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(32px, 4.4vw, 64px);
  overflow: hidden;
  background: var(--ink-panel);
  color: var(--cream);
}

.login__aside::before,
.login__aside::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(245, 243, 238, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.login__aside::before {
  width: min(48vw, 660px);
  aspect-ratio: 1;
  right: -24%;
  bottom: -20%;
}

.login__aside::after {
  width: min(30vw, 410px);
  aspect-ratio: 1;
  right: -8%;
  bottom: -4%;
  border-color: rgba(157, 181, 164, 0.14);
}

.login__brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login__brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(245, 243, 238, 0.14);
}

.login__wordmark strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.login__wordmark span {
  display: block;
  margin-top: 2px;
  color: var(--cream-muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.23em;
}

.login__statement {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: auto 0;
  padding: 58px 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login__statement h1 {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(40px, 4.1vw, 62px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--cream);
}

.login__lede {
  margin-top: 26px;
  color: var(--cream-muted);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  line-height: 2;
}

.login__aside-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: rgba(245, 243, 238, 0.48);
  font-size: 9px;
  letter-spacing: 0.17em;
  line-height: 1.8;
}

.login__aside-foot .hairline {
  margin-top: 7px;
  flex: none;
}

.login__aside-foot span {
  color: rgba(245, 243, 238, 0.32);
}

.login__main {
  display: grid;
  place-items: center;
  padding: 48px clamp(24px, 4vw, 64px);
}

.login__panel {
  width: min(100%, 408px);
  animation: rise 0.45s 0.06s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login__panel-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login__panel-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px var(--line);
}

.login__panel-wordmark strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.login__panel-wordmark small {
  display: block;
  margin-top: 1px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.login__head h2 {
  margin-top: 12px;
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.login__head-desc {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.login-notice {
  margin-top: 24px;
  padding: 11px 14px;
  background: var(--amber-tint);
  border-left: 2px solid var(--amber);
  border-radius: 0 7px 7px 0;
  color: #6F5322;
  font-size: 12px;
  line-height: 1.7;
}

.login__form {
  margin-top: 32px;
}

.login__form .field + .field {
  margin-top: 19px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.field__input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field__input::placeholder {
  color: var(--ink-faint);
}

.field__input:hover {
  border-color: rgba(23, 24, 26, 0.3);
}

.field__input:focus {
  border-color: var(--pine);
  background: #FFFEFA;
  box-shadow: 0 0 0 3px rgba(61, 90, 76, 0.15);
}

.field__input--code {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.24em;
}

.field__input--code::placeholder {
  letter-spacing: normal;
}

.field__hint {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

textarea.field__input {
  height: auto;
  min-height: 116px;
  padding: 11px 13px;
  line-height: 1.75;
  resize: vertical;
}

select.field__input {
  appearance: none;
  padding-right: 34px;
  background-image: none;
  cursor: pointer;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap .field__input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
}

.password-toggle:hover {
  background: var(--paper-sunken);
  color: var(--ink);
}

.form-message {
  margin-top: 14px;
  color: var(--danger-deep);
  font-size: 12px;
  line-height: 1.65;
}

.login__submit {
  margin-top: 24px;
  height: 46px;
}

.login__form .form-message + .login__submit {
  margin-top: 12px;
}

.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--pine);
  vertical-align: 2px;
}

.login__foot {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login__aside {
    display: none;
  }

  .login__main {
    min-height: 100vh;
    padding: 44px 24px;
  }

  .login__panel-brand {
    display: flex;
  }
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    opacity 0.16s ease;
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #F8F6F0;
}

.btn--primary:hover {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
}

.btn--quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.btn--quiet:hover {
  background: var(--paper-sunken);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost {
  color: var(--ink-muted);
}

.btn--ghost:hover {
  background: var(--paper-sunken);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #FCF7F5;
}

.btn--danger:hover {
  background: var(--danger-deep);
  border-color: var(--danger-deep);
}

.btn--danger-quiet {
  border-color: rgba(142, 63, 50, 0.28);
  color: var(--danger);
  background: transparent;
}

.btn--danger-quiet:hover {
  background: var(--danger-tint);
  border-color: rgba(142, 63, 50, 0.42);
}

.btn--sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 11.5px;
}

.btn--wide {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn.is-busy {
  opacity: 0.8;
  cursor: wait;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  background: var(--paper-sunken);
  color: var(--ink);
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------
   App shell
   ------------------------------------------------------------ */

.admin {
  min-height: 100vh;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  padding: 9px 14px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--cream);
  font-size: 12px;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 252px;
  padding: 28px 16px 22px;
  overflow-y: auto;
  background: var(--ink-panel);
  color: var(--cream-muted);
  border-right: 1px solid rgba(245, 243, 238, 0.06);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
}

.sidebar__brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(245, 243, 238, 0.13);
}

.sidebar__wordmark strong {
  display: block;
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.sidebar__wordmark span {
  display: block;
  margin-top: 2px;
  color: rgba(245, 243, 238, 0.45);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.21em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 42px;
}

.nav__label {
  padding: 0 12px;
  margin: 18px 0 7px;
  color: rgba(245, 243, 238, 0.36);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav__label:first-child {
  margin-top: 0;
}

.nav__label--second {
  margin-top: 26px;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #B7BDB5;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.015em;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav__link:hover {
  background: rgba(245, 243, 238, 0.065);
  color: var(--cream);
}

.nav__link[aria-current="page"] {
  background: #2B372F;
  color: #F6F3EB;
}

.nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 2px;
  background: var(--pine-light);
}

.nav__icon {
  display: inline-flex;
  flex: none;
  color: currentColor;
  opacity: 0.8;
}

.nav__link[aria-current="page"] .nav__icon {
  opacity: 1;
}

.nav__text {
  min-width: 0;
}

.nav__index {
  margin-left: auto;
  color: rgba(245, 243, 238, 0.32);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.nav__link[aria-current="page"] .nav__index {
  color: var(--pine-light);
}

.sidebar__foot {
  margin-top: auto;
  padding: 22px 12px 0;
  border-top: 1px solid rgba(245, 243, 238, 0.09);
}

.sidebar__expiry {
  margin-top: 7px;
  color: #AEB5AC;
  font-size: 10px;
  line-height: 1.7;
}

.sidebar__copy {
  margin-top: 16px;
  color: rgba(245, 243, 238, 0.3);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 252px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 clamp(22px, 3.4vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar__route {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.topbar__mark {
  display: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex: none;
}

.topbar__eyebrow {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.topbar__slash {
  color: var(--line-strong);
  font-family: var(--font-serif);
  font-size: 14px;
}

.topbar__title {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--pine-tint);
  color: var(--pine-deep);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--topbar {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(245, 243, 238, 0.12);
  background: #2B372F;
  color: #DFE7DE;
  font-size: 10px;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.admin-chip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.admin-chip__text strong {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 650;
}

.admin-chip__text span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.topbar__btn {
  height: 34px;
  padding: 0 10px;
  border-color: transparent;
  font-size: 11.5px;
}

.topbar__btn:hover {
  border-color: var(--line);
}

.topbar__btn.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

.view {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) clamp(22px, 3.8vw, 48px) 84px;
}

.view:focus {
  outline: none;
}

/* ------------------------------------------------------------
   Page header
   ------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.page-head__text {
  min-width: 0;
}

.page-title {
  margin-top: 10px;
  font-size: clamp(27px, 2.6vw, 34px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.22;
  color: var(--ink);
}

.page-title:focus {
  outline: none;
}

.page-desc {
  max-width: 620px;
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ------------------------------------------------------------
   Overview
   ------------------------------------------------------------ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 126px;
  padding: 19px 20px 17px;
  background: var(--paper-raised);
  transition: background 0.16s ease;
}

.stat-card:hover {
  background: #FFFDF8;
}

.stat-card__value {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-card--alert .stat-card__value {
  color: var(--amber);
}

.stat-card__label {
  margin-top: auto;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.stat-card__hint {
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.stat-card__arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--ink-faint);
  opacity: 0.5;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.stat-card:hover .stat-card__arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}

.overview-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.panel__head-text {
  min-width: 0;
}

.panel__title {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.4;
}

.panel__meta {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10.5px;
}

.panel__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--pine);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.panel__link:hover {
  color: var(--pine-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel__body {
  padding: 20px;
}

.review-list {
  display: flex;
  flex-direction: column;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 20px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.review-row__name {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-row__handle {
  margin-top: 1px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.review-row__reason {
  grid-column: 1 / -1;
  grid-row: 2;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

.review-row__meta {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  color: var(--ink-muted);
  font-size: 10.5px;
}

.review-row__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-row__meta time {
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.review-row__actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: start;
}

.audit-feed {
  display: flex;
  flex-direction: column;
}

.audit-feed__item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.audit-feed__item:last-child {
  border-bottom: 0;
}

.audit-feed__time {
  padding-top: 2px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
}

.audit-feed__body {
  min-width: 0;
}

.audit-feed__action {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.5;
}

.audit-feed__target {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.panel--version {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: var(--ink-panel);
  border-color: var(--ink-panel);
  color: var(--cream);
}

.panel--version::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -84px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(245, 243, 238, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.version-card {
  position: relative;
  z-index: 1;
}

.version-card .eyebrow {
  color: var(--pine-light);
}

.version-card__status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  color: #DCE3DA;
  font-size: 11px;
}

.version-card__dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--pine-light);
}

.version-card__number {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.version-card__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  color: rgba(245, 243, 238, 0.68);
  font-size: 10.5px;
  font-weight: 600;
}

.version-card__link:hover {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------
   Toolbar, tabs, search
   ------------------------------------------------------------ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--paper-sunken);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  appearance: none;
  padding: 8px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 24, 26, 0.09);
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 260px;
  height: 40px;
  padding: 0 6px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-raised);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search:focus-within {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(61, 90, 76, 0.13);
}

.search__input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12.5px;
}

.search__input::placeholder {
  color: var(--ink-faint);
}

.search__submit {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
}

.search__submit:hover {
  background: var(--paper-sunken);
  color: var(--ink);
}

.search__clear {
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.search__clear:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select {
  appearance: none;
  height: 40px;
  min-width: 132px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.select:hover {
  border-color: var(--line-strong);
}

.select:focus {
  border-color: var(--pine);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 90, 76, 0.13);
}

.toolbar-note {
  color: var(--ink-muted);
  font-size: 11px;
}

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(23, 24, 26, 0.024);
  color: var(--ink-muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.11em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.65;
  vertical-align: top;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(23, 24, 26, 0.022);
}

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

.data-table--users {
  min-width: 850px;
}

.data-table--finance {
  min-width: 960px;
}

.data-table--audit {
  min-width: 940px;
}

.data-table--applications {
  min-width: 900px;
}

.cell-main {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.cell-time {
  display: block;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  white-space: nowrap;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}

.cell-reason {
  display: -webkit-box;
  max-width: 300px;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.cell-note {
  display: block;
  max-width: 240px;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.6;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-cell__text {
  min-width: 0;
}

.user-cell__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.user-cell__handle {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
}

.actor-cell {
  color: var(--ink-soft);
  font-size: 11px;
}

.actor-cell__type {
  color: var(--ink-muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-text {
  display: block;
  max-width: 300px;
  overflow: hidden;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-code {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
}

.progress-cell {
  min-width: 120px;
}

.progress {
  width: 116px;
  max-width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.progress__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pine);
  transition: width 0.3s ease;
}

.progress--processing .progress__bar {
  background: var(--amber);
}

.progress--failed .progress__bar {
  background: var(--danger);
}

.progress__label {
  margin-top: 5px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* ------------------------------------------------------------
   Badges
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--good {
  background: #E6ECE4;
  border-color: rgba(61, 90, 76, 0.14);
  color: #2F4A3D;
}

.badge--warn {
  background: var(--amber-tint);
  border-color: rgba(138, 101, 39, 0.14);
  color: #76551F;
}

.badge--bad {
  background: var(--danger-tint);
  border-color: rgba(142, 63, 50, 0.14);
  color: var(--danger-deep);
}

.badge--muted {
  background: var(--paper-sunken);
  border-color: var(--line);
  color: var(--ink-muted);
}

.badge--info {
  background: var(--blue-tint);
  border-color: rgba(62, 91, 103, 0.14);
  color: var(--blue);
}

.badge--pine {
  background: var(--pine);
  border-color: var(--pine);
  color: #F7F5EF;
}

/* ------------------------------------------------------------
   Pagination, empty and loading states
   ------------------------------------------------------------ */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.pagination__info {
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination__page {
  min-width: 78px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 24px;
  text-align: center;
}

.empty__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-muted);
}

.empty__title {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.empty__desc {
  max-width: 400px;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.empty__action {
  margin-top: 16px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-left: 2px solid var(--danger);
  border-radius: 0 7px 7px 0;
  background: var(--danger-tint);
  color: var(--danger-deep);
  font-size: 11.5px;
  line-height: 1.7;
}

.alert svg {
  flex: none;
  margin-top: 2px;
}

.alert--muted {
  border-left-color: var(--ink-muted);
  background: var(--paper-sunken);
  color: var(--ink-soft);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(61, 90, 76, 0.12);
  border-left: 2px solid var(--pine);
  border-radius: 0 7px 7px 0;
  background: var(--pine-tint);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.notice svg {
  flex: none;
  margin-top: 2px;
  color: var(--pine);
}

.notice--plain {
  border-color: var(--line);
  border-left-color: var(--ink-muted);
  background: var(--paper-sunken);
}

.skeleton-list {
  display: flex;
  flex-direction: column;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.sk {
  display: block;
  border-radius: 3px;
  background: var(--paper-deep);
  animation: sk-pulse 1.5s ease-in-out infinite;
}

.sk--avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
}

.sk--line {
  width: 38%;
  height: 9px;
}

.sk--line-wide {
  width: 62%;
  height: 9px;
}

.sk--line-short {
  width: 22%;
  height: 8px;
  margin-left: auto;
}

.sk--stat-value {
  width: 52px;
  height: 30px;
  margin-bottom: 14px;
}

.sk--stat-label {
  width: 64%;
  height: 9px;
}

.sk--stat-hint {
  width: 44%;
  height: 7px;
}

.skeleton-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skeleton-stats .stat-card {
  min-height: 126px;
}

@keyframes sk-pulse {
  0%, 100% { opacity: 0.52; }
  50% { opacity: 0.9; }
}

/* ------------------------------------------------------------
   Dialogs, drawers, overlays
   ------------------------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(19, 24, 21, 0.48);
  animation: fade-in 0.16s ease both;
}

.overlay.is-closing {
  animation: fade-out 0.15s ease both;
}

.overlay--drawer {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(19, 24, 21, 0.4);
}

.dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(23, 24, 26, 0.14);
  border-radius: 16px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-dialog);
  animation: rise 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.dialog--wide {
  width: min(680px, 100%);
}

.dialog__head {
  padding: 25px 58px 8px 26px;
}

.dialog__eyebrow {
  margin-bottom: 8px;
  color: var(--pine);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.dialog__title {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.dialog__subtitle {
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.dialog__body {
  padding: 14px 26px 26px;
  overflow-y: auto;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 26px;
  border-top: 1px solid var(--line);
  background: rgba(23, 24, 26, 0.018);
}

.drawer {
  display: flex;
  flex-direction: column;
  width: min(500px, 100%);
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper-raised);
  box-shadow: var(--shadow-drawer);
  animation: slide-in 0.24s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.overlay--drawer.is-closing .drawer {
  animation: slide-out 0.18s ease both;
}

.drawer__head {
  position: relative;
  padding: 27px 58px 18px 28px;
  border-bottom: 1px solid var(--line);
}

.drawer__eyebrow {
  margin-bottom: 8px;
  color: var(--pine);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.drawer__title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.drawer__close {
  position: absolute;
  top: 17px;
  right: 17px;
}

.drawer__body {
  flex: 1;
  padding: 24px 28px 30px;
  overflow-y: auto;
}

.drawer__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 28px;
  border-top: 1px solid var(--line);
  background: rgba(23, 24, 26, 0.018);
}

.drawer__foot:empty {
  display: none;
}

.confirm__message {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
}

.confirm__detail {
  margin-top: 12px;
  padding: 11px 13px;
  border-left: 2px solid var(--line-strong);
  background: var(--paper-sunken);
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.review-subject {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--paper-sunken);
}

.review-subject__name {
  font-size: 12.5px;
  font-weight: 650;
}

.review-subject__handle {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

.form-error {
  margin-top: 10px;
  color: var(--danger-deep);
  font-size: 11.5px;
  line-height: 1.65;
}

.char-count {
  margin-left: auto;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch__track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 99px;
  background: #D6D0C4;
  transition: background 0.17s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FCFBF7;
  box-shadow: 0 1px 2px rgba(23, 24, 26, 0.18);
  transition: transform 0.17s ease;
}

.switch input:checked + .switch__track {
  background: var(--pine);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

.switch input:disabled + .switch__track {
  opacity: 0.48;
}

.switch__text {
  color: var(--ink-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.secret-code {
  display: block;
  padding: 16px 17px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--paper-sunken);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
}

.secret-note {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
}

/* ------------------------------------------------------------
   User detail
   ------------------------------------------------------------ */

.profile {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.profile__body {
  min-width: 0;
}

.profile__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.profile__handle {
  margin-top: 2px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.profile__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.profile__signature {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.section {
  margin-top: 26px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.meta-item {
  min-width: 0;
  padding: 11px 13px;
  background: var(--paper-raised);
}

.meta-item__label {
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-item__value {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.6;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper-sunken);
}

.mini-stat__value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.mini-stat__label {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.drawer-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* ------------------------------------------------------------
   Announcements
   ------------------------------------------------------------ */

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.announcement--inactive {
  background: #F7F4ED;
}

.announcement__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.announcement__title {
  flex: 1;
  min-width: 180px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.announcement--inactive .announcement__title {
  color: var(--ink-muted);
}

.announcement__body {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.announcement__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.announcement__schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.7;
}

.announcement__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.announcement__switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

/* ------------------------------------------------------------
   Feedback
   ------------------------------------------------------------ */

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.feedback__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feedback__user {
  color: var(--ink-muted);
  font-size: 10.5px;
}

.feedback__time {
  margin-left: auto;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.feedback__content {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feedback__contact {
  margin-top: 10px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.feedback__response {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.feedback__note-label {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feedback__note {
  min-height: 76px;
  margin-top: 7px;
}

.feedback__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

/* ------------------------------------------------------------
   System
   ------------------------------------------------------------ */

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.system-card {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.system-card__label {
  color: var(--ink-muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.system-card__value {
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.system-card__hint {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 9.5px;
}

.flag-list {
  border-top: 1px solid var(--line);
}

.flag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.flag-row__title {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.flag-row__desc {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.flag-form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.flag-form__note {
  max-width: 430px;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ------------------------------------------------------------
   Toasts
   ------------------------------------------------------------ */

.toasts {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(350px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-left: 3px solid var(--pine-light);
  border-radius: 8px;
  background: var(--ink-panel);
  color: var(--cream);
  box-shadow: 0 10px 30px rgba(18, 23, 20, 0.2);
  pointer-events: auto;
  animation: toast-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.toast.is-leaving {
  animation: toast-out 0.16s ease both;
}

.toast--error {
  border-left-color: #C87B6D;
}

.toast--success {
  border-left-color: #8FAE99;
}

.toast--info {
  border-left-color: #B7B0A1;
}

.toast__icon {
  margin-top: 2px;
  flex: none;
  color: var(--pine-light);
}

.toast--error .toast__icon {
  color: #D79A8E;
}

.toast__message {
  flex: 1;
  min-width: 0;
  color: #EAE7DE;
  font-size: 11.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.toast__close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  margin: -2px -3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(245, 243, 238, 0.55);
}

.toast__close:hover {
  background: rgba(245, 243, 238, 0.08);
  color: var(--cream);
}

/* ------------------------------------------------------------
   Animation
   ------------------------------------------------------------ */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { transform: translateX(28px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(28px); opacity: 0.5; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1200px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  }

  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
    padding-left: 13px;
    padding-right: 13px;
  }

  .main {
    margin-left: 220px;
  }

  .view {
    padding-left: 28px;
    padding-right: 28px;
  }

  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }

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

  .overview-side {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    align-items: start;
  }

  .stat-card {
    min-height: 116px;
    padding: 17px 18px 15px;
  }

  .stat-card__value {
    font-size: 34px;
  }
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.has-layer {
    overflow: hidden;
  }

  .admin {
    display: block;
  }

  .sidebar {
    position: static;
    z-index: auto;
    width: auto;
    padding: 9px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(245, 243, 238, 0.08);
  }

  .sidebar__brand,
  .sidebar__foot {
    display: none;
  }

  .nav {
    display: flex;
    flex-direction: row;
    gap: 2px;
    margin-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav__label,
  .nav__index {
    display: none;
  }

  .nav__link {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11px;
  }

  .nav__link[aria-current="page"]::before {
    top: 8px;
    bottom: 8px;
  }

  .nav__icon {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    min-height: 62px;
    padding: 0 18px;
  }

  .topbar__mark {
    display: block;
  }

  .topbar__eyebrow,
  .topbar__slash {
    display: none;
  }

  .admin-chip {
    padding-right: 9px;
    margin-right: 2px;
  }

  .admin-chip__text strong {
    max-width: 96px;
  }

  .admin-chip__text span {
    max-width: 96px;
  }

  .topbar__btn {
    width: 34px;
    padding: 0;
  }

  .topbar__btn .btn__label {
    display: none;
  }

  .view {
    padding: 28px 18px 64px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
  }

  .page-head__actions {
    justify-content: flex-start;
  }

  .page-title {
    font-size: 27px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .toolbar__group {
    width: 100%;
  }

  .search {
    width: 100%;
  }

  .tabs {
    max-width: 100%;
  }

  .stat-card {
    min-height: 105px;
  }

  .stat-card__value {
    font-size: 31px;
  }

  .review-row {
    grid-template-columns: 1fr;
  }

  .review-row__identity {
    grid-column: 1;
    grid-row: 1;
  }

  .review-row__reason {
    grid-column: 1;
    grid-row: 2;
  }

  .review-row__meta {
    grid-column: 1;
    grid-row: 3;
  }

  .review-row__actions {
    grid-column: 1;
    grid-row: 4;
    padding-top: 4px;
  }

  .toasts {
    top: 74px;
    right: 12px;
  }

  body.is-authed .toasts {
    top: 126px;
  }

  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog,
  .dialog--wide {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .login__main {
    padding: 31px 20px;
  }

  .login__head h2 {
    font-size: 27px;
  }

  .overlay:not(.overlay--drawer) {
    align-items: flex-end;
    padding: 0;
  }

  .dialog {
    width: 100%;
    max-height: 92vh;
    border-right: 0;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    animation: sheet-up 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .dialog__head {
    padding: 22px 54px 8px 20px;
  }

  .dialog__body {
    padding: 13px 20px 22px;
  }

  .dialog__foot {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .drawer {
    width: 100%;
  }

  .drawer__head {
    padding: 23px 54px 16px 20px;
  }

  .drawer__body {
    padding: 20px;
  }

  .drawer__foot {
    padding: 13px 20px calc(13px + env(safe-area-inset-bottom));
  }

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

  .form-grid .field--full {
    grid-column: auto;
  }

  .page-head__actions .btn {
    flex: 1;
  }

  .feedback__time {
    width: 100%;
    margin-left: 0;
  }

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

  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 480px) {
  .topbar {
    gap: 10px;
    padding: 0 14px;
  }

  .topbar__title {
    font-size: 11.5px;
  }

  .admin-chip__text span {
    display: none;
  }

  .admin-chip {
    padding-right: 7px;
  }

  .admin-chip__text strong {
    max-width: 78px;
  }

  .view {
    padding: 24px 14px 58px;
  }

  .page-title {
    font-size: 25px;
  }

  .page-desc {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 98px;
    padding: 14px 14px 13px;
  }

  .stat-card__value {
    font-size: 28px;
  }

  .stat-card__label {
    font-size: 11px;
  }

  .stat-card__hint {
    font-size: 9.5px;
  }

  .stat-card__arrow {
    display: none;
  }

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

  .system-card__value {
    font-size: 24px;
  }

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

  .pagination__controls {
    width: 100%;
    justify-content: space-between;
  }

  .dialog__foot .btn {
    flex: 1;
  }

  .drawer__foot .btn {
    flex: 1 1 calc(50% - 8px);
  }

  .toasts {
    top: 74px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  body.is-authed .toasts {
    top: 126px;
  }

  .flag-row {
    align-items: flex-start;
    gap: 14px;
  }

  .announcement,
  .feedback {
    padding: 17px 16px;
  }

  .audit-feed__item {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 11px 16px;
  }
}

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