/* ToolRent Admin — light content + professional slate sidebar */
:root {
  --sidebar: #1e2a3b;
  --sidebar-text: #b7c4d6;
  --sidebar-active: #34d399;
  --sidebar-hover: rgba(255,255,255,0.07);
  --bg: #f3f6f9;
  --card: #ffffff;
  --text: #152033;
  --muted: #66768c;
  --border: #e2e8f0;
  --primary: #0b7a3b;
  --primary-dark: #086331;
  --danger: #b42318;
  --warn: #b54708;
  --info: #175cd3;
  --radius: 8px;
  --shadow: none;
  --font: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-blue: #60a5fa;
  --nav-violet: #a78bfa;
  --nav-amber: #fbbf24;
  --nav-orange: #fb923c;
  --nav-green: #34d399;
  --nav-cyan: #22d3ee;
  --nav-pink: #f472b6;
  --nav-rose: #fb7185;
  --nav-slate: #94a3b8;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
html, body { margin: 0; padding: 0; }
body.admin-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.admin-sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #2a3a52;
}
.sidebar-brand {
  padding: 1.15rem 1.1rem;
  font-weight: 700;
  font-size: 0.98rem;
  color: #f8fafc;
  letter-spacing: -0.02em;
  border-bottom: 1px solid #2a3a52;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
}
.sidebar-brand > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-close,
.admin-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #f1f5f9;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-menu-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 51, 0.4);
  z-index: 1100;
}
.admin-save-busy {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 32, 51, 0.4);
  backdrop-filter: blur(2px);
}
.admin-save-busy[hidden] {
  display: none !important;
}
.admin-save-busy-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(21, 32, 51, 0.14);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.admin-save-busy-card .fa-spinner {
  color: var(--primary);
  font-size: 1.15rem;
}
body.admin-save-busy-open {
  overflow: hidden;
}
.btn.is-busy,
button.is-busy {
  pointer-events: none;
  opacity: 0.92;
}
.btn.is-busy .fa-spinner {
  margin-right: 0.15rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.75rem 0.6rem 1.25rem;
  flex: 1;
  overflow: auto;
}
.nav-group-label {
  margin: 0.85rem 0.55rem 0.35rem;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7f92ab;
}
.nav-group-label:first-child {
  margin-top: 0.25rem;
}
.sidebar-foot {
  padding: 0.6rem;
  border-top: 1px solid #2a3a52;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item i {
  width: 1.15rem;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.nav-item .fa-gauge-high { color: var(--nav-blue); }
.nav-item .fa-list-check { color: var(--nav-violet); }
.nav-item .fa-boxes-stacked { color: var(--nav-amber); }
.nav-item .fa-list-ol { color: var(--nav-orange); }
.nav-item .fa-cart-shopping { color: var(--nav-green); }
.nav-item .fa-users { color: var(--nav-cyan); }
.nav-item .fa-envelope,
.nav-item .fa-comments { color: var(--nav-pink); }
.nav-item .fa-wallet { color: #4ade80; }
.nav-item .fa-file-invoice { color: #c084fc; }
.nav-item .fa-coins { color: #fbbf24; }
.nav-item .fa-clock-rotate-left { color: var(--nav-slate); }
.nav-item .fa-triangle-exclamation,
.nav-item .fa-shield-halved { color: var(--nav-rose); }
.nav-item .fa-screwdriver-wrench { color: var(--nav-slate); }
.nav-item .fa-calendar-days { color: var(--nav-blue); }
.nav-item .fa-heart-pulse { color: var(--nav-rose); }
.nav-item .fa-gear { color: var(--nav-slate); }
.nav-item .fa-key,
.nav-item .fa-id-card { color: #38bdf8; }
.nav-item .fa-cloud-arrow-down,
.nav-item .fa-download { color: #67e8f9; }
.nav-item .fa-arrow-up-right-from-square { color: #67e8f9; }
.nav-item .fa-right-from-bracket { color: var(--nav-rose); }
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}
.nav-item.active {
  background: rgba(52, 211, 153, 0.14);
  color: #f8fafc;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--sidebar-active);
}
.nav-item.active i { color: var(--sidebar-active); }

.admin-main {
  padding: 1.35rem 1.6rem 2rem;
  min-width: 0;
}
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-top-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.admin-top h1 {
  margin: 0;
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-account {
  position: relative;
}
.admin-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.admin-account-toggle:hover,
.admin-account.is-open .admin-account-toggle {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(21, 32, 51, 0.06);
}
.admin-account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ecfdf5;
  color: var(--primary);
  flex-shrink: 0;
  font-size: 0.85rem;
}
.admin-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
  text-align: left;
}
.admin-account-name {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-account-meta small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.1;
}
.admin-account-caret {
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 0.15rem;
  transition: transform 0.15s ease;
}
.admin-account.is-open .admin-account-caret { transform: rotate(180deg); }
.admin-account-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 80;
  min-width: 220px;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(21, 32, 51, 0.12);
}
.admin-account-panel[hidden] { display: none !important; }
.admin-account-panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem 0.65rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid #eef2f7;
}
.admin-account-panel-head strong {
  font-size: 0.9rem;
  color: var(--text);
}
.admin-account-panel-head span {
  font-size: 0.74rem;
  color: var(--muted);
}
.admin-account-panel a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.7rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 550;
}
.admin-account-panel a i {
  width: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}
.admin-account-panel a .fa-heart-pulse { color: #fb7185; }
.admin-account-panel a .fa-gear { color: #64748b; }
.admin-account-panel a .fa-arrow-up-right-from-square { color: #0ea5e9; }
.admin-account-panel a:hover,
.admin-account-panel a.is-active {
  background: #f3f6f9;
}
.admin-account-sep {
  height: 1px;
  background: #eef2f7;
  margin: 0.3rem 0.35rem;
}
.admin-account-logout {
  color: #b91c1c !important;
}
.admin-account-logout i { color: #ef4444 !important; }
.admin-account-logout:hover { background: #fef2f2 !important; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.flash-success { background: #e8f8ee; color: #176b34; }
.flash-error { background: #fdecec; color: #9b1c1c; }

/* Legacy dash-kpis / dash-mini removed — see Dashboard styles below */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.stat-icon.users { background: #3b82f6; }
.stat-icon.services { background: #8b5cf6; }
.stat-icon.orders { background: #28a745; }
.stat-icon.pending { background: #f59e0b; }
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.25rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.search-box {
  display: flex;
  gap: 0.45rem;
  flex: 1;
  min-width: 220px;
}
.search-box input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
}
.btn {
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn:disabled,
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary:disabled:hover { background: var(--primary); }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.status-tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #536579;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.status-tab .count,
.admin-tab-count,
.inv-tab .tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.status-tab.active,
.status-tab.is-active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.status-tab.active .count,
.status-tab.is-active .count,
.inv-tab.active .tab-count,
.admin-tab.active .admin-tab-count {
  background: #dcfce7;
  color: #166534;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.data-table thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}
.data-table td {
  padding: 0.72rem 0.7rem;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.data-table tbody tr:hover td {
  background: #fbfdff;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table a.table-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.data-table a.table-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.data-table .empty-row,
.data-table .dash-empty td {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0.75rem !important;
  background: transparent !important;
}
.data-table .mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}
.data-table .muted {
  color: var(--muted);
}

/* Shared admin list shell */
.admin-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.admin-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.admin-list-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-list-meta {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.admin-list-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.admin-list-filters {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f7;
}
.admin-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.admin-list-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: #536579;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.admin-list-tab:hover {
  background: #f8fafc;
  color: var(--text);
}
.admin-list-tab.is-active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.admin-list-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.admin-list-tab.is-active .admin-list-tab-count {
  background: #dcfce7;
  color: #166534;
}
.admin-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
}
.admin-list-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}
.admin-list-field--search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.admin-list-field label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.admin-list-field select,
.admin-list-field input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.48rem 0.65rem;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
  color: var(--text);
}
.admin-list-field-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.05rem;
}
.admin-table-wrap,
.order-table-wrap,
.log-table-wrap {
  overflow-x: auto;
  border: 1px solid #eef2f7;
  border-radius: 8px;
}
.admin-table-wrap .data-table,
.admin-table.data-table {
  margin: 0;
}
.admin-list .table-pagination {
  border-top: 0;
  padding-top: 0.35rem;
  margin-top: 0;
}

/* Back-compat: old log-filters map toward shared look */
.log-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.log-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}
.log-filter--search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.log-filter label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.log-filter select,
.log-filter input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.48rem 0.65rem;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
}
.log-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.05rem;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  font-size: 0.85rem;
}
.table-pagination-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.table-pagination-meta {
  color: var(--muted);
}
.table-per-page {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.table-per-page-select {
  min-width: 4.25rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
.table-pagination-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.table-pagination-btn {
  color: var(--text);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  min-width: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  line-height: 1.2;
}
.table-pagination-btn:hover:not(.disabled) {
  background: var(--bg);
}
.table-pagination-btn.disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.table-pagination-btn.table-pagination-current {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
  font-weight: 600;
  cursor: default;
}
.table-pagination-ellipsis {
  color: var(--muted);
  padding: 0 0.2rem;
  user-select: none;
}
.table-pagination-current {
  color: var(--muted);
}
.table-pagination-info {
  color: var(--muted);
}
.input-currency {
  display: flex;
  align-items: stretch;
}
.input-currency-symbol {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
}
.input-currency input {
  border-radius: 0 8px 8px 0;
  flex: 1;
}
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0.5rem !important;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-processing { background: #eff6ff; color: #1d4ed8; }
.badge-processing.inv-status-active,
.badge-pending.inv-status-waiting {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.inv-status-active .inv-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
}
.inv-spinner--muted {
  border-color: #fde68a;
  border-top-color: #d97706;
}
.badge-success { background: #ecfdf5; color: #047857; }
.badge-reject { background: #fef2f2; color: #b91c1c; }
.badge-expired { background: #fdf2f8; color: #be185d; }
.badge-active { background: #ecfdf5; color: #047857; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-remote { background: #eff6ff; color: #1d4ed8; }
.badge-server { background: #fef3c7; color: #92400e; }
.badge-imei { background: #f5f3ff; color: #6d28d9; }
.badge-other { background: #f3f4f6; color: #6b7280; }
.badge-added { background: #ecfdf5; color: #047857; }
.badge-updated { background: #eff6ff; color: #1d4ed8; }
.badge-edited { background: #fef3c7; color: #92400e; }
.badge-rotated { background: #f5f3ff; color: #6d28d9; }
.badge-recovered { background: #fff7ed; color: #c2410c; }
.badge-source-website { background: #eff6ff; color: #1d4ed8; }
.badge-source-api { background: #f5f3ff; color: #6d28d9; }
.badge-source-admin { background: #fef3c7; color: #92400e; }
.badge-credit  { background: #ecfdf5; color: #047857; }
.badge-debit   { background: #fef2f2; color: #b91c1c; }
.badge-refund  { background: #fff7ed; color: #c2410c; }
.badge-order   { background: #eff6ff; color: #1d4ed8; }
.badge-paid    { background: #ecfdf5; color: #047857; }
.pay-amt { font-weight: 600; }
.pay-amt--credit { color: #047857; }
.pay-amt--debit { color: #b91c1c; }
.pay-note {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-failed  { background: #fef2f2; color: #b91c1c; }

.gmail-panel .gmail-connected {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.gmail-accounts { margin: 0.85rem 0 0.5rem; }
.gmail-accounts-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.gmail-account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.gmail-account-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}
.gmail-disconnect-form { display: inline; margin: 0 0 0 auto; }
.gmail-setup {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: #fafafa;
}
.gmail-setup summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
}
.gmail-steps {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
  color: #555;
  font-size: 0.88rem;
  line-height: 1.65;
}
.gmail-connect-form { margin-top: 0.5rem; }
.btn-gmail {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  border-radius: 8px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.btn-gmail:hover:not(:disabled) { background: #f8f9fa; }
.btn-gmail:disabled { opacity: 0.55; cursor: not-allowed; }

.gmail-inbox-link-meta {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #1d4ed8;
  text-decoration: none;
}
.gmail-inbox-link-meta:hover { text-decoration: underline; }

.gmail-inbox-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gmail-app-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
}
.gmail-app-back { flex-shrink: 0; }
.gmail-app-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.gmail-app-title strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmail-app-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.gmail-app-actions form { margin: 0; display: inline; }
.gmail-disconnect-btn { color: var(--danger) !important; }

.gmail-split {
  display: flex;
  min-height: 560px;
  max-height: calc(100vh - 220px);
  background: #fff;
}
.gmail-split-list {
  width: 360px;
  min-width: 300px;
  max-width: 38%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #f6f8fc;
  flex-shrink: 0;
}
.gmail-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5f6368;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.gmail-list-label { display: flex; align-items: center; gap: 0.4rem; }
.gmail-list-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: #eef2f7;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.gmail-list-status {
  margin: 1rem;
  font-size: 0.85rem;
}
.gmail-thread-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gmail-thread-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #e8eaed;
  padding: 0.7rem 1rem 0.65rem;
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s ease;
}
.gmail-thread-item:hover { background: #eef2f7; }
.gmail-thread-item.is-active {
  background: #d3e3fd;
  box-shadow: inset 3px 0 0 #1a73e8;
}
.gmail-thread-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.gmail-thread-from {
  font-size: 0.84rem;
  font-weight: 600;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.gmail-thread-item.is-active .gmail-thread-from { color: #1a73e8; }
.gmail-thread-date {
  font-size: 0.72rem;
  color: #5f6368;
  white-space: nowrap;
  flex-shrink: 0;
}
.gmail-thread-subject {
  font-size: 0.82rem;
  font-weight: 500;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.gmail-thread-badge {
  color: #ea8600;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.gmail-thread-snippet {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #5f6368;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gmail-split-view {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: #fff;
}
.gmail-view-empty,
.gmail-view-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: 100%;
  min-height: 320px;
  color: #5f6368;
  font-size: 0.9rem;
}
.gmail-view-empty i { font-size: 2.5rem; opacity: 0.35; }
.gmail-view-inner { min-height: 100%; }
.gmail-view-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #e8eaed;
}
.gmail-view-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.gmail-view-top .gmail-view-subject {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.gmail-delete-btn {
  flex-shrink: 0;
  color: #5f6368;
}
.gmail-delete-btn:hover {
  color: #d93025;
  background: #fce8e6;
}
.gmail-view-subject {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 400;
  color: #202124;
  line-height: 1.35;
  word-break: break-word;
}
.gmail-view-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.gmail-view-from strong {
  display: block;
  font-size: 0.9rem;
  color: #202124;
}
.gmail-view-from-addr {
  display: block;
  font-size: 0.78rem;
  color: #5f6368;
  margin-top: 0.1rem;
}
.gmail-view-date {
  font-size: 0.78rem;
  color: #5f6368;
  white-space: nowrap;
}
.gmail-reset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.gmail-reset-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #fef7e0;
  color: #b06000;
  text-decoration: none;
  border: 1px solid #f9e6b3;
}
.gmail-reset-links a:hover { background: #fdecc8; }
.gmail-view-body { padding: 0; }
.gmail-view-frame {
  width: 100%;
  min-height: 360px;
  border: none;
  display: block;
  background: #fff;
}
.gmail-view-text {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font: 0.875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #202124;
}

.gmail-extra {
  border-top: 1px solid var(--border);
  padding: 0;
}
.gmail-extra summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.gmail-extra summary::-webkit-details-marker { display: none; }
.gmail-extra[open] summary { border-bottom: 1px solid var(--border); }
.gmail-extra-body { padding: 1rem 1.25rem 1.25rem; }

.gmail-messages-section { margin-bottom: 1.25rem; }
.gmail-messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.gmail-message-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.gmail-message-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: #fff;
}
.gmail-message-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.gmail-message-from {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmail-message-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.gmail-message-subject {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.gmail-message-snippet {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 900px) {
  .gmail-split {
    flex-direction: column;
    max-height: none;
    min-height: 0;
  }
  .gmail-split-list {
    width: 100%;
    max-width: none;
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .gmail-split-view { min-height: 360px; }
}
@media (max-width: 720px) {
  .gmail-oauth-fields { grid-template-columns: 1fr; }
  .gmail-bind-row { flex-direction: column; align-items: stretch; }
}
.gmail-inbox-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.gmail-inbox-tabs { margin: 1rem 0 1.25rem; flex-wrap: wrap; }
.gmail-inbox-tabs .security-tab { text-decoration: none; }
.gmail-inbox-tabs .count {
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  font-size: 0.72rem;
}
.gmail-inbox-active-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.gmail-inbox-active-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.gmail-inbox-count {
  font-size: 0.82rem;
  color: var(--muted);
}
.gmail-inbox-empty {
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafafa;
  font-size: 0.88rem;
  color: var(--muted);
}
.gmail-inbox-empty-hint { margin: 0.5rem 0 0; }

.gmail-hub-panel { padding: 1.25rem 1.5rem 1.5rem; }
.gmail-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.gmail-hub-head h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.gmail-hub-head p { margin: 0; color: var(--muted); font-size: 0.88rem; max-width: 42rem; }
.gmail-hub-subtitle {
  margin: 1.25rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.gmail-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.gmail-hub-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gmail-hub-card:hover {
  border-color: #86efac;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}
.gmail-hub-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: #ecfdf5;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.gmail-hub-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gmail-hub-card-body strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmail-hub-card-body span { font-size: 0.78rem; color: var(--muted); }
.gmail-hub-card-arrow { color: #94a3b8; font-size: 0.75rem; }
.gmail-oauth-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.gmail-inbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.gmail-inbox-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.gmail-inbox-hero-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  background: #ecfdf5;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.gmail-inbox-hero h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.gmail-bind-box {
  padding: 1rem 1.1rem;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 1.25rem;
}
.gmail-bind-box h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.gmail-bind-hint { margin: 0 0 0.75rem; font-size: 0.82rem; color: var(--muted); }
.gmail-bind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.gmail-bind-row .jobs-filter-select { min-width: 160px; flex: 1 1 160px; }
.gmail-messages-section { margin-bottom: 1.25rem; }
.gmail-messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.gmail-message-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.gmail-message-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: #fff;
}
.gmail-message-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.gmail-message-from {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmail-message-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.gmail-message-subject {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.gmail-message-snippet {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 720px) {
  .gmail-oauth-fields { grid-template-columns: 1fr; }
  .gmail-bind-row { flex-direction: column; align-items: stretch; }
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.badge-link {
  text-decoration: none;
}
.badge-link:hover { filter: brightness(0.95); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background-color: #fff;
  min-height: 38px;
  box-sizing: border-box;
}
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--primary, #16a34a);
  flex-shrink: 0;
  cursor: pointer;
}
.form-group select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  cursor: pointer;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.form-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #ffffff;
  font-family: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #121212;
}
.auth-shell {
  width: min(420px, 100%);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
  text-decoration: none;
  color: inherit;
}
.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #121212;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auth-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e6e6e6;
}
.auth-brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-brand small {
  display: block;
  margin-top: 0.1rem;
  color: #6b6b6b;
  font-size: 0.75rem;
  font-weight: 500;
}
.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 1.6rem 1.45rem 1.45rem;
}
.auth-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.auth-card > p,
.auth-lead {
  margin: 0 0 1.2rem;
  color: #6b6b6b;
  font-size: 0.95rem;
  line-height: 1.5;
}
.auth-form .form-group { margin-bottom: 0.95rem; }
.auth-form .form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.auth-form .form-group input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: #121212;
}
.auth-form .form-group input:focus {
  outline: none;
  border-color: #121212;
  box-shadow: none;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  padding: 0;
}
.password-toggle:hover {
  color: #121212;
  background: #f3f3f3;
}
.password-toggle:focus-visible {
  outline: 2px solid #121212;
  outline-offset: 1px;
}
.auth-wrap .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.auth-wrap .btn-primary {
  background: #0b7a3b;
  border-color: #0b7a3b;
  color: #fff;
}
.auth-wrap .btn-primary:hover { background: #086331; border-color: #086331; }
.auth-wrap .btn-secondary {
  background: #fff;
  border-color: #cfcfcf;
  color: #121212;
}
.auth-wrap .btn-secondary:hover { background: #f6f6f6; }
.auth-wrap .btn-ghost,
.auth-wrap .btn-ghost.btn-block {
  background: #fff;
  border: 1px solid #e6e6e6;
  color: #121212;
  width: 100%;
  min-height: 44px;
}
.auth-wrap .btn-ghost:hover { background: #f6f6f6; }
.btn-block { width: 100%; justify-content: center; }
.auth-2fa-actions { display: grid; gap: 0.5rem; margin-top: 0.85rem; }
.auth-hint { margin: 0.85rem 0 0; color: #6b6b6b; font-size: 0.82rem; }
.auth-footer-link {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: #6b6b6b;
}
.auth-footer-link a {
  color: #0b7a3b;
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }
.auth-wrap .flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #e6e6e6;
}
.auth-wrap .flash-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.auth-wrap .flash-success {
  background: #eef7f1;
  border-color: #bbf7d0;
  color: #166534;
}
.otp-input {
  letter-spacing: 0.18em;
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.security-2fa-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}
.badge-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.security-2fa-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.security-choice {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fafafa;
}
.security-choice h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.security-choice p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.totp-qr {
  display: inline-block;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0.85rem 1rem;
  list-style: none;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
}
.security-recovery .flash { margin-bottom: 0.75rem; }

.security-page { gap: 0.9rem; }
.security-layout {
  padding: 0;
  overflow: hidden;
}
.security-layout .security-tabs.admin-tabs {
  /* inherits admin-tabs */
}
.security-tab i { margin-right: 0.15rem; }
.security-content.admin-tab-panels {
  padding: 1.35rem 1.5rem 1.5rem;
}
.security-panel { display: none; }
.security-panel.active { display: block; }
.sec-panel-title {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 700;
}
.sec-subhead {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
}
.sec-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
}
.sec-danger-block {
  border-top-color: #fecaca;
}
.sec-status {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.85rem 0 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.sec-status--on {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.sec-status--off {
  background: #f8fafc;
}
.sec-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary);
  flex-shrink: 0;
}
.sec-status--on .sec-status-icon {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
}
.sec-status strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.sec-status span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.sec-inline-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.sec-inline-row input { flex: 1; min-width: 0; }
.sec-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.sec-method-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sec-method-card strong { font-size: 0.92rem; }
.sec-method-card > span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.sec-method-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
}
.sec-method-icon--totp { background: #dbeafe; color: #1d4ed8; }
.sec-method-icon--email { background: #fce7f3; color: #be185d; }
.sec-test-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.sec-test-row strong { display: block; font-size: 0.88rem; margin-bottom: 0.15rem; }
.security-recovery {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.security-recovery h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #166534;
}
.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.recovery-code-list code {
  display: block;
  padding: 0.45rem 0.65rem;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  text-align: center;
}
.totp-qr {
  width: 180px;
  height: 180px;
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
@media (max-width: 720px) {
  .sec-method-grid { grid-template-columns: 1fr; }
  .recovery-code-list { grid-template-columns: 1fr; }
  .sec-inline-row { flex-direction: column; }
}
.security-subsection {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.security-subsection h3 {
  margin: 0 0 0.35rem;
  font-size: 0.93rem;
  font-weight: 500;
}
.security-subsection > p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.security-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  margin-bottom: 1rem;
}
.security-status-card .security-2fa-status { margin: 0; }

@media (max-width: 860px) {
  .security-2fa-choices { grid-template-columns: 1fr; }
  .recovery-code-list { grid-template-columns: 1fr; }
  .security-content { padding: 1.15rem 1rem; }
}

.demo-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body.admin-body { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18);
  }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
  body.admin-nav-open { overflow: hidden; }
  body.admin-nav-open .admin-overlay { display: block; }
  .admin-menu-btn,
  .sidebar-close {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }
  .admin-main {
    padding: 0.9rem 0.9rem 1.5rem;
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
  }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid,
  .svc-form-grid-2 { grid-template-columns: 1fr; }
  .table-pagination { flex-direction: column; align-items: flex-start; }
  .panel { overflow-x: visible; }
  .form-group input,
  .form-group select,
  .form-group textarea,
  .search-box input {
    font-size: 16px;
  }
  .order-detail-dl > div { grid-template-columns: 1fr; }
  .svc-edit-head-content,
  .svc-edit-top-stat,
  .svc-edit-actions,
  .tg-toggle-banner { flex-direction: column; align-items: flex-start; }
  .inv-main-head { flex-direction: column; }
  .inv-main-actions { width: 100%; }
}

/* Digital Inventory — simple */
.inv-simple { padding: 1.15rem 1.2rem 1.35rem; }
.inv-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.inv-add select,
.inv-add input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-weight: 400;
  background: #fff;
  min-width: 0;
}
.inv-add select { flex: 1.2; min-width: 160px; }
.inv-add input { flex: 1; min-width: 140px; }
.inv-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.25rem;
  white-space: nowrap;
}
.inv-link:hover { text-decoration: underline; }
.inv-meta {
  margin: 0.9rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.inv-table-wrap { overflow: auto; padding-top: 0.25rem; }
.inv-table td, .inv-table th { font-weight: 400; vertical-align: middle; }
.inv-cell-pass {
  white-space: nowrap;
}
.inv-pass-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: none;
  white-space: nowrap;
}
.inv-pass-text {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.inv-pass-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.15rem;
  color: #16a34a;
  line-height: 1;
}
.inv-pass-verified .fa-circle-check {
  font-size: 0.95rem;
}
.inv-pass-checking {
  color: #9ca3af;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}
.inv-pass-checking .fa-spinner { font-size: 0.85rem; }
.inv-queue-verify--minimal {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--muted, #9ca3af);
  font-size: 0.85rem;
}
.inv-queue-verify--minimal .inv-verify-elapsed {
  min-width: 2.5rem;
}

.inv-th-check,
.inv-cell-check {
  width: 2.1rem;
  text-align: center;
  padding-left: 0.55rem !important;
  padding-right: 0.35rem !important;
}
.inv-th-online,
.inv-cell-online {
  width: 4.6rem;
  text-align: center;
  white-space: nowrap;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}
.inv-online-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.inv-online-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.inv-online-slider {
  position: relative;
  width: 2rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.inv-online-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.inv-online-switch input:checked + .inv-online-slider {
  background: #10b981;
}
.inv-online-switch input:checked + .inv-online-slider::after {
  transform: translateX(0.9rem);
}
.inv-online-switch input:disabled + .inv-online-slider {
  opacity: 0.55;
}
.inv-online-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  min-width: 1.4rem;
}
.inv-online-switch input:checked ~ .inv-online-text {
  color: #047857;
}
.inv-offline-badge {
  background: #f1f5f9;
  color: #475569;
  margin-left: 0.25rem;
}
tr[data-offline="1"] {
  opacity: 0.78;
}
tr[data-offline="1"] .inv-cell-serial .inv-next-sell {
  display: none;
}
.inv-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.inv-check-label input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--brand, #16a34a);
  cursor: pointer;
}
.inv-btn-delete-selected:not(:disabled) {
  color: var(--danger);
  border-color: #fecaca;
}
.inv-btn-delete-selected:not(:disabled):hover {
  background: #fef2f2;
}
.inv-th-actions,
.inv-row-actions {
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.inv-cell-status {
  white-space: normal;
  max-width: 16rem;
}
.inv-failed-badge {
  white-space: normal;
  text-align: left;
  line-height: 1.35;
  max-width: 100%;
}
.inv-cell-status .badge,
.inv-cell-status .inv-icon-btn,
.inv-cell-status .inv-order-ref {
  display: inline-flex;
  vertical-align: middle;
}
.inv-cell-serial {
  white-space: nowrap;
}
.inv-next-sell {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
tr[data-next-sell="1"] {
  background: #f0fdf4;
}
tr[data-next-sell="1"] td:first-child {
  box-shadow: inset 3px 0 0 #10b981;
}
.inv-row-actions .inv-icon-btn {
  vertical-align: middle;
}
.inv-row-actions form { display: inline; margin: 0; }
.inv-actions-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}
.inv-actions-toggle {
  width: 2rem;
  height: 2rem;
  color: #475569;
}
.inv-actions-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.inv-actions-menu.is-open .inv-actions-toggle {
  background: #e2e8f0;
  color: #0f172a;
}
.inv-actions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  min-width: 11.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.inv-actions-dropdown[hidden] {
  display: none !important;
}
.inv-menu-item-form {
  display: block;
  margin: 0;
}
.inv-menu-item.inv-icon-btn,
.inv-actions-dropdown .inv-menu-item {
  width: 100%;
  height: auto;
  min-height: 2rem;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 500;
}
.inv-menu-item.inv-icon-btn:hover,
.inv-actions-dropdown .inv-menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
}
.inv-menu-item-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}
.inv-menu-item .inv-google-g {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.inv-menu-item.inv-icon-danger {
  color: #dc2626;
}
.inv-menu-item.inv-icon-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}
.inv-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.82rem;
}
.inv-queue-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
  color: #2563eb;
  font-size: 0.82rem;
}
.inv-queue-status.inv-queue-stuck {
  color: var(--danger);
  cursor: help;
}
.inv-queue-status.inv-queue-verify {
  color: #b45309;
  cursor: help;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 0.2rem;
  max-width: 9.5rem;
  min-width: 0;
}
.inv-queue-verify .inv-spinner {
  border-color: #fde68a;
  border-top-color: #d97706;
  width: 12px;
  height: 12px;
}
.inv-queue-verify-main {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.inv-queue-verify .inv-verify-label {
  font-size: 0.78rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}
.inv-queue-verify .inv-verify-elapsed {
  display: block;
  font-size: 0.72rem;
  color: #92400e;
  margin: 0;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.inv-queue-verify.inv-queue-stuck {
  max-width: 10.5rem;
}
.inv-queue-verify.inv-queue-stuck .inv-verify-label {
  max-width: 100%;
  white-space: normal;
  color: var(--danger);
}
.inv-timer-cell.inv-cell-restock {
  white-space: normal;
  max-width: 10rem;
  min-width: 6.5rem;
  vertical-align: middle;
}
.inv-timer-cell.inv-cell-restock .inv-queue-status {
  max-width: 100%;
}

.inv-icon-btn:hover {
  background: #ecfdf5;
}
.inv-icon-btn.inv-icon-sold {
  color: #c2410c;
}
.inv-icon-btn.inv-icon-sold:hover {
  background: #ffedd5;
}
.inv-icon-btn.inv-icon-available {
  color: #047857;
}
.inv-icon-btn.inv-icon-available:hover {
  background: #d1fae5;
}
.inv-icon-btn.inv-icon-retry {
  color: #b45309;
}
.inv-icon-btn.inv-icon-retry:hover {
  background: #fffbeb;
}
.inv-icon-btn.inv-icon-rotate {
  color: #1d4ed8;
}
.inv-icon-btn.inv-icon-rotate:hover {
  background: #dbeafe;
}
.inv-icon-btn.inv-icon-copy {
  color: #0284c7;
}
.inv-icon-btn.inv-icon-copy:hover {
  background: #e0f2fe;
}
.inv-icon-btn.inv-icon-recover {
  color: #0d9488;
}
.inv-icon-btn.inv-icon-recover:hover {
  background: #ccfbf1;
  border-color: #5eead4;
}
.inv-act-recover { background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%); }
.inv-icon-btn.inv-icon-gmail {
  position: relative;
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
}
.inv-icon-btn.inv-icon-gmail .inv-google-g {
  display: block;
  width: 15px;
  height: 15px;
  pointer-events: none;
  transition: filter 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
/* Not connected — muted G, same footprint as other action icons */
.inv-icon-btn.inv-icon-gmail.is-unbound {
  background: transparent;
}
.inv-icon-btn.inv-icon-gmail.is-unbound .inv-google-g {
  filter: grayscale(1);
  opacity: 0.42;
}
.inv-icon-btn.inv-icon-gmail.is-unbound:hover {
  background: #f1f5f9;
}
.inv-icon-btn.inv-icon-gmail.is-unbound:hover .inv-google-g {
  opacity: 0.72;
  filter: grayscale(0.35);
}
/* Connected — full-color G + tiny check (no green box) */
.inv-icon-btn.inv-icon-gmail.is-bound {
  background: transparent;
}
.inv-icon-btn.inv-icon-gmail.is-bound .inv-google-g {
  filter: none;
  opacity: 1;
}
.inv-icon-btn.inv-icon-gmail.is-bound::after {
  content: '';
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34a853 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M4.7 9.2 1.8 6.3l1.1-1.1 1.8 1.8 3.7-3.7 1.1 1.1z'/%3E%3C/svg%3E") center / 7px 7px no-repeat;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(52, 168, 83, 0.35);
}
.inv-icon-btn.inv-icon-gmail.is-bound:hover {
  background: #f0fdf4;
}
.inv-icon-btn.inv-icon-gmail.is-bound:hover::after {
  background-color: #188038;
}
.inv-gmail-modal-body { padding: 0 1.25rem 1.25rem; }
.inv-gmail-oauth-form { margin: 0 0 0.75rem; }
.inv-gmail-oauth-form .btn-gmail { width: 100%; justify-content: center; }
.inv-gmail-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.inv-gmail-modal-panel { max-width: 440px; }
.inv-gmail-modal-bind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}
.inv-gmail-modal-divider {
  border: 0;
  border-top: 1px solid var(--border, #e5e7eb);
  margin: 1rem 0 0.75rem;
}
.inv-act-btn.inv-act-gmail .inv-act-google-g {
  width: 14px;
  height: 14px;
  display: block;
}
.inv-icon-btn.inv-icon-verify {
  color: #15803d;
}
.inv-icon-btn.inv-icon-verify:hover {
  background: #dcfce7;
}
.inv-icon-btn.inv-icon-verify:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.inv-icon-btn.inv-icon-danger {
  color: var(--danger);
}
.inv-icon-btn.inv-icon-danger:hover {
  background: #fef2f2;
}
.inv-icon-btn.inv-icon-info {
  color: var(--danger);
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
}
.inv-icon-btn.inv-icon-info:hover {
  background: #fef2f2;
}
.inv-icon-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}
.inv-icon-label--wide {
  white-space: normal;
  width: max-content;
  max-width: 220px;
  text-align: left;
}
.inv-icon-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #0f172a;
}
.inv-icon-btn:hover .inv-icon-label,
.inv-icon-btn:focus-visible .inv-icon-label,
.inv-queue-status:hover .inv-icon-label {
  opacity: 1;
}
.inv-queue-elapsed {
  font-size: 0.78rem;
  color: #64748b;
  min-width: 2.5rem;
}
.inv-queue-stuck .inv-queue-elapsed {
  color: #b45309;
}
.inv-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: inv-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes inv-spin {
  to { transform: rotate(360deg); }
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.linkish:hover { text-decoration: underline; }
.linkish.danger { color: var(--danger); }
.inv-row-active { background: #f0fdf4; }
.inv-history {
  margin-top: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
}
.inv-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.inv-history-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
}
.inv-timer-cell { white-space: nowrap; }
.inv-timer {
  display: inline-block;
  min-width: 3.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.inv-timer-warn { background: #fff7ed; color: #c2410c; }
.inv-timer-due { background: #fef2f2; color: #b91c1c; font-weight: 500; }
.inv-timer-queue {
  background: #eff6ff;
  color: #1d4ed8;
}
.inv-rotate-elapsed {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.inv-rotate-done {
  font-variant-numeric: tabular-nums;
  color: var(--text, #334155);
}
.inv-queue-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.inv-sidebar-hint--tight {
  margin-top: 0.35rem;
  margin-bottom: 0;
}
.inv-timer-queue.inv-timer-due {
  background: #fef9c3;
  color: #a16207;
}
.inv-order-ref {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.inv-expiry-ago {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.72rem;
  color: #be185d;
}
.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 0.65rem;
}
.inv-toolbar .inv-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.inv-timer-set {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.inv-timer-set label { font-size: 0.82rem; color: var(--muted); }
.inv-timer-set input[type="number"] {
  width: 4.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  font: inherit;
}
.inv-timer-unit { font-size: 0.8rem; color: var(--muted); }
.inv-code { font-size: 0.82rem; max-width: 280px; word-break: break-all; }
.inv-ts { white-space: nowrap; font-size: 0.85rem; }
.inv-sold-at { color: #c2410c; font-weight: 500; }
.inv-order-id { font-size: 0.75rem; color: var(--muted); }
.inv-pending { display: block; font-size: 0.8rem; color: #1d4ed8; margin-top: 0.2rem; }
.btn-mark-sold {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-mark-sold:hover { background: #ffedd5; }
.inv-subh {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-top h1 { font-size: 1.05rem; }
  .kpi-value { font-size: 1.3rem; }
}

/* Inventory — full-width table + account drawer */
.inv-layout {
  display: block;
}

.inv-sidebar {
  padding: 0;
}

.inv-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1900;
}

.inv-drawer.open {
  display: block;
}

body.inv-drawer-open {
  overflow: hidden;
}

.inv-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.inv-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.inv-drawer.open .inv-drawer-panel {
  transform: translateX(0);
}

.inv-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-shrink: 0;
}

.inv-drawer-head .inv-sidebar-title {
  margin-bottom: 0.25rem;
}

.inv-drawer-hint {
  margin: 0;
}

.inv-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.2rem 1.35rem;
}

.inv-drawer-tabs {
  display: flex;
  gap: 0;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-shrink: 0;
}

.inv-drawer-tabs .inv-tab {
  flex: 1;
  text-align: center;
}

.inv-drawer-mode {
  display: flex;
  gap: 1.25rem;
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-shrink: 0;
}
.inv-drawer-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.inv-drawer-mode-option input {
  margin: 0;
  accent-color: var(--primary, #16a34a);
}

.inv-bulk-textarea {
  width: 100%;
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.job-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.job-badge .fa-spinner {
  font-size: 0.7rem;
}
.job-badge--queued { background: #fef3c7; color: #92400e; }
.job-badge--processing { background: #dbeafe; color: #1d4ed8; }
.job-badge--paused { background: #f3e8ff; color: #7e22ce; }
.job-badge--done { background: #dcfce7; color: #15803d; }
.job-badge--failed { background: #fee2e2; color: #b91c1c; }

.badge-paused { background: #f3e8ff; color: #7e22ce; }

.jobs-page .admin-list-meta.jobs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.jobs-meta-empty {
  color: var(--muted);
  font-size: 0.88rem;
}
.jobs-by-tool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
}
.jobs-by-tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  text-decoration: none;
}
.jobs-by-tool-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.badge-queue {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.jobs-table-summary {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.jobs-page .jobs-table-wrap {
  max-height: min(74vh, 860px);
  overflow: auto;
}
.jobs-page .admin-list-actions .inv-live {
  margin-right: 0.15rem;
}

.job-table {
  margin: 0;
  font-size: 0.86rem;
}

.job-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  box-shadow: 0 1px 0 var(--border);
  padding: 0.6rem 0.65rem;
  white-space: nowrap;
}

.job-table tbody td {
  padding: 0.62rem 0.65rem;
  vertical-align: middle;
}

.job-table tbody tr:last-child td {
  border-bottom: none;
}

.job-row--processing {
  background: #f0f9ff;
}

.job-row--processing td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

.job-row--paused {
  background: #faf5ff;
}

.job-row--failed {
  background: #fffbfb;
}

.job-col-actions {
  width: 1%;
  white-space: nowrap;
}

.job-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  align-items: center;
}

.job-actions .inv-icon-btn.job-act-pause {
  color: #475569;
}
.job-actions .inv-icon-btn.job-act-pause:hover {
  background: #f1f5f9;
}
.job-actions .inv-icon-btn.job-act-resume {
  color: #15803d;
}
.job-actions .inv-icon-btn.job-act-resume:hover {
  background: #dcfce7;
}

.job-col-pos {
  width: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-col-id {
  white-space: nowrap;
}

.job-col-tool {
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  color: #111827;
}

.job-col-account {
  min-width: 10rem;
}

.job-account-link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  color: inherit;
  text-decoration: none;
}

.job-account-link:hover .job-account-user {
  color: #1d4ed8;
  text-decoration: underline;
}

.job-account-user {
  font-size: 0.84rem;
  color: #374151;
  word-break: break-all;
}

.inv-cred-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 8.5rem;
  line-height: 1.25;
}

a.inv-cred-cell--link {
  color: inherit;
  text-decoration: none;
}

a.inv-cred-cell--link:hover .inv-cred-user {
  color: var(--info);
  text-decoration: underline;
}

.inv-cred-sn {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.inv-cred-user,
.inv-cred-pass {
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
}

.inv-cred-pass {
  color: #475569;
}

.inv-cred-empty {
  color: var(--muted);
}

.job-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #374151;
  white-space: nowrap;
}

.job-type-pill i {
  color: #6b7280;
  font-size: 0.78rem;
}

.job-type-pill--verify i {
  color: #15803d;
}

.job-col-source {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.job-col-dt {
  font-size: 0.8rem;
  white-space: nowrap;
}

.job-col-error {
  max-width: 12rem;
  font-size: 0.82rem;
  color: var(--danger);
  word-break: break-word;
}

.job-muted {
  color: #cbd5e1;
}

.jobs-empty {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: var(--muted);
}

.jobs-empty i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.45;
}

.jobs-pagination {
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .jobs-page .admin-list-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.inv-bulk-hint code {
  font-size: 0.76rem;
}

.inv-sidebar-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.inv-sidebar-hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.inv-sidebar-form .form-group {
  margin-bottom: 0.85rem;
}

.inv-sidebar-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.inv-sidebar-form select,
.inv-sidebar-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: #fff;
}

.inv-sidebar-form .form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.inv-open-site {
  display: inline-block;
  margin-top: 0.85rem;
}

.inv-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.1rem 0;
}

.inv-timer-set--stack .inv-timer-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inv-timer-set--stack input[type="number"] {
  width: 5.5rem;
  flex: 1;
  min-width: 0;
}
.inv-pw-policy label {
  font-size: 0.82rem;
  color: var(--muted);
}
.inv-pw-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.55rem 0 0.75rem;
}
.inv-pw-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.inv-pw-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  margin-bottom: 0.65rem;
}
.inv-pw-row input[type="number"] {
  width: 4.25rem;
}
.inv-pw-row select {
  min-width: 10rem;
  flex: 1;
}
.inv-pw-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.inv-pw-preview {
  flex: 1;
  min-width: 7rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.9rem;
}

.svc-pw-policy {
  margin-top: 0.25rem;
}
.svc-pw-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.65rem;
}
.svc-pw-row label {
  min-width: 6.5rem;
  margin: 0;
}
.svc-pw-row select,
.svc-pw-row input[type="number"] {
  min-width: 10rem;
  flex: 1;
}
.svc-pw-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.85rem;
  margin-top: 0.65rem;
}
.svc-pw-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}
.svc-pw-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.svc-pw-preview {
  flex: 1;
  min-width: 8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.95rem;
}

.inv-main {
  padding: 1.15rem 1.2rem 1.35rem;
  min-width: 0;
}

.inv-tool-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.inv-tool-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.inv-tool-bar-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.inv-tool-field--bar {
  flex: 1;
  min-width: 0;
  max-width: 480px;
}

.inv-tool-login-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  max-width: min(520px, 100%);
  padding: 0.45rem 0.8rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.inv-tool-login-link:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}

.inv-tool-login-link i {
  font-size: 0.82rem;
  opacity: 0.95;
  flex-shrink: 0;
}

.inv-tool-login-label {
  flex-shrink: 0;
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.inv-tool-login-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  font-weight: 500;
  opacity: 0.98;
}

.inv-tool-field-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
  background: #f8faf9;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.inv-tool-select {
  flex: 1;
  min-width: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  color: #111827;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}

.inv-tool-select:hover,
.inv-tool-select:focus {
  border-color: #28a745;
  outline: none;
  box-shadow: 0 0 0 3px rgba(40,167,69,0.12);
}

.inv-main-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.inv-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
  margin-left: auto;
}

.inv-status-tabs {
  margin-bottom: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.inv-status-tabs .status-tab {
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.inv-status-tabs .status-tab[data-status="all"] {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.inv-status-tabs .status-tab[data-status="all"] .count {
  background: #e2e8f0;
  color: #334155;
}
.inv-status-tabs .status-tab[data-status="all"].active {
  background: #475569;
  border-color: #475569;
  color: #fff;
}

.inv-status-tabs .status-tab[data-status="available"] {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}
.inv-status-tabs .status-tab[data-status="available"] .count {
  background: #d1fae5;
  color: #065f46;
}
.inv-status-tabs .status-tab[data-status="available"].active {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.inv-status-tabs .status-tab[data-status="on_rent"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.inv-status-tabs .status-tab[data-status="on_rent"] .count {
  background: #fee2e2;
  color: #991b1b;
}
.inv-status-tabs .status-tab[data-status="on_rent"].active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.inv-status-tabs .status-tab[data-status="schedule"] {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}
.inv-status-tabs .status-tab[data-status="schedule"] .count {
  background: #ffedd5;
  color: #9a3412;
}
.inv-status-tabs .status-tab[data-status="schedule"].active {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}

.inv-status-tabs .status-tab[data-status="queue"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.inv-status-tabs .status-tab[data-status="queue"] .count {
  background: #dbeafe;
  color: #1e40af;
}
.inv-status-tabs .status-tab[data-status="queue"].active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.inv-status-tabs .status-tab[data-status="failed"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.inv-status-tabs .status-tab[data-status="failed"] .count {
  background: #fee2e2;
  color: #991b1b;
}
.inv-status-tabs .status-tab[data-status="failed"].active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.inv-status-tabs .status-tab.active .count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.inv-status-tabs .status-tab:not(.active):hover {
  filter: brightness(0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.inv-table tbody tr td {
  border-bottom: 1px solid var(--border);
}

.inv-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.inv-main-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 200px;
}

.inv-tool-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8faf9;
  flex-shrink: 0;
}

.inv-main-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.inv-main .inv-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.inv-main-actions {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  flex: 1 1 100%;
}

.inv-action-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.inv-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.inv-action-group--bulk {
  flex: 1 1 auto;
  justify-content: flex-start;
}

.inv-action-group--selected {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.inv-action-divider {
  width: 1px;
  align-self: stretch;
  min-height: 2rem;
  background: #cbd5e1;
  flex-shrink: 0;
  margin: 0 0.15rem;
}

.inv-action-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.inv-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.78rem;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: filter 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}

.inv-act-btn i {
  font-size: 0.82rem;
  opacity: 0.95;
}

.inv-act-btn:not(:disabled):hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.inv-act-btn:not(:disabled):active {
  transform: translateY(0);
}

.inv-act-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.inv-act-add { background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%); }
.inv-act-sold { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); }
.inv-act-change { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); }
.inv-act-check { background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%); }
.inv-act-retry { background: linear-gradient(180deg, #a855f7 0%, #9333ea 100%); }
.inv-act-delete { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); }
.inv-act-export { background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%); }
.inv-act-copy { background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%); }
.inv-act-refresh { background: linear-gradient(180deg, #64748b 0%, #475569 100%); }

@media (max-width: 992px) {
  .inv-action-toolbar-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.45rem;
    align-items: stretch;
  }

  .inv-action-group {
    display: contents;
  }

  .inv-action-divider {
    display: none;
  }

  .inv-action-toolbar-row .inv-act-btn {
    width: 100%;
    min-width: 0;
    min-height: 2.15rem;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}

@media (max-width: 720px) {
  .inv-head-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .inv-head-actions .inv-act-add {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .inv-head-actions .inv-live {
    align-self: center;
  }

  .inv-head-actions .inv-act-refresh {
    width: 100%;
    justify-content: center;
  }

  .inv-action-toolbar-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.45rem;
  }

  .inv-action-toolbar-row .inv-act-btn {
    min-height: 2.35rem;
    padding: 0.38rem 0.35rem;
    font-size: 0.68rem;
  }

  .inv-action-toolbar-row .inv-act-btn i {
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  .inv-action-toolbar-row {
    grid-template-columns: 1fr;
  }
}

.svc-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.svc-name-cell img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.inv-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.inv-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: inv-live-pulse 2s infinite;
}

.inv-live-off .inv-live-dot {
  background: #94a3b8;
  animation: none;
  box-shadow: none;
}

@keyframes inv-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* History dialog — wide but not full viewport */
body.inv-dialog-open { overflow: hidden; }

.inv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.inv-modal.open {
  display: flex;
}

.inv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.inv-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.inv-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.inv-dialog-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
}

.inv-dialog-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.inv-dialog-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.inv-dialog-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.inv-dialog-body {
  padding: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.confirm-modal-body {
  padding: 1rem 1.15rem 0.25rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.confirm-modal-body p {
  margin: 0;
}

.confirm-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.confirm-modal-foot form {
  margin: 0;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.confirm-modal-panel {
  width: min(360px, 92vw);
  max-width: 360px;
  max-height: min(80vh, 420px);
}

.user-add-modal-panel {
  width: min(400px, 92vw);
  max-width: 400px;
  max-height: min(90vh, 640px);
}

.user-add-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.user-add-form .confirm-modal-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 1rem;
}

.user-add-form .confirm-modal-foot {
  flex-shrink: 0;
}

.tr-confirm-panel {
  width: min(460px, 92vw);
  max-height: min(80vh, 520px);
}

.inv-tab,
.admin-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #536579;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.inv-tab:hover,
.admin-tab:hover {
  background: #f8fafc;
  color: var(--text);
}

.inv-tab.active,
.admin-tab.active,
.admin-tab.is-active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.inv-tab-panels { padding: 0.85rem 1.15rem 1.15rem; }

.inv-tab-panel { display: none; }
.inv-tab-panel.active { display: block; }
.svc-tab-panel[hidden] { display: none !important; }
.svc-tab-panel.active:not([hidden]) { display: block; }
.svc-tab-actions[hidden] { display: none !important; }
.admin-tab-panels.admin-detail-form {
  padding: 0.95rem 1rem 1.1rem;
}

.inv-dialog-body .inv-subh:first-child { margin-top: 0; }

@media (max-width: 960px) {
  .inv-drawer-panel {
    width: min(100vw, 460px);
  }
}

.user-detail-back {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.user-detail-back a {
  color: var(--muted);
  text-decoration: none;
}

.user-detail-back a:hover { color: var(--primary); }

/* ─── User detail page ─── */
.ud-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ud-back {
  margin: 0;
  font-size: 0.85rem;
}

.ud-back a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ud-back a:hover { color: var(--primary); }

.ud-hero {
  padding: 1.15rem 1.35rem;
  margin: 0;
}

.ud-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ud-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.ud-identity {
  min-width: 0;
  flex: 1;
}

.ud-name-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ud-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.ud-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.ud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.ud-chip.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #475569;
}

.ud-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.ud-metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ud-metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ud-metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ud-metric-value--money {
  color: var(--primary);
}

.ud-tabs-panel {
  padding: 0;
  overflow: hidden;
  margin: 0;
}

.ud-tabs {
  position: static;
  padding: 0 0.65rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.ud-tab-panels {
  padding: 1.15rem 1.25rem 1.35rem;
}

.ud-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 180px;
  padding: 1.5rem;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafbfc;
}

.ud-empty i {
  font-size: 1.35rem;
  opacity: 0.55;
}

.ud-empty p {
  margin: 0;
  font-size: 0.92rem;
}

.ud-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 1.1rem 1.2rem;
}

.ud-card--compact {
  margin-bottom: 1rem;
}

.ud-card-head h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.ud-card-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.ud-card-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ud-optional {
  color: var(--muted);
  font-weight: 400;
}

.ud-adjust-form {
  margin-top: 1rem;
}

.ud-adjust-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 0.85rem 1rem;
}

.ud-card-actions {
  margin-top: 1rem;
}

.ud-inline-form {
  margin: 0;
}

.ud-api-table {
  margin-bottom: 1rem;
}

.ud-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.25rem 0.45rem 0.25rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.ud-key-chip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text);
}

.ud-key-revoked {
  text-decoration: line-through;
  opacity: 0.5;
}

.ud-copy-btn {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
}

.ud-row-muted td {
  opacity: 0.78;
}

.ud-col-actions {
  text-align: right;
}

.ud-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.ud-row-actions form {
  display: inline;
  margin: 0;
}

.ud-muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.ud-creds {
  margin-top: 0.25rem;
}

.ud-creds-list {
  margin: 0.9rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.ud-creds-list > div {
  display: grid;
  gap: 0.2rem;
}

.ud-creds-list dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ud-creds-list dd {
  margin: 0;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
}

.ud-creds-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
}

.user-page-tabs {
  position: static;
}

.tab-count {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.inv-tab.active .tab-count {
  background: #ecfdf5;
  color: var(--primary);
}

.wallet-amt-pos { color: #047857; font-weight: 500; }
.wallet-amt-neg { color: #b91c1c; font-weight: 500; }

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

  .ud-adjust-grid {
    grid-template-columns: 1fr;
  }

  .order-detail-grid,
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ud-metrics {
    grid-template-columns: 1fr;
  }

  .ud-hero {
    padding: 1rem;
  }

  .ud-tab-panels {
    padding: 1rem;
  }

  .ud-card-head--row {
    align-items: stretch;
  }

  .ud-card-head--row .btn {
    width: 100%;
    justify-content: center;
  }
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.order-detail-dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.order-detail-dl > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.order-detail-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.order-detail-dl dd {
  margin: 0;
}

.order-detail-pre {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-detail-pre-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.order-detail-empty {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.order-detail-form .form-group {
  margin-bottom: 0.85rem;
}

.order-detail-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.order-detail-form .field-hint {
  font-weight: 400;
  color: var(--muted);
}

.order-detail-form select,
.order-detail-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.order-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}


/* Shared admin detail (order edit, etc.) */
.admin-detail {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.05rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}
.admin-detail-back:hover { color: var(--primary); }
.admin-detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-detail-title-row h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-detail-title-row .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95em;
}
.admin-detail-meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.admin-detail-stat {
  text-align: right;
  min-width: 120px;
}
.admin-detail-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.admin-detail-stat strong {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #166534;
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
.admin-detail-grid--full {
  grid-template-columns: minmax(0, 1fr);
}
.svc-section + .svc-section--divider {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8eef4;
}
.svc-section .sec-panel-title {
  margin-bottom: 0.35rem;
}
.admin-detail-metric--action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.admin-detail-metric--action .btn {
  white-space: nowrap;
}
.admin-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.05rem 1.1rem;
}
.admin-detail-card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.admin-detail-card--full { width: 100%; }
.admin-detail-dl {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}
.admin-detail-dl > div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 0.5rem;
  font-size: 0.88rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}
.admin-detail-dl > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.admin-detail-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-detail-dl dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.admin-detail-block { margin-bottom: 0.9rem; }
.admin-detail-block-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.admin-detail-pre {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.admin-detail-pre--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.admin-detail-form .form-group { margin-bottom: 0.9rem; }
.admin-detail-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.admin-detail-form .field-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}
.admin-detail-form select,
.admin-detail-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
}
.admin-detail-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}
.admin-detail-form select:focus,
.admin-detail-form textarea:focus {
  outline: none;
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.25);
}
.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 0.25rem;
}
.admin-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.admin-detail-stat-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.admin-detail-form-section {
  margin: 1.15rem 0 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
  font-size: 0.92rem;
  font-weight: 700;
}
.admin-detail-form-grid .form-group.full { grid-column: 1 / -1; }
.admin-detail-form .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-detail-form .form-group select,
.admin-detail-form .form-group textarea {
  width: 100%;
}
.svc-detail-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}
.svc-detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.svc-detail-logo--add {
  background: #ecfdf5;
  color: var(--primary);
  border-color: #bbf7d0;
  font-size: 1rem;
}
.svc-logo-upload {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.svc-logo-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.35rem 0 0.75rem;
}
.svc-logo-source-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.svc-logo-source-option input[type="radio"] {
  width: 0.95rem;
  height: 0.95rem;
}
.svc-logo-panel[hidden] {
  display: none !important;
}
.svc-logo-panel input[type="url"],
.svc-logo-panel input[type="file"] {
  width: 100%;
  max-width: 36rem;
}
.svc-logo-upload img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.svc-logo-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.svc-logo-remove input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
}
.svc-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.svc-url-row input { flex: 1; min-width: 0; }
.svc-url-row .btn { white-space: nowrap; flex-shrink: 0; }
.svc-diagnostic {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-top: 0.15rem;
}
.svc-diagnostic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}
.svc-diagnostic #diag-body {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #334155;
}
.svc-diagnostic #diag-body p { margin: 0 0 0.4rem; }
.svc-diag-hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.75rem 0;
}
.svc-diag-line { margin: 0 0 0.35rem; font-size: 0.8rem; }
.svc-diag-notes {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: #475569;
}
.svc-help-list {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.55;
}
.svc-help-list li + li { margin-top: 0.25rem; }
.text-ok { color: #15803d; font-weight: 600; }
.text-info { color: #2563eb; font-weight: 600; }
.text-warn { color: #b45309; }
.text-danger { color: #b91c1c; }
.muted { color: var(--muted); }
@media (max-width: 960px) {
  .admin-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-detail-head { flex-direction: column; }
  .admin-detail-stat { text-align: left; }
  .admin-detail-dl > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .admin-detail-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Service Edit Page Styling */
.svc-edit-head {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.svc-edit-head-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.svc-edit-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.svc-edit-logo-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.svc-edit-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.svc-edit-title-group h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.svc-edit-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}
.svc-pill-id {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #f1f5f9;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.svc-edit-top-stat {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.svc-edit-top-stat-item {
  display: flex;
  flex-direction: column;
}
.svc-edit-top-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}
.svc-edit-top-stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.svc-edit-top-stat-val.highlight {
  color: var(--primary);
}

.svc-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}
.svc-edit-card {
  padding: 1.5rem;
}
.svc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.svc-section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.svc-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.svc-form-full {
  grid-column: 1 / -1;
}
.svc-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.svc-field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.svc-field-group input,
.svc-field-group select,
.svc-field-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.svc-field-group input:focus,
.svc-field-group select:focus,
.svc-field-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12);
}
.svc-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}
.svc-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}
.svc-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease, transform 0.1s ease;
}
.svc-btn-save:hover {
  background: var(--primary-dark);
}
.svc-btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: #fff;
  color: var(--danger);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.svc-btn-delete:hover {
  background: #fef2f2;
  border-color: var(--danger);
}

/* Sidebar widget cards */
.svc-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.svc-inv-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}
.svc-inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.88rem;
}
.svc-inv-label {
  color: #475569;
  font-weight: 500;
}
.svc-inv-count {
  font-weight: 700;
  font-size: 0.95rem;
}
.svc-inv-count.avail { color: #16a34a; }

.log-table td,
.log-table th {
  vertical-align: top;
}

.log-time {
  white-space: nowrap;
  font-size: 0.85rem;
}

.log-details {
  min-width: 140px;
  max-width: 320px;
  line-height: 1.45;
  font-size: 0.88rem;
  color: #475569;
  word-break: break-word;
}

.log-entity {
  min-width: 120px;
}

.log-entity-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-all;
}

.log-ip {
  white-space: nowrap;
  font-size: 0.78rem;
}

.order-status-form {
  margin: 0;
  display: inline-block;
}

.order-status-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.order-status-select.badge-pending { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.order-status-select.badge-processing { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.order-status-select.badge-success { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.order-status-select.badge-reject { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.order-time {
  white-space: nowrap;
  font-size: 0.85rem;
}
.svc-inv-count.sold { color: #d97706; }
.svc-inv-count.disabled { color: #94a3b8; }

.svc-info-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.82rem;
  color: #475569;
}
.svc-info-box code {
  background: #e2e8f0;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #0f172a;
}

@media (max-width: 1080px) {
  .svc-edit-layout {
    grid-template-columns: 1fr;
  }
}

/* ─── Telegram Settings Panel ─── */

/* Master toggle banner */
.tg-toggle-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  transition: background 0.25s, border-color 0.25s;
}
.tg-toggle-banner.tg-on {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0;
}
.tg-toggle-banner.tg-off {
  background: #f8fafc;
  border: 1px solid var(--border);
}
.tg-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.tg-toggle-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.tg-on .tg-toggle-icon {
  background: #dcfce7;
  color: #16a34a;
}
.tg-off .tg-toggle-icon {
  background: #f1f5f9;
  color: #94a3b8;
}
.tg-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.tg-toggle-info strong {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.tg-toggle-info span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Custom toggle switch */
.tg-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}
.tg-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tg-switch-slider {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s;
}
.tg-switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.tg-switch input:checked + .tg-switch-slider {
  background: #22c55e;
}
.tg-switch input:checked + .tg-switch-slider::after {
  transform: translateX(20px);
}

/* Setup guide card */
.tg-setup-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.tg-setup-card summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.tg-setup-card summary::-webkit-details-marker { display: none; }
.tg-setup-card summary::before {
  content: "▸";
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s;
}
.tg-setup-card[open] summary::before {
  transform: rotate(90deg);
}
.tg-setup-card summary i {
  color: #3b82f6;
  font-size: 0.85rem;
}
.tg-setup-body {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.tg-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.5;
}
.tg-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.tg-step a {
  color: #2563eb;
  text-decoration: none;
}
.tg-step a:hover {
  text-decoration: underline;
}
.tg-step code {
  background: #f1f5f9;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.84em;
  color: #0f172a;
}

/* Credential cards row */
.tg-creds-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}
.tg-cred-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tg-cred-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tg-cred-header i {
  color: #64748b;
  font-size: 0.85rem;
}
.tg-cred-header label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  margin: 0;
}
.tg-cred-card input,
.tg-cred-card textarea,
.tg-cred-card select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background-color: #f8fafc;
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
  line-height: 1.4;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.tg-cred-card select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  cursor: pointer;
}
.tg-cred-card textarea {
  min-height: 88px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}
.tg-cred-card input:focus,
.tg-cred-card textarea:focus,
.tg-cred-card select:focus {
  outline: none;
  border-color: #93c5fd;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.tg-cred-card small {
  font-size: 0.78rem;
  color: var(--muted);
}
.tg-cred-card small code {
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}
.tg-chat-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.tg-chat-row input {
  flex: 1;
  min-width: 0;
}
.tg-chat-btn {
  flex-shrink: 0;
  align-self: stretch;
  min-height: 38px;
  white-space: nowrap;
}
.tg-threshold-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.tg-threshold-card label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.tg-threshold-card input {
  width: 100%;
  max-width: 8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
  min-height: 38px;
}
.tg-threshold-card input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.tg-threshold-card small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.tg-settings-form {
  max-width: 920px;
}
.tg-setup-card {
  margin-top: 1.25rem;
}

/* Events section */
.tg-events-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}
.tg-events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.tg-event-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  user-select: none;
}
.tg-event-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.tg-event-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tg-event-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  background: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.tg-event-check i {
  font-size: 0.6rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}
.tg-event-card input:checked ~ .tg-event-check {
  background: #22c55e;
  border-color: #22c55e;
}
.tg-event-card input:checked ~ .tg-event-check i {
  opacity: 1;
}
.tg-event-card input:checked ~ .tg-event-icon,
.tg-event-card input:checked ~ .tg-event-info {
  opacity: 1;
}
.tg-event-card:has(input:checked) {
  border-color: #86efac;
  background: #f0fdf4;
}
.tg-event-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.tg-ev-pass   { background: #dcfce7; color: #16a34a; }
.tg-ev-orders  { background: #dbeafe; color: #2563eb; }
.tg-ev-jobs    { background: #fef3c7; color: #d97706; }
.tg-ev-stock   { background: #fce7f3; color: #db2777; }
.tg-ev-expiry  { background: #fee2e2; color: #dc2626; }
.tg-ev-wallet  { background: #ecfdf5; color: #059669; }
.tg-ev-msg     { background: #e0e7ff; color: #4f46e5; }
.tg-event-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.tg-event-info strong {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
}
.tg-event-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Save row */
.tg-save-row {
  margin-top: 0.25rem;
}
.tg-save-row .btn {
  gap: 0.45rem;
}

/* Test section */
.tg-test-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}
.tg-test-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.tg-test-info > i {
  font-size: 1.15rem;
  color: #8b5cf6;
  flex-shrink: 0;
}
.tg-test-info div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.tg-test-info strong {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.tg-test-info span {
  font-size: 0.8rem;
  color: var(--muted);
}
.tg-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.tg-test-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

@media (max-width: 640px) {
  .tg-creds-row { grid-template-columns: 1fr; }
  .tg-events-grid { grid-template-columns: 1fr; }
  .tg-test-section { flex-direction: column; align-items: flex-start; }
}

/* Service Drag & Drop / Move Styles */
.svc-drag-cell {
  width: 58px;
  min-width: 58px;
  text-align: center;
  padding: 0.35rem 0.4rem !important;
  user-select: none;
}
.svc-drag-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.svc-drag-handle {
  cursor: grab;
  color: #94a3b8;
  padding: 0.3rem 0.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.svc-drag-handle:hover,
.svc-drag-handle:active {
  color: var(--primary);
  background: #f1f5f9;
}
.svc-drag-handle:active {
  cursor: grabbing;
}
.svc-move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.svc-move-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.65rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}
.svc-move-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--primary);
  border-color: #cbd5e1;
}
.svc-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
tr.svc-row-dragging {
  opacity: 0.45;
  background: #eff6ff !important;
}
tr.svc-row-drag-over {
  border-top: 2px solid #3b82f6 !important;
  background: #f8fafc;
}
.svc-order-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.svc-order-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .admin-main {
    padding: 0.65rem 0.7rem 4.5rem;
    font-size: 0.8125rem;
  }
  .admin-top {
    margin-bottom: 0.7rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0.6rem;
  }
  .admin-top h1 {
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-top-actions {
    gap: 0.3rem;
  }
  .admin-account-meta {
    display: none;
  }
  .admin-account-toggle {
    padding: 0.28rem;
    border-radius: 50%;
  }
  .admin-account-caret { display: none; }
  .admin-account-panel {
    min-width: 200px;
  }
  .panel {
    padding: 0.75rem 0.7rem 0.85rem;
    overflow-x: visible;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-head h2 { font-size: 0.92rem; }
  .panel-head > div {
    width: 100%;
    flex-wrap: wrap;
  }
  .toolbar,
  .dash-toolbar,
  .search-box {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
  .search-box input,
  .log-filter select,
  .log-filter input[type="search"],
  .inv-tool-select,
  .jobs-filter-select,
  .order-status-select,
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 40px;
    font-size: 16px;
  }
  .btn,
  .table-pagination-btn {
    min-height: 32px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
  }
  .btn-sm {
    min-height: 30px;
    font-size: 0.72rem;
    padding: 0.28rem 0.45rem;
  }
  .badge { font-size: 0.65rem; padding: 0.12rem 0.4rem; }
  .log-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .log-filter,
  .log-filter--search {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .log-filter-actions {
    width: 100%;
  }
  .log-filter-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .admin-list {
    padding: 0.85rem 0.75rem 0.95rem;
  }
  .admin-list-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-list-field,
  .admin-list-field--search {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .admin-list-field-actions {
    width: 100%;
  }
  .admin-list-field-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .admin-list-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }
  .admin-list-tab { flex-shrink: 0; }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn,
  .confirm-modal-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .confirm-modal-foot .btn { width: 100%; justify-content: center; }
  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    font-size: 0.75rem;
  }
  .table-pagination-links {
    width: 100%;
    justify-content: space-between;
  }
  .table-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 32px;
    font-size: 0.72rem;
  }

  .inv-tool-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.65rem;
  }
  .inv-tool-bar-label { font-size: 0.72rem; }
  .inv-tool-field--bar { max-width: none; }
  .inv-tool-login-link {
    width: 100%;
    max-width: none;
    min-height: 36px;
    font-size: 0.74rem;
    padding: 0.42rem 0.65rem;
    justify-content: flex-start;
  }
  .inv-main-head { align-items: stretch; padding-bottom: 0.65rem; }
  .inv-main-title { font-size: 0.92rem; margin-bottom: 0.2rem; }
  .inv-main-title-row { gap: 0.5rem; }
  .inv-tool-logo { width: 36px; height: 36px; border-radius: 9px; }
  .inv-meta { font-size: 0.75rem; gap: 0.25rem; }
  .inv-main-actions {
    gap: 0.45rem;
  }
  .inv-head-actions {
    flex: 1 1 100%;
    width: 100%;
  }

  .status-tabs,
  .inv-status-tabs,
  .jobs-status-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.45rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
  }
  .status-tab {
    flex: 0 0 auto;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
  }
  .status-tab .count { font-size: 0.65rem; padding: 0.02rem 0.32rem; }

  .inv-table-wrap,
  .order-table-wrap,
  .log-table-wrap,
  .dash-table-wrap,
  .jobs-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0;
  }
  .admin-main .data-table {
    display: table;
    width: max-content;
    min-width: 100%;
    font-size: 0.75rem;
  }
  .admin-main .data-table thead,
  .admin-main .data-table tbody,
  .admin-main .data-table tr {
    display: table-row-group;
  }
  .admin-main .data-table thead { display: table-header-group; }
  .admin-main .data-table tr { display: table-row; }
  .admin-main .data-table th,
  .admin-main .data-table td {
    display: table-cell;
    white-space: nowrap;
    vertical-align: middle;
  }
  .admin-main .data-table tbody td::before { content: none; }
  .inv-row-actions { white-space: nowrap; }

  .jobs-table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .jobs-filters {
    width: 100%;
  }
  .jobs-filter-select {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .inv-modal { padding: 0; align-items: stretch; }
  .inv-modal-panel {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .inv-drawer-panel {
    width: 100vw;
    max-width: 100vw;
  }
  .inv-dialog-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .svc-edit-head-content,
  .svc-edit-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .svc-edit-actions .btn { width: 100%; justify-content: center; }
}

/* ─── Dashboard ─── */
.dash {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-updated {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.dash-period {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.25rem;
  background: #e8eef5;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
}
.dash-period-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #536579;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.42rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}
.dash-period-btn:hover { color: var(--text); background: rgba(255,255,255,0.7); }
.dash-period-btn.is-active,
.dash-period-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 0 0 1px #bbf7d0;
}

.dash-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dash-alerts-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}
.dash-alert i { color: var(--muted); font-size: 0.75rem; }
.dash-alert--danger { border-color: #fecaca; background: #fff5f5; }
.dash-alert--warn { border-color: #fde68a; background: #fffbeb; }
.dash-alert--info { border-color: #bfdbfe; background: #f8fbff; }
.dash-alert:hover { border-color: #cfcfcf; }

.dash-section { display: flex; flex-direction: column; gap: 0.65rem; }
.dash-section-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.dash-section-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dash-section-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #166534;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}
.dash-section-tag--live {
  color: #175cd3;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.dash-kpis,
.dash-live {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.dash-kpi,
.dash-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.dash-kpi::before,
.dash-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}
.dash-kpis .dash-kpi:nth-child(1) { background: #fff; }
.dash-kpis .dash-kpi:nth-child(1)::before { background: #16a34a; }
.dash-kpis .dash-kpi:nth-child(2) { background: #fff; }
.dash-kpis .dash-kpi:nth-child(2)::before { background: #2563eb; }
.dash-kpis .dash-kpi:nth-child(3) { background: #fff; }
.dash-kpis .dash-kpi:nth-child(3)::before { background: #0d9488; }
.dash-kpis .dash-kpi:nth-child(4) { background: #fff; }
.dash-kpis .dash-kpi:nth-child(4)::before { background: #d97706; }
.dash-live .dash-tile:nth-child(1) { background: #fff; }
.dash-live .dash-tile:nth-child(1)::before { background: #ea580c; }
.dash-live .dash-tile:nth-child(2) { background: #fff; }
.dash-live .dash-tile:nth-child(2)::before { background: #7c3aed; }
.dash-live .dash-tile:nth-child(3) { background: #fff; }
.dash-live .dash-tile:nth-child(3)::before { background: #0284c7; }
.dash-live .dash-tile:nth-child(4) { background: #fff; }
.dash-live .dash-tile:nth-child(4)::before { background: #16a34a; }
.dash-tile:hover { border-color: #cbd5e1; filter: brightness(0.99); }
.dash-kpi-label,
.dash-tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-kpi-value,
.dash-tile-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.dash-kpi-meta,
.dash-tile-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.dash-activity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
}
.dash-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem 1rem 1.05rem;
  min-width: 0;
}
.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dash-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.dash-panel-sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.dash-panel-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.dash-panel-link:hover { text-decoration: underline; }
.dash-panel-tools {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}
.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.dash-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #525252;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
a.dash-tab { color: #525252; }
.dash-tab:hover { background: #fafafa; color: var(--text); }
.dash-tab.is-active,
.dash-tab.active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.dash-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #737373;
  background: #f3f3f3;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.dash-tab.is-active .dash-tab-count,
.dash-tab.active .dash-tab-count {
  background: #dcfce7;
  color: #166534;
}
.dash-search {
  display: flex;
  gap: 0.4rem;
}
.dash-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.84rem;
  background: #fff;
}
.dash-table-wrap { overflow-x: auto; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
}
.dash-table thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  white-space: nowrap;
}
.dash-table tbody td {
  padding: 0.65rem 0.55rem;
  font-size: 0.84rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.dash-table tbody tr:hover td { background: #fcfcfc; }
.dash-table a { color: var(--text); font-weight: 600; text-decoration: none; }
.dash-table a:hover { color: var(--primary); text-decoration: underline; }
.dash-empty td {
  text-align: center;
  color: var(--muted);
  padding: 1.25rem 0.75rem !important;
}
.dash-muted {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .dash-kpis,
  .dash-live,
  .dash-activity { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .dash-kpis,
  .dash-live,
  .dash-activity { grid-template-columns: 1fr; }
  .dash-period { width: 100%; }
  .dash-period-btn { flex: 1 1 auto; text-align: center; }
}

.inv-optional { font-weight: 400; color: #94a3b8; font-size: 0.82em; }
.inv-date-fields input[type="date"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.inv-expiry-remain { font-weight: 600; font-size: 0.84rem; }
.inv-expiry-remain--ok { color: #047857; }
.inv-expiry-remain--soon { color: #c2410c; }
.inv-expiry-remain--expired { color: #b91c1c; }
.inv-expiry-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
}

/* Utils — email inventory import */
.utils-page { display: flex; flex-direction: column; gap: 1.1rem; }
.utils-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.utils-head h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.utils-sub { margin: 0; max-width: 52rem; font-size: 0.84rem; color: #94a3b8; line-height: 1.45; }
.utils-sub code,
.demo-banner code {
  font-size: 0.78rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.utils-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.utils-pick-form { margin: 0; }
.utils-form { display: flex; flex-direction: column; gap: 0.85rem; }
.utils-preview { display: flex; flex-direction: column; gap: 0.65rem; }
.utils-preview-count { margin: 0; font-size: 0.84rem; color: #475569; }
.utils-preview-table { font-size: 0.86rem; }
.utils-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
}
.utils-check input { margin-top: 0.2rem; }
.utils-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.utils-note { font-size: 0.8rem; color: #94a3b8; }

/* ── Error logs ── */
.err-page.admin-list {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.err-metric-open { color: #b91c1c; }
.err-inline-form { margin: 0; display: inline; }
.err-page {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.err-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.err-toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1rem;
}
.err-stat {
  font-size: 0.86rem;
  color: #64748b;
}
.err-stat strong {
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.err-stat--open strong { color: #b91c1c; }
.err-toolbar-hint {
  font-size: 0.78rem;
  color: #94a3b8;
}
.err-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.err-inline-form { margin: 0; }
.err-intro {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
}
.err-tabs {
  margin-bottom: 0.95rem;
}
.err-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.err-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 120px;
}
.err-filter--grow {
  flex: 1;
  min-width: 180px;
}
.err-filter label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.err-filter select,
.err-filter input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #fff;
  min-height: 38px;
}
.err-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.05rem;
}
.err-list-wrap { min-height: 8rem; }
.err-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  text-align: center;
}
.err-empty i { font-size: 1.6rem; color: #86efac; }
.err-empty p { margin: 0; font-size: 0.92rem; color: #64748b; }
.err-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.err-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: #fff;
  border-left-width: 3px;
}
.err-card--critical { border-left-color: #dc2626; background: #fffafa; }
.err-card--error { border-left-color: #ef4444; }
.err-card--warning { border-left-color: #f59e0b; }
.err-card--info { border-left-color: #3b82f6; }
.err-card-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.err-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.err-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  line-height: 1.4;
}
.err-badge--critical { background: #fee2e2; color: #991b1b; }
.err-badge--error { background: #fee2e2; color: #b91c1c; }
.err-badge--warning { background: #fef3c7; color: #92400e; }
.err-badge--info { background: #dbeafe; color: #1d4ed8; }
.err-status {
  display: inline-flex;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: capitalize;
  background: #f1f5f9;
  color: #475569;
}
.err-status--open { background: #fee2e2; color: #991b1b; }
.err-status--acked { background: #fef3c7; color: #92400e; }
.err-status--resolved { background: #dcfce7; color: #166534; }
.err-hits {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.err-card-msg {
  margin: 0;
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}
.err-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.err-card-hint {
  margin: 0;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
}
.err-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
}
.err-card-meta .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}
.err-card-time { color: #94a3b8; }
.err-card-tech {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #64748b;
}
.err-card-tech summary {
  cursor: pointer;
  color: #64748b;
  font-weight: 500;
  user-select: none;
}
.err-card-tech summary:hover { color: #334155; }
.err-card-tech-body {
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: #475569;
  word-break: break-word;
}
.err-card-tech-body .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}
.err-card-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.err-card-actions form { margin: 0; }
.err-btn-resolve {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}
.err-btn-resolve:hover {
  background: #d1fae5;
  color: #065f46;
}

@media (max-width: 720px) {
  .err-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .err-filter,
  .err-filter--grow {
    min-width: 0;
    width: 100%;
  }
  .err-filter-actions {
    width: 100%;
  }
  .err-filter-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .err-card {
    flex-direction: column;
  }
  .err-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
}


/* —— System status —— */
.sys-status { display: flex; flex-direction: column; gap: 1.25rem; }
.sys-site-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  border-radius: 10px;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
}
.sys-site-banner--ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.sys-site-banner--bad {
  border-color: #fca5a5;
  background: #fef2f2;
}
.sys-site-banner-main { min-width: 0; flex: 1; }
.sys-site-banner strong { display: block; margin-bottom: 0.15rem; font-size: 1.05rem; color: #0f172a; }
.sys-site-banner span { color: #64748b; font-size: 0.85rem; }
.sys-metrics .sys-metric {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sys-metrics .sys-metric strong { font-size: 1.65rem; letter-spacing: -0.02em; }
.sys-metrics .sys-metric small { color: #64748b; font-size: 0.8rem; }
.sys-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 0.1rem 0;
}
.sys-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0b7a3b;
  transition: width 0.35s ease;
}
.sys-bar-fill--warn { background: #d97706; }
.sys-bar-fill--bad { background: #dc2626; }
.sys-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
@media (max-width: 960px) {
  .sys-grid { grid-template-columns: 1fr; }
}
.sys-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.sys-hint { color: #94a3b8; font-size: 0.8rem; }
.sys-table { width: 100%; border-collapse: collapse; }
.sys-table th,
.sys-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 0.88rem;
}
.sys-table th {
  color: #64748b;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f8fafc;
}
.sys-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sys-pill--ok { background: #ecfdf5; color: #047857; }
.sys-pill--warn { background: #fffbeb; color: #b45309; }
.sys-pill--bad { background: #fef2f2; color: #b91c1c; }

/* ── Site license (admin) ─────────────────────────────────────────────────── */
.site-lic {
  max-width: 720px;
  padding: 1.5rem 1.6rem 1.35rem;
}
.site-lic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.site-lic-eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-lic-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}
.site-lic-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
}
.site-lic-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.site-lic-badge--bad {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.site-lic-list {
  margin: 0;
  padding: 0.25rem 0 0;
}
.site-lic-row {
  display: grid;
  grid-template-columns: minmax(140px, 38%) 1fr;
  gap: 0.85rem 1.25rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.site-lic-row:last-child {
  border-bottom: none;
  padding-bottom: 0.35rem;
}
.site-lic-row dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.site-lic-row dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}
.site-lic-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}
@media (max-width: 560px) {
  .site-lic { padding: 1.2rem 1.1rem 1.1rem; }
  .site-lic-row {
    grid-template-columns: 1fr;
    gap: 0.28rem;
    padding: 0.75rem 0;
  }
  .site-lic-title { font-size: 1.08rem; }
}

/* ── Site updates (admin) ─────────────────────────────────────────────────── */
.site-upd {
  max-width: 720px;
  padding: 1.5rem 1.6rem 1.45rem;
}
.site-upd-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.site-upd-eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-upd-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}
.site-upd-sub {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 42rem;
}
.site-upd-actions {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.site-upd-btn {
  min-height: 42px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
}
.site-upd-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* Users list cells */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.user-cell-avatar,
.user-detail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.82rem;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}
.user-detail-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}
.user-cell-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.user-cell-email {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.user-key-chip i { color: var(--primary); font-size: 0.75rem; }
.user-key-chip:hover { border-color: #cbd5e1; background: #fff; }
.user-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Shared admin tabs card */
.admin-tabs-card {
  padding: 0;
  overflow: hidden;
}
.admin-tabs,
.inv-dialog-tabs.ud-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}
.admin-tab-panels,
.ud-tab-panels {
  padding: 0.95rem 1rem 1.1rem;
}
.admin-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 0.9rem;
}
.admin-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.admin-detail-metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-detail-metric span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-detail-metric strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-detail-form-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 1rem 1.05rem;
}
.admin-detail-form-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.admin-detail-form-help {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.admin-detail-form-card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.admin-detail-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.admin-detail-form .input-currency {
  display: flex;
  align-items: stretch;
}
.admin-detail-form .input-currency-symbol {
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
}
.admin-detail-form .input-currency input {
  border-radius: 0 6px 6px 0;
  width: 100%;
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
@media (max-width: 960px) {
  .admin-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-detail-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-detail-metrics { grid-template-columns: 1fr; }
}

.cur-symbol { font-size: 1.05rem; font-weight: 600; }
.cur-inline-form { display: inline; margin: 0; }
.cur-default-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.cur-default-check input { width: auto; margin: 0; }

.site-logo-upload {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.site-logo-upload img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.site-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8fafc;
}
.site-color-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.site-color-field input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.site-color-hex {
  width: 7.5rem;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.9rem;
}

/* Site updates status */
.site-updates-status {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}
.site-updates-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}
.site-updates-status.is-available::before { background: #2563eb; }
.site-updates-status.is-blocked::before { background: #94a3b8; }
.site-updates-visual {
  flex: 0 0 auto;
}
.site-updates-success {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
}
.site-updates-success-svg {
  width: 56px;
  height: 56px;
}
.site-updates-success-ring {
  stroke: #16a34a;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  animation: site-updates-ring 0.7s ease forwards;
}
.site-updates-success-check {
  stroke: #16a34a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: site-updates-check 0.45s 0.45s ease forwards;
}
@keyframes site-updates-ring {
  to { stroke-dashoffset: 0; }
}
@keyframes site-updates-check {
  to { stroke-dashoffset: 0; }
}
.site-updates-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 1.55rem;
}
.site-updates-icon--update {
  background: #eff6ff;
  color: #2563eb;
}
.site-updates-icon--blocked {
  background: #f8fafc;
  color: #94a3b8;
}
.site-updates-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.site-updates-version {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-updates-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.site-updates-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .site-updates-status {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
