:root {
  color-scheme: dark;
  font: 15px/1.45 system-ui, sans-serif;
  background: #0e131c;
  color: #edf2f8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1f2f49, #0e131c 62%);
}

.topbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: #2b9fd6; color: #06131d; font-weight: 900; letter-spacing: .04em;
}
.eyebrow { margin: 0; color: #7ed7ff; letter-spacing: .12em; font-size: 11px; }
h1, h2, h3, h4 { margin: 0 0 6px; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted { color: #aeb9c8; }
.small { font-size: 13px; }

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 20px 44px;
}

.card {
  background: rgba(18, 24, 35, .94);
  border: 1px solid #384963;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.subcard {
  background: #121925;
  border: 1px solid #32425a;
  border-radius: 10px;
  padding: 14px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.tab-btn {
  background: #1c2638;
  color: #dbe6f5;
  border: 1px solid #394b67;
  font-weight: 700;
}
.tab-btn.active {
  background: #2b9fd6;
  color: #05131c;
  border-color: #4cc2ff;
}

.section-gap { margin-top: 14px; }
.unlock-card { max-width: 560px; margin: 28px auto; padding: 24px; }
.summary-bar { margin-bottom: 12px; }
.asset-details { margin-top: 6px; }
.asset-breakdown {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.asset-chip {
  padding: 4px 8px; border-radius: 6px; background: #121a27; border: 1px solid #354761; font-size: 12px;
}

.top-actions, .actions, .inline-form, .pager {
  display: flex; align-items: center; gap: 8px;
}
.pager { justify-content: space-between; margin-top: 10px; }
.actions { margin-top: 14px; flex-wrap: wrap; }

.status-pill {
  padding: 5px 10px; border-radius: 999px;
  background: #1a2434; border: 1px solid #3d5270; font-size: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 270px minmax(360px, 1fr) 370px;
  gap: 14px;
  align-items: start;
}

.codes-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.shop-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 14px;
  align-items: start;
}

.accounts-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1120px) {
  .workspace-grid, .codes-grid, .shop-layout, .accounts-layout { grid-template-columns: 1fr; }
}

.panel-head, .shop-header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.panel-head > div { flex: 1; }

.shop-filters {
  display: grid;
  grid-template-columns: 150px 150px 190px 1fr auto;
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 960px) {
  .shop-filters { grid-template-columns: 1fr 1fr; }
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label { display: block; margin: 10px 0 4px; color: #cdd8e6; font-weight: 600; font-size: 13px; }
label.checkbox-line {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 500;
}
label.checkbox-line input[type="checkbox"] { width: auto; }

input, textarea, select {
  box-sizing: border-box; width: 100%;
  border: 1px solid #4e607c; border-radius: 7px;
  padding: 8px 10px; background: #0c1017; color: #f5f8fc; font: inherit;
}
textarea { resize: vertical; }

button {
  border: 0; border-radius: 7px; padding: 8px 14px;
  background: #2b9fd6; color: #05131c; font-weight: 800; cursor: pointer; white-space: nowrap;
}
button:disabled { cursor: not-allowed; opacity: .45; }
button.subtle { background: #334055; color: #e6edf5; font-weight: 600; }
button.small-btn { padding: 5px 9px; font-size: 12px; }
button.danger { background: #7a2d36; color: #ffe3e6; }

.catalog-filter {
  display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; margin-bottom: 10px;
}

.list-box {
  margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto;
}
.recipient-btn {
  width: 100%; text-align: left; background: #121925; color: #e9eff8;
  border: 1px solid #33435b; padding: 8px 10px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.recipient-btn.active { border-color: #4cc2ff; background: #172b40; }

.selected-box {
  margin-top: 10px; padding: 9px 10px; border-radius: 7px;
  background: #111926; border: 1px solid #354965; font-size: 13px;
}

.catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px; max-height: 540px; overflow-y: auto; padding-right: 2px;
}

.catalog-item {
  border: 1px solid #34445d; border-radius: 9px; padding: 10px;
  background: #121824; display: flex; flex-direction: column; gap: 8px;
}
.catalog-top { display: flex; gap: 10px; align-items: center; }
.thumb-wrap {
  width: 50px; height: 50px; flex: 0 0 50px; border-radius: 8px;
  background: #0b0f17; border: 1px solid #384963;
  display: grid; place-items: center; overflow: hidden;
}
.thumb-wrap.thumb-missing { border-style: dashed; border-color: #9e6b2b; }
.thumb-wrap img, .thumb-wrap canvas { max-width: 46px; max-height: 46px; object-fit: contain; display: block; }
.thumb-badge { font-size: 10px; color: #f0b768; text-align: center; line-height: 1.1; padding: 2px; }

.item-meta { min-width: 110px; flex: 1; }
.item-title { font-weight: 700; font-size: 13px; color: #f1f5fa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 12px; color: #9fb0c7; word-break: normal; overflow-wrap: break-word; }
.item-add { display: flex; gap: 6px; align-items: center; }
.item-add input { width: 88px; padding: 5px 7px; font-size: 13px; }
.item-add button { flex: 1; padding: 6px 10px; font-size: 13px; }

.cart-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 270px; overflow-y: auto; margin-bottom: 10px;
}
.cart-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 8px; background: #121925; border: 1px solid #34445c;
}
.cart-row .thumb-wrap { width: 38px; height: 38px; flex: 0 0 38px; }
.cart-row .thumb-wrap img, .cart-row .thumb-wrap canvas { max-width: 34px; max-height: 34px; }
.cart-info { flex: 1; min-width: 110px; }
.cart-qty { width: 82px; padding: 5px 6px; font-size: 13px; }

.table-scroll { overflow-x: auto; max-height: 580px; overflow-y: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-table th, .admin-table td {
  padding: 8px 8px; border-bottom: 1px solid #2a374c; text-align: left; vertical-align: middle;
  word-break: normal; overflow-wrap: break-word;
}
.admin-table th {
  position: sticky; top: 0; background: #161f2f; color: #9bc5e8; font-weight: 700; z-index: 1;
}
.admin-table tr.selected-row { background: #182b40; }
.admin-table .thumb-wrap { width: 38px; height: 38px; flex: 0 0 38px; }
.admin-table .thumb-wrap img, .admin-table .thumb-wrap canvas { max-width: 34px; max-height: 34px; }

.badge {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #233146; color: #cfe0f5;
}
.badge.ok { background: #173a28; color: #8be2a8; }
.badge.warn { background: #463216; color: #ffd479; }
.badge.off { background: #3f2228; color: #ffadb5; }

.hist-row {
  padding: 7px 9px; border-radius: 7px; background: #121925; border: 1px solid #2e3e55; font-size: 12px;
}

.sep { border: 0; border-top: 1px solid #30405a; margin: 16px 0; }

.status { min-height: 1.4em; color: #ffd479; margin: 8px 0; }
.status.ok { color: #91e6ad; }
.banner { padding: 4px 2px; }

.pending-banner {
  border-color: #d69837; background: rgba(58, 41, 14, .45); margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}

.preview-box, .receipt-box {
  margin-top: 14px; padding: 12px; border-radius: 9px;
  background: #101926; border: 1px solid #44648d;
}
.receipt-box { border-color: #469d69; background: #0f2119; }
.preview-line { margin: 4px 0; font-size: 13px; }

.reward-summary {
  list-style: none; margin: 8px 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.reward-summary li {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 5px 7px; border-radius: 6px; background: rgba(255, 255, 255, .04);
}
.reward-summary .thumb-wrap { width: 32px; height: 32px; flex: 0 0 32px; }
.reward-summary .thumb-wrap img, .reward-summary .thumb-wrap canvas { max-width: 28px; max-height: 28px; }

.warning-list { margin: 6px 0; padding-left: 18px; color: #ffd479; font-size: 13px; }

.code-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: #0d1d2d;
  border: 1px solid #3c6e97;
  color: #8ce2ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.subtab-btn,
.we-subtab-btn {
  background: #182233;
  color: #cfe0f5;
  border: 1px solid #344763;
  padding: 8px 15px;
  font-weight: 700;
  border-radius: 10px;
}
.subtab-btn.active,
.we-subtab-btn.active {
  background: #238ec2;
  color: #05131c;
  border-color: #54c7ff;
}
.subtabs-top {
  margin-bottom: 14px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.four-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 960px) {
  .three-col, .four-col { grid-template-columns: 1fr 1fr; }
}

.map-thumb {
  width: 72px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #384963;
  background: #0b0f17;
  display: block;
}
.drop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #121925;
  border: 1px solid #31425a;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.drop-row .thumb-wrap { width: 34px; height: 34px; flex: 0 0 34px; }
.drop-row .thumb-wrap img, .drop-row .thumb-wrap canvas { max-width: 30px; max-height: 30px; }
.drop-row input[type="number"] { width: 76px; padding: 4px 6px; font-size: 12px; }
.picker-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  margin-top: 8px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border-radius: 7px;
  background: #101723;
  border: 1px solid #304159;
  cursor: pointer;
  text-align: left;
  color: #edf2f8;
  font-weight: 500;
}
.picker-item:hover { border-color: #4cc2ff; background: #16263a; }
.picker-item .thumb-wrap { width: 32px; height: 32px; flex: 0 0 32px; }
.picker-item .thumb-wrap img, .picker-item .thumb-wrap canvas { max-width: 28px; max-height: 28px; }
.inline-mini-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #121b29;
  border: 1px solid #31435c;
  font-size: 12px;
}
.mini-chip .thumb-wrap { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 4px; }
.mini-chip .thumb-wrap img, .mini-chip .thumb-wrap canvas { max-width: 20px; max-height: 20px; }

/* ---- v1.01 R1: Global Item Hover Tooltip, Rich Map Drop Cards & Bulk Controls ---- */
.item-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 340px;
  min-width: 230px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 22, 34, 0.97);
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  color: #f3f6fc;
  font-size: 13px;
  line-height: 1.45;
}
.item-tooltip-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.item-tooltip-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 10px;
  background: #0c1220;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-tooltip-icon img, .item-tooltip-icon canvas {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
}
.item-tooltip-title {
  font-size: 14px;
  font-weight: 700;
  color: #fde68a;
  word-break: break-word;
}
.item-tooltip-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 3px;
}
.item-tooltip-desc {
  font-size: 12.5px;
  color: #dbe6f7;
  white-space: pre-line;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 7px;
  margin-top: 4px;
}

.bulk-sel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.drop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.drop-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drop-card-info {
  flex: 1;
  min-width: 0;
}
.drop-card-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #f8fafc;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}
.drop-card-calc {
  font-size: 12px;
  color: #facc15;
  margin-top: 2px;
}
.drop-card-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.drop-card-controls label {
  display: block;
  margin: 0 0 3px 0;
  font-size: 11px;
  color: #94a3b8;
}
.drop-card-controls input {
  width: 100%;
  padding: 5px 7px;
  font-size: 12.5px;
}
.drop-card-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}
.drop-card-outcomes label {
  margin: 0;
  font-size: 12px;
}

.picker-filter-bar {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 8px;
  margin-top: 6px;
}
.map-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 330px;
  overflow-y: auto;
}
.map-picker-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.22);
  text-align: left;
  min-width: 0;
}
.map-picker-card .mp-meta {
  flex: 1;
  min-width: 110px;
}
.map-picker-card .mp-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.3;
}
.map-picker-card .mp-id {
  font-size: 11px;
  color: #94a3b8;
}

.bulk-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(30, 58, 138, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.32);
}
.bulk-box h4 {
  margin: 0 0 6px 0;
  color: #93c5fd;
}
.accent-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid rgba(147, 197, 253, 0.4);
}

/* ---- v1.01 R2A: 2-Tier Full-Width Page 4, Multi-Tab Shop, Live Picker & No Vertical Wrap ---- */
.maps-stack-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.maps-top-panel, .maps-editor-panel {
  width: 100%;
}
.maps-table-scroll {
  max-height: 360px;
}
.maps-editor-panel.highlight-pulse {
  border-color: #4cc2ff;
  box-shadow: 0 0 0 2px rgba(76, 194, 255, 0.32), 0 10px 28px rgba(0, 0, 0, 0.32);
}
.maps-outcomes-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.outcome-box h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
}
.outcome-win { border-color: rgba(74, 222, 128, 0.35); }
.outcome-draw { border-color: rgba(250, 204, 21, 0.35); }
.outcome-lose { border-color: rgba(248, 113, 113, 0.35); }

.maps-drops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}
.maps-drops-grid .drop-card {
  margin-bottom: 0;
}
.maps-bottom-split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
@media (max-width: 1080px) {
  .maps-outcomes-row { grid-template-columns: 1fr; }
  .maps-bottom-split { grid-template-columns: 1fr; }
}

.multi-tab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 10px;
}
.multi-tab-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #101723;
  border: 1px solid #32445d;
  font-size: 12.5px;
  font-weight: 600;
  color: #dce7f5;
  margin: 0;
  cursor: pointer;
}
.multi-tab-chip:hover { border-color: #4cc2ff; }
.multi-tab-chip input[type="checkbox"] { width: auto; margin: 0; }
.tab-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inline-item-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #101724;
  border: 1px solid #2f4058;
  min-height: 46px;
}
.inline-item-preview .thumb-wrap {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.inline-item-preview .thumb-wrap img, .inline-item-preview .thumb-wrap canvas {
  max-width: 30px;
  max-height: 30px;
}
.item-warn-text {
  color: #fbbf24;
  font-weight: 600;
  font-size: 12.5px;
}

.roul-weight-hint {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #cfe6f9;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(6, 10, 18, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: min(980px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.shared-picker-grid {
  max-height: 52vh;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.mini-chip {
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}
.picker-item span {
  min-width: 110px;
  word-break: normal;
  overflow-wrap: break-word;
}
.admin-table tr.clickable-row {
  cursor: pointer;
}
.admin-table tr.clickable-row:hover {
  background: rgba(43, 159, 214, 0.12);
}

/* ---- v1.03: Page 6 Tank Balance & Skills (91 Tanks) ---- */
.bal-top-split {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}
.bal-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.bal-inline-row select, .bal-inline-row input {
  flex: 1 1 180px;
  min-width: 140px;
}
.bal-global-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px 10px;
}
.bal-global-grid label, .bal-stat-inputs-grid label, .bal-skill-global-grid label {
  display: block;
  font-size: 12px;
  color: #b7cde4;
  margin-bottom: 3px;
}
.bal-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.bal-filter-bar input[type="search"], .bal-filter-bar input:not([type="checkbox"]) {
  flex: 1 1 240px;
  min-width: 200px;
}
.bal-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bal-role-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #334a66;
  background: #101926;
  color: #d6e6f8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bal-role-btn.active {
  background: #2563eb;
  border-color: #93c5fd;
  color: #fff;
}
.bal-role-btn.role-dps.active { background: #dc2626; border-color: #fca5a5; }
.bal-role-btn.role-tank.active { background: #2563eb; border-color: #93c5fd; }
.bal-role-btn.role-sup.active { background: #0d9488; border-color: #5eead4; }

.bal-tank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px;
}
.bal-tank-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0f1724;
  border: 1px solid #2b3c54;
  color: #e6f0fc;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.bal-tank-card:hover {
  border-color: #60a5fa;
  background: #142236;
}
.bal-tank-card.selected {
  border-color: #facc15;
  background: #192b44;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.45);
}
.bal-tank-card.modified {
  border-left: 3px solid #38bdf8;
}
.bal-tank-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: #09111c;
  border: 1px solid #26364d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  color: #94a3b8;
}
.bal-tank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bal-tank-meta {
  min-width: 0;
  flex: 1;
}
.bal-tank-name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bal-tank-sub {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 3px;
  flex-wrap: wrap;
}
.bal-role-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.bal-role-tag.cls-1 { background: #dc2626; }
.bal-role-tag.cls-2 { background: #2563eb; }
.bal-role-tag.cls-3 { background: #0d9488; }
.bal-preset-tag {
  font-size: 11px;
  color: #93c5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.bal-tank-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bal-tank-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bal-ed-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: #0a1220;
  border: 1px solid #355075;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bal-ed-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bal-ed-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bal-presets-box {
  margin-bottom: 14px;
}
.bal-preset-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.bal-preset-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bal-preset-btn {
  padding: 7px 12px;
  border-radius: 8px;
  background: #101d2e;
  border: 1px solid #335073;
  color: #dbeafe;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bal-preset-btn:hover {
  border-color: #60a5fa;
  background: #172b45;
}
.bal-preset-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #93c5fd;
  color: #fff;
}
.bal-custom-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #26364d;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bal-custom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.bal-custom-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #132238;
  border: 1px solid #3b5a82;
  font-size: 12px;
}
.bal-custom-chip.active {
  border-color: #facc15;
  background: #1f3654;
}
.bal-custom-chip button {
  padding: 2px 6px;
  font-size: 11px;
}
.bal-custom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.bal-custom-actions input {
  flex: 1 1 200px;
  max-width: 280px;
}

.bal-mid-split {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}
.bal-stat-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 10px;
}
.bal-skill-global-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(135px, 1fr));
  gap: 10px;
  align-items: end;
}
.bal-slot-input {
  width: 78px;
  padding: 4px 6px;
  text-align: center;
}
.bal-delta-up { color: #4ade80; font-weight: 700; }
.bal-delta-down { color: #f87171; font-weight: 700; }
.bal-delta-same { color: #94a3b8; }

@media (max-width: 1080px) {
  .bal-top-split, .bal-mid-split, .bal-skill-global-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.04 Server Health & Diagnostics Strip */
.health-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(16, 30, 50, 0.94), rgba(13, 24, 40, 0.94));
  border: 1px solid #2b4466;
}
.health-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.health-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 36, 0.9);
  border: 1px solid #2a3e5a;
  font-size: 12.5px;
  color: #dbeafe;
  white-space: nowrap;
}
.health-chip strong {
  color: #93c5fd;
  font-weight: 600;
}
.hc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #94a3b8;
}
.hc-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.hc-dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}
.health-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* v1.09 Sheet 7: Arcade Game Modes Builder & Green Toggle Switches */
.arc-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.arc-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #101d2e;
  border: 1px solid #335073;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.arc-mode-pill:hover {
  border-color: #60a5fa;
  background: #172b45;
}
.arc-mode-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.arc-mode-pill.is-off {
  opacity: 0.72;
}
.arc-mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: #64748b;
}
.arc-mode-dot.on {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}
.arc-master-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(15, 29, 48, 0.85);
  border: 1px solid #2b4466;
}
.arc-info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 2fr;
  gap: 10px 12px;
  margin-bottom: 14px;
}
.arc-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.arc-rule-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.arc-ofa-scope-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.arc-ofa-scope-row select {
  flex: 1 1 220px;
}
.toggle-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin: 0;
  user-select: none;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch-lg {
  width: 58px;
  height: 32px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #334155;
  border: 1px solid #475569;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease;
}
.toggle-switch-lg .toggle-slider::before {
  width: 24px;
  height: 24px;
}
.toggle-switch input:checked + .toggle-slider {
  background: #22c55e;
  border-color: #4ade80;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch-lg input:checked + .toggle-slider::before {
  transform: translateX(26px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid #86efac;
  outline-offset: 2px;
}
@media (max-width: 1080px) {
  .arc-info-grid, .arc-rules-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.10 Sheet 5 Event Halls & Fireball Weekly Tanks + Sheet 7 Tank Bans */
.ev-halls-card {
  margin-bottom: 14px;
}
.ev-halls-table input[type="time"] {
  width: 120px;
  padding: 5px 8px;
}
.ev-halls-table input[type="time"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ev-weekly-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #263850;
}
.ev-weekly-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ev-weekly-head input {
  width: 260px;
  max-width: 100%;
}
.ev-weekly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ev-weekly-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid #4ade80;
  color: #dcfce7;
  font-size: 12px;
  font-weight: 600;
}
.ev-weekly-chip button {
  padding: 0 5px;
  border: none;
  background: transparent;
  color: #fca5a5;
  font-weight: 700;
  cursor: pointer;
}
.ev-weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}
.ev-weekly-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #0f1724;
  border: 1px solid #2b3c54;
  color: #dbeafe;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.ev-weekly-item:hover {
  border-color: #60a5fa;
  background: #142236;
}
.ev-weekly-item.picked {
  border-color: #4ade80;
  background: rgba(22, 163, 74, 0.2);
}
.ev-weekly-item img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.arc-banned-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.bal-tank-card.banned {
  border-color: #ef4444;
  background: rgba(127, 29, 29, 0.32);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
}
.bal-tank-card.banned .bal-tank-thumb img {
  filter: grayscale(100%) brightness(0.65);
}
.arc-ban-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.arc-ban-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #ef4444;
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.arc-ban-btn:hover {
  background: #dc2626;
  color: #fff;
}
.arc-ban-btn.is-banned {
  background: #dc2626;
  border-color: #fca5a5;
  color: #fff;
}
.arc-ed-ban-toggle {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  font-size: 12.5px;
  font-weight: 600;
  color: #fecaca;
}
.arc-ed-ban-toggle .toggle-switch input:checked + .toggle-slider {
  background: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.55);
}

/* Sheet 3: Account VIP Editor */
.acc-vip-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(25, 34, 52, 0.9);
  border: 1px solid #445a7c;
}
.acc-vip-box h4 {
  margin: 0 0 6px;
  color: #ffd966;
}
.badge.vip-on {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
  white-space: nowrap;
}
.badge.vip-super {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.28), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(250, 204, 21, 0.85);
  color: #fef08a;
  white-space: nowrap;
}
.badge.vip-off {
  background: rgba(100, 116, 139, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  white-space: nowrap;
}

/* Sheet 3: Online Registration Policy Card (v1.12) */
.acc-policy-card {
  margin-bottom: 14px;
}
.acc-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 10px;
}
.acc-policy-toggle {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-weight: 600;
}
.ev-online-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 25, 42, 0.72);
  border: 1px solid #304564;
}

/* v1.13 Multi-GM Login, Staff RBAC, Per-GM Invites & Audit Log */
.staff-badge {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.65);
  color: #dbeafe;
  font-weight: 700;
}
.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.emergency-key-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #334a6b;
}
.emergency-key-details summary {
  cursor: pointer;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
}
.policy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.online-pill {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.65);
  color: #dcfce7;
}
.acc-invites-card {
  margin-bottom: 14px;
}
.invite-create-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.6fr auto;
  gap: 10px;
  align-items: end;
}
.acc-filter-grid {
  grid-template-columns: 160px 180px 1fr auto;
}
.staff-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  align-items: start;
}
.modal-narrow {
  max-width: 460px;
}
.invite-src-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 980px) {
  .invite-create-grid,
  .acc-filter-grid,
  .staff-layout {
    grid-template-columns: 1fr;
  }
}

/* v1.16 Dynamic Lobby Banner / Zalo QR & Skin Research */
.banner-admin-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  align-items: start;
}
.banner-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 29, 48, 0.72);
  border: 1px solid #2d4669;
}
.banner-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.banner-form-card input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}
.banner-stage {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, #123663, #07172d 70%);
  border: 1px dashed #3b5f8a;
}
.banner-mock-card {
  position: relative;
  padding: 7px;
  border-radius: 12px;
  background: rgba(8, 23, 51, 0.90);
  border: 2px solid rgba(94, 200, 255, 0.85);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  text-align: center;
}
.banner-mock-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
}
.banner-mock-min {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  border-radius: 6px;
  background: rgba(15, 42, 87, 0.95);
  border: 1px solid rgba(140, 216, 255, 0.9);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.banner-mock-caption {
  margin-top: 6px;
  color: #ffe88a;
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.3;
  word-break: break-word;
}
.banner-preview-empty {
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}
.sr-estimate-box {
  background: rgba(15, 29, 48, 0.72);
  border: 1px solid #304b70;
}
@media (max-width: 980px) {
  .banner-admin-grid {
    grid-template-columns: 1fr;
  }
}
