/* Trendy Game Operations Console */
:root {
  --font: "Noto Sans TC", "DM Sans", system-ui, sans-serif;
  --font-en: "DM Sans", "Noto Sans TC", system-ui, sans-serif;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #f8fafc;
  --card: #ffffff;
  --err: #ef4444;
  --ok: #22c55e;
  --radius: 16px;
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.screen { min-height: 100vh; min-height: 100dvh; }

/* ??? Login ??? */
.login-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  background: #030712;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-a {
  width: 420px; height: 420px;
  background: #1d4ed8;
  top: -120px; left: -80px;
}

.orb-b {
  width: 360px; height: 360px;
  background: #7c3aed;
  bottom: -100px; right: -60px;
  animation-delay: -6s;
}

.orb-c {
  width: 280px; height: 280px;
  background: #0ea5e9;
  top: 40%; left: 55%;
  animation-delay: -12s;
  opacity: 0.35;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -20px) scale(1.05); }
  66% { transform: translate(-16px, 12px) scale(0.95); }
}

.login-wrap {
  position: relative;
  width: min(420px, 100%);
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
  color: #f8fafc;
}

.logo-mark {
  width: auto;
  height: auto;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 24px rgba(37, 99, 235, 0.45));
}

.logo-mark img { display: block; height: 40px; width: auto; margin: 0 auto; max-width: 160px; }
.logo-mark svg { width: 100%; height: 100%; display: block; }

.login-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.login-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-en);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-tagline {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

.login-card {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f1f5f9;
}

.login-hint {
  margin: 0 0 22px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.03em;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.6);
  color: #f8fafc;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: #64748b; }

.field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.password-toggle:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
}

.password-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.password-toggle.is-visible {
  color: #93c5fd;
}

.password-toggle svg {
  display: block;
}

.password-toggle .icon-eye-closed[hidden],
.password-toggle .icon-eye-open[hidden] {
  display: none;
}

.captcha-line {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.captcha-q {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
  letter-spacing: 0.02em;
  line-height: 1.2;
  min-width: 7.5rem;
}

.captcha-line input {
  flex: 1 1 auto;
  min-width: 4.5rem;
  margin: 0;
  padding: 11px 12px;
}

.btn-captcha-refresh {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-captcha-refresh:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
}

.captcha-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-login {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.btn-login:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.55);
}

.btn-login:active { transform: scale(0.98); }

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  min-height: 1.35em;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  text-align: center;
  color: #94a3b8;
  line-height: 1.45;
}

.form-status:empty {
  padding: 0;
  margin-top: 8px;
  min-height: 0;
}

.form-status.err {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.form-status.ok {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  font-family: var(--font-en);
}

/* ??? App shell ??? */
.app-shell {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: auto;
  height: 28px;
  flex-shrink: 0;
}

.topbar-logo img { display: block; height: 28px; width: auto; max-width: 110px; }
.topbar-logo svg { width: 100%; height: 100%; display: block; }

.topbar-title {
  display: block;
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.topbar-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-en);
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-meta > span:first-child {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.btn-outline {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dashboard {
  flex: 1;
  padding: 32px 24px 56px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.dash-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.dash-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.dash-desc {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}

.module-grid--sub {
  max-width: 560px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.module-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.module-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
  border-color: #bfdbfe;
}

.module-tile.is-active {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.module-tile.is-soon { cursor: default; opacity: 0.88; }
.module-tile.is-soon:hover { transform: none; }

.module-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.module-badge.live {
  background: #dcfce7;
  color: #166534;
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
}

.module-icon--emoji {
  font-size: 1.75rem;
  line-height: 1;
  color: inherit;
}

.module-icon svg { width: 24px; height: 24px; }

.module-icon.admin { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.module-icon.server { background: linear-gradient(145deg, #475569, #334155); }
.module-icon.pay { background: linear-gradient(145deg, #f97316, #ea580c); }
.module-icon.orders { background: linear-gradient(145deg, #6366f1, #4f46e5); }
.module-icon.vending { background: linear-gradient(145deg, #10b981, #059669); }
.module-icon.dpp { background: linear-gradient(145deg, #8b5cf6, #7c3aed); }

.module-tile h3 {
  margin: 0;
  font-family: var(--font-en);
  font-size: 1.05rem;
  font-weight: 700;
}

.module-tile p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.module-toast {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.88rem;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.view-toolbar-end {
  justify-content: flex-end;
}

.srv-range-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.srv-range-label select {
  min-width: 8.5rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.srv-chart-stats {
  margin: -4px 0 10px;
  font-size: 0.78rem;
}

.topbar-home {
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  padding: 0;
  border-radius: 10px;
}

.topbar-home:hover .topbar-title {
  color: var(--blue);
}

.topbar-home:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.status-toggle {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.status-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.status-toggle .status-pill:hover {
  filter: brightness(0.95);
}

.btn-back {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

.btn-back:hover { text-decoration: underline; }

.config-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.88rem;
  line-height: 1.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow-md);
}

.metric-card .metric-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric-card .metric-value {
  font-family: var(--font-en);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.metric-card .metric-unit {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.metric-card.is-error .metric-value {
  font-size: 0.85rem;
  color: var(--err);
  font-weight: 600;
}

.db-health-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.db-health-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.db-health-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.db-health-legend-item.health-ok i {
  background: #16a34a;
}

.db-health-legend-item.health-warn i {
  background: #ca8a04;
}

.db-health-legend-item.health-bad i {
  background: #dc2626;
}

.db-health-legend-hint {
  flex: 1 1 220px;
  font-weight: 400;
  color: var(--muted);
}

.metric-card.health-ok {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, var(--card) 48%);
}

.metric-card.health-warn {
  border-color: #fde047;
  background: linear-gradient(180deg, #fefce8 0%, var(--card) 48%);
}

.metric-card.health-bad {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fef2f2 0%, var(--card) 48%);
}

.metric-card .metric-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-card .metric-health::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.metric-card.health-ok .metric-health {
  color: #15803d;
}

.metric-card.health-warn .metric-health {
  color: #a16207;
}

.metric-card.health-bad .metric-health {
  color: #b91c1c;
}

.metric-card.health-na .metric-health {
  color: var(--muted);
  font-weight: 500;
}

.metric-card.health-na .metric-health::before {
  background: #94a3b8;
}

.chart-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.chart-panel h2 {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 88px;
  padding-top: 4px;
}

.mini-chart .bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  opacity: 0.85;
}

.mini-chart.empty {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.backend-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.backend-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.backend-panel h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.backend-panel-desc {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.backend-soon-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.backend-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.backend-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.backend-group-head {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.backend-group-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.backend-group-meta {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.backend-table-wrap {
  overflow-x: auto;
}

.backend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.backend-table th,
.backend-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.backend-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
}

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

.backend-table .mono {
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-pill.ok {
  background: #ecfdf5;
  color: #047857;
}

.status-pill.warn {
  background: #fffbeb;
  color: #b45309;
}

.status-pill.off {
  background: #f1f5f9;
  color: #64748b;
}

.weight-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.weight-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.weight-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.backend-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.backend-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.backend-toolbar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.btn-preset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-preset:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-apply-weight {
  margin-left: auto;
  border: none;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-apply-weight:hover { background: #1d4ed8; }
.btn-apply-weight:disabled { opacity: 0.55; cursor: not-allowed; }

.backend-group-status {
  padding: 8px 14px 0;
  font-size: 0.78rem;
  min-height: 1.2em;
}

.backend-group-status.ok { color: #047857; }
.backend-group-status.err { color: var(--err); }

.weight-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.weight-editor input[type="range"] {
  flex: 1;
  min-width: 60px;
  accent-color: var(--blue);
}

.weight-editor input[type="number"] {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  font-family: var(--font-en);
}

.usage-cells {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.usage-cells span { color: var(--ink); }
.usage-hint {
  margin-top: 4px;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #b45309;
  white-space: normal;
  max-width: 220px;
}
.usage-na { color: var(--muted); }

.admin-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.admin-hub-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-hub-tab.is-active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}

.admin-hub-tab.hidden {
  display: none !important;
}

.cy-coins-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.cy-coins-note {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.cy-coins-search {
  margin-bottom: 10px;
}
.cy-coins-search-row,
.cy-coins-adjust-row {
  align-items: flex-end;
  gap: 10px;
}
.cy-coins-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  min-width: 0;
}
.cy-coins-field--grow {
  flex: 1 1 160px;
}
.cy-coins-field select,
.cy-coins-field input {
  font: inherit;
  font-weight: 500;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  min-height: 40px;
}
.cy-coins-result {
  margin-top: 14px;
}
.cy-coins-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.cy-coins-balance {
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 140px;
}
.cy-coins-balance-label {
  display: block;
  font-size: 0.78rem;
  color: #9a3412;
  font-weight: 600;
  margin-bottom: 4px;
}
.cy-coins-balance strong {
  font-size: 1.8rem;
  color: #c2410c;
  font-variant-numeric: tabular-nums;
}
.cy-coins-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 16px;
  margin: 0;
  flex: 1 1 240px;
}
.cy-coins-meta dt {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}
.cy-coins-meta dd {
  margin: 2px 0 0;
  font-size: 0.92rem;
  color: #0f172a;
}
.cy-coins-logs-title,
.cy-coins-adjust h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}
.cy-coins-adjust {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.cy-coins-adjust > .muted {
  margin: 0 0 12px;
  font-size: 0.86rem;
}
.cy-coins-logs-table td.mono,
.cy-coins-logs-table .mono {
  font-variant-numeric: tabular-nums;
}

.panel-card.fam-merchant-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 18px;
}

.fam-merchant-form-card {
  max-width: 920px;
}

.fam-merchant-list-card {
  margin-top: 16px;
}

.panel-card.fam-merchant-card h2,
.panel-card.fam-merchant-card .fam-list-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.fam-list-status {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.fam-merchant-note {
  margin: 0 0 16px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.fam-merchant-note code {
  font-size: 0.82em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
}

.fam-edit-banner {
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  margin: 0 0 16px;
  font-size: 0.88rem;
}

.fam-form-block {
  margin-bottom: 16px;
  padding: 14px 14px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.fam-form-block:last-of-type {
  margin-bottom: 12px;
}

.fam-form-section {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.01em;
}

.fam-field {
  margin-bottom: 12px;
}

.fam-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0;
}

.fam-field input,
.fam-field select,
.fam-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fam-field input::placeholder,
.fam-field textarea::placeholder {
  color: #94a3b8;
}

.fam-field input:focus,
.fam-field select:focus,
.fam-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.fam-field textarea {
  min-height: 72px;
  resize: vertical;
}

.fam-field select {
  cursor: pointer;
  appearance: auto;
}

.row-actions.fam-form-actions {
  margin-top: 4px;
  padding-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-grid .fam-field {
  margin-bottom: 12px;
}

.fam-span-2 {
  grid-column: 1 / -1;
}

.fam-vip-row {
  display: flex;
  align-items: stretch;
}

.fam-vip-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  cursor: pointer;
  font-size: 0.88rem;
  color: #1e3a8a;
}

.fam-vip-card input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.fam-vip-card strong {
  display: block;
  font-size: 0.88rem;
  color: #1e3a8a;
}

.fam-vip-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 400;
}

.req {
  color: #dc2626;
}

.fam-merch-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
}

.fam-merch-table {
  min-width: 920px;
  margin: 0;
}

.fam-merch-table th {
  background: #f8fafc;
  font-size: 0.78rem;
}

.fam-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .fam-span-2 {
    grid-column: auto;
  }
  .fam-merchant-form-card {
    max-width: none;
  }
}

.admin-users-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.admin-users-table .merchants-col,
.admin-users-table .machines-col {
  max-width: 220px;
  white-space: normal;
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-users-table td {
  vertical-align: top;
}

.admin-users-table .status-col,
.admin-users-table .actions-col {
  vertical-align: middle;
  white-space: nowrap;
}

.admin-users-table .actions-col {
  text-align: right;
  width: 1%;
  padding-left: 16px;
}

.admin-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.admin-dialog form {
  padding: 20px 18px 16px;
}

.admin-dialog h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.admin-dialog fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 14px 0;
  padding: 10px 12px 12px;
}

.admin-dialog legend {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 6px;
}

.au-modules-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.au-module-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.au-module-name {
  min-width: 72px;
  font-weight: 600;
}

.au-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.au-field-hint {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.au-vending-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.au-vending-section-title--spaced {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.au-vending-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 12px;
  align-items: start;
}

.au-vending-grid--single {
  grid-template-columns: 1fr;
}

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

.au-vending-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.au-vending-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.au-vending-field input[type="number"] {
  width: 100%;
  box-sizing: border-box;
}

.au-switch-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: linear-gradient(155deg, #f8fbff 0%, #eef4fc 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.au-switch-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent, #2563eb);
  cursor: pointer;
}

.au-switch-card strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

.au-switch-muted {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
}

.au-merchant-search,
.au-merchant-manual {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.fa-picker { position: relative; margin-top: 8px; }

.fa-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}

.fa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.8rem;
  color: #9a3412;
  white-space: nowrap;
}

.fa-chip--active {
  background: #ffedd5;
  border-color: #ea580c;
  box-shadow: 0 0 0 1px #ea580c;
  font-weight: 600;
}

.fa-chip button {
  padding: 0;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #fdba74;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.fa-picker-row input {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.fa-picker-drop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  margin-top: 4px;
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch;
}

/* 開啟時改 fixed，避免 .tech-feature-panel / .maint-feature-panel 的 overflow:hidden 裁切 */
.fa-picker-drop.fa-picker-drop--fixed {
  position: fixed;
  right: auto;
  margin-top: 0;
  z-index: 400;
}

.fa-picker-drop.hidden { display: none; }

.fa-picker-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  padding: 10px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fa-picker-opt:hover { background: #fff7ed; }

.dpp-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.dpp-chip button {
  background: #93c5fd;
}

.dpp-picker-opt:hover { background: #eff6ff; }

.au-merchant-search input,
.au-merchant-manual input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.au-merchant-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 28px;
}

.au-merchant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
}

.au-merchant-chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.ui-popup-dialog .ui-popup-body {
  padding: 20px 18px 16px;
}

.ui-popup-dialog h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.ui-popup-dialog p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}

.btn-sm-inline {
  width: auto;
  padding: 10px 18px;
}

.user-chip-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
}

.user-chip-btn:hover .user-avatar {
  box-shadow: 0 0 0 2px var(--blue);
}

.profile-dialog .profile-username {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.fab-export {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  font: inherit;
}

.fab-export.hidden {
  display: none !important;
}

.export-fmt-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.export-fmt-sheet.hidden {
  display: none !important;
}

.export-fmt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.export-fmt-panel {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.export-fmt-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.export-fmt-panel .export-fmt-hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.export-fmt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.export-fmt-grid button {
  width: 100%;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.export-fmt-grid button:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.export-fmt-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.export-fmt-cancel {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.btn-danger-outline {
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .user-meta { display: none; }
}

@media (max-width: 480px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

#view-vending {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
  padding: 0;
  margin: 0 -4px;
}

#vending-root {
  flex: 1;
  min-height: 0;
}

.ven-admin-hint.err {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
}

.ven-admin-hint.ok {
  color: #166534;
}

.vending-embed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.vending-embed-toolbar .vending-embed-status {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.vending-embed-status {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #334155;
  background: #e2e8f0;
}

.vending-embed-status.err {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.vending-embed-frame {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 80px);
  border: 0;
  border-radius: 12px;
  background: #f4f7fb;
}

.module-grid--ven {
  max-width: 920px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.module-grid--dpp {
  max-width: 560px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.ven-feature-panel {
  padding: 20px;
}

.ven-feature-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.ven-feature-head h2 {
  flex: 1 1 160px;
  margin: 0;
  font-size: 1.15rem;
}

.ven-soon-block {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--line, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.ven-soon-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.ven-soon-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.ven-soon-desc {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.ven-admin-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.ven-merchant-mount {
    margin-top: 8px;
  }
  .ven-merchant-mount #panel-card {
    border: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }
  .ven-merchant-mount .layout-body {
    padding: 0;
  }
  .ven-merchant-mount .card-fluid {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
  }

.ven-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.ven-admin-head h2 {
  flex: 1 1 160px;
}

.ven-admin-merchant-pick {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ven-merchant-fa-picker {
  min-width: 260px;
  max-width: 420px;
}

.ven-merchant-fa-picker .ven-field-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.ven-admin-merchant-pick > span:first-child {
  font-size: 0.75rem;
  color: var(--muted);
}

.ven-admin-merchant-pick select.ven-field {
  min-width: 220px;
}

.ven-merchant-scope {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}

.pay-week-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}

.pay-week-card h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.pay-week-card p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.pay-weekly-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.pay-weekly-lead {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.pay-weekly-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.pay-weekly-toolbar label {
  display: block;
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.pay-weekly-toolbar select {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}

.pay-week-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.pay-week-grid .lbl {
  color: var(--muted);
}

.pay-week-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pay-week-badge.settled {
  background: #dcfce7;
  color: #166534;
}

.pay-week-badge.unsettled {
  background: #fef9c3;
  color: #854d0e;
}

.pay-week-actions {
  margin-top: 4px;
}

#pay-weekly-ledger.hidden {
  display: none;
}

/* Pay ???? ? ?? pay/merchant Dashboard */
.pay-dash-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 20px;
}

.pay-dash-sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pay-dash-sheet-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.pay-dash-sheet-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pay-dash-sheet-controls label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.pay-dash-sheet-controls input[type="date"],
.pay-dash-sheet-controls input[type="month"] {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.85rem;
}

.pay-dash-follow-section {
  margin: 0 0 16px;
}

.pay-dash-follow-heading {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.pay-dash-follow-stack {
  display: grid;
  gap: 12px;
}

.pay-dash-follow-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.pay-dash-follow-card--alert {
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.05);
}

.pay-dash-follow-card-title {
  font-weight: 700;
  font-size: 15px;
}

.pay-dash-follow-card-meta {
  font-size: 13px;
  color: var(--muted);
}

.pay-dash-follow-btn {
  justify-self: start;
  width: auto;
}

.pay-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .pay-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pay-kpi {
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pay-kpi .t {
  font-size: 0.72rem;
  opacity: 0.92;
  font-weight: 600;
}

.pay-kpi .v {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 4px;
}

.pay-kpi .sub {
  font-size: 0.65rem;
  opacity: 0.85;
  margin-top: 2px;
}

.pay-kpi.c1 { background: linear-gradient(145deg, #8b5cf6, #6d28d9); }
.pay-kpi.c2 { background: linear-gradient(145deg, #22c55e, #15803d); }
.pay-kpi.c3 { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.pay-kpi.c4 { background: linear-gradient(145deg, #f97316, #c2410c); }
.pay-kpi.c5 { background: linear-gradient(145deg, #a855f7, #7e22ce); }
.pay-kpi.c6 { background: linear-gradient(145deg, #10b981, #047857); }
.pay-kpi.c7 { background: linear-gradient(145deg, #0ea5e9, #0369a1); }
.pay-kpi.c8 { background: linear-gradient(145deg, #ef4444, #b91c1c); }

.pay-chart-wrap {
  position: relative;
  min-height: 280px;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px 4px;
  background: #fafafc;
  overflow: hidden;
}

.pay-monthly-sheet .pay-kpi .sub.mom-up {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.pay-monthly-sheet .pay-kpi .sub.mom-down {
  color: rgba(255, 255, 255, 0.85);
  opacity: 0.95;
}

.pay-monthly-range {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.pay-monthly-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .pay-monthly-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pay-monthly-chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 8px;
  background: #fff;
}

.pay-monthly-chart-card--wide {
  grid-column: 1 / -1;
}

.pay-monthly-chart-card h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 800;
}

.pay-chart-wrap--tall {
  min-height: 300px;
  height: 300px;
}

.pay-chart-wrap--devices {
  min-height: 320px;
  height: 320px;
}

.pay-monthly-daily-table {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pay-monthly-daily-table h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.pay-monthly-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pay-monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.pay-monthly-table th,
.pay-monthly-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.pay-monthly-table th:first-child,
.pay-monthly-table td:first-child {
  text-align: left;
}

.pay-monthly-table thead th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--muted);
}

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

.pay-dash-stats-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.45;
}

.pay-recent-orders {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pay-recent-orders-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pay-recent-orders-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.pay-recent-orders-toast {
  flex: 1;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: #16a34a;
  min-height: 1em;
}

.pay-dash-empty {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 12px 0;
}

.pay-order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pay-order-card .machine {
  font-weight: 800;
  font-size: 0.92rem;
  flex: 1;
  min-width: 0;
}

.pay-order-card .amt {
  font-weight: 800;
  color: #16a34a;
  font-size: 1rem;
  flex-shrink: 0;
}

.pay-order-pay-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.pay-order-nos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}

.pay-order-no-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-order-no-row .lbl {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 64px;
}

.pay-order-no-row .val {
  flex: 1;
  font-size: 0.72rem;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pay-order-copy {
  flex-shrink: 0;
  border: none;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.pay-order-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pay-order-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.pay-order-st.done {
  color: #16a34a;
  font-weight: 700;
}

.pay-tab-h h3,
.pay-dev-hero h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.pay-tab-h .sub,
.pay-dev-hero .sub {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.pay-orders-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.pay-dev-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.pay-dev-card h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.pay-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pay-date-row input[type="date"] {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}

.pay-date-sep {
  font-size: 0.78rem;
  color: var(--muted);
}

.pay-search-wrap input,
.pay-dev-search-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.pay-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pay-filter-pill {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.pay-filter-pill.on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.pay-scene-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}

.pay-scene-pill {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
}

.pay-scene-pill.on {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.pay-orders-stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
}

.pay-orders-stat {
  text-align: center;
}

.pay-orders-stat .val {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.pay-orders-stat .lab {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
}

.pay-orders-stat-note {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .pay-orders-stats-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ord-orders-chart-section {
  margin: 14px 0 18px;
}

.ord-orders-chart-card .pay-chart-wrap {
  min-height: 240px;
  height: 240px;
}

.ord-orders-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}

.ord-orders-table {
  min-width: 960px;
}

.ord-orders-table.mstat-table {
  min-width: 1080px;
}

.ord-orders-table .cell-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.ord-orders-table .cell-nowrap {
  white-space: nowrap;
}

.ord-orders-table .ord-amt {
  font-weight: 700;
  white-space: nowrap;
}

.ord-st-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #475569;
}

.ord-st-badge.done {
  background: #dcfce7;
  color: #166534;
}

.ord-st-badge.warn {
  background: #fef9c3;
  color: #854d0e;
}

.ord-st-badge.bad {
  background: #fee2e2;
  color: #991b1b;
}

.ord-td-lab {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.tga-list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}

.tga-list-pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
}

.tga-list-pagination-size select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.tga-list-pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.tga-page-btn,
.tga-page-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  cursor: pointer;
}

.tga-page-btn:disabled,
.tga-page-num:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tga-page-num.on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 700;
}

.tga-page-nums {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.tga-page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
}

.tga-page-input {
  width: 64px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
}

.tga-page-go {
  height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.tga-list-pagination-info {
  margin-left: auto;
  font-size: 0.82rem;
  color: #64748b;
}

.fa-chip--all {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  font-weight: 700;
}

.ord-merchant-all-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ord-merchant-all-btn.on,
.ord-merchant-all-btn:disabled {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  cursor: default;
}

#pay-merchant-pick .fa-picker-row,
#ven-merchant-pick .fa-picker-row,
#orders-merchant-pick .fa-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pay-merchant-pick .fa-picker-row input[type="search"],
#ven-merchant-pick .fa-picker-row input[type="search"],
#orders-merchant-pick .fa-picker-row input[type="search"] {
  flex: 1;
  min-width: 0;
}

@media (max-width: 720px) {
  .tga-list-pagination-info {
    margin-left: 0;
    width: 100%;
  }
}

.pay-game-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.pay-game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.pay-game-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  flex: 1;
}

.pay-game-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.pay-game-badge.ok { background: #dcfce7; color: #15803d; }
.pay-game-badge.warn { background: #fef9c3; color: #a16207; }
.pay-game-badge.bad { background: #fee2e2; color: #b91c1c; }
.pay-game-badge.neu { background: #f1f5f9; color: #475569; }

.pay-game-pay-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.pay-game-loc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.pay-game-coin-msg {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.pay-game-coin-msg.ok { color: #15803d; }
.pay-game-coin-msg.bad { color: #b91c1c; }

.dash-retry-badge {
  display: inline-block;
  min-width: 1.6rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.82rem;
  text-align: center;
}

.pay-game-retry-count {
  font-weight: 700;
  color: #b91c1c;
}

.pay-game-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.pay-game-card-foot .amt {
  color: #16a34a;
  font-weight: 800;
}

.pay-dev-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.pay-dev-sum-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.pay-dev-sum-head h4 {
  margin: 0;
  font-size: 0.9rem;
}

.pay-dev-sum-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.pay-dev-sum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pay-dev-sum-tile {
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  min-height: 64px;
}

.pay-dev-sum-tile .lab {
  display: block;
  font-size: 0.68rem;
  opacity: 0.9;
}

.pay-dev-sum-tile .num {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  margin-top: 4px;
}

.pay-dev-sum-tile.g { background: linear-gradient(145deg, #22c55e, #15803d); }
.pay-dev-sum-tile.p { background: linear-gradient(145deg, #a855f7, #7e22ce); }
.pay-dev-sum-tile.b { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.pay-dev-sum-tile.y { background: linear-gradient(145deg, #f97316, #c2410c); }

.pay-dev-sum-split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.pay-dev-sum-split .sl {
  color: var(--muted);
  margin-right: 6px;
}

.pay-dev-sum-split .sv {
  font-weight: 700;
}

.pay-dev-sum-split .sv.g { color: #16a34a; }
.pay-dev-sum-split .sv.b { color: #2563eb; }

.pay-dev-trend-chart-wrap {
  position: relative;
  height: 260px;
  margin-top: 8px;
}

.pay-dev-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--muted);
}

.pay-dev-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.pay-dev-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.pay-dev-device-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.pay-dev-device-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pay-dev-device-name {
  font-weight: 800;
  font-size: 0.92rem;
}

.pay-dev-idx-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

.pay-dev-loc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.pay-dev-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 10px;
  font-size: 0.72rem;
}

.pay-dev-cell .lb {
  display: block;
  color: var(--muted);
}

.pay-dev-cell .val {
  font-weight: 700;
}

.pay-dev-cell .val.red { color: #dc2626; }
.pay-dev-cell .val.green { color: #16a34a; }
.pay-dev-cell .val.blue { color: #2563eb; }

button.pay-dev-idx-badge {
  font: inherit;
  cursor: pointer;
  border: none;
}

.pay-dev-go-detail-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: #6366f1;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.pay-dev-more {
  margin-top: 8px;
}

.pay-dev-detail-panel.hidden {
  display: none;
}

.pay-dev-detail-hero {
  background: linear-gradient(120deg, #4c1d95, #5b21b6, #2563eb);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.pay-dev-detail-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pay-dev-detail-hero-titles {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.pay-dev-detail-hero-titles h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pay-dev-detail-hero-spacer {
  width: 40px;
  flex-shrink: 0;
}

.pay-dev-back-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.pay-dev-back-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.pay-dev-detail-device-line {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.pay-dev-detail-date-lab {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.pay-dev-detail-date-input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.pay-dev-kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.pay-dev-kpi-mini {
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 6px;
}

.pay-dev-kpi-mini .t {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}

.pay-dev-kpi-mini .v {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.pay-dev-kpi-mini .v.red { color: #dc2626; }
.pay-dev-kpi-mini .v.blue { color: #2563eb; }
.pay-dev-kpi-mini .v.orange { color: #ea580c; }

.pay-dev-detail-chart-wrap {
  height: 200px;
}

.pay-dev-detail-split {
  margin-bottom: 10px;
}

.pay-dev-slot-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.pay-dev-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.pay-dev-slot-time {
  font-weight: 800;
  font-size: 0.88rem;
}

.pay-dev-slot-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.pay-dev-slot-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

.pay-dev-slot-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.68rem;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.pay-dev-slot-split .row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.pay-dev-slot-split .lb {
  color: var(--muted);
}

.pay-dev-slot-split .sv {
  font-weight: 800;
}

.pay-dev-slot-split .sv.g { color: #15803d; }
.pay-dev-slot-split .sv.b { color: #2563eb; }

@media (max-width: 720px) {
  .pay-dev-kpi-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .pay-dev-sum-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Vending ??????? vending/merchant input/select? */
.ven-feature-panel .ven-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9d7ee;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
  font: inherit;
  background: #fff;
  color: var(--ink, #15213b);
}

.ven-feature-panel select.ven-field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360708f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: #fff;
}

.ven-feature-panel input[type="date"].ven-field {
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
  min-width: 0;
  background-clip: padding-box;
  color-scheme: light;
}

.ven-feature-panel input[type="date"].ven-field::-webkit-calendar-picker-indicator {
  opacity: 0.95;
  margin-inline: 0 4px;
  cursor: pointer;
}

.ven-field-label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, #60708f);
  margin: 0;
  min-width: 0;
}

.ven-btn-secondary {
  background: #e6edfa;
  color: #254179;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  min-width: 92px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

a.ven-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.ven-btn-secondary:hover {
  background: #d6e4f7;
}

.ven-admin-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ven-admin-kpi {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.ven-admin-kpi .v {
  font-size: 1.35rem;
  font-weight: 700;
}

.ven-admin-kpi .l {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.ven-admin-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.ven-admin-table-wrap {
  overflow: auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ven-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ven-admin-table th,
.ven-admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.ven-admin-table th {
  background: #f1f5f9;
  font-weight: 600;
}

.ven-admin-list--hscroll .ven-admin-table {
  min-width: 720px;
}

@media (max-width: 720px) {
  .ven-admin-kpis {
    grid-template-columns: 1fr;
  }
}

.ven-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ven-dash-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1 1 200px;
}

.ven-dash-controls {
  display: grid;
  grid-template-columns: 170px 110px auto auto;
  gap: 10px;
  align-items: end;
}

.ven-dash-controls .ven-field-label {
  min-width: 0;
}

.ven-dash-controls .ven-btn-secondary {
  align-self: end;
}

@media (max-width: 720px) {
  .ven-dash-controls {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ven-dash-controls {
    grid-template-columns: 1fr;
  }

  .ven-dash-controls .ven-btn-secondary {
    width: 100%;
  }
}

.ven-dash-controls label.ven-field-label input,
.ven-dash-controls label.ven-field-label select {
  width: 100%;
}

.ven-list-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.ven-list-filter-row .ven-field-label {
  flex: 1 1 180px;
  min-width: 140px;
}

.ven-hscroll-wrap {
  overflow: auto;
  width: 100%;
  border: 1px solid #c9d7ee;
  border-radius: 10px;
  background: #fff;
}

.ven-hscroll-wrap.ven-list-view--hscroll .ven-ledger-table {
  min-width: 960px;
  width: max-content;
}

.ven-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ven-ledger-table th,
.ven-ledger-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e8eef7;
  text-align: left;
  vertical-align: top;
}

.ven-ledger-table th {
  background: #f3f6fb;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.ven-ledger-table tbody tr:hover {
  background: #f8fbff;
}

.ven-ledger-table .prod-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.ven-ledger-table .cell-break {
  word-break: break-word;
  max-width: 220px;
}

.ven-muted {
  color: var(--muted, #60708f);
}

.ven-dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .ven-dash-charts {
    grid-template-columns: 1fr;
  }
}

.ven-dash-chart-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.ven-dash-chart-card h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink);
}

.ven-dash-block-title {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.ven-dash-status-filter {
  margin: 0 0 12px;
}

.ven-dash-trend-table {
  width: 100%;
  max-width: 32rem;
}

.ven-chart-wrap {
  height: 220px;
  position: relative;
}

.ven-list-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.ven-list-filter input[type="search"],
.ven-list-filter select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: min(280px, 100%);
}

.ven-feature-panel .hidden {
  display: none !important;
}

.ven-btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  min-width: 92px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.ven-btn-primary:hover {
  background: #1d4ed8;
}

.ven-btn-xs {
  min-height: 32px;
  min-width: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.ven-orders-filter {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.ven-orders-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .ven-orders-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ven-orders-filter {
    grid-template-columns: 1fr;
  }
}

.ven-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ven-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.ven-badge-done {
  background: #d1fae5;
  color: #065f46;
}

.ven-badge-other {
  background: #e2e8f0;
  color: #334155;
}

.ven-settle-next {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
}

.ven-sync-block {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.ven-sync-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.ven-textarea {
  width: 100%;
  min-height: 140px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #c9d7ee;
  border-radius: 10px;
  resize: vertical;
  box-sizing: border-box;
}

.ven-field-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ?? ???????? pay/merchant ????? ?? */
.module-grid--maint {
  max-width: 560px;
}

.maint-feature-panel.card-panel {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #4f7cff 0%, #5b6cf0 38%, var(--bg, #f1f5f9) 38%);
}

.maint-feature-panel .ven-feature-head {
  margin: 0;
  padding: 16px 20px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.maint-feature-panel #maint-feature-body {
  min-height: 280px;
}

.pwd-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .pwd-sheet {
    align-items: center;
    padding: 24px 16px;
  }
}

.pwd-sheet.hidden {
  display: none !important;
}

.pwd-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.pwd-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(92vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 18px 16px;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .pwd-sheet-panel {
    border-radius: 16px;
    padding: 20px 18px;
  }
}

.pwd-sheet-panel h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.pwd-sheet-panel label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.pwd-sheet-panel input[type="text"],
.pwd-sheet-panel input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
}

.pwd-sheet-panel textarea,
.pwd-sheet-panel select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
}

.pwd-sheet-panel textarea {
  min-height: 72px;
  resize: vertical;
}

.ven-prod-form-panel {
  max-width: 480px;
}

/* ??? ? ?????????? vs ???? */
.ven-cab-prod-readonly-block {
  margin: 0 0 14px;
  padding: 12px 12px 4px;
  background: #eef2f7;
  border: 1px solid #d1dae6;
  border-radius: 12px;
}

.ven-cab-prod-section-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.ven-cab-prod-readonly-block label {
  margin-top: 8px;
  font-weight: 600;
  color: #64748b;
}

.ven-cab-prod-form-panel .ven-field-readonly,
.pwd-sheet-panel input.ven-field-readonly {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
  cursor: default;
  box-shadow: none;
}

.ven-cab-prod-form-panel .ven-field-readonly:focus,
.pwd-sheet-panel input.ven-field-readonly:focus {
  outline: none;
  border-color: #cbd5e1;
  box-shadow: none;
}

.ven-cab-prod-editable-block {
  padding: 12px;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 12px;
}

.ven-cab-prod-editable-label {
  margin: 0 0 8px !important;
  color: #166534 !important;
  font-weight: 700 !important;
}

.ven-cab-prod-editable-block .ven-field-editable {
  background: #fff;
  border-color: #22c55e;
  font-weight: 600;
}

.ven-cab-prod-editable-block .ven-field-editable:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.ven-prod-image-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ven-prod-image-controls input#ven-prod-image {
  flex: 1;
  min-width: 140px;
}

.ven-prod-image-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

.ven-prod-image-preview {
  margin-top: 8px;
}

.ven-prod-preview-img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  object-fit: contain;
}

.pwd-sheet-status {
  min-height: 22px;
  font-size: 0.82rem;
  color: var(--err, #dc2626);
  margin: 8px 0 0;
}

.pwd-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.pwd-sheet-actions .ven-btn-primary {
  flex: 1;
}

.maint-config-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 12px 0;
  border-top: 1px solid #eef0f4;
}

.maint-config-switch-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
}

.maint-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  margin: 0;
}

.maint-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.maint-switch-track {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.maint-switch-track::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.maint-switch input:checked + .maint-switch-track {
  background: #3b82f6;
}

.maint-switch input:checked + .maint-switch-track::before {
  transform: translateX(22px);
}

.maint-switch input:focus-visible + .maint-switch-track {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.maint-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px 28px;
}

.maint-wrap--wide {
  max-width: 1180px;
}

.maint-hero-sub {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.85;
  line-height: 1.45;
}

.maint-hero {
  padding: 8px 4px 18px;
  color: #fff;
}

.maint-hero h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.maint-search-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  margin-bottom: 12px;
}

.maint-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.maint-search-row input {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: 0.88rem;
}

.maint-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.maint-stat {
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.maint-stat .num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.maint-stat .num.blue {
  color: #2563eb;
}

.maint-stat .num.red {
  color: #dc2626;
}

.maint-stat .lab {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.maint-list-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.tga-list-toolbar,
.maint-list-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.tga-list-view-toggle,
.maint-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: #f1f5f9;
  border-radius: 999px;
}

.tga-list-view-pill,
.maint-view-pill {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  color: #64748b;
}

.tga-list-view-pill.on,
.maint-view-pill.on {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.tga-list-host--cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tga-list-host--cards .maint-device-card,
.tga-list-host--cards .pay-order-card,
.tga-list-host--cards .pay-game-card,
.tga-list-host--cards .pay-dev-device-card,
.tga-list-host--cards .ven-list-card,
.tga-list-host--cards .maint-ven-card {
  margin-bottom: 0;
}

.ven-list-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line, #e2e8f0);
}

.ven-list-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.ven-list-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.35;
}

.ven-list-card-sub {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.ven-list-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.82rem;
}

.ven-list-card-grid .lbl {
  display: block;
  font-size: 0.68rem;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.ven-list-card-grid .val {
  font-weight: 700;
  color: #0f172a;
}

.maint-devices-table-wrap {
  margin-bottom: 0;
}

.maint-devices-table {
  min-width: 1100px;
}

.maint-table-maint.ok {
  color: #15803d;
  font-weight: 600;
}

.maint-table-maint.warn {
  color: #b45309;
  font-weight: 600;
}

.maint-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.maint-row-btn {
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.maint-row-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.maint-row-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.maint-row-btn.btn-maint-config {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.maint-row-btn.btn-maint-query {
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
}

.maint-row-btn.btn-maint-test-coin {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.maint-device-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line, #e2e8f0);
}

.maint-device-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.maint-device-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.35;
}

.maint-device-id {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.maint-online-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.maint-online-badge.on {
  background: #dbeafe;
  color: #1d4ed8;
}

.maint-online-badge.off {
  background: #f1f5f9;
  color: #64748b;
}

.maint-online-badge.warn {
  background: #fef3c7;
  color: #b45309;
}

.maint-online-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.settle-rental-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  margin-right: 4px;
  vertical-align: middle;
}

.maint-ven-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.tga-list-host--cards.maint-ven-cards {
  display: grid;
}

.maint-ven-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.maint-ven-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.maint-ven-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.maint-ven-card-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  word-break: break-all;
}

.maint-ven-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-bottom: 12px;
}

.maint-ven-card-grid .lbl {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin-bottom: 2px;
}

.maint-ven-card-grid .val {
  display: block;
  font-size: 0.82rem;
  color: #0f172a;
  word-break: break-word;
}

.maint-ven-card-actions {
  display: flex;
  justify-content: flex-end;
}

.cab-csv-import {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}

.cab-csv-import p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.cab-csv-import-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cab-csv-import-row input[type="file"] {
  max-width: 100%;
  font-size: 13px;
}

.tech-ven-csv-dry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.tech-ven-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.maint-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.maint-kv {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.maint-kv .ico {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.maint-kv .lbl {
  color: var(--muted, #64748b);
  font-size: 0.68rem;
  display: block;
}

.maint-kv .val {
  font-weight: 700;
  color: #0f172a;
}

.maint-kv .val.price {
  color: #dc2626;
}

.maint-kv .val.ok {
  color: #16a34a;
}

.maint-kv .val.warn {
  color: #ca8a04;
}

.maint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.maint-actions > button {
  flex: 1 1 calc(50% - 5px);
  min-width: 7.5rem;
  font: inherit;
}

.btn-maint-config {
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  cursor: pointer;
}

.btn-maint-query {
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  cursor: pointer;
}

.btn-maint-query:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-maint-test-coin {
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #92400e;
  background: #fffbeb;
  cursor: pointer;
}

.btn-maint-test-coin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.maint-test-coin-hint {
  font-size: 0.78rem;
  margin: 0 0 10px;
  color: var(--muted, #64748b);
}

.maint-test-coin-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.maint-test-coin-amount-row input {
  width: 100px;
  margin: 0;
}

.maint-test-coin-result {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.maint-test-coin-result.hidden {
  display: none;
}

.maint-test-coin-result.ok {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #86efac;
}

.maint-test-coin-result.bad {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.maint-status-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.maint-status-overlay.hidden {
  display: none !important;
}

.maint-status-panel {
  background: #f1f5f9;
  border-radius: 16px;
  width: min(420px, 100%);
  max-height: min(85vh, 640px);
  overflow-y: auto;
  padding: 16px 14px 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
}

.maint-status-panel h4 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
}

.maint-status-section {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.maint-status-section h5 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.maint-status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
}

.maint-status-row:last-child {
  border-bottom: none;
}

.maint-status-row .k {
  color: #64748b;
  flex-shrink: 0;
}

.maint-status-row .v {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  color: #0f172a;
}

.maint-status-err {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.maint-status-signal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}

.maint-status-signal .sig-dbm {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.maint-status-signal .sig-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.maint-status-signal .sig-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.maint-status-signal.maint-signal--strong .sig-pill {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.maint-status-signal.maint-signal--strong .sig-pill::before {
  background: #10b981;
}

.maint-status-signal.maint-signal--normal .sig-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.maint-status-signal.maint-signal--normal .sig-pill::before {
  background: #3b82f6;
}

.maint-status-signal.maint-signal--weak .sig-pill {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
}

.maint-status-signal.maint-signal--weak .sig-pill::before {
  background: #f59e0b;
}

.maint-status-signal.maint-signal--poor .sig-pill {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.maint-status-signal.maint-signal--poor .sig-pill::before {
  background: #ef4444;
}

.maint-status-signal.maint-signal--unknown .sig-pill {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.maint-status-signal.maint-signal--unknown .sig-pill::before {
  background: #94a3b8;
}

.maint-status-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.maint-status-total-card {
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.maint-status-total-card.coins {
  background: #ecfdf5;
  border: 1px solid #86efac;
}

.maint-status-total-card.ship {
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.maint-status-total-card .tl {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
}

.maint-status-total-card .tn {
  font-size: 1.05rem;
  font-weight: 800;
}

.maint-status-total-card.coins .tn {
  color: #047857;
}

.maint-status-total-card.ship .tn {
  color: #b45309;
}

.maint-status-panel .btn-maint-query {
  width: 100%;
  margin-top: 12px;
}

.tech-embed-frame {
  width: 100%;
  min-height: calc(100vh - 140px);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: #f8fafc;
}

/* ?? ??????? UI? ?? */
.module-icon.dpp { background: linear-gradient(145deg, #8b5cf6, #7c3aed); }
.module-icon.maint { background: linear-gradient(145deg, #4f7cff, #5b6cf0); }
.module-icon.tech { background: linear-gradient(145deg, #0ea5e9, #0284c7); }

.module-grid--tech {
  max-width: 920px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.tga-feature-head {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.tga-feature-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tga-feature-titles h2 {
  margin: 0;
  font-size: 1.15rem;
}

.tga-feature-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.tga-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tga-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tga-subnav-btn.active {
  background: var(--accent, #2563eb);
  border-color: transparent;
  color: #fff;
}

.tga-subnav-glyph {
  font-size: 1.05rem;
  line-height: 1;
}

.tga-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tga-action-glyph {
  font-size: 0.85rem;
  line-height: 1;
}

.maint-row-btn.btn-tech-edit {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.maint-row-btn.btn-tech-batch {
  color: #7c3aed;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.maint-row-btn.btn-tech-maint {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.gp-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.gp-action-group .gp-row-btn {
  box-sizing: border-box;
  min-height: 26px;
  padding: 5px 8px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
}

.btn-gp-query.gp-row-btn {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #fff;
  border: none;
}

.btn-gp-probe.gp-row-btn {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border: none;
}

.btn-gp-edit.gp-row-btn,
.btn-gs-edit.gp-row-btn,
.btn-gs-detail.gp-row-btn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.btn-gp-batch-row.gp-row-btn {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.btn-gp-batch-maint-row.gp-row-btn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.gp-action-group .gp-row-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gp-filter-card {
  background: #fafafa;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.gp-probe-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  font-size: 0.85rem;
}

.gp-probe-settings-row label {
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
}

.gp-probe-settings-row input[type="number"] {
  width: 72px;
  margin: 0;
}

.gp-probe-settings-row .muted {
  flex: 1 1 200px;
  margin: 0;
  font-size: 0.78rem;
}

.gp-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gp-filter-row label {
  margin: 0;
  font-weight: 700;
}

.gp-filter-row select {
  flex: 1;
  min-width: 160px;
  margin: 0;
}

.gp-gateway-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.gp-gateway-picker-search {
  margin: 0;
  width: 100%;
}

.gp-gateway-picker-select {
  margin: 0;
  width: 100%;
  max-height: 10rem;
}

.pwd-sheet-panel .gp-gateway-picker-select {
  min-height: 7.5rem;
}

.gp-gateway-scan-row {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
}

.gp-scan-gateway-btn {
  border-color: #4f46e5;
  color: #4f46e5;
  flex-shrink: 0;
  white-space: nowrap;
}

.gp-search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.gp-search-row input {
  margin: 0;
  flex: 1;
}

.tech-probe-pick {
  cursor: pointer;
}

.tech-probe-pick.selected {
  background: #eff6ff;
}

.tech-probe-loc {
  max-width: 12rem;
  word-break: break-word;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}

.tech-hw-hero-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.tech-hw-hero-title h3 {
  margin: 0 0 4px;
}

.tech-hw-hero-title .sub {
  margin: 0;
}

.tech-feature-panel.card-panel {
  padding: 0;
  overflow: hidden;
  background: var(--bg, #f1f5f9);
}

.tech-feature-panel .ven-feature-head {
  margin: 0;
  padding: 16px 20px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line, #e2e8f0);
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.tech-feature-panel .ven-feature-head h2 {
  flex: none;
  margin: 0;
}

.tech-merchant-bar {
  width: 100%;
}

.tech-merchant-bar .fa-picker {
  max-width: none;
}

.tech-merchant-bar .ven-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
}

.tech-feature-panel #tech-feature-body {
  padding: 16px 20px 24px;
}

.tech-feature-inner {
  max-width: none;
}

.tech-feature-panel .tech-feature-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.tech-cy-recharge-wrap .tech-feature-desc {
  margin-bottom: 12px;
}
.tech-cy-recharge-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}
.tech-cy-recharge-table .mono {
  font-variant-numeric: tabular-nums;
}
.tech-cy-st {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.tech-cy-st--ok {
  background: #dcfce7;
  color: #166534;
}
.tech-cy-st--pending {
  background: #ffedd5;
  color: #9a3412;
}
.tech-cy-st--bad {
  background: #fee2e2;
  color: #991b1b;
}
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.tech-search-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  margin-bottom: 12px;
}

.tech-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tech-search-row input[type="search"],
.tech-search-row input[type="text"] {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: 0.88rem;
}

.tech-search-row select {
  flex: 0 1 auto;
  min-width: 108px;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: 0.88rem;
  background: #fff;
}

.tech-search-row .ven-btn-secondary {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tech-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tech-subnav button.active {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: transparent;
}

.tech-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.tech-file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.tech-hw-shell {
  margin: -16px -20px -24px;
}

.tech-hw-hero {
  background: linear-gradient(180deg, #4f46e5 0%, #6366f1 100%);
  padding: 16px 20px 18px;
  color: #fff;
}

.tech-hw-hero h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.tech-hw-hero .sub {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
}

.tech-hw-scope-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.tech-hw-scope-row select {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
}

.tech-hw-panel {
  padding: 16px 20px 24px;
  background: var(--bg, #f1f5f9);
}

.tech-hw-hint {
  margin: 0 0 12px;
  font-size: 0.84rem;
}

.tech-hw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}

.tech-hw-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.tech-hw-form input,
.tech-hw-form textarea,
.tech-hw-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font: inherit;
  background: #fff;
}

.tech-hw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .tech-hw-form-row {
    grid-template-columns: 1fr;
  }
}

.tech-hw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-hw-gateway-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tech-hw-gateway-row input {
  flex: 1;
  min-width: 0;
}

.tech-hw-scan-gw-btn {
  flex: 0 0 auto;
  min-width: 44px;
  padding-inline: 12px;
}

.tech-anomaly-wrap .tech-search-row label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  flex: 0 0 auto;
}

.tech-anomaly-wrap .tech-search-row input.tech-anomaly-date {
  flex: 0 1 148px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: 0.88rem;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.tech-anomaly-wrap .tech-search-row #tech-anomaly-event-filter {
  flex: 1 1 180px;
  min-width: 140px;
}

.tech-anomaly-wrap .tech-search-row #tech-anomaly-search {
  flex: 1 1 220px;
}

.tech-anomaly-hint {
  margin: -4px 0 12px;
  font-size: 0.68rem;
}

.tech-anomaly-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
}

.tech-anomaly-table-wrap .tech-anomaly-table,
.tech-anomaly-table-wrap .ven-ledger-table.tech-anomaly-table {
  min-width: 980px;
  width: 100%;
  margin: 0;
  border: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.tech-anomaly-table th,
.tech-anomaly-table td {
  padding: 6px 8px;
  font-size: 0.72rem;
  vertical-align: top;
}

.tech-anomaly-table th {
  font-size: 0.7rem;
  white-space: nowrap;
}

.tech-anomaly-cell-time {
  white-space: nowrap;
  font-size: 0.7rem;
}

.tech-anomaly-cell-type {
  white-space: nowrap;
}

.tech-anomaly-cell-mono {
  word-break: break-all;
  font-size: 0.68rem;
  max-width: 11rem;
}

.tech-anomaly-cell-summary {
  max-width: 14rem;
  word-break: break-word;
}

.tech-anomaly-cell-detail {
  font-size: 0.65rem;
  color: var(--muted, #64748b);
  max-width: 12rem;
  word-break: break-all;
}

.tech-anomaly-sev {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.tech-anomaly-sev.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.tech-anomaly-sev.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.tech-anomaly-sev.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.tech-anomaly-chart-card {
  margin: 12px 0 14px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.tech-anomaly-hotspot-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e2e8f0);
}

.tech-anomaly-hotspot-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

.tech-anomaly-hotspot-table {
  font-size: 0.82rem;
}

.tech-anomaly-chart-head h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
}

.tech-anomaly-chart-head p {
  margin: 0 0 10px;
  font-size: 0.72rem;
}

.tech-anomaly-device-chart {
  position: relative;
  min-height: 200px;
}

.tech-anomaly-chart-y-label {
  position: absolute;
  left: 0;
  top: 8px;
  font-size: 0.65rem;
  color: var(--muted, #64748b);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.tech-anomaly-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 190px;
  padding: 8px 8px 4px 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.tech-anomaly-chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 42px;
  flex: 0 0 auto;
  height: 170px;
  cursor: default;
}

.tech-anomaly-chart-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  line-height: 1;
}

.tech-anomaly-chart-col {
  width: 28px;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.tech-anomaly-chart-x {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tech-anomaly-wrap .tech-search-row label {
    flex: 0 0 2.4em;
  }

  .tech-anomaly-wrap .tech-search-row input.tech-anomaly-date,
  .tech-anomaly-wrap .tech-search-row #tech-anomaly-event-filter,
  .tech-anomaly-wrap .tech-search-row #tech-anomaly-search {
    flex: 1 1 100%;
    width: 100%;
  }

  .tech-anomaly-wrap .tech-search-row #btn-tech-anomaly-query,
  .tech-anomaly-wrap .tech-search-row #btn-tech-anomaly-search {
    width: 100%;
  }
}

.tech-qr-wrap .tech-qr-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tech-qr-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.tech-qr-field input[type="url"] {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: 0.88rem;
  box-sizing: border-box;
}

.tech-qr-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.tech-qr-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.88rem;
  cursor: pointer;
}

.tech-qr-checks input {
  margin: 0;
}

/* ========== DPP 機台管理 ========== */
.tech-feature-panel.card-panel:has(.tech-dpp-machines) {
  overflow: visible;
}

.tech-feature-panel:has(.tech-dpp-machines) #tech-feature-body {
  padding: 12px 14px 20px;
  overflow-x: clip;
  min-width: 0;
}

.tech-dpp-machines {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.tech-dpp-machines .tech-dpp-mach-tabs {
  display: none;
}

.tech-dpp-machines .tech-dpp-mach-page {
  display: grid;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
}

.tech-dpp-machines .tech-dpp-mach-pane {
  min-width: 0;
}

.tech-dpp-machines .tech-dpp-gp-hero h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.tech-dpp-machines .tech-dpp-gp-panel {
  border: 1px solid var(--border, #dbe6f8);
  border-radius: 14px;
  background: var(--surface, #fff);
  padding: 12px 14px;
  min-width: 0;
  max-width: 100%;
}

.tech-dpp-machines .tech-dpp-filter-card {
  margin-bottom: 10px;
}

.tech-dpp-machines .tech-dpp-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.tech-dpp-machines .tech-dpp-filter-status-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 110px;
}

.tech-dpp-machines .tech-dpp-filter-status-wrap > span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.tech-dpp-machines .tech-dpp-search-row {
  display: flex;
  flex: 1 1 200px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.tech-dpp-machines .tech-dpp-filter-status-wrap select,
.tech-dpp-machines .tech-dpp-search-row input,
.tech-dpp-machines .tech-dpp-mach-field input:not([type="checkbox"]),
.tech-dpp-machines .tech-dpp-mach-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #c9d7ee;
  background: #fff;
  font-size: 16px;
  line-height: 1.25;
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
}

.tech-dpp-machines .tech-dpp-filter-status-wrap select,
.tech-dpp-machines .tech-dpp-mach-field select {
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.tech-dpp-machines .tech-dpp-search-row input {
  flex: 1 1 auto;
  width: auto;
}

.tech-dpp-machines .tech-dpp-search-row .ven-btn-secondary {
  flex: 0 0 auto;
  height: 40px;
  min-height: 40px;
  white-space: nowrap;
}

.tech-dpp-machines .tech-dpp-mach-scroll-hint {
  margin: 0 0 8px;
  font-size: 0.78rem;
}

.tech-dpp-machines .tech-dpp-mach-list-scroll {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden; /* 強制表格不撐開外層頁面 */
}

.tech-dpp-machines .tech-dpp-mach-list-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  width: 100%;
  border: 1px solid #e2e9f6;
  border-radius: 12px;
  background: #fff;
}

.tech-dpp-machines .tech-dpp-mach-table {
  min-width: 860px;
  width: max-content;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.tech-dpp-machines .tech-dpp-mach-table th,
.tech-dpp-machines .tech-dpp-mach-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.tech-dpp-machines .tech-dpp-mach-shop-cell {
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-dpp-machines .tech-dpp-mach-device-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-dpp-machines .tech-dpp-mach-address-cell {
  white-space: normal;
  word-break: break-word;
  max-width: 240px;
  min-width: 160px;
  font-size: 0.85rem;
  line-height: 1.35;
}

.tech-dpp-machines .tech-dpp-mach-action-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 4px 0 8px -4px rgba(15, 23, 42, 0.18);
}

.tech-dpp-machines .tech-dpp-mach-table thead .tech-dpp-mach-action-cell {
  z-index: 3;
  background: #f8fafc;
}

.tech-dpp-machines .tech-dpp-mach-action-cell .maint-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
}

.tech-dpp-machines .tech-dpp-dev-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tech-dpp-machines .tech-dpp-dev-pill--on {
  background: #dcfce7;
  color: #166534;
}

.tech-dpp-machines .tech-dpp-dev-pill--off {
  background: #f1f5f9;
  color: #64748b;
}

.tech-dpp-machines .tech-dpp-mach-forms-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  min-width: 0;
}

@media (min-width: 960px) {
  .tech-feature-panel:has(.tech-dpp-machines) #tech-feature-body {
    padding: 16px 20px 24px;
  }

  .tech-dpp-machines .tech-dpp-mach-forms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.tech-dpp-machines .tech-dpp-mach-panel {
  border: 1px solid var(--border, #dbe6f8);
  border-radius: 14px;
  background: var(--surface, #fff);
  padding: 14px 16px;
  min-width: 0;
}

.tech-dpp-machines .tech-dpp-mach-panel--muted {
  background: var(--surface-2, #f8fafc);
}

.tech-dpp-machines .tech-dpp-mach-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8896b5;
}

.tech-dpp-machines .tech-dpp-mach-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.tech-dpp-machines .tech-dpp-mach-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
}

.tech-dpp-machines .tech-dpp-mach-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
}

.tech-dpp-machines .tech-dpp-mach-field-label {
  font-size: 12px;
  font-weight: 700;
  color: #51658e;
}

.tech-dpp-machines .tech-dpp-mach-field-split {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .tech-dpp-machines .tech-dpp-mach-field-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tech-dpp-machines .tech-dpp-mach-check-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9d7ee;
  border-radius: 10px;
  background: #f8fafc;
  writing-mode: horizontal-tb;
  white-space: normal;
}

.tech-dpp-machines .tech-dpp-mach-check-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-height: none;
  margin: 0;
  appearance: auto;
  -webkit-appearance: checkbox;
}

.tech-dpp-machines .tech-dpp-mach-check-row > span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  writing-mode: horizontal-tb;
}

.tech-dpp-machines .tech-dpp-mach-field--map {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1;
}

.tech-dpp-machines .tech-dpp-mach-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.tech-dpp-machines .tech-dpp-mach-actions .ven-btn-primary,
.tech-dpp-machines .tech-dpp-mach-actions .ven-btn-secondary {
  width: 100%;
  min-height: 44px;
}

@media (min-width: 480px) {
  .tech-dpp-machines .tech-dpp-mach-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tech-dpp-machines .tech-dpp-mach-actions .ven-btn-primary,
  .tech-dpp-machines .tech-dpp-mach-actions .ven-btn-secondary {
    width: auto;
    flex: 1 1 auto;
  }
}

.tech-dpp-machines #tech-dpp-mach-status {
  margin-top: 10px;
}

.tech-dpp-machines #tech-dpp-mach-status.is-error {
  color: #b91c1c;
}

.tech-dpp-machines #tech-dpp-mach-list-status {
  margin-top: 10px;
  font-size: 0.85rem;
}

/* 手機：分頁 + 緊湊篩選 + 可橫滑列表 */
@media (max-width: 768px) {
  .tech-feature-panel.card-panel:has(.tech-dpp-machines) {
    overflow: visible;
  }

  .tech-feature-panel:has(.tech-dpp-machines) #tech-feature-body {
    padding: 8px 10px 24px;
    overflow-x: clip;
    min-width: 0;
  }

  .tech-dpp-machines .tech-dpp-mach-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg, #f1f5f9);
    padding: 4px 0 8px;
  }

  .tech-dpp-machines .tech-dpp-mach-tabs:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-dpp-machines .tech-dpp-mach-tabs:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  .tech-dpp-machines .tech-dpp-mach-tab {
    min-height: 40px;
    border: 1px solid #d0dbeb;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 6px;
  }

  .tech-dpp-machines .tech-dpp-mach-tab.is-active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 0 0 1px #93c5fd;
  }

  .tech-dpp-machines .tech-dpp-mach-page {
    gap: 0;
  }

  .tech-dpp-machines .tech-dpp-mach-pane {
    display: none !important;
  }

  .tech-dpp-machines .tech-dpp-mach-pane.is-active {
    display: block !important;
  }

  /* 清單分頁時整塊隱藏表單，避免表格撐寬後表單文字被擠到螢幕右緣 */
  .tech-dpp-machines[data-tab="list"] .tech-dpp-mach-forms-grid {
    display: none !important;
  }

  .tech-dpp-machines[data-tab="create"] .tech-dpp-mach-forms-grid,
  .tech-dpp-machines[data-tab="edit"] .tech-dpp-mach-forms-grid {
    display: block !important;
  }

  .tech-dpp-machines .tech-dpp-mach-page {
    gap: 0;
    overflow-x: clip;
    max-width: 100%;
  }

  .tech-dpp-machines .tech-dpp-mach-forms-grid {
    display: block;
    gap: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .tech-dpp-machines .tech-dpp-gp-panel,
  .tech-dpp-machines .tech-dpp-mach-panel,
  .tech-dpp-machines .tech-dpp-mach-form-fields {
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
  }

  .tech-dpp-machines .tech-dpp-mach-field--map,
  .tech-dpp-machines .tech-dpp-mach-check-row {
    width: 100%;
    max-width: 100%;
  }

  .tech-dpp-machines .tech-dpp-gp-hero h3 {
    font-size: 1.05rem;
  }

  .tech-dpp-machines .tech-dpp-gp-panel {
    padding: 10px;
  }

  .tech-dpp-machines .tech-dpp-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .tech-dpp-machines .tech-dpp-filter-status-wrap {
    width: 100%;
    min-width: 0;
  }

  .tech-dpp-machines .tech-dpp-search-row {
    width: 100%;
    flex: 0 0 auto;
  }

  .tech-dpp-machines .tech-dpp-search-row .ven-btn-secondary {
    flex: 0 0 auto;
  }

  .tech-dpp-machines .tech-dpp-mach-list-scroll,
  .tech-dpp-machines .tech-dpp-mach-list-wrap {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .tech-dpp-machines .tech-dpp-mach-list-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border: 1px solid #e2e9f6;
    border-radius: 12px;
    background: #fff;
  }

  .tech-dpp-machines .tech-dpp-mach-table {
    display: table;
    min-width: 860px;
    width: max-content;
  }

  .tech-dpp-machines .tech-dpp-mach-table thead {
    display: table-header-group;
  }

  .tech-dpp-machines .tech-dpp-mach-table tbody {
    display: table-row-group;
  }

  .tech-dpp-machines .tech-dpp-mach-table tr {
    display: table-row;
  }

  .tech-dpp-machines .tech-dpp-mach-table th,
  .tech-dpp-machines .tech-dpp-mach-table td {
    display: table-cell;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    font-size: 0.84rem;
  }

  .tech-dpp-machines .tech-dpp-mach-table th {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
  }

  .tech-dpp-machines .tech-dpp-mach-table td::before {
    content: none;
    display: none;
  }

  .tech-dpp-machines .tech-dpp-mach-action-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    min-width: 88px;
  }

  .tech-dpp-machines .tech-dpp-mach-table thead .tech-dpp-mach-action-cell {
    background: #f8fafc;
  }

  .tech-dpp-machines .tech-dpp-mach-panel {
    padding: 12px;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .tech-dpp-machines .tech-dpp-mach-field-split {
    grid-template-columns: 1fr;
  }

  .tech-dpp-machines .tech-dpp-mach-actions {
    flex-direction: column;
  }

  .tech-dpp-machines .tech-dpp-mach-actions .ven-btn-primary,
  .tech-dpp-machines .tech-dpp-mach-actions .ven-btn-secondary {
    width: 100%;
  }

  .tech-dpp-machines .tech-dpp-mach-field input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    background-clip: padding-box;
    color-scheme: light;
  }
}

/* ?? Server ? ??? Report ?? */
.module-grid--server {
  max-width: 980px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 8px;
}

.srv-report-root {
  margin-top: 4px;
}

.srv-report-search {
  margin-bottom: 12px;
}

.srv-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.srv-report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}

.srv-report-field input[type="date"] {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  min-width: 10.5rem;
}

.srv-report-hint {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 48rem;
}

.srv-report-kpis.ven-admin-kpis {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  margin: 12px 0 16px;
}

.srv-report-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.srv-report-chart-card h2 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.srv-report-chart-sub {
  margin: 0 0 10px;
  font-size: 0.75rem;
}

.srv-report-chart-wrap {
  height: 260px;
  position: relative;
}

.srv-report-chart-wrap--wide {
  height: 280px;
}

.srv-report-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .srv-report-charts {
    grid-template-columns: 1fr;
  }
}

/* ???}??? */
.module-icon.troubleshoot { background: linear-gradient(145deg, #e11d48, #be123c); }
.ts-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
}
.ts-search-input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font: inherit;
}
.ts-verdict {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.ts-verdict.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.ts-verdict.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.ts-verdict.empty { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }
.ts-stats-note { font-size: 0.82rem; margin: 0 0 16px; }
.ts-section { margin: 20px 0; }
.ts-section h4 { margin: 0 0 10px; font-size: 0.95rem; }
.ts-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ts-order-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.ts-order-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.ts-source { font-size: 0.75rem; color: var(--muted, #64748b); }
.ts-kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px;
  font-size: 0.82rem;
  margin: 4px 0;
}
.ts-kv span:first-child { color: var(--muted, #64748b); }
.ts-note { font-size: 0.75rem; margin: 8px 0 0; }
.ts-trail-table { font-size: 0.82rem; }

.ts-ai-bullets {
  margin: 0;
  padding-left: 1.2rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.ts-ai-bullets li { margin: 4px 0; }
.ts-ai-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.ts-ai-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  color: #475569;
  flex: 0 1 auto;
  min-width: 0;
}
.ts-ai-input {
  box-sizing: border-box;
  width: 18rem;
  max-width: min(100%, 22rem);
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  color: #0f172a;
  background: #fff;
  line-height: 1.2;
}
.ts-ai-input--device {
  width: 7.5rem;
  max-width: 7.5rem;
}
.ts-ai-md-preview {
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ts-ai-actions { display: flex; }
.ts-ai-events-wrap {
  overflow-x: auto;
}
.ts-ai-events-table th:nth-child(1),
.ts-ai-events-table td:nth-child(1) {
  white-space: nowrap;
  min-width: 10.5rem;
}
.ts-ai-events-table th:nth-child(2),
.ts-ai-events-table td:nth-child(2),
.ts-ai-events-table th:nth-child(3),
.ts-ai-events-table td:nth-child(3) {
  white-space: nowrap;
}
.ts-ai-events-table .cell-nowrap {
  white-space: nowrap;
}

.ts-log-toolbar { flex-wrap: wrap; gap: 10px; align-items: end; }
.ts-log-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding-bottom: 8px;
}

.ts-bad-blurb {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

/* 網關健康 · 行動優先卡片 UI */
.ts-gw-shell {
  max-width: 960px;
}
.ts-gw-blurb {
  margin: 0 0 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 12px;
  padding: 0;
  color: #9a3412;
}
.ts-gw-blurb > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.ts-gw-blurb > summary::-webkit-details-marker { display: none; }
.ts-gw-blurb-hint {
  font-weight: 500;
  font-size: 0.75rem;
  color: #c2410c;
  opacity: 0.85;
}
.ts-gw-blurb[open] .ts-gw-blurb-hint { display: none; }
.ts-gw-blurb > p {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.ts-gw-deps {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
}
.ts-gw-subnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 6px;
  margin: 0 0 14px;
  padding-bottom: 4px;
}
.ts-gw-subnav .tga-subnav-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 9px 12px;
  font-size: 0.82rem;
  min-height: 40px;
}
.ts-gw-subnav .tga-subnav-btn.active {
  background: #e11d48;
  border-color: transparent;
  color: #fff;
}
.ts-gw-panel {
  min-width: 0;
}
.ts-gw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 0 0 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
}
.ts-gw-toolbar-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  flex: 1 1 220px;
  min-width: 0;
}
.ts-gw-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ts-gw-toolbar-actions .ven-btn-primary,
.ts-gw-toolbar-actions .ven-btn-secondary,
.ts-gw-toolbar-actions a.ven-btn-secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  margin: 0;
}
.ts-gw-toolbar--bare {
  align-items: center;
}
.ts-gw-toolbar--scan {
  flex-direction: column;
  align-items: stretch;
}
.ts-gw-toolbar--scan .ts-gw-toolbar-fields {
  flex: none;
  width: 100%;
  grid-template-columns: 1fr;
}
.ts-gw-toolbar--scan .ts-gw-toolbar-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ts-gw-toolbar--scan .ts-gw-toolbar-actions .ven-btn-primary {
  grid-column: 1 / -1;
}
.ts-gw-toolbar--scan .ts-gw-toolbar-actions .ven-btn-secondary {
  width: 100%;
}
.ts-gw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  min-width: 0;
}
.ts-gw-field input,
.ts-gw-field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
  background: #fff;
}
.ts-gw-block {
  margin: 0 0 18px;
}
.ts-gw-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.ts-gw-block-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}
.ts-gw-mini-h {
  margin: 12px 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
}
.ts-gw-window,
.ts-gw-count,
.ts-gw-hint,
.ts-gw-run-meta {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.ts-gw-cards {
  display: grid;
  gap: 10px;
}
.ts-gw-card {
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
.ts-gw-card--static {
  box-shadow: none;
}
.ts-gw-card--click {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ts-gw-card--click:hover,
.ts-gw-card--click:focus-visible {
  border-color: #fda4af;
  box-shadow: 0 2px 12px rgba(225, 29, 72, 0.1);
  outline: none;
}
.ts-gw-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.ts-gw-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.ts-gw-card-sub {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  word-break: break-word;
}
.ts-gw-card-badge {
  flex: 0 0 auto;
}
.ts-gw-card-body {
  display: grid;
  gap: 6px;
}
.ts-gw-kv {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  font-size: 0.82rem;
  align-items: start;
}
.ts-gw-kv .lbl {
  color: var(--muted, #64748b);
  font-weight: 600;
}
.ts-gw-kv .val {
  color: #0f172a;
  word-break: break-word;
  min-width: 0;
}
.ts-gw-kv .val.mono,
.ts-gw-card .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}
.ts-gw-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.ts-gw-card-actions .maint-row-btn,
.ts-gw-card-actions .tga-action-btn {
  min-height: 36px;
  padding: 6px 10px;
}
.ts-gw-empty {
  padding: 16px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}
.ts-gw-bullets {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.ts-gw-bullets li { margin: 4px 0; }
.ts-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.ts-pill.ok { background: #ecfdf5; color: #065f46; }
.ts-pill.bad { background: #fef2f2; color: #991b1b; }

@media (max-width: 640px) {
  .ts-gw-shell .tga-feature-sub {
    font-size: 0.78rem;
  }
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) {
    flex-direction: column;
    align-items: stretch;
  }
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-fields {
    grid-template-columns: 1fr 1fr;
  }
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-actions {
    width: 100%;
  }
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-actions .ven-btn-primary,
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-actions .ven-btn-secondary,
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-actions a.ven-btn-secondary {
    flex: 1 1 calc(50% - 4px);
  }
  .ts-gw-kv {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .ts-gw-card-actions .maint-row-btn,
  .ts-gw-card-actions .tga-action-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }
}

@media (min-width: 641px) {
  .ts-gw-toolbar--scan .ts-gw-toolbar-actions {
    grid-template-columns: minmax(140px, 1.2fr) repeat(2, minmax(110px, 1fr));
  }
  .ts-gw-toolbar--scan .ts-gw-toolbar-actions .ven-btn-primary {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .ts-gw-toolbar:not(.ts-gw-toolbar--scan) .ts-gw-toolbar-fields {
    grid-template-columns: 1fr;
  }
}

/* APP  */
.tech-dpp-app-data .dpp-app-data-section-title {
  font-size: 0.95rem;
  margin: 18px 0 8px;
  font-weight: 700;
}
.tech-dpp-app-data .dpp-app-data-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}
.tech-dpp-app-data .dpp-app-data-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #dbe6f8);
  background: #f8fafc;
}
.tech-dpp-app-data .dpp-app-data-kpi span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}
.tech-dpp-app-data .dpp-app-data-kpi strong {
  font-size: 1.15rem;
  color: #0f172a;
}
.tech-dpp-app-data .dpp-app-data-kpi small {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
}
.tech-dpp-app-data .dpp-app-data-bar {
  display: inline-block;
  width: 88px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
  overflow: hidden;
}
.tech-dpp-app-data .dpp-app-data-bar > span {
  display: block;
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
}
.tech-dpp-app-data .dpp-app-data-flag {
  color: #b45309;
  font-weight: 600;
}
.tech-dpp-app-data .tga-subnav {
  margin: 0 0 12px;
}
