/* Admin Control Panel — High-Density Dark Layout (220px Sidebar + Mobile Drawer) */

.admin-shell {
  display: flex;
  min-height: 100dvh;
  background: var(--bg);
}

.admin-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 180ms ease-out;
}

.admin-sidebar.open {
  transform: translateX(0);
}

@media (min-width: 960px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    transform: none;
    flex-shrink: 0;
  }
}

.admin-sidebar-brand {
  height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar-brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.admin-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adm-nav-item {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  transition: background-color var(--ease-fast), color var(--ease-fast);
}

.adm-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.adm-nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.adm-badge-count {
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--warning-bg);
  color: var(--warning);
}

.admin-sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.65);
  display: none;
}

.admin-backdrop.open {
  display: block;
}

@media (min-width: 960px) {
  .admin-backdrop {
    display: none !important;
  }
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-menu-btn {
  display: inline-flex;
}

@media (min-width: 960px) {
  .admin-menu-btn {
    display: none;
  }
}

.admin-content {
  padding: 16px;
  max-width: 1280px;
  width: 100%;
}

@media (min-width: 768px) {
  .admin-content {
    padding: 20px;
  }
}

/* Compact Admin KPI Grid */
.adm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .adm-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1200px) {
  .adm-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.adm-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.adm-kpi-lbl {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.adm-kpi-val {
  font-size: 18px;
  font-weight: 700;
}

/* Lightweight Bar Chart (Pure CSS/SVG, zero heavy JS library) */
.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 150px;
  padding-top: 16px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-track {
  width: 100%;
  max-width: 38px;
  height: 110px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.chart-val {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chart-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.filter-bar .input, .filter-bar .select {
  width: auto;
  min-width: 140px;
  flex: 1;
}

.inline-input {
  width: 84px;
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
}

.receipt-preview-img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* Compact Responsive Admin Orders List */
.adm-orders-wrap {
  overflow-x: auto;
}

.adm-orders-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: auto;
}

.adm-orders-table th,
.adm-orders-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.adm-orders-table th {
  font-size: 11px;
  white-space: nowrap;
}

.adm-col-act,
.adm-cell-act {
  text-align: right;
  white-space: nowrap;
}

.adm-ord-customer {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}

.adm-ord-server {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.25;
}

.adm-ord-qty {
  color: var(--text);
  font-weight: 600;
}

.adm-ord-guild {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--accent);
  line-height: 1.2;
}

.adm-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--ease-fast), color var(--ease-fast), background-color var(--ease-fast);
}

.adm-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.adm-ord-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.adm-ord-sub {
  font-size: 11px;
  margin-top: 2px;
  text-transform: lowercase;
}

.adm-ord-meta {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.25;
}

.adm-ord-action-btn {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

@media (max-width: 639px) {
  .adm-orders-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .adm-orders-table thead {
    display: none;
  }

  .adm-orders-table,
  .adm-orders-table tbody {
    display: block;
    width: 100%;
  }

  .adm-orders-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 11px 12px;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }

  .adm-orders-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .adm-orders-table tbody td {
    display: block;
    padding: 0;
    border: none;
  }

  .adm-orders-table tbody td[colspan] {
    grid-column: 1 / -1;
    padding: 8px 2px;
  }

  .adm-cell-info {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    min-width: 0;
  }

  .adm-cell-amount {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    text-align: right;
  }

  .adm-cell-status {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    align-self: center;
    min-width: 0;
  }

  .adm-cell-act {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    align-self: center;
  }

  .adm-ord-action-btn {
    min-height: 34px;
    padding: 0 12px;
  }
}
