/* ==========================================================================
   PRISM FOOD · Admin console
   Warm paper, brown ink, mint accent. No external fonts, images or CSS libs.
   ========================================================================== */

:root {
  --paper: #f8f8f0;
  --paper-raised: #fffdf4;
  --paper-deep: #f3eedf;
  --paper-input: #fffbe9;

  --ink: #68482c;
  --ink-body: #725d42;
  --ink-muted: #93836a;
  --ink-faint: #b5a68a;

  --line: #e7dcc4;
  --line-strong: #d5c6a8;
  --shadow-offset: #ece2ca;
  --shadow-offset-strong: #e0d3b8;

  --mint: #19c8b9;
  --mint-deep: #0e9388;
  --mint-ink: #064a44;
  --mint-soft: #bcf0de;
  --mint-wash: #e9faf5;

  --butter: #efc15a;
  --butter-wash: #fbf2d6;
  --butter-line: #eed9a1;

  --clay: #e59266;
  --clay-wash: #fbeade;

  --rose: #bf5346;
  --rose-deep: #973b30;
  --rose-wash: #fbe9e4;
  --rose-line: #ecc3b8;

  --sky: #889df0;
  --sky-wash: #eef1fc;

  --green: #7ba95c;
  --green-wash: #eff6e6;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pill: 999px;

  --panel-shadow: 0 5px 0 var(--shadow-offset), 0 18px 35px rgba(104, 72, 44, 0.055);
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-body);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% -8%, rgba(188, 240, 222, 0.5), transparent 40%),
    radial-gradient(circle at 96% 2%, rgba(247, 205, 103, 0.16), transparent 34%),
    radial-gradient(rgba(104, 72, 44, 0.055) 1px, transparent 1.2px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-overlay {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
}

a {
  color: var(--mint-deep);
  text-underline-offset: 3px;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.muted {
  color: var(--ink-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--mint-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow--mint {
  color: var(--mint-soft);
}

:focus-visible {
  outline: 3px solid rgba(25, 200, 185, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--mint-soft);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
  background-clip: padding-box;
}

/* ==========================================================================
   Brand
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
}

.brand__mark span {
  position: absolute;
  top: 6px;
  left: 9px;
  width: 24px;
  height: 31px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-raised);
  box-shadow: 0 2px 0 rgba(104, 72, 44, 0.1);
}

.brand__mark span:nth-child(1) {
  background: var(--butter);
  transform: rotate(-16deg) translateX(-4px);
}

.brand__mark span:nth-child(2) {
  background: var(--mint-soft);
  transform: rotate(-2deg);
}

.brand__mark span:nth-child(3) {
  background: var(--paper-raised);
  transform: rotate(12deg) translateX(4px);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__text strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.brand__text > span {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand--light .brand__text strong {
  color: var(--paper-raised);
}

.brand--light .brand__text > span {
  color: rgba(248, 248, 240, 0.55);
}

.brand--light .brand__mark span {
  border-color: var(--paper-raised);
}

.brand--light .brand__mark span:nth-child(1) {
  background: var(--butter);
}

.brand--light .brand__mark span:nth-child(2) {
  background: var(--mint);
}

.brand--light .brand__mark span:nth-child(3) {
  background: var(--paper-raised);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(2px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  border-color: var(--mint-deep);
  background: var(--mint);
  color: var(--mint-ink);
  box-shadow: 0 4px 0 #0d9a8e, 0 8px 18px rgba(17, 168, 155, 0.16);
}

.btn--primary:hover {
  background: #35d3c5;
}

.btn--primary:active {
  box-shadow: 0 1px 0 #0d9a8e;
}

.btn--primary:disabled {
  box-shadow: 0 2px 0 #0d9a8e;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--shadow-offset);
}

.btn--ghost:hover {
  border-color: var(--ink-faint);
  background: #fffef8;
}

.btn--ghost:active {
  box-shadow: 0 1px 0 var(--shadow-offset);
}

.btn--danger {
  border-color: var(--rose-line);
  background: var(--rose-wash);
  color: var(--rose-deep);
  box-shadow: 0 3px 0 #e6c8bf;
}

.btn--danger:hover {
  border-color: #d9a396;
  background: #fdeee9;
}

.btn--danger-solid {
  border-color: var(--rose-deep);
  background: var(--rose);
  color: #fffdf8;
  box-shadow: 0 4px 0 #933b30;
}

.btn--danger-solid:hover {
  background: #cc6253;
}

.btn--icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 13px;
}

.btn--icon .icon {
  width: 18px;
  height: 18px;
}

.btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  gap: 5px;
  font-size: 11.5px;
  border-radius: var(--pill);
  box-shadow: 0 2px 0 var(--shadow-offset);
}

.btn--sm .icon {
  width: 13px;
  height: 13px;
}

.btn--lg {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 14.5px;
  border-radius: var(--pill);
}

.btn--block {
  width: 100%;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--mint-deep);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--ink);
}

/* ==========================================================================
   Form controls
   ========================================================================== */

.field {
  margin-bottom: 15px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.req {
  color: var(--rose);
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper-input);
  color: var(--ink-body);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

textarea {
  min-height: 120px;
  line-height: 1.65;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #b8a98c;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--mint);
  background: #fffdf1;
  box-shadow: 0 0 0 4px rgba(25, 200, 185, 0.14);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select {
  width: auto;
  min-height: 34px;
  padding: 4px 28px 4px 11px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 46px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  transform: translateY(-50%);
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-muted);
}

.input-action:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.input-action .icon {
  width: 17px;
  height: 17px;
}

.hint {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

.field__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.form-error {
  margin: 2px 0 12px;
  color: var(--rose-deep);
  font-size: 12px;
  line-height: 1.55;
}

.form-error--box {
  padding: 9px 12px;
  border: 1px dashed var(--rose-line);
  border-radius: 12px;
  background: var(--rose-wash);
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 2px 0 14px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--mint-deep);
  cursor: pointer;
}

/* ==========================================================================
   Badges & chips
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--paper-deep);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge--active {
  border-color: #a9ddcd;
  background: var(--mint-wash);
  color: #0b6f63;
}

.badge--blocked {
  border-color: var(--rose-line);
  background: var(--rose-wash);
  color: #a13f32;
}

.badge--pinned {
  border-color: var(--butter-line);
  background: var(--butter-wash);
  color: #8a6110;
}

.badge--draft {
  border-color: var(--line-strong);
  background: var(--paper-deep);
  color: var(--ink-muted);
}

.badge--neutral {
  border-color: var(--line);
  background: var(--paper-deep);
  color: var(--ink-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--paper-deep);
  color: var(--ink-body);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
}

.chip--mint {
  border-color: #b3e7d8;
  background: var(--mint-wash);
  color: #0b6f63;
}

.chip--butter {
  border-color: var(--butter-line);
  background: var(--butter-wash);
  color: #7d5a13;
}

/* ==========================================================================
   Login
   ========================================================================== */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
  gap: clamp(24px, 3.4vw, 54px);
  align-items: center;
  width: 100%;
  max-width: 1280px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 52px) clamp(18px, 4vw, 48px);
}

.login__hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(680px, calc(100vh - 80px));
  padding: clamp(26px, 3.4vw, 48px);
  overflow: hidden;
  border: 1.5px solid #5c4128;
  border-radius: 32px;
  background:
    radial-gradient(circle at 82% 8%, rgba(188, 240, 222, 0.22), transparent 36%),
    radial-gradient(circle at 4% 96%, rgba(239, 193, 90, 0.16), transparent 34%),
    linear-gradient(152deg, #5a3e26 0%, #68482c 52%, #7b5a37 100%);
  color: var(--paper);
  box-shadow: 0 10px 0 #e6dac0, 0 34px 60px rgba(104, 72, 44, 0.18);
}

.login__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(248, 248, 240, 0.08) 1px, transparent 1.2px);
  background-size: 18px 18px;
  pointer-events: none;
}

.login__hero > * {
  position: relative;
  z-index: 1;
}

.login__pitch {
  margin-top: auto;
  margin-bottom: auto;
  padding: 40px 0 30px;
  max-width: 460px;
}

.login__pitch h2 {
  color: var(--paper-raised);
  font-size: clamp(27px, 2.8vw, 38px);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.login__copy {
  max-width: 400px;
  margin-top: 14px;
  color: rgba(248, 248, 240, 0.72);
  font-size: 13px;
  line-height: 1.75;
}

.login__points {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: rgba(248, 248, 240, 0.86);
}

.login__points li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.point-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(188, 240, 222, 0.35);
  border-radius: 8px;
  background: rgba(188, 240, 222, 0.12);
  color: var(--mint-soft);
}

.point-icon .icon {
  width: 13px;
  height: 13px;
}

.login__prisms {
  position: absolute;
  right: -24px;
  bottom: -34px;
  z-index: 0;
  width: 250px;
  height: 230px;
  opacity: 0.85;
  pointer-events: none;
}

.prism-card {
  position: absolute;
  display: block;
  width: 118px;
  height: 152px;
  border: 2px solid rgba(248, 248, 240, 0.55);
  border-radius: 20px;
  box-shadow: 0 8px 0 rgba(44, 28, 16, 0.22);
}

.prism-card--back {
  right: 82px;
  bottom: 48px;
  background: rgba(239, 193, 90, 0.35);
  transform: rotate(-16deg);
}

.prism-card--mid {
  right: 38px;
  bottom: 70px;
  background: rgba(25, 200, 185, 0.4);
  transform: rotate(-4deg);
}

.prism-card--front {
  right: 22px;
  bottom: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 244, 0.12);
  transform: rotate(9deg);
  backdrop-filter: blur(1px);
}

.prism-card--front span {
  color: rgba(248, 248, 240, 0.85);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-align: center;
  line-height: 1.5;
}

.login__hero-foot {
  margin-top: 26px;
  color: rgba(248, 248, 240, 0.42);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login__panel-wrap {
  width: 100%;
}

.login__panel {
  width: 100%;
  max-width: 478px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 38px);
  border: 1.5px solid var(--line);
  border-radius: 28px;
  background: var(--paper-raised);
  box-shadow: 0 8px 0 #e9dfc8, 0 30px 55px rgba(104, 72, 44, 0.08);
}

.login__panel h1 {
  margin-top: 2px;
  font-size: 31px;
  letter-spacing: 0.01em;
}

.login__lead {
  margin-top: 7px;
  margin-bottom: 24px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.login__panel form {
  margin-top: 4px;
}

.login__panel .btn--primary {
  margin-top: 4px;
}

.login__panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1.5px dashed var(--line);
  color: var(--ink-faint);
  font-size: 10.5px;
}

.login__secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login__secure .icon {
  width: 14px;
  height: 14px;
  color: var(--mint-deep);
}

.login__fineprint {
  margin-top: 15px;
  color: var(--ink-faint);
  font-size: 10.5px;
  text-align: center;
}

/* ==========================================================================
   Shell / sidebar / topbar
   ========================================================================== */

.shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 16px 18px;
  border-right: 1.5px solid var(--line);
  background: rgba(255, 253, 244, 0.74);
  backdrop-filter: blur(10px);
}

.sidebar__brand {
  margin-left: 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav__label {
  margin: 16px 12px 5px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav__label:first-child {
  margin-top: 4px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav__link .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  transition: color 0.16s ease;
}

.nav__link:hover {
  background: rgba(188, 240, 222, 0.32);
  color: var(--ink);
  transform: translateX(2px);
}

.nav__link:hover .icon {
  color: var(--mint-deep);
}

.nav__link.is-active {
  border-color: #b9e8da;
  background: var(--mint-wash);
  color: #0b6f63;
  box-shadow: 0 2px 0 rgba(25, 200, 185, 0.16);
}

.nav__link.is-active .icon {
  color: var(--mint-deep);
}

.sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}

.connect-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper-deep);
}

.connect-card__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(25, 200, 185, 0.16);
}

.connect-card__body {
  min-width: 0;
}

.connect-card__label {
  display: block;
  color: var(--ink-muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.connect-card__host {
  display: block;
  overflow: hidden;
  color: var(--ink-body);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar__note {
  padding: 0 4px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.mobile-only {
  display: none !important;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 3.2vw, 40px) 16px;
  background: linear-gradient(to bottom, rgba(248, 248, 240, 0.97) 62%, rgba(248, 248, 240, 0));
  backdrop-filter: blur(8px);
}

.topbar__titles {
  min-width: 0;
}

.topbar h1 {
  margin-top: 2px;
  font-size: 27px;
  line-height: 1.2;
}

.page-sub {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.55;
}

.topbar__actions {
  display: flex;
  gap: 8px;
  flex: none;
  padding-top: 4px;
}

.view-root {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 6px clamp(20px, 3.2vw, 40px) 64px;
  flex: 1;
}

.view {
  animation: view-in 0.32s ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Panels
   ========================================================================== */

.panel {
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: var(--paper-raised);
  box-shadow: var(--panel-shadow);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 13px;
  border-bottom: 1.5px dashed var(--line);
}

.panel__head h2 {
  font-size: 16px;
}

.panel__sub {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.panel__body {
  padding: 20px;
}

.panel + .panel {
  margin-top: 18px;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   Overview
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 15px 15px 14px;
  border: 1.5px solid var(--line);
  border-radius: 19px;
  background: var(--paper-raised);
  box-shadow: 0 4px 0 var(--shadow-offset);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: card-in 0.4s ease both;
}

.stat-card:nth-child(2) { animation-delay: 0.03s; }
.stat-card:nth-child(3) { animation-delay: 0.06s; }
.stat-card:nth-child(4) { animation-delay: 0.09s; }
.stat-card:nth-child(5) { animation-delay: 0.12s; }
.stat-card:nth-child(6) { animation-delay: 0.15s; }

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 7px 0 var(--shadow-offset), 0 16px 26px rgba(104, 72, 44, 0.07);
}

.stat-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 11px;
  border: 1px solid var(--tone-line, var(--line));
  border-radius: 12px;
  background: var(--tone-wash, var(--paper-deep));
  color: var(--tone, var(--ink-muted));
}

.stat-card__icon .icon {
  width: 18px;
  height: 18px;
}

.stat-card__value {
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  margin-top: 5px;
  color: var(--ink-body);
  font-size: 11.5px;
  font-weight: 700;
}

.stat-card__note {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

.stat-card--mint {
  --tone: var(--mint-deep);
  --tone-wash: var(--mint-wash);
  --tone-line: #b3e7d8;
}

.stat-card--butter {
  --tone: #a47412;
  --tone-wash: var(--butter-wash);
  --tone-line: var(--butter-line);
}

.stat-card--rose {
  --tone: #a3453a;
  --tone-wash: var(--rose-wash);
  --tone-line: var(--rose-line);
}

.stat-card--sky {
  --tone: #5569c4;
  --tone-wash: var(--sky-wash);
  --tone-line: #c9d2f7;
}

.stat-card--clay {
  --tone: #a45c2e;
  --tone-wash: var(--clay-wash);
  --tone-line: #ecc9b0;
}

.stat-card--green {
  --tone: #557d37;
  --tone-wash: var(--green-wash);
  --tone-line: #cfe2b9;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 20px;
  border: none;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color 0.15s ease;
}

.recent-user:last-child {
  border-bottom: none;
}

.recent-user:hover {
  background: rgba(233, 250, 245, 0.6);
}

.recent-user__body {
  min-width: 0;
}

.recent-user__name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-user__id {
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-user__chevron {
  color: var(--ink-faint);
}

.recent-user__chevron .icon {
  width: 14px;
  height: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1.5px solid rgba(104, 72, 44, 0.14);
  border-radius: 12px;
  background: var(--mint-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.avatar--mint { background: var(--mint-soft); }
.avatar--butter { background: #f7e0a7; }
.avatar--clay { background: #f6cfb5; }
.avatar--sky { background: #d6ddf9; }

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.quick-link:hover {
  border-color: #bfe9dc;
  background: var(--mint-wash);
  transform: translateX(2px);
}

.quick-link__icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 9px;
  background: var(--paper-deep);
  color: var(--mint-deep);
}

.quick-link__icon .icon {
  width: 15px;
  height: 15px;
}

.quick-link__text {
  flex: 1;
  min-width: 0;
}

.quick-link__sub {
  display: block;
  color: var(--ink-faint);
  font-size: 9.5px;
  font-weight: 500;
}

.quick-link > .icon {
  width: 13px;
  height: 13px;
  color: var(--ink-faint);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 18px 18px;
}

.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.info-row__label {
  flex: none;
  color: var(--ink-muted);
}

.info-row__value {
  overflow: hidden;
  color: var(--ink-body);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.last-updated {
  padding: 0 18px 16px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

/* ==========================================================================
   Users
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 250px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-box > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

.search-box input {
  min-height: 40px;
  padding-left: 38px;
  padding-right: 36px;
  border-radius: var(--pill);
  background: var(--paper-raised);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-muted);
}

.search-clear:hover {
  background: var(--line);
  color: var(--ink);
}

.search-clear .icon {
  width: 12px;
  height: 12px;
}

.toolbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 11px;
}

.select-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.table th {
  padding: 9px 18px;
  border-bottom: 1.5px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink-faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 12px 18px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-body);
  font-size: 12px;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background: rgba(233, 250, 245, 0.45);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.user-cell__body {
  min-width: 0;
}

.user-cell__name {
  display: block;
  max-width: 180px;
  overflow: hidden;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-cell__name:hover {
  color: var(--mint-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.user-cell__id {
  max-width: 180px;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.openid-cell {
  max-width: 210px;
  overflow: hidden;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.time-cell {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 18px;
  border-top: 1.5px dashed var(--line);
  color: var(--ink-muted);
  font-size: 10.5px;
}

.pager__info b {
  color: var(--ink-body);
  font-weight: 700;
}

.pager__controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pager__page {
  min-width: 58px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

/* ==========================================================================
   Drawer
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(74, 55, 36, 0.34);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.overlay.is-open {
  opacity: 1;
}

.overlay--drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.drawer {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  height: 100%;
  max-height: 100dvh;
  border-left: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: -22px 0 55px rgba(74, 55, 36, 0.2);
  transform: translateX(30px);
  opacity: 0.6;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.overlay.is-open .drawer {
  transform: none;
  opacity: 1;
}

.drawer__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1.5px dashed var(--line);
  background: var(--paper-raised);
}

.drawer__head h2 {
  font-size: 19px;
  line-height: 1.3;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 44px;
}

.drawer__body > * + * {
  margin-top: 14px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: 0 3px 0 var(--shadow-offset);
}

.identity .avatar {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 18px;
}

.identity__body {
  flex: 1;
  min-width: 0;
}

.identity__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
}

.identity__id {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
}

.identity__id code {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-muted);
}

.copy-btn:hover {
  border-color: var(--mint);
  color: var(--mint-deep);
}

.copy-btn .icon {
  width: 11px;
  height: 11px;
}

.drawer-section {
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: 0 3px 0 var(--shadow-offset);
}

.drawer-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.drawer-section__title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
}

.drawer-section__title .icon {
  width: 15px;
  height: 15px;
  color: var(--mint-deep);
}

.drawer-section__count {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.kv-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.kv-key {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
  word-break: break-word;
}

.kv-key small {
  display: block;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8.5px;
}

.kv-val {
  min-width: 0;
  color: var(--ink-body);
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}

.pref-value {
  white-space: pre-wrap;
}

.json-details {
  margin-top: 2px;
}

.json-details summary {
  color: var(--mint-deep);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.json-details summary:hover {
  color: var(--ink);
}

.json {
  max-height: 220px;
  margin: 6px 0 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
  color: var(--ink-body);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.library-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.library-meta {
  margin-top: 9px;
  color: var(--ink-faint);
  font-size: 9.5px;
  font-family: var(--mono);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
}

.deck-card {
  padding: 10px 11px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.deck-card__name {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.deck-card__meta {
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8.5px;
}

.deck-card__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.todo__box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  color: transparent;
}

.todo__box .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.4;
}

.todo--done .todo__box {
  border-color: var(--mint-deep);
  background: var(--mint);
  color: var(--mint-ink);
}

.todo__text {
  color: var(--ink-body);
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-word;
}

.todo--done .todo__text {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.todo__meta {
  display: block;
  margin-top: 1px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.action-row:first-of-type {
  padding-top: 0;
}

.action-row:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}

.action-row__text {
  min-width: 0;
}

.action-row__title {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
}

.action-row__desc {
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.action-row .btn {
  flex: none;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 40px);
  padding: 24px;
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper-raised);
  box-shadow: 0 9px 0 #e7dcc2, 0 32px 64px rgba(74, 55, 36, 0.22);
  transform: translateY(12px) scale(0.985);
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.overlay.is-open .modal {
  transform: none;
  opacity: 1;
}

.modal--sm {
  max-width: 420px;
}

.modal--md {
  max-width: 600px;
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border: 1.5px solid var(--butter-line);
  border-radius: 14px;
  background: var(--butter-wash);
  color: #9a6a10;
}

.modal__icon .icon {
  width: 21px;
  height: 21px;
}

.modal__icon--danger {
  border-color: var(--rose-line);
  background: var(--rose-wash);
  color: var(--rose-deep);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal h2 {
  margin-top: 1px;
  font-size: 20px;
}

.modal__lead {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.65;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

/* ==========================================================================
   Announcements
   ========================================================================== */

.announce-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.announce {
  padding: 16px 18px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: 0 4px 0 var(--shadow-offset);
}

.announce__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.announce__main {
  min-width: 0;
}

.announce__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.announce__title {
  font-size: 15.5px;
  line-height: 1.45;
  word-break: break-word;
}

.announce__content {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: var(--ink-body);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.announce__content.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.announce__more {
  margin-top: 3px;
  padding: 0;
  border: none;
  background: none;
  color: var(--mint-deep);
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.announce__more:hover {
  color: var(--ink);
}

.announce__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1.5px dashed var(--line);
}

.announce__meta {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.6;
}

.announce__actions {
  display: flex;
  gap: 5px;
}

.announce__actions .btn {
  box-shadow: none;
}

.announce-skeleton {
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
}

/* ==========================================================================
   Audit log
   ========================================================================== */

.timeline {
  position: relative;
  margin: 0;
  padding: 4px 0 4px 26px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  border-left: 1.5px dashed var(--line-strong);
}

.log {
  position: relative;
  padding: 7px 0 15px;
}

.log:last-child {
  padding-bottom: 2px;
}

.log::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -23px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper-raised);
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.log--mint::before {
  background: var(--mint);
  box-shadow: 0 0 0 1px #8fd9cc;
}

.log--rose::before {
  background: var(--rose);
  box-shadow: 0 0 0 1px #daa79c;
}

.log--butter::before {
  background: var(--butter);
  box-shadow: 0 0 0 1px #e5cb8d;
}

.log--clay::before {
  background: var(--clay);
  box-shadow: 0 0 0 1px #e3ba9d;
}

.log__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.log__action {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.log__time {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.log__meta {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.6;
  word-break: break-word;
}

.log__meta code {
  color: var(--ink-body);
  font-size: 9.5px;
}

.log__detail {
  margin-top: 4px;
}

.log__detail summary {
  color: var(--mint-deep);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.log__detail .json {
  margin-top: 5px;
}

/* ==========================================================================
   States, skeletons, empty
   ========================================================================== */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 20px;
  text-align: center;
}

.state__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 3px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 15px;
  background: var(--paper-deep);
  color: var(--ink-faint);
}

.state__icon .icon {
  width: 23px;
  height: 23px;
}

.state__title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.state__desc {
  max-width: 400px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.65;
  word-break: break-word;
}

.state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.state--error .state__icon {
  border-color: var(--rose-line);
  border-style: solid;
  background: var(--rose-wash);
  color: var(--rose-deep);
}

.state--error .state__desc {
  color: var(--rose-deep);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 46px 20px;
  color: var(--ink-muted);
  font-size: 11.5px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--mint-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  display: block;
  height: 11px;
  border-radius: 7px;
  background: linear-gradient(90deg, #efe7d4 25%, #f9f3e4 37%, #efe7d4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.35s ease infinite;
}

.skeleton--circle {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.skeleton--title {
  width: 42%;
  height: 15px;
}

.skeleton--value {
  width: 54%;
  height: 25px;
  margin-bottom: 8px;
}

.w-25 { width: 25%; }
.w-40 { width: 40%; }
.w-55 { width: 55%; }
.w-70 { width: 70%; }
.w-85 { width: 85%; }
.w-100 { width: 100%; }

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 20px;
}

.skeleton-card {
  padding: 15px;
  border: 1.5px solid var(--line);
  border-radius: 19px;
  background: var(--paper-raised);
}

.skeleton-card .skeleton--circle {
  margin-bottom: 12px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 18px;
}

.skeleton-panel {
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: var(--paper-raised);
}

.skeleton-panel__head {
  width: 30%;
  height: 15px;
  margin-bottom: 20px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.skeleton-row:last-child {
  border-bottom: none;
}

.skeleton-row__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-table {
  padding: 6px 18px 14px;
}

.skeleton-table .skeleton-row {
  padding: 13px 0;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--mint);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  box-shadow: 0 4px 0 var(--shadow-offset), 0 14px 28px rgba(74, 55, 36, 0.13);
  pointer-events: auto;
  animation: toast-in 0.24s ease both;
}

.toast--error {
  border-left-color: var(--rose);
}

.toast--info {
  border-left-color: var(--sky);
}

.toast__icon {
  margin-top: 1px;
  color: var(--mint-deep);
}

.toast--error .toast__icon {
  color: var(--rose);
}

.toast--info .toast__icon {
  color: #5569c4;
}

.toast__icon .icon {
  width: 16px;
  height: 16px;
}

.toast__text {
  flex: 1;
  min-width: 0;
  color: var(--ink-body);
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-word;
}

.toast__close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
}

.toast__close:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.toast__close .icon {
  width: 11px;
  height: 11px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Boot
   ========================================================================== */

.boot {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--paper);
  color: var(--ink-muted);
  font-size: 12px;
}

.boot__mark {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 40px;
  margin-bottom: 10px;
}

.boot__mark span {
  width: 11px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--mint-soft);
  animation: boot-breathe 0.9s ease-in-out infinite alternate;
}

.boot__mark span:nth-child(2) {
  height: 38px;
  background: var(--mint);
  animation-delay: 0.14s;
}

.boot__mark span:nth-child(3) {
  background: var(--butter);
  animation-delay: 0.28s;
}

@keyframes boot-breathe {
  from {
    transform: scaleY(0.82);
    opacity: 0.75;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1240px) {
  .stat-grid,
  .skeleton-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-grid,
  .skeleton-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login__hero {
    min-height: 600px;
  }
}

@media (max-width: 1080px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
    max-width: 600px;
    gap: 20px;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 40px;
  }

  .login__hero {
    min-height: 0;
    padding: 24px 26px;
    border-radius: 26px;
  }

  .login__pitch {
    padding: 22px 0 4px;
  }

  .login__pitch h2 {
    font-size: 24px;
  }

  .login__copy,
  .login__points,
  .login__prisms,
  .login__hero-foot {
    display: none;
  }

  .login__panel {
    max-width: none;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1.5px solid var(--line);
    background: rgba(255, 253, 244, 0.94);
  }

  .sidebar__brand {
    margin-left: 0;
    flex: none;
  }

  .sidebar__brand .brand__text {
    display: none;
  }

  .brand__mark {
    transform: scale(0.92);
  }

  .nav {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav__label,
  .sidebar__foot {
    display: none;
  }

  .nav__link {
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 12px;
  }

  .nav__link:hover {
    transform: none;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .topbar {
    position: static;
    padding-top: 18px;
  }

  .view-root {
    padding-bottom: 56px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 16px 16px 12px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .page-sub {
    font-size: 11px;
  }

  .view-root {
    padding: 4px 16px 48px;
  }

  .stat-grid,
  .skeleton-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card__value {
    font-size: 24px;
  }

  .panel {
    border-radius: 18px;
  }

  .panel__head {
    padding: 13px 15px 11px;
  }

  .panel__body {
    padding: 16px;
  }

  .toolbar {
    gap: 10px;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-box {
    max-width: none;
    flex-basis: 100%;
  }

  .table th,
  .table td {
    padding-left: 14px;
    padding-right: 14px;
  }

  .col-optional {
    display: none;
  }

  .col-optional-2 {
    display: none;
  }

  .recent-user {
    padding: 10px 15px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .recent-user__chevron {
    display: none;
  }

  .quick-links,
  .info-list {
    padding: 14px 15px 15px;
  }

  .last-updated {
    padding: 0 15px 14px;
  }

  .drawer {
    width: 100%;
  }

  .drawer__head {
    padding: 14px 16px;
  }

  .drawer__body {
    padding: 14px 16px 36px;
  }

  .kv-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .overlay {
    padding: 12px;
  }

  .modal {
    padding: 20px;
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .pager {
    padding: 10px 15px;
  }

  .announce {
    padding: 14px 15px 11px;
  }

  .announce__head {
    flex-direction: column;
    gap: 8px;
  }

  .announce__actions {
    align-self: flex-end;
  }

  .action-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .action-row .btn {
    align-self: flex-start;
  }
}

@media (max-width: 560px) {
  body {
    background-size: auto, auto, 18px 18px;
  }

  .login {
    padding: 12px 12px 30px;
  }

  .login__hero {
    padding: 20px;
  }

  .login__pitch h2 {
    font-size: 21px;
  }

  .login__panel {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .login__panel h1 {
    font-size: 26px;
  }

  .login__panel-foot {
    align-items: flex-start;
  }

  .sidebar {
    gap: 10px;
    padding: 8px 10px;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
    transform: scale(0.85);
    margin: -2px;
  }

  .nav__link {
    padding: 7px 9px;
    font-size: 11.5px;
    gap: 6px;
  }

  .nav__link .icon {
    width: 15px;
    height: 15px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar__actions {
    padding-top: 0;
  }

  .stat-card__icon {
    width: 31px;
    height: 31px;
    border-radius: 10px;
  }

  .stat-card__icon .icon {
    width: 16px;
    height: 16px;
  }

  .stat-card__value {
    font-size: 22px;
  }

  .stat-card__note {
    display: none;
  }

  .toolbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  .table {
    min-width: 620px;
  }

  .table th,
  .table td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .user-cell {
    min-width: 140px;
  }

  .pager {
    flex-direction: column;
    align-items: flex-start;
  }

  .pager__controls {
    width: 100%;
    justify-content: space-between;
  }

  .drawer-section {
    padding: 13px;
  }

  .deck-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .modal__actions {
    flex-direction: column-reverse;
  }

  .modal__actions .btn {
    width: 100%;
  }

  .announce__actions .btn {
    min-height: 28px;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .timeline {
    padding-left: 22px;
  }

  .timeline::before {
    left: 5px;
  }

  .log::before {
    left: -21px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
