:root {
  --outside: #070b10;
  --frame: #0b0f15;
  --frame-2: #111720;
  --surface: #111820;
  --surface-solid: #141c25;
  --dark: #090d12;
  --dark-2: #070a0f;
  --ink: #f3f6fb;
  --muted: #8f9aa8;
  --soft: #18212b;
  --line: rgba(148, 163, 184, 0.16);
  --yellow: #d99a32;
  --yellow-2: #e3ad50;
  --yellow-soft: rgba(217, 154, 50, 0.11);
  --green: #d99a32;
  --red: #f87171;
  --blue: #7f95ad;
  --card-bg: #111820;
  --card-border: rgba(148, 163, 184, 0.16);
  --accent-border: rgba(217, 154, 50, 0.28);
  --frame-bg: #0b0f15;
  --login-bg: #070b10;
  --login-panel-bg: #111820;
  --topbar-bg: rgba(11, 15, 21, 0.92);
  --nav-bg: #111820;
  --nav-border: rgba(148, 163, 184, 0.18);
  --input-bg: #0b1118;
  --hover-bg: rgba(217, 154, 50, 0.08);
  --active-bg: rgba(217, 154, 50, 0.16);
  --active-ink: #f1c779;
  --primary-bg: #c98a2b;
  --primary-ink: #0b0f15;
  --primary-hover: #d99a32;
  --table-head-bg: #0d131b;
  --shadow: 0 34px 70px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 999px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --outside: #eef2f6;
  --frame: #f7f9fc;
  --frame-2: #eef3f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --dark: #111827;
  --dark-2: #0f172a;
  --ink: #111827;
  --muted: #64707f;
  --soft: #e6edf5;
  --line: rgba(15, 23, 42, 0.12);
  --yellow: #c98728;
  --yellow-2: #d99a32;
  --yellow-soft: rgba(201, 135, 40, 0.10);
  --green: #c98728;
  --red: #b94c43;
  --blue: #64748b;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.12);
  --accent-border: rgba(201, 135, 40, 0.26);
  --frame-bg: #f7f9fc;
  --login-bg: #eef2f6;
  --login-panel-bg: #ffffff;
  --topbar-bg: rgba(247, 249, 252, 0.92);
  --nav-bg: #ffffff;
  --nav-border: rgba(15, 23, 42, 0.12);
  --input-bg: #ffffff;
  --hover-bg: rgba(201, 135, 40, 0.08);
  --active-bg: rgba(201, 135, 40, 0.14);
  --active-ink: #7a4a0a;
  --primary-bg: #111827;
  --primary-ink: #fff;
  --primary-hover: #0f172a;
  --table-head-bg: #f3f6fa;
  --shadow: 0 30px 65px rgba(15, 23, 42, 0.16);
  --soft-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--outside);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button,
input,
select {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(217, 154, 50, 0.68);
  outline-offset: 3px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
  background: var(--login-bg);
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  color: var(--ink);
  background: var(--login-panel-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.login-logo-card {
  width: min(260px, 100%);
  height: 112px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-logo {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.login-logo {
  width: 252px;
  height: 112px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.30));
}

.login-panel h1 {
  margin: 22px 0 26px;
  font-size: 2.4rem;
  line-height: 1.06;
  font-weight: 500;
}

.login-form,
.filter-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(217, 154, 50, 0.16);
}

.primary-button,
.discord-button,
.tool-button,
.icon-button,
.topnav button,
.brand-button,
.selection-tile,
.round-action,
.theme-toggle {
  border: 0;
}

.primary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  color: var(--primary-ink);
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.primary-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.discord-button {
  min-height: 48px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  color: #fff;
  background: #5865f2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 34px rgba(88, 101, 242, 0.24);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.discord-button:hover {
  background: #4752c4;
  box-shadow: 0 20px 42px rgba(88, 101, 242, 0.30);
  transform: translateY(-1px);
}

.login-form .discord-button,
.login-form .discord-button.disabled {
  color: #fff;
  background: #5865f2;
  opacity: 1 !important;
  filter: none !important;
}

.discord-button.disabled:hover {
  background: #5865f2;
  box-shadow: 0 16px 34px rgba(88, 101, 242, 0.24);
  transform: none;
}

.discord-logo {
  width: 22px;
  height: 18px;
  flex: 0 0 auto;
  color: #fff;
  fill: currentColor;
  stroke: none;
}

.primary-button.compact {
  align-self: end;
  min-height: 46px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.form-error.success {
  color: var(--yellow-2);
}

.app-shell {
  min-height: 100vh;
  padding: 44px;
  background: var(--outside);
}

.dashboard-frame {
  width: min(1540px, 100%);
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--frame-bg);
  border: 1px solid var(--card-border);
  border-radius: 42px;
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 26px 12px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
}

.brand-button {
  min-height: 64px;
  width: 210px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 1.24rem;
  font-weight: 500;
}

.brand-button:hover {
  transform: translateY(-1px);
}

.header-logo {
  width: 190px;
  height: 78px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.26));
}

.topnav {
  justify-self: center;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 5px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.topnav button,
.tool-button,
.icon-button,
.theme-toggle {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  color: var(--ink);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
}

.topnav button.active {
  color: var(--active-ink);
  background: var(--active-bg);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.topnav button:not(.active):hover,
.tool-button:hover,
.icon-button:hover,
.theme-toggle:hover {
  background: var(--hover-bg);
}

.session-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-pill {
  min-height: 46px;
  min-width: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--yellow-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.account-pill {
  min-height: 46px;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  overflow: hidden;
  color: var(--muted);
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-pill.live {
  color: var(--green);
  background: var(--yellow-soft);
}

.main-content {
  width: 100%;
  margin: 0 auto;
  padding: 22px;
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
}

.home-panel {
  min-height: calc(100vh - 164px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "welcome welcome total last-log"
    "last-economy circulation errors resources"
    "top-job sync activity activity"
    "snapshot snapshot activity activity";
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.welcome-area {
  grid-area: welcome;
  align-self: end;
  padding: 22px 8px 22px 4px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.welcome-area h1 {
  margin: 0;
  font-size: 2.95rem;
  line-height: 1.06;
  font-weight: 500;
}

.home-intro {
  max-width: 60ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 700;
}

.selection-tile,
.home-stat-card,
.home-card,
.dark-card,
.chart-panel,
.stat-card,
.table-shell,
.filter-grid {
  border-radius: var(--radius-lg);
}

.selection-tile {
  min-height: 196px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 18px;
  padding: 26px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--soft-shadow);
}

.selection-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.20);
}

.logs-tile {
  background: var(--surface);
}

.economy-tile {
  min-height: 196px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--accent-border);
}

.tile-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: var(--yellow-soft);
  border: 1px solid var(--accent-border);
  border-radius: 19px;
}

:root[data-theme="dark"] .tile-icon {
  color: var(--yellow-2);
  background: var(--yellow-soft);
}

.selection-tile strong {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 500;
}

.selection-tile small {
  display: block;
  max-width: 27ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.4;
}

.home-stat-card,
.home-card,
.dark-card {
  position: relative;
  min-height: 168px;
  padding: 26px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--soft-shadow);
}

.home-stat-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 10px;
}

.stat-total {
  grid-area: total;
}

.stat-last-log {
  grid-area: last-log;
}

.stat-last-economy {
  grid-area: last-economy;
}

.stat-circulation {
  grid-area: circulation;
}

.stat-errors {
  grid-area: errors;
}

.stat-resources {
  grid-area: resources;
}

.stat-top-job {
  grid-area: top-job;
}

.stat-sync {
  grid-area: sync;
}

.home-stat-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--yellow-2);
  background: var(--yellow-soft);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
}

.home-stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-stat-card strong {
  align-self: end;
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 2.35vw, 2.45rem);
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.home-stat-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 700;
}

.home-card h2,
.dark-card h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
}

.activity-card {
  grid-area: activity;
  min-height: 320px;
}

.economy-snapshot-card {
  grid-area: snapshot;
  min-height: 320px;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.home-card-head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 20px;
}

:root[data-theme="light"] .activity-item {
  background: rgba(255, 255, 255, 0.48);
}

.activity-dot {
  width: 12px;
  height: 12px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(127, 149, 173, 0.12);
}

.activity-item.error .activity-dot {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 123, 112, 0.12);
}

.activity-item.warn .activity-dot,
.activity-item.money-in .activity-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(217, 154, 50, 0.14);
}

.activity-item.money-out .activity-dot {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 123, 112, 0.12);
}

.activity-item p {
  min-width: 0;
  margin: 0;
}

.activity-item strong,
.activity-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item strong {
  font-size: 0.92rem;
}

.activity-item small,
.activity-item time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.snapshot-grid div {
  min-height: 104px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 22px;
}

:root[data-theme="light"] .snapshot-grid div {
  background: rgba(255, 255, 255, 0.50);
}

.snapshot-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.view-panel {
  padding: 26px;
  background: var(--card-bg);
  box-shadow: var(--soft-shadow);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 500;
}

.panel-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.tool-button {
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
}

.tool-button.mini {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.76rem;
}

.tool-button.danger {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.28);
}

.filter-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  align-items: end;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.economy-filter-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.stat-card {
  min-height: 104px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.stat-card.green strong {
  color: var(--green);
}

.stat-card.red strong {
  color: var(--red);
}

.stat-card.amber strong {
  color: var(--yellow);
}

.table-shell {
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--table-head-bg);
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--hover-bg);
}

.level-pill,
.amount-pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 900;
}

.level-error {
  color: #fff;
  background: var(--red);
}

.level-warn {
  color: var(--yellow-2);
  background: var(--yellow-soft);
}

.level-info,
.level-debug {
  color: #fff;
  background: var(--dark);
}

.amount-positive {
  color: var(--green);
  background: var(--yellow-soft);
}

.amount-negative {
  color: #fff;
  background: var(--red);
}

.economy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.chart-panel {
  min-height: 260px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.chart-panel.wide {
  grid-column: 1 / -1;
  min-height: 220px;
}

.chart-panel h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr minmax(86px, auto);
  align-items: center;
  gap: 10px;
}

.bar-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-weight: 800;
}

.bar-track {
  height: 16px;
  overflow: hidden;
  background: var(--soft);
  border-radius: var(--radius-sm);
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--yellow);
  border-radius: inherit;
}

.trend-chart {
  height: 150px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(24px, 1fr);
  align-items: end;
  gap: 7px;
  padding-top: 16px;
  border-bottom: 1px dotted var(--line);
}

.trend-bar {
  min-height: 4px;
  background: var(--yellow);
  border-radius: 8px 8px 0 0;
}

.trend-bar.negative {
  background: var(--red);
}

.users-panel {
  display: grid;
  gap: 16px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 520px);
  gap: 12px;
}

.user-card {
  min-height: 100%;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
}

.user-card h3 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
}

.user-form {
  display: grid;
  gap: 14px;
}

.users-table-shell table {
  min-width: 960px;
}

.users-table-shell td strong,
.users-table-shell td small {
  display: block;
}

.users-table-shell td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.role-pill,
.status-pill {
  display: inline-flex;
  min-width: 88px;
  justify-content: center;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 900;
}

.role-owner,
.role-admin {
  color: var(--yellow-2);
  background: var(--yellow-soft);
  border: 1px solid var(--accent-border);
}

.role-viewer {
  color: var(--blue);
  background: rgba(127, 149, 173, 0.12);
  border: 1px solid rgba(127, 149, 173, 0.22);
}

.status-pill.active {
  color: var(--yellow-2);
  background: var(--yellow-soft);
}

.status-pill.disabled {
  color: var(--muted);
  background: var(--soft);
}

.discord-id-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 7px 11px;
  overflow-wrap: anywhere;
  color: var(--yellow-2);
  background: var(--yellow-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(540px, 100vw);
  height: 100vh;
  overflow: auto;
  padding: 24px;
  color: #fff;
  background: var(--dark);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: -24px 0 60px rgba(19, 22, 18, 0.22);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.drawer-head h3 {
  margin: 0;
}

.detail-drawer .icon-button {
  color: var(--yellow-2);
  background: var(--yellow-soft);
  border: 1px solid var(--accent-border);
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.detail-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}

.detail-item small {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.detail-item span {
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

@media (max-width: 1180px) {
  .app-shell {
    padding: 22px;
  }

  .home-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "welcome welcome"
      "total last-log"
      "last-economy circulation"
      "errors resources"
      "top-job sync"
      "activity activity"
      "snapshot snapshot";
  }
}

@media (max-width: 980px) {
  .dashboard-frame {
    border-radius: 30px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 16px;
  }

  .topnav {
    grid-column: 1 / -1;
    justify-self: stretch;
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .main-content {
    padding: 14px;
  }

  .home-panel,
  .economy-layout,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .home-panel {
    grid-template-areas:
      "welcome"
      "total"
      "last-log"
      "last-economy"
      "circulation"
      "errors"
      "resources"
      "top-job"
      "sync"
      "activity"
      "snapshot";
  }

  .filter-grid,
  .economy-filter-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-tile,
  .home-stat-card,
  .home-card,
  .dark-card {
    min-height: 220px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 10px;
  }

  .dashboard-frame {
    border-radius: 24px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .brand-button,
  .session-tools {
    justify-self: start;
  }

  .topnav {
    grid-template-columns: 1fr;
  }

  .welcome-area h1 {
    font-size: 2.1rem;
  }

  .snapshot-grid,
  .filter-grid,
  .economy-filter-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: grid;
  }

  .selection-tile strong {
    font-size: 2.15rem;
  }

  .detail-item {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
