/* ══════════════════════════════════════════════════
   XELIUM Admin Panel — Monochrome Theme
   ══════════════════════════════════════════════════ */

:root {
  --bg: #08080c;
  --surface: #0e0e14;
  --surface2: #131319;
  --surface3: #18181f;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.15);
  --accent: #ffffff;
  --accent2: #c0c0c8;
  --accent-glow: rgba(255,255,255,0.10);
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --text: #e8e8f0;
  --text2: #888898;
  --text3: #44444e;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ════════════════ SCROLLBAR ════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ════════════════ LOGIN SCREEN (stile clienti) ════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
  z-index: 100;
}

#login-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.015) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  background: rgba(0, 0, 0, 0.60);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 48px 40px;
  width: 380px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(20px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 3px;
}

.login-subtitle {
  color: #71717a;
  font-size: 13px;
  display: block;
  margin-top: 4px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
  width: 100%;
  background: rgba(0, 0, 0, 0.40);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 11px 14px 11px 38px;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  font-size: 13px;
  pointer-events: none;
}

.input-group input:focus,
.input-group select:focus {
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.55);
}

.input-group select option {
  background: #0a0a0f;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: #ffffff;
  border: none;
  border-radius: 10px;
  color: #000000;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 8px;
  font-family: var(--sans);
  box-shadow: 0 4px 20px rgba(255,255,255,0.08);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255,255,255,0.12);
  background: #e0e0e0;
}

.btn-login:active { transform: translateY(0); }

.btn-arrow { font-size: 18px; transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(4px); }

.login-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

/* ════════════════ MAIN PANEL ════════════════ */
.main-panel {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 32px;
}

.brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.sidebar-brand span {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 14px 10px 6px;
  user-select: none;
}

.nav-group-label:first-child { padding-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  text-decoration: none;
  font-size: 13.5px;
  position: relative;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 99px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255,255,255,0.7);
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; color: var(--text2); transition: color 0.2s; }

.nav-item:hover .nav-icon { color: var(--text); }
.nav-item.active .nav-icon { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-logout:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
}

/* ── Content Area ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
}

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

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

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: #ffffff;
  font-size: 15px;
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  color: #ffffff;
  font-size: 14px;
  opacity: 0.9;
}

.label-icon {
  color: var(--text2);
  margin-right: 2px;
  font-size: 12px;
}

.page-subtitle {
  color: var(--text2);
  font-size: 13px;
  flex: 1;
}

.btn-refresh, .btn-secondary {
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-refresh:hover, .btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-primary {
  padding: 9px 18px;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  color: #000000;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255,255,255,0.10); background: #e0e0e0; }
.btn-primary.btn-large { padding: 13px 32px; font-size: 15px; }

.btn-danger {
  padding: 9px 18px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-hover); }

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-size: 18px;
  color: #ffffff;
  flex-shrink: 0;
}

.stat-icon i { color: #ffffff; }

.stat-info { display: flex; flex-direction: column; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
}

.stat-glow {
  position: absolute;
  bottom: -30px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(25px);
  opacity: 0.3;
}

.glow-gold { background: rgba(255,238,150,0.45); }
.glow-blue { background: rgba(255,255,255,0.35); }
.glow-green { background: rgba(255,255,255,0.25); }
.glow-red { background: rgba(255,255,255,0.15); }
.glow-white { background: rgba(255,255,255,0.5); }

/* ── Dashboard Row ── */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ── Security card ── */
.sec-card {
  background: var(--surface);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 16px;
}
.sec-head { display: flex; align-items: center; gap: 10px; }
.sec-icon { font-size: 18px; }
.sec-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.sec-badge {
  background: rgba(255, 80, 80, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 80, 80, 0.35);
  border-radius: 99px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
}
.sec-body { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
.sec-col { flex: 1; min-width: 180px; }
.sec-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); margin-bottom: 6px; }
.sec-list { display: flex; flex-direction: column; gap: 4px; }
.sec-item {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
}
.sec-item b { color: #ff6b6b; }
.sec-note {
  margin-top: 12px;
  font-size: 12px;
  color: #ffb86b;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* ── Config Preview ── */
.config-preview { padding: 16px 20px; }

.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.config-key { color: var(--text2); font-size: 13px; }

.config-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Recent Logs ── */
.recent-logs {
  padding: 12px 20px;
  max-height: 220px;
  overflow-y: auto;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.log-entry:last-child { border-bottom: none; }

.log-time { color: var(--text3); font-family: var(--mono); min-width: 60px; }
.log-user { color: var(--text2); }
.log-event {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
}

.loading-msg { color: var(--text2); padding: 12px 0; font-size: 13px; }

/* ── Search Bar ── */
.search-bar { margin-bottom: 16px; }

.search-bar input {
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* ── Table ── */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.data-table td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.data-table tbody tr:hover { background: var(--surface2); }

.empty-state {
  text-align: center;
  color: var(--text2);
  padding: 32px !important;
}

/* Table badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-active { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-banned { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-user { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-vip { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-owner { background: rgba(255,255,255,0.10); color: #ffffff; }

.hwid-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
}

.action-btns { display: flex; gap: 6px; }

.btn-sm {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  font-family: var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--red); }
.btn-sm-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm-green { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--green); }
.btn-sm-green:hover { background: rgba(16,185,129,0.2); }
.btn-sm-secondary { background: var(--surface2); border-color: var(--border); color: var(--text2); }
.btn-sm-secondary:hover { color: var(--text); }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 400px;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── Config Grid ── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.hint {
  font-size: 12px;
  color: var(--text2);
  margin-top: 12px;
  line-height: 1.5;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 8px;
}

.toggle-row label:first-child {
  font-size: 13px;
  color: var(--text);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--surface3);
  border-radius: 99px;
  transition: 0.2s;
  border: 1px solid var(--border);
}

.slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider { background: #ffffff; border-color: #ffffff; }
input:checked + .slider::before { transform: translateX(20px); background: #000000; }

/* ── Save Bar ── */
.save-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-status {
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s;
}

.save-status.visible { opacity: 1; }

/* ── Logs table ── */
.log-event-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.log-ip-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
}

/* ════════════════ DEPLOY PAGE ════════════════ */
.deploy-info-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.deploy-info-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
  flex-shrink: 0;
  margin-top: 2px;
}

.deploy-info-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.deploy-info-text strong { color: var(--text); }

.deploy-gen-card { margin-bottom: 16px; }

.deploy-gen-body {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.deploy-gen-btn {
  white-space: nowrap;
  padding: 11px 24px;
  font-size: 14px;
  flex-shrink: 0;
}

/* Risultato link */
.deploy-result {
  background: rgba(16,185,129,0.05);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

.deploy-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.deploy-result-icon { font-size: 22px; }

.deploy-result-header strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.deploy-expires {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-top: 2px;
}

.deploy-cmd-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.deploy-cmd-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.deploy-cmd-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deploy-cmd-line code {
  font-family: var(--mono);
  font-size: 13px;
  color: #34d399;
  flex: 1;
  word-break: break-all;
  line-height: 1.5;
}

.btn-copy {
  padding: 7px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--sans);
  flex-shrink: 0;
}

.btn-copy:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.deploy-warn {
  font-size: 12px;
  color: #f59e0b;
  opacity: 0.85;
}

.deploy-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .deploy-two-col { grid-template-columns: 1fr; }
}

/* ════════════════ TICKETS PAGE ════════════════ */

/* ── Sotto-tab sorgente ticket (clienti / store) ── */
.tickets-source-tabs{
  display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap;
}
.tsrc-tab{
  padding:8px 16px; border-radius:8px; cursor:pointer;
  background:var(--bg-card, rgba(0,0,0,0.45)); color:var(--text2, #a1a1aa);
  border:1px solid var(--border-lighter, rgba(255,255,255,0.09));
  font-size:12px; font-weight:600; letter-spacing:0.5px; transition:all 0.2s;
}
.tsrc-tab:hover{ color:#fff; border-color:rgba(255,255,255,0.25); }
.tsrc-tab.active{ color:#fff; border-color:rgba(255,255,255,0.5); background:rgba(255,255,255,0.06); box-shadow:0 0 0 1px rgba(255,255,255,0.12); }

.tickets-admin-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 500px;
}

.tickets-admin-list {
  width: 420px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.tickets-admin-detail {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ticket-detail-empty-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text2);
  gap: 10px;
}

.ticket-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-admin-card:hover { border-color: var(--border-hover); background: var(--surface2); }

.tac-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tac-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.tac-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.tac-user strong { font-size: 12px; }

.tac-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text2);
  background: var(--surface2);
  border-radius: 6px;
  padding: 8px 10px;
}

.tac-details code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  word-break: break-all;
}

.tac-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Ticket detail in admin */
.ticket-admin-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ticket-admin-user-card {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  flex-shrink: 0;
}

.ticket-admin-messages {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-admin-msg { display: flex; }

.msg-client { justify-content: flex-end; }
.msg-admin { justify-content: flex-start; }

.tam-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-client .tam-bubble {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
}

.msg-admin .tam-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

.tam-from {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
}

.tam-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tam-time {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--mono);
  align-self: flex-end;
}

.ticket-admin-reply {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.ticket-admin-reply textarea {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  resize: none;
}

.ticket-admin-reply textarea:focus { border-color: var(--border-hover); }

@media (max-width: 900px) {
  
/* ── Sotto-tab sorgente ticket (clienti / store) ── */
.tickets-source-tabs{
  display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap;
}
.tsrc-tab{
  padding:8px 16px; border-radius:8px; cursor:pointer;
  background:var(--bg-card, rgba(0,0,0,0.45)); color:var(--text2, #a1a1aa);
  border:1px solid var(--border-lighter, rgba(255,255,255,0.09));
  font-size:12px; font-weight:600; letter-spacing:0.5px; transition:all 0.2s;
}
.tsrc-tab:hover{ color:#fff; border-color:rgba(255,255,255,0.25); }
.tsrc-tab.active{ color:#fff; border-color:rgba(255,255,255,0.5); background:rgba(255,255,255,0.06); box-shadow:0 0 0 1px rgba(255,255,255,0.12); }

.tickets-admin-layout { flex-direction: column; height: auto; }
  .tickets-admin-list { width: 100%; max-height: 300px; }
  .tickets-admin-detail { min-height: 400px; }
}

/* ── Client status (live) — chip compatti allineati a sinistra ── */
.client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}
.client-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  font-size: 11px;
}
.client-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.client-chip .chip-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.client-chip .chip-hwid {
  color: var(--text3);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-chip .chip-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.client-chips-empty,
.client-chips-loading {
  color: var(--text3);
  font-size: 12px;
  padding: 8px 4px;
}

/* ── Status pills ordini store ── */
.status-pending{display:inline-block;padding:3px 12px;border-radius:99px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;background:rgba(245,158,11,.14);color:#f59e0b}
.status-paid{display:inline-block;padding:3px 12px;border-radius:99px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;background:rgba(59,130,246,.14);color:#3b82f6}
.status-delivered{display:inline-block;padding:3px 12px;border-radius:99px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;background:rgba(16,185,129,.14);color:#10b981}
.status-canceled{display:inline-block;padding:3px 12px;border-radius:99px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;background:rgba(239,68,68,.14);color:#ef4444}
