:root {
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
  background: #09070f;
  color: #f5f7fa;
  --surface: rgba(25, 19, 38, .72);
  --surface-2: rgba(36, 27, 54, .68);
  --line: rgba(203, 184, 255, .12);
  --muted: #9f99ad;
  --green: #31c48d;
  --yellow: #f5b942;
  --accent: #8b5cf6;
  --accent-strong: #6d28d9;
  --danger: #f05b64;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(126, 73, 255, .18), transparent 30%),
    radial-gradient(circle at 16% 84%, rgba(82, 38, 154, .12), transparent 28%),
    #09070f;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(168, 85, 247, .42), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(79, 70, 229, .38), transparent 38%),
    linear-gradient(135deg, #10061f 0%, #251044 45%, #130a2a 100%);
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent);
  pointer-events: none;
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 36px;
  background: rgba(19, 12, 35, .88);
  border: 1px solid rgba(196, 181, 253, .2);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(6, 2, 15, .58);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-panel h1 { margin: 4px 0 0; font-size: 30px; }
.login-copy { color: var(--muted); line-height: 1.6; margin: 22px 0 28px; }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  background: linear-gradient(145deg, #a855f7, #6d28d9); color: white;
  font-weight: 800; font-size: 24px; border-radius: 6px;
  box-shadow: 0 10px 28px rgba(124, 58, 237, .38);
  overflow: hidden;
}
.brand-mark.small { width: 36px; height: 36px; font-size: 18px; }
.brand-mark.logo-mark {
  background: #08050f;
  border: 1px solid rgba(167,139,250,.24);
}
.brand-mark.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.primary-button, .secondary-button {
  display: flex; justify-content: center; align-items: center; width: 100%; min-height: 44px;
  border: 0; border-radius: 6px; text-decoration: none; cursor: pointer; font-weight: 700;
}
.primary-button { background: linear-gradient(100deg, #7c3aed, #9f4df2); color: white; }
.primary-button:hover { filter: brightness(1.1); }
.primary-button.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.discord-button { gap: 10px; box-shadow: 0 12px 30px rgba(109, 40, 217, .3); }
.discord-symbol { font-size: 17px; }
.secondary-button { margin-top: 10px; background: #262c35; color: white; }
.primary-button.compact { width: auto; padding: 0 22px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  position: relative;
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 25%, rgba(139, 92, 246, .045) 50%, transparent 72%),
    radial-gradient(circle at 72% 42%, rgba(139, 92, 246, .09), transparent 34%);
  pointer-events: none;
}
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 208px; padding: 24px 16px;
  display: flex; flex-direction: column;
  background: rgba(10, 8, 16, .82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 30px; }
.brand strong { font-size: 13px; }
.brand div:last-child, .user-menu div:nth-child(2), .sidebar-foot div { display: grid; gap: 3px; }
.brand span, .user-menu span, .sidebar-foot span { font-size: 12px; color: var(--muted); }
.nav-list { display: grid; gap: 8px; }
.nav-item {
  min-height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 12px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: #a8a1b5; cursor: pointer; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.7; opacity: .62; }
.nav-item:hover { background: rgba(139, 92, 246, .08); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, .24), rgba(139, 92, 246, .07));
  border-color: rgba(167, 139, 250, .16);
  color: white;
  box-shadow: inset 3px 0 var(--accent), 0 10px 28px rgba(31, 16, 59, .18);
}
.nav-item.active svg { color: #b69cff; opacity: 1; }
.sidebar-foot {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 10px;
  border-top: 1px solid var(--line);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }

.content { grid-column: 2; min-width: 0; padding: 0 38px 52px; position: relative; z-index: 1; }
.topbar {
  min-height: 96px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.topbar h1 { margin: 2px 0 0; font-size: 25px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(139, 92, 246, .22) center/cover; border: 1px solid rgba(196, 181, 253, .22);
  font-weight: 700; overflow: hidden;
}
.icon-button {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255,255,255,.025); color: #bcb4c8; cursor: pointer;
}
.icon-button:hover { background: rgba(139, 92, 246, .12); color: white; }
.icon-button svg { width: 16px; height: 16px; stroke-width: 1.8; }
#menu-toggle { display: none; }

.view { display: none; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric {
  min-height: 146px; padding: 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, .18), transparent 30%),
    linear-gradient(145deg, rgba(28, 22, 41, .74), rgba(20, 16, 29, .72));
  border: 1px solid rgba(167, 139, 250, .16); border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
  backdrop-filter: blur(16px);
}
.metric::after {
  content: "";
  position: absolute; width: 110px; height: 110px; right: -50px; top: -56px;
  background: radial-gradient(circle, rgba(139, 92, 246, .18), transparent 68%);
  pointer-events: none;
}
.metric:first-child {
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, .16), transparent 30%),
    linear-gradient(145deg, rgba(18, 41, 43, .72), rgba(20, 16, 29, .72));
  border-color: rgba(49, 196, 141, .18);
}
.metric:first-child::after { background: radial-gradient(circle, rgba(49, 196, 141, .18), transparent 68%); }
.metric-icon {
  width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 15px;
  color: #b69cff; background: rgba(139, 92, 246, .11);
  border: 1px solid rgba(167, 139, 250, .16); border-radius: 7px;
}
.metric:first-child .metric-icon {
  color: #7ee0b5; background: rgba(34, 197, 139, .1);
  border-color: rgba(74, 222, 167, .16);
}
.metric-icon svg { width: 17px; height: 17px; stroke-width: 1.7; opacity: .82; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 13px; font-weight: 600; }
.metric strong { display: block; margin: 8px 0 7px; font-size: 28px; }
.metric small { font-size: 11px; }
.panel {
  margin-bottom: 18px; padding: 22px;
  background: linear-gradient(145deg, rgba(28, 22, 41, .8), rgba(16, 13, 23, .72));
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .15);
  backdrop-filter: blur(18px);
}

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; }
.live-badge, .read-only {
  padding: 6px 9px; border: 1px solid rgba(167,139,250,.16); border-radius: 7px;
  background: rgba(139,92,246,.06); color: var(--muted); font-size: 11px;
}
.live-badge i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.chart { height: 220px; display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 5px; padding-top: 20px; }
.bar-group { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; min-width: 0; }
.bar {
  width: 100%; min-height: 2px;
  background: linear-gradient(180deg, #b695ff, #7044dc);
  border-radius: 4px 4px 1px 1px;
  box-shadow: 0 0 18px rgba(139, 92, 246, .16);
  transition: height .3s ease;
}
.bar-group span { color: #737d8b; font-size: 9px; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); font-size: 13px; }
.recent-row:first-child { border-top: 0; }
.recent-row span { color: var(--muted); }
.text-button { background: transparent; border: 0; color: var(--accent); cursor: pointer; font-weight: 700; }
.empty-state { color: var(--muted); padding: 30px 0; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 10px; text-align: left; border-top: 1px solid var(--line); font-size: 12px; }
th { color: var(--muted); font-weight: 600; }
.search-input, .settings-form input:not([type="range"]), .settings-form select {
  min-height: 40px; padding: 0 12px; background: rgba(8, 7, 12, .58); border: 1px solid var(--line);
  border-radius: 6px; color: white; outline: none;
}
.search-input:focus, .settings-form input:focus, .settings-form select:focus { border-color: rgba(167,139,250,.48); box-shadow: 0 0 0 3px rgba(139,92,246,.08); }
.history-filters {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 22px; align-items: end;
  margin: -4px 0 22px; padding: 16px;
  background: rgba(8, 7, 12, .34); border: 1px solid var(--line); border-radius: 7px;
}
.date-fields { display: flex; gap: 10px; }
.date-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.date-fields input {
  min-height: 38px; padding: 0 10px; color: white; color-scheme: dark;
  background: rgba(13, 10, 19, .72); border: 1px solid var(--line); border-radius: 6px;
}
.date-presets { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.date-presets button {
  min-height: 34px; padding: 0 11px; color: #b9b1c5; cursor: pointer;
  background: rgba(139, 92, 246, .055); border: 1px solid rgba(167,139,250,.13); border-radius: 6px;
}
.date-presets button:hover { color: white; background: rgba(139, 92, 246, .15); border-color: rgba(167,139,250,.3); }
.filter-summary { grid-column: 1 / -1; margin: 0; color: #817a8d; font-size: 11px; }
.dashboard-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 0 auto;
  color: var(--muted);
}
.dashboard-date-fields,
.dashboard-presets {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dashboard-date-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}
.dashboard-date-fields input {
  width: 118px;
  min-height: 30px;
  padding: 0 8px;
  color: white;
  color-scheme: dark;
  background: rgba(13, 10, 19, .64);
  border: 1px solid rgba(167, 139, 250, .13);
  border-radius: 6px;
}
.dashboard-presets button {
  min-height: 30px;
  padding: 0 9px;
  color: #b9b1c5;
  cursor: pointer;
  background: rgba(139, 92, 246, .05);
  border: 1px solid rgba(167, 139, 250, .13);
  border-radius: 6px;
  font-size: 12px;
}
.dashboard-presets button:hover {
  color: white;
  background: rgba(139, 92, 246, .15);
  border-color: rgba(167, 139, 250, .3);
}
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.status-active { color: var(--yellow); background: rgba(245, 185, 66, .12); }
.status-started { color: var(--green); background: rgba(49, 196, 141, .12); }
.status-failed { color: var(--danger); background: rgba(240, 91, 100, .12); }
.log-panel { min-height: 520px; }
.log-list { background: rgba(7, 6, 11, .48); border: 1px solid var(--line); border-radius: 7px; padding: 8px 16px; }
.log-row { display: grid; grid-template-columns: 80px 150px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid #202630; color: #b8c0cc; font: 12px Consolas, monospace; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: #6f7987; }
.log-event { color: var(--green); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 18px; }
.config-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .85fr); gap: 18px; align-items: start; }
.settings-form { display: grid; gap: 22px; }
.settings-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.settings-form small { color: var(--muted); font-weight: 400; }
.settings-form textarea {
  width: 100%; resize: vertical; min-height: 190px; padding: 13px;
  color: white; line-height: 1.55; outline: none;
  background: rgba(8, 7, 12, .58); border: 1px solid var(--line); border-radius: 6px;
}
.settings-form textarea:focus { border-color: rgba(167,139,250,.48); box-shadow: 0 0 0 3px rgba(139,92,246,.08); }
.settings-form select { appearance: none; cursor: pointer; }
.server-guide { display: grid; gap: 12px; }
.server-guide > div {
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(139,92,246,.045);
}
.server-guide svg { width: 20px; color: var(--purple-soft); }
.server-guide span { display: grid; gap: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.server-guide strong { color: var(--text); font-size: 13px; }
.range-row { display: grid; grid-template-columns: 1fr 72px; gap: 15px; align-items: center; }
.range-row output { min-height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: rgba(8, 7, 12, .58); }
input[type="range"] { accent-color: var(--accent); }
.form-message { min-height: 18px; margin: 0; color: var(--green); font-size: 12px; }
.command-list { display: grid; }
.command-list div { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(0, 1fr); gap: 22px; padding: 16px 0; border-top: 1px solid var(--line); }
.command-list div:first-child { border-top: 0; }
.command-list code { color: var(--yellow); }
.command-list span { display: grid; gap: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: left; }
.command-list span strong { color: #f4f6f8; font-size: 13px; }
.preview-panel { position: sticky; top: 18px; }
.discord-preview {
  min-height: 230px; display: flex; gap: 12px; padding: 18px;
  background: #313338; border: 1px solid rgba(255,255,255,.06); border-radius: 7px;
}
.preview-avatar {
  flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center;
  color: white; font-weight: 800; background: linear-gradient(145deg, #a855f7, #6d28d9); border-radius: 50%;
}
.preview-content { min-width: 0; flex: 1; }
.preview-content > div { display: flex; align-items: center; gap: 6px; }
.preview-content strong { font-size: 14px; }
.preview-content span { padding: 2px 4px; color: white; background: #5865f2; border-radius: 3px; font-size: 9px; font-weight: 700; }
.preview-content time { color: #949ba4; font-size: 10px; }
.preview-content p { margin: 5px 0 12px; color: #dbdee1; line-height: 1.5; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-content img { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; object-fit: contain; }
.responder-actions { display: flex; align-items: center; gap: 8px; }
.add-block-button { color: #c5b4ff; background: rgba(139,92,246,.12); }
.add-block-button:disabled { opacity: .35; cursor: not-allowed; }
.responder-notice {
  margin-bottom: 18px; padding: 12px 14px; color: #a49cad; line-height: 1.5; font-size: 12px;
  background: rgba(139,92,246,.055); border: 1px solid rgba(167,139,250,.13); border-radius: 7px;
}
.responder-blocks { display: grid; gap: 14px; }
.responder-block {
  display: grid; gap: 17px; padding: 18px;
  background: rgba(8,7,12,.35); border: 1px solid var(--line); border-radius: 7px;
}
.responder-block-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.responder-block-heading > div { display: grid; gap: 4px; }
.responder-block-heading span { font-size: 14px; font-weight: 700; }
.responder-block-heading small, .responder-block label small { color: var(--muted); font-size: 11px; font-weight: 400; }
.delete-block-button { color: #ff8b94; background: rgba(240,91,100,.07); border-color: rgba(240,91,100,.14); }
.responder-block label { display: grid; gap: 8px; font-size: 12px; font-weight: 600; }
.responder-block textarea {
  width: 100%; resize: vertical; min-height: 105px; padding: 12px;
  color: white; line-height: 1.5; outline: none;
  background: rgba(8,7,12,.58); border: 1px solid var(--line); border-radius: 6px;
}
.responder-block textarea:focus { border-color: rgba(167,139,250,.48); box-shadow: 0 0 0 3px rgba(139,92,246,.08); }
.responder-empty { border: 1px dashed rgba(167,139,250,.16); border-radius: 7px; }
.owner-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.inventory-metric {
  border-color: rgba(74, 222, 167, .2);
  background: linear-gradient(145deg, rgba(20, 57, 47, .72), rgba(20, 16, 29, .7));
}
.inventory-metric .metric-icon { color: #7ee0b5; background: rgba(34, 197, 139, .1); border-color: rgba(74, 222, 167, .16); }
.admin-list { display: grid; gap: 10px; }
.admin-register-form {
  display: grid; gap: 8px; margin: -4px 0 18px; padding: 14px;
  background: rgba(139,92,246,.055); border: 1px solid rgba(167,139,250,.13); border-radius: 7px;
}
.registration-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.admin-registration-form { display: grid; gap: 19px; }
.admin-registration-form label { display: grid; gap: 8px; font-size: 12px; font-weight: 700; }
.admin-registration-form label small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.admin-registration-form input,
.admin-registration-form select {
  min-height: 41px; padding: 0 12px; color: white; outline: none;
  background: rgba(8,7,12,.58); border: 1px solid var(--line); border-radius: 6px;
}
.admin-registration-form input:focus,
.admin-registration-form select:focus { border-color: rgba(167,139,250,.48); box-shadow: 0 0 0 3px rgba(139,92,246,.08); }
.registration-security-note {
  display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; padding: 12px;
  color: #a9a1b4; line-height: 1.5; font-size: 11px;
  background: rgba(52,211,153,.045); border: 1px solid rgba(52,211,153,.12); border-radius: 7px;
}
.registration-security-note svg { width: 17px; height: 17px; color: #70d7ac; }
.registration-list { display: grid; gap: 9px; }
.registration-row {
  display: grid; grid-template-columns: minmax(200px, 1fr) auto auto minmax(210px, auto);
  gap: 14px; align-items: center; padding: 13px;
  background: rgba(8,7,12,.35); border: 1px solid var(--line); border-radius: 7px;
}
.registration-controls { display: grid; grid-template-columns: 1fr 1.25fr; gap: 7px; }
.registration-controls button {
  min-height: 34px; padding: 0 10px; color: white; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(139,92,246,.07);
}
.registration-controls .status-control.blocked { color: #7ee0b5; }
.registration-controls button:disabled { opacity: .48; cursor: not-allowed; }
.access-level-badge {
  justify-self: start;
  border: 1px solid rgba(167,139,250,.25);
  background: rgba(139,92,246,.12);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.access-level-badge.owner {
  border-color: rgba(74,222,167,.35);
  background: rgba(20,184,120,.14);
  color: #7ee0b5;
}
.registration-controls .delete-account-control {
  color: #ffb3ba; border-color: rgba(240,91,100,.2); background: rgba(240,91,100,.06);
}
.integration-status { padding: 6px 9px; border-radius: 6px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.integration-status.pending { color: #f1c56b; background: rgba(245,185,66,.08); border: 1px solid rgba(245,185,66,.14); }
.integration-status.connected { color: #77dfb2; background: rgba(49,196,141,.08); border: 1px solid rgba(49,196,141,.14); }
.admin-register-form label { font-size: 12px; font-weight: 700; }
.admin-register-form > div { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; }
.admin-register-form input {
  min-height: 40px; padding: 0 12px; color: white; outline: none;
  background: rgba(8,7,12,.58); border: 1px solid var(--line); border-radius: 6px;
}
.admin-register-form small { color: var(--muted); font-size: 10px; }
.admin-row {
  display: grid; grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(92px, .55fr)) minmax(290px, 1.2fr);
  gap: 14px; align-items: center; padding: 14px;
  background: rgba(8,7,12,.35); border: 1px solid var(--line); border-radius: 7px;
}
.admin-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(139,92,246,.18) center/cover; border: 1px solid rgba(167,139,250,.18); border-radius: 50%;
}
.admin-identity > div:last-child { display: grid; gap: 4px; min-width: 0; }
.admin-identity strong, .admin-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity strong { font-size: 13px; }
.admin-identity span, .admin-stat span { color: var(--muted); font-size: 10px; }
.admin-stat { display: grid; gap: 5px; }
.admin-stat strong { font-size: 15px; }
.admin-controls { display: grid; grid-template-columns: minmax(80px, 1fr) 58px 64px; gap: 6px; }
.admin-controls input, .admin-controls button {
  min-height: 34px; color: white; border: 1px solid var(--line); border-radius: 6px;
  background: rgba(139,92,246,.07);
}
.quantity-control {
  min-height: 34px; display: grid; grid-template-columns: 22px 1fr; align-items: center;
  color: #8e859d; border: 1px solid var(--line); border-radius: 6px; background: rgba(139,92,246,.07);
}
.quantity-control svg { width: 13px; height: 13px; justify-self: end; stroke-width: 1.8; }
.admin-controls .quantity-control input {
  width: 100%; min-width: 0; padding: 0 5px; border: 0; outline: none; background: transparent;
  appearance: textfield; -moz-appearance: textfield;
}
.admin-controls .quantity-control input::-webkit-inner-spin-button,
.admin-controls .quantity-control input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.admin-controls button { cursor: pointer; }
.admin-controls button:hover { background: rgba(139,92,246,.18); }
.admin-controls .credit-action { font-size: 10px; font-weight: 800; border: 0; }
.admin-controls .credit-add {
  color: #eafff6;
  background: linear-gradient(135deg, rgba(25, 170, 111, .92), rgba(52, 211, 153, .72));
  box-shadow: 0 8px 20px rgba(16, 185, 129, .14);
}
.admin-controls .credit-add:hover { background: linear-gradient(135deg, #22a970, #4adea7); }
.admin-controls .credit-remove {
  color: #fff0f1;
  background: linear-gradient(135deg, rgba(196, 55, 70, .94), rgba(240, 91, 100, .76));
  box-shadow: 0 8px 20px rgba(240, 91, 100, .13);
}
.admin-controls .credit-remove:hover { background: linear-gradient(135deg, #d33d4e, #fa6a74); }
.confirmation-dialog {
  width: min(460px, calc(100% - 32px)); padding: 0; color: white;
  background: transparent; border: 0;
}
.confirmation-dialog::backdrop { background: rgba(5,3,9,.78); backdrop-filter: blur(7px); }
.confirmation-card {
  display: grid; gap: 14px; padding: 26px;
  background: linear-gradient(145deg, rgba(31,23,45,.98), rgba(15,11,22,.98));
  border: 1px solid rgba(240,91,100,.2); border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}
.confirmation-card h2, .confirmation-card p { margin: 0; }
.confirmation-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; font-size: 12px; }
.confirmation-icon {
  width: 42px; height: 42px; display: grid; place-items: center; color: #ff8992;
  background: rgba(240,91,100,.1); border: 1px solid rgba(240,91,100,.18); border-radius: 7px;
}
.confirmation-icon svg { width: 20px; height: 20px; }
.delete-admin-identity { display: grid; gap: 4px; padding: 11px; background: rgba(255,255,255,.03); border-radius: 6px; }
.delete-admin-identity span { color: var(--muted); font-size: 10px; }
.confirmation-card label { display: grid; gap: 8px; font-size: 12px; }
.confirmation-card input {
  min-height: 40px; padding: 0 11px; color: white; outline: none;
  background: rgba(7,5,10,.7); border: 1px solid var(--line); border-radius: 6px;
}
.confirmation-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-top: 4px; }
.confirmation-actions button { min-height: 40px; border-radius: 6px; cursor: pointer; }
.dialog-secondary { color: #c5bdce; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.dialog-danger { color: white; background: linear-gradient(135deg,#bd3344,#ed5965); border: 0; font-weight: 700; }
.dialog-danger:disabled { opacity: .35; cursor: not-allowed; }
.reset-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.danger-panel { border-color: rgba(240,91,100,.18); }
.danger-icon {
  width: 36px; height: 36px; display: grid; place-items: center; color: #ff8992;
  background: rgba(240,91,100,.08); border: 1px solid rgba(240,91,100,.15); border-radius: 7px;
}
.danger-icon svg { width: 17px; height: 17px; }
.reset-warning {
  margin-bottom: 18px; padding: 13px; color: #c7a4a8; line-height: 1.55; font-size: 12px;
  background: rgba(240,91,100,.055); border: 1px solid rgba(240,91,100,.12); border-radius: 7px;
}
.danger-wide-button, .secondary-wide-button {
  width: 100%; min-height: 42px; border-radius: 6px; cursor: pointer; font-weight: 700;
}
.danger-wide-button { color: white; background: linear-gradient(135deg,#bd3344,#ed5965); border: 0; }
.secondary-wide-button { color: white; background: linear-gradient(135deg,#5f35bd,#8b5cf6); border: 0; }
.secondary-wide-button:disabled { opacity: .35; cursor: not-allowed; }
.secondary-wide-button.is-loading {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 1;
  cursor: wait;
  overflow: hidden;
}
.secondary-wide-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.16) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: cleanup-shimmer 1.4s linear infinite;
}
.button-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cleanup-spin .75s linear infinite;
}
@keyframes cleanup-spin {
  to { transform: rotate(360deg); }
}
@keyframes cleanup-shimmer {
  to { transform: translateX(100%); }
}
.email-cleanup-form { display: grid; gap: 17px; }
.gmail-connection-actions { display: flex; align-items: center; gap: 10px; }
.gmail-disconnect-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #ffd5d8;
  background: linear-gradient(135deg, rgba(151,35,53,.72), rgba(213,55,72,.88));
  border: 1px solid rgba(255,112,124,.28);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}
.gmail-disconnect-button:hover { filter: brightness(1.12); }
.gmail-disconnect-button:active { transform: translateY(1px); }
.gmail-disconnect-button:disabled { opacity: .65; cursor: wait; }
.gmail-disconnect-button svg { width: 16px; height: 16px; }
.gmail-disconnect-button.is-loading { min-width: 190px; }
.email-cleanup-form label { display: grid; gap: 8px; font-size: 12px; font-weight: 600; }
.email-cleanup-form select {
  min-height: 40px; padding: 0 11px; color: white; color-scheme: dark;
  background: rgba(8,7,12,.58); border: 1px solid var(--line); border-radius: 6px;
}

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reset-layout { grid-template-columns: 1fr; }
  .registration-layout { grid-template-columns: 1fr; }
  .settings-layout, .config-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .admin-row { grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(80px, .5fr)); }
  .admin-controls { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 0 16px 34px; }
  #menu-toggle { display: block; }
  .topbar { min-height: 78px; margin-bottom: 20px; }
  .topbar .eyebrow, .user-menu div:nth-child(2) { display: none; }
  .topbar h1 { font-size: 20px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 112px; padding: 15px; }
  .metric strong { font-size: 25px; }
  .panel { padding: 16px; }
  .chart { gap: 3px; height: 180px; }
  .bar-group span { display: none; }
  .recent-row { grid-template-columns: 1fr auto; }
  .recent-row span:nth-child(2), .recent-row span:nth-child(3) { display: none; }
  .search-input { width: 150px; }
  .command-list div { grid-template-columns: 1fr; gap: 8px; }
  .owner-summary { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr 1fr 1fr; }
  .admin-identity { grid-column: 1 / -1; }
  .admin-controls { grid-column: 1 / -1; }
  .history-filters { grid-template-columns: 1fr; }
  .date-fields { display: grid; grid-template-columns: 1fr 1fr; }
  .date-fields input { width: 100%; min-width: 0; }
  .date-presets { justify-content: flex-start; }
  .dashboard-filter { justify-content: flex-start; margin-left: 0; }
  .dashboard-date-fields { flex-wrap: wrap; }
  .admin-register-form > div { grid-template-columns: 1fr; }
  .registration-row { grid-template-columns: 1fr; }
  .registration-controls { grid-template-columns: 1fr 1fr; }
}
