:root {
  --bg: #080706;
  --panel: #12100d;
  --panel2: #191511;
  --panel-hover: #211c16;
  --line: #332a1f;
  --line-bright: #594730;
  --muted: #9e9383;
  --text: #f7f2e8;
  --gold: #f5bd4f;
  --orange: #f09235;
  --purple: #c582ff;
  --cyan: #63d7f7;
  --green: #4ee095;
  --red: #ff6470;
  --blue: #6aa9ff;
  --pink: #f783be;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(245, 189, 79, 0.14), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(185, 62, 45, 0.14), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

.shell {
  min-height: 100vh;
  max-width: 1920px;
  margin: 0 auto;
}

header {
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 9, 8, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brandMark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(245, 189, 79, 0.65);
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  color: var(--gold);
  background: linear-gradient(145deg, #2b2013, #14100b);
  box-shadow: 0 0 22px rgba(245, 189, 79, 0.18);
  flex-shrink: 0;
}

.brandText {
  display: grid;
  line-height: 1.1;
}

.brandText strong {
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--text);
}

.brandText span {
  font-size: 10px;
  color: var(--gold);
  margin-top: 3px;
  font-weight: 600;
}

.liveStatus {
  margin-left: 14px;
  border: 1px solid var(--line);
  background: #15120e;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.liveStatus i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #665e54;
}

.liveStatus i.live {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.headerActions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.headerActions a, .linkButton {
  color: #cfc5b4;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  cursor: pointer;
  transition: all 0.16s ease;
}

.headerActions a:hover, .linkButton:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.headerActions .deleteNav {
  color: #ff8e96;
  border: 1px solid #6b333a;
  background: #231114;
}

.headerActions .deleteNav:hover {
  border-color: #ff6470;
  background: #33161b;
}

.avatar {
  border: 1px solid var(--line-bright);
  background: #211b13;
  color: var(--gold);
  border-radius: 10px;
  height: 35px;
  min-width: 35px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}

.notice {
  margin: 16px 28px 0;
  padding: 12px 15px;
  border: 1px solid #7d5729;
  background: #261a0d;
  color: #ffca7a;
  border-radius: 12px;
  font-size: 12px;
}

.noteGroups {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 28px 0;
  scrollbar-width: thin;
}

.noteGroups button {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.noteGroups button:hover {
  border-color: var(--line-bright);
  color: var(--text);
}

.noteGroups button.active {
  color: #140f08;
  border-color: var(--gold);
  background: linear-gradient(135deg, #f5bd4f, #e0872b);
}

.noteGroups em {
  font-style: normal;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 28px;
}

.metric {
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, #17130f, #0e0c0a);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.metricLabel {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric b {
  font-size: 24px;
  display: block;
  margin-top: 10px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.green { color: var(--green); }
.cyan { color: var(--cyan); }
.orange { color: var(--orange); }
.yellow, .gold { color: var(--gold); }
.blue { color: var(--blue); }
.purple { color: var(--purple); }
.pink { color: var(--pink); }
.red { color: var(--red); }
.muted { color: var(--muted); }

.inventorySection {
  padding: 0 28px 32px;
}

.sectionTitle {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 2px 0 14px;
}

.sectionTitle span {
  font-size: 9px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.sectionTitle h2 {
  font-size: 20px;
  margin: 4px 0 0;
}

.sectionTitle small {
  color: var(--muted);
  font-size: 11px;
}

.toolbar {
  border: 1px solid var(--line);
  min-height: 62px;
  border-radius: 15px;
  background: #100e0b;
  display: flex;
  align-items: center;
  padding: 10px;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  padding: 0 12px;
  display: flex !important;
  align-items: center;
  flex: 1;
  min-width: 200px;
}

.search:focus-within {
  border-color: var(--gold);
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12px;
}

.toolbar .itemFilter {
  min-width: 130px;
}

.toolbar .itemFilter select {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
  width: 100%;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background-color: var(--panel2);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23f5bd4f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"),
    linear-gradient(145deg, #211b14, #14110d);
  background-repeat: no-repeat;
  background-position: right 10px center, center;
  background-size: 15px, 100%;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.toolbar .itemFilter select option {
  background: #181410;
  color: var(--text);
}

.accountStatusFilter {
  height: 40px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  padding: 3px;
  gap: 2px;
}

.accountStatusFilter button {
  min-width: 58px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.accountStatusFilter button.active {
  background: linear-gradient(135deg, #6b4c1b, #3d2810);
  color: var(--gold);
  border: 1px solid rgba(245, 189, 79, 0.35);
}

.scriptButton {
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #755628;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b2a12, #1f170c);
  color: var(--gold);
  padding: 0 15px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.16s ease;
}

.scriptButton:hover {
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 16px rgba(245, 189, 79, 0.2);
}

.viewActions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.viewSwitch {
  height: 40px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  padding: 3px;
}

.viewSwitch button {
  width: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.viewSwitch button.active {
  background: linear-gradient(135deg, #6b4c1b, #3d2810);
  color: var(--gold);
}

.expandIcon {
  height: 40px;
  width: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--panel2);
  color: var(--gold);
  cursor: pointer;
}

.expandIcon span {
  display: block;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.expandIcon:hover span {
  transform: rotate(180deg);
}

.expandIcon.active {
  border-color: var(--gold);
  background: #332410;
}

/* Selection Bar */
.selectionActions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 15px;
  margin-bottom: 12px;
  background: #1d1710;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
}

.selectionActions b {
  font-size: 12px;
  color: var(--gold);
  margin-right: auto;
}

/* Item Grid */
.itemGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
}

.itemCard {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, #17130f, #0d0b09);
  padding: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.itemCard:hover, .itemCard:focus {
  border-color: var(--gold);
  outline: none;
  background: #1d1711;
  transform: translateY(-2px);
}

.itemArt {
  height: 108px;
  border: 1px solid #362c20;
  border-radius: 11px;
  background: radial-gradient(circle, rgba(245, 189, 79, 0.16), transparent 68%), #0c0a08;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 36px;
  color: var(--gold);
}

.itemArt img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.itemArt em {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  background: rgba(8, 7, 6, 0.88);
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  padding: 3px 7px;
  color: #fff;
}

.itemCard h3 {
  font-size: 13px;
  margin: 10px 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itemTags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.itemTags span {
  border: 1px solid #3b3023;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}

/* Rarity Styles (AOTR) */
.rarity-secret, .rarity-apex, .rarity-exclusive {
  color: #ff5c77 !important;
  border-color: #822b3a !important;
}
.rarity-divine {
  color: #5cf2ff !important;
  border-color: #276f78 !important;
}
.rarity-mythic {
  color: #df75ff !important;
  border-color: #69327a !important;
}
.rarity-legendary {
  color: #ffbe42 !important;
  border-color: #7d5918 !important;
}
.rarity-epic {
  color: #a87eff !important;
  border-color: #4c377a !important;
}
.rarity-rare {
  color: #5caaff !important;
  border-color: #29517d !important;
}
.rarity-uncommon {
  color: #5ce08d !important;
  border-color: #26633d !important;
}
.rarity-common {
  color: #b8b0a4 !important;
  border-color: #474139 !important;
}

/* Account Table View */
.tableControls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  gap: 10px;
  flex-wrap: wrap;
}

.tableControls label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tableControls select {
  height: 34px;
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  padding: 0 9px;
}

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

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: #fff;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.itemTableWrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #100d0a;
}

.itemTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.itemTable th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #14110d;
}

.itemTable td {
  padding: 11px 14px;
  border-bottom: 1px solid #241e16;
  font-size: 12px;
  color: #ded6c8;
  vertical-align: middle;
}

.sortButton {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.sortButton.active, .sortButton.active span {
  color: var(--gold);
}

.noteGroupRow {
  background: linear-gradient(90deg, #211a11, #14100c);
  cursor: pointer;
}

.noteGroupRow:hover {
  background: linear-gradient(90deg, #2b2216, #1a1510);
}

.noteGroupButton {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.noteChevron {
  color: var(--gold);
  font-size: 14px;
}

.noteAccountCount {
  border: 1px solid #2d5940;
  border-radius: 999px;
  color: var(--green);
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
}

.groupTotalCell {
  color: var(--gold) !important;
  font-weight: 900;
  font-size: 12px !important;
}

.accountTableRow.accountOnline td:first-child {
  border-left: 3px solid var(--green);
}

.accountTableRow.accountOffline td:first-child {
  border-left: 3px solid #595247;
}

.accountTableRow.accountOnline {
  background: linear-gradient(90deg, rgba(78, 224, 149, 0.06), transparent 28%);
}

.accountTableRow:hover {
  background: rgba(245, 189, 79, 0.05);
}

.usernameCell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.usernameTop b {
  font-size: 13px;
  color: #fff;
}

.placeBadge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(245, 189, 79, 0.12);
  border: 1px solid rgba(245, 189, 79, 0.3);
  color: var(--gold);
}

.boostPill {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(78, 224, 149, 0.12);
  border: 1px solid rgba(78, 224, 149, 0.3);
  color: var(--green);
}

.accountMetaSub {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prestigeBadge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(245, 189, 79, 0.14);
  border: 1px solid rgba(245, 189, 79, 0.35);
  color: var(--gold);
}

.itemsCountButton {
  min-width: 68px;
  border: 1px solid var(--line-bright);
  background: #1d1710;
  color: var(--gold);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.itemsCountButton:hover {
  border-color: var(--gold);
  background: #2b2115;
}

.accountCheckbox {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Right Drawer */
.drawerBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 3, 0.72);
  backdrop-filter: blur(4px);
  z-index: 49;
}

.itemDrawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(460px, 95vw);
  height: 100vh;
  background: linear-gradient(165deg, #181410, #0b0907);
  border-left: 1px solid var(--line-bright);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.85);
  z-index: 50;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.itemDrawer.open {
  transform: translateX(0);
}

.drawerClose {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-bright);
  background: #211b14;
  color: var(--text);
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
}

.drawerItemHead {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 36px 0 16px;
}

.drawerHeroCompact {
  width: 92px;
  height: 92px;
  border: 1px solid var(--line-bright);
  border-radius: 15px;
  background: radial-gradient(circle, rgba(245, 189, 79, 0.18), transparent 68%), #0c0a08;
  display: grid;
  place-items: center;
  font-size: 36px;
  color: var(--gold);
}

.drawerHeroCompact img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.eyebrow {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 10px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.drawerSummary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 18px;
}

.drawerSummary b {
  font-size: 19px;
  color: var(--gold);
}

.drawerStatsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.drawerStatBox {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 10px;
}

.drawerStatBox span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  font-weight: 800;
}

.drawerStatBox b {
  display: block;
  font-size: 14px;
  margin-top: 4px;
}

.ownerListHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.ownerList {
  display: grid;
  gap: 8px;
}

.ownerRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 13px;
  border-left: 3px solid #595247;
}

.ownerRow.ownerOnline {
  border-left-color: var(--green);
}

.copyUsername {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.copyUsername:hover {
  color: var(--gold);
  text-decoration: underline;
}

.accountItemGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.accountItem {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 9px;
}

.accountItemArt {
  height: 92px;
  border: 1px solid #332a1f;
  border-radius: 9px;
  background: radial-gradient(circle, rgba(245, 189, 79, 0.14), transparent 68%), #0b0907;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 28px;
  color: var(--gold);
}

.accountItemArt img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.accountItemArt em {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  background: rgba(8, 7, 6, 0.88);
  border: 1px solid var(--line-bright);
  border-radius: 5px;
  padding: 2px 5px;
  color: #fff;
}

.accountItem > b {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.accountItem > small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

/* Auth & Admin Pages */
.authPage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.authCard {
  width: min(94vw, 460px);
  border: 1px solid var(--line-bright);
  background: rgba(18, 15, 12, 0.94);
  border-radius: 22px;
  padding: 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.authCard h1 {
  font-size: 34px;
  margin: 14px 0;
}

.authCard p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form input, .keyForm input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-bright);
  background: var(--panel2);
  border-radius: 10px;
  padding: 0 13px;
  outline: none;
}

.form input:focus, .keyForm input:focus {
  border-color: var(--gold);
}

.primaryButton {
  border: 0;
  background: linear-gradient(135deg, #f5bd4f, #d97c24);
  color: #140f08;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
}

.secondary, .copyAllButton {
  border: 1px solid var(--line-bright);
  background: #211b13;
  color: var(--gold);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.danger {
  border: 1px solid #73383f;
  background: #261215;
  color: #ff8e96;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.adminPage {
  max-width: 1040px;
  margin: auto;
  padding: 36px 20px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
}

.panel h2 {
  margin-top: 0;
}

.keyForm {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.keyCreate {
  grid-template-columns: 1fr auto;
}

.keyList {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.keyRow, .userRow {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 12px;
}

.rowActions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.newKey {
  word-break: break-all;
  border: 1px solid #7f5b29;
  background: #24190b;
  color: var(--gold);
  padding: 14px;
  border-radius: 10px;
  margin-top: 12px;
}

.dataStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.dataStats > div {
  border: 1px solid var(--line);
  background: #0e0c09;
  border-radius: 13px;
  padding: 16px;
}

.dataStats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dataStats b {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.dangerZone {
  border-color: #6e333b;
  background: linear-gradient(145deg, #1d0e11, #120f0d);
}

.dangerButton {
  border: 1px solid #a84c58;
  background: linear-gradient(135deg, #6c1c2a, #3b1421);
  color: #ffbec4;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
}

.emptyCard {
  grid-column: 1 / -1;
  min-height: 120px;
  border: 1px dashed var(--line-bright);
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px;
  text-align: center;
}

.topLinkGap {
  display: inline-block;
  width: 14px;
}

.versionBadge {
  font-size: 11px;
  color: var(--gold);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  padding: 3px 8px;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 14px;
    flex-wrap: wrap;
    min-height: 58px;
  }
  .liveStatus {
    display: none;
  }
  .headerActions a, .linkButton {
    padding: 6px 8px;
    font-size: 10px;
  }
  .avatar {
    display: none;
  }
  .noteGroups {
    padding: 12px 14px 0;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    gap: 9px;
  }
  .metric {
    min-height: 86px;
    padding: 12px;
  }
  .metric b {
    font-size: 20px;
  }
  .inventorySection {
    padding: 0 14px 24px;
  }
  .toolbar {
    gap: 8px;
  }
  .search {
    flex-basis: 100%;
  }
  .toolbar .itemFilter {
    min-width: calc(50% - 4px);
    flex: 1;
  }
  .itemGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .keyForm, .keyRow, .userRow, .dataStats {
    grid-template-columns: 1fr;
  }
  .drawerStatsGrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .itemDrawer {
    width: 100vw;
    padding: 18px;
  }
}
