/* ============================================================================
 * Zenko — stylesheet MOBILE-ONLY.
 * L'app è bloccata a runtime da /js/mobile-guard.js su viewport non-mobile
 * (pointer:coarse + hover:none + max-width:820px). Tutti gli stili qui sotto
 * targetizzano portrait phone (≤820px). Le media query @media (max-width: …)
 * raffinano per phone piccoli (480/540/560/640px). Nessun layout desktop.
 * Non aggiungere @media (min-width: …) o grid multi-colonna desktop.
 * ============================================================================ */
:root {
  --bg: #1a1a2e;
  --bg-2: #232342;
  --fg: #f5f5f7;
  --muted: #9aa0b4;
  --accent: #c0c0c0;
  --accent-2: #e6c200;
  --danger: #e35d6a;
  --ok: #4ade80;
  --radius: 10px;
  --header-height: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

a { color: var(--accent-2); text-decoration: none; }

/* ─── HEADER & NAV ─────────────────────────────────────────────────────── */
#app-header {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-height);
  padding: 12px 16px;
  background: var(--bg-2);
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
#app-header .logo {
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 6px;
}
#app-header .logo i { color: var(--accent-2); }

#app-nav { display: flex; gap: 4px; }
#app-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--muted); font-size: 0.7rem; transition: all 0.15s;
}
#app-nav a i { font-size: 1.1rem; }
#app-nav a:hover, #app-nav a:focus { color: var(--fg); background: rgba(255,255,255,0.05); }

/* #app-root: UNICO container che scrolla. Posizionato tra header e footer. */
#app-root {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: var(--footer-height, 0px);
  overflow-y: auto;
  overflow-x: hidden;
}
/* Wrapper di centratura: ogni figlio diretto di #app-root viene centrato e padded. */
#app-root > * {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  width: 100%;
}
/* Buttons are inline-block by default: force block so margin:auto works. */
#app-root > button { display: block; }
/* Titoli pagina che restano incollati in cima allo scroll container. */
#app-root > h2:first-child,
#app-root > .notif-header:first-child {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  margin-top: 0;
  margin-bottom: 0;
}
/* Login hero: full bleed, niente max-width né padding. */
#app-root:has(.login-hero) > * {
  max-width: none;
  padding: 0;
  margin: 0;
}

.loading, .empty { color: var(--muted); text-align: center; padding: 24px; }

/* ─── LOGIN HERO ─────────────────────────────────────────────────────── */
.login-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 16px;
  width: 100%;
  min-height: 100%;
}
.login-hero h2 { margin: 0 0 8px; font-size: 1.6rem; }
.login-hero p { color: var(--muted); margin: 0 0 24px; }
.login-hero button { font-size: 1rem; padding: 12px 24px; }
.login-hero button i { margin-right: 8px; }
.login-hero .login-hint {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 320px;
}
.login-hero .login-hint i { color: var(--accent-2); margin-right: 4px; }
.login-hero .login-error {
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(227, 93, 106, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 0.85rem;
  max-width: 320px;
}
.login-hero .login-error i { margin-right: 6px; }

/* ─── DESKTOP BLOCK (mobile-only guard) ─────────────────────────────────── */
.desktop-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 32px;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.desktop-block i {
  font-size: 4rem;
  color: var(--accent-2);
  margin-bottom: 24px;
}
.desktop-block h1 { margin: 0 0 16px; font-size: 1.8rem; }
.desktop-block p { color: var(--muted); margin: 0 0 12px; max-width: 420px; line-height: 1.5; }
.desktop-block .muted { font-size: 0.85rem; color: var(--accent-2); margin-top: 16px; }

/* ─── BUTTONS ──────────────────────────────────────────────────────────── */
button {
  background: var(--accent-2); color: #111;
  border: 0; padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }
button.secondary { background: transparent; color: var(--fg); border: 1px solid #444; }
button.secondary:hover { border-color: var(--accent-2); color: var(--accent-2); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.icon-btn {
  background: transparent; border: 1px solid #444; color: var(--fg);
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.85rem;
}
.icon-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ─── FORMS ────────────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--bg); color: var(--fg);
  border: 1px solid #444; border-radius: var(--radius);
  padding: 10px; font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-row { display: flex; gap: 10px; }
.form-row .field { flex: 1; }

.admin-form { background: var(--bg-2); padding: 16px; border-radius: var(--radius); margin-bottom: 16px; }

/* ─── GRID / CARDS ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: var(--bg-2); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform 0.15s;
}
.card:hover { transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #111; }
.card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.card .title { font-weight: 600; }
.card .meta { color: var(--muted); font-size: 0.85rem; }
.card .price { color: var(--accent-2); font-weight: 700; }

/* ─── LOT GALLERY ──────────────────────────────────────────────────────── */
.lot-gallery { margin-bottom: 16px; }
.lot-gallery #lot-main-img { width: 100%; border-radius: 10px; max-height: 400px; object-fit: contain; background: #111; }
.lot-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.lot-thumbs .thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.5; border: 2px solid transparent; transition: opacity 0.15s, border-color 0.15s; }
.lot-thumbs .thumb.active, .lot-thumbs .thumb:hover { opacity: 1; border-color: var(--accent); }

/* ─── TABS ─────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid #333; padding-bottom: 8px;
  user-select: none; -webkit-user-select: none;
}
.admin-tabs .tab {
  background: transparent; color: var(--muted); border: none;
  padding: 8px 16px; border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 600; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.admin-tabs .tab:hover { color: var(--fg); background: rgba(255,255,255,0.03); }
.admin-tabs .tab.active {
  color: var(--accent-2); background: var(--bg-2);
  border-bottom: 2px solid var(--accent-2);
}

.tab-panel { display: none; animation: fadeIn 0.2s; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── ITEM LISTS (categories, users) ──────────────────────────────────── */
.item-list { list-style: none; padding: 0; margin: 0 0 16px; user-select: none; -webkit-user-select: none; }
.item-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-2); border-radius: var(--radius);
  margin-bottom: 6px; border: 1px solid transparent; transition: border-color 0.15s;
}
.item-list li:hover { border-color: #444; }
.item-info { display: flex; flex-direction: column; gap: 2px; }
.item-primary { font-weight: 600; }
.item-secondary { font-size: 0.8rem; color: var(--muted); }
.item-actions { display: flex; align-items: center; gap: 8px; }

/* ─── BADGES ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.badge-admin { background: var(--accent-2); color: #111; }
.badge-user { background: #333; color: var(--fg); }
.badge-you { background: transparent; color: var(--muted); border: 1px solid #444; }
.badge-approved { background: #2e7d32; color: #fff; }
.badge-banned { background: #b71c1c; color: #fff; }
.badge-active { background: #2e7d32; color: #fff; }
.badge-consumed { background: #555; color: #ddd; }
.badge-revoked { background: #b71c1c; color: #fff; }
.badge-expired { background: #555; color: #ddd; }

/* ─── REPUTATION LEVELS ─────────────────────────────────────────────── */
.badge-level-1 { background: #6c757d; color: #fff; }
.badge-level-2 { background: #2e7d32; color: #fff; }
.badge-level-3 { background: #1976d2; color: #fff; }
.badge-level-4 { background: #6a1b9a; color: #fff; }
.badge-level-5 { background: linear-gradient(135deg, #d4a017, #ff7f00); color: #111; }
.badge-level-1 i, .badge-level-2 i, .badge-level-3 i,
.badge-level-4 i, .badge-level-5 i { margin-right: 4px; }

.reputation-card {
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 14px 16px; margin: 14px 0 6px;
}
.reputation-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.reputation-points { color: var(--muted); }
.reputation-points strong { color: var(--fg); font-size: 1.1rem; }
.reputation-progress .bar {
  width: 100%; height: 8px; background: #2a2a2a;
  border-radius: 999px; overflow: hidden; margin-bottom: 6px;
}
.reputation-progress .bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-2, #d4a017), #ff7f00);
  transition: width 0.4s;
}
.reputation-progress small { color: var(--muted); }
.reputation-max { color: var(--accent-2, #d4a017); }

/* ─── REACTIONS BAR ─────────────────────────────────────────────────── */
.reactions-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 14px 0;
}
.reaction-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #1f1f1f; border: 1px solid #2e2e2e;
  border-radius: 999px; color: var(--fg);
  cursor: pointer; transition: transform 0.1s, background 0.15s, border-color 0.15s;
  user-select: none;
}
.reaction-btn:hover:not(:disabled) {
  background: #2a2a2a; transform: translateY(-1px);
}
.reaction-btn.active {
  background: rgba(212, 160, 23, 0.18);
  border-color: var(--accent-2, #d4a017);
  color: var(--accent-2, #d4a017);
}
.reaction-btn:disabled { opacity: 0.6; cursor: wait; }
.reaction-emoji { font-size: 1.15rem; line-height: 1; }
.reaction-count { font-size: 0.85rem; font-weight: 600; min-width: 14px; text-align: center; }

/* ─── PUSH SWITCH (profilo) ──────────────────────────────────────────── */
.push-switch-wrap {
  display: flex; align-items: center; gap: 12px;
}
.push-label {
  font-size: 0.9rem; color: var(--muted); transition: color 0.2s;
}
.switch {
  position: relative; display: inline-block; width: 48px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #444; border-radius: 26px;
  transition: background 0.25s;
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: var(--fg); border-radius: 50%;
  transition: transform 0.25s;
}
.switch input:checked + .switch-slider { background: var(--ok); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: wait; }

/* ─── AVATAR (profilo) ──────────────────────────────────────────────── */
.avatar-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 14px 16px; margin: 14px 0;
}
.avatar-wrap {
  width: 88px; height: 88px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--accent-2, #d4a017);
  flex-shrink: 0; background: #111;
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-info { display: flex; flex-direction: column; gap: 6px; }
.avatar-info p { margin: 0; }
.avatar-upload {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 6px 12px;
  background: #1f1f1f; border: 1px solid #2e2e2e;
  border-radius: 8px; color: var(--fg);
  cursor: pointer; transition: background 0.15s;
  font-size: 0.9rem; align-self: flex-start;
}
.avatar-upload:hover { background: #2a2a2a; }

/* ─── NAV BELL BADGE ────────────────────────────────────────────────── */
.nav-bell { position: relative; }
.nav-badge {
  position: absolute; top: 4px; right: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: #b71c1c; color: #fff;
  font-size: 0.7rem; font-weight: 700; line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #111);
}
.nav-bell--has-unread .fa-bell { color: var(--accent-2, #d4a017); }
@keyframes nav-bell-pulse-once {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  70%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.nav-bell--pulse .fa-bell {
  display: inline-block;
  transform-origin: 50% 55%;
  animation: nav-bell-pulse-once 700ms ease-out 1;
}
@media (prefers-reduced-motion: reduce) {
  .nav-bell--pulse .fa-bell { animation: none; }
}

/* ─── NOTIFICATIONS PAGE ────────────────────────────────────────────── */
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.notif-header h2 { margin: 0; }
.notif-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a; border-radius: 10px;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  position: relative;
}
.notif-item:hover { background: #222; transform: translateX(2px); }
.notif-item.unread { border-left: 3px solid var(--accent-2, #d4a017); }
.notif-item.read { opacity: 0.75; }
.notif-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #2a2a2a; color: var(--fg);
  font-size: 1rem;
}
.notif-outbid    .notif-icon { background: #6a1b9a; color: #fff; }
.notif-won       .notif-icon { background: linear-gradient(135deg, #d4a017, #ff7f00); color: #111; }
.notif-approved  .notif-icon { background: #2e7d32; color: #fff; }
.notif-level     .notif-icon { background: #1976d2; color: #fff; }
.notif-order     .notif-icon { background: #00838f; color: #fff; }
.notif-default   .notif-icon { background: #444; color: #fff; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; margin-bottom: 2px; }
.notif-msg { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.notif-date { color: var(--muted); font-size: 0.78rem; }
.notif-dot {
  position: absolute; top: 16px; left: 38px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2, #d4a017);
  box-shadow: 0 0 0 2px var(--bg-elev, #1a1a1a);
}

/* Filtri (chips) */
.notif-filters {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.notif-chip {
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a;
  color: var(--fg);
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.85rem; cursor: pointer;
  min-height: 32px;
  transition: background 0.15s, border-color 0.15s;
}
.notif-chip:hover { background: #222; }
.notif-chip[aria-selected="true"] {
  background: var(--accent-2, #d4a017);
  border-color: var(--accent-2, #d4a017);
  color: #111; font-weight: 600;
}

/* Gruppi */
.notif-group + .notif-group { margin-top: 18px; }
.notif-group-title {
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 4px 4px 8px;
}
.notif-group-title--new {
  color: var(--accent-2, #d4a017);
  display: flex; align-items: center; gap: 8px;
}
.notif-group-title--new::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, rgba(212,160,23,0.35), transparent);
}

/* Item: bottone menu + swipe bg + collapse */
.notif-item {
  padding-right: 44px;
  /* Permette pan verticale nativo; il pan orizzontale lo gestiamo via JS. */
  touch-action: pan-y;
}
.notif-item:focus-visible { outline: 2px solid var(--accent-2, #d4a017); outline-offset: 2px; }
.notif-menu-btn {
  position: absolute; top: 6px; right: 6px;
  width: 36px; height: 36px; min-width: 36px;
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  z-index: 2;
}
.notif-menu-btn:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.notif-menu-btn:focus-visible { outline: 2px solid var(--accent-2, #d4a017); outline-offset: 2px; }

.notif-swipe-bg {
  position: absolute; top: 0; right: 0; bottom: 0; width: 100%;
  background: linear-gradient(to right, transparent 60%, #b71c1c 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 22px; color: #fff; font-size: 1.1rem;
  pointer-events: none; opacity: 0; z-index: 0;
  transition: opacity 120ms;
}
.notif-item.is-swiping .notif-swipe-bg { opacity: 1; }
.notif-item.is-swipe-armed .notif-swipe-bg { background: #b71c1c; }
.notif-item.is-swiping {
  background: var(--bg-elev, #1a1a1a);
  z-index: 1;
}
/* Disabilita hover transform durante swipe (interferisce con translateX). */
.notif-item.is-swiping:hover { transform: none; }
.notif-item > .notif-icon,
.notif-item > .notif-body,
.notif-item > .notif-dot { position: relative; z-index: 1; }

/* Menu popover */
.notif-menu {
  position: absolute; top: 44px; right: 6px; z-index: 5;
  background: var(--bg-2, #181818);
  border: 1px solid #2a2a2a; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; min-width: 200px;
  padding: 4px;
  animation: notif-menu-in 140ms ease-out;
}
.notif-menu button {
  background: transparent; border: 0; color: var(--fg);
  padding: 10px 12px; text-align: left; font-size: 0.9rem;
  display: flex; align-items: center; gap: 10px;
  border-radius: 6px; cursor: pointer; min-height: 44px;
}
.notif-menu button:hover { background: rgba(255,255,255,0.06); }
.notif-menu button.danger { color: #ff6b6b; }
.notif-menu button.danger:hover { background: rgba(183,28,28,0.18); }
@keyframes notif-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Empty state */
.notif-empty {
  text-align: center; padding: 48px 20px;
  color: var(--muted);
}
.notif-empty-icon {
  font-size: 3rem; opacity: 0.35; margin-bottom: 12px;
}
.notif-empty h3 { margin: 0 0 6px; color: var(--fg); font-weight: 600; }
.notif-empty p { margin: 0; font-size: 0.9rem; }

/* Skeleton statici (no shimmer infinito) */
.notif-skeleton { pointer-events: none; }
.notif-skeleton .skeleton-block {
  background: #2a2a2a;
}
.notif-skeleton .skeleton-line {
  height: 10px; background: #2a2a2a; border-radius: 4px;
  margin: 6px 0;
}
.notif-skeleton, .notif-skeleton * { transition: none !important; }
.notif-skeleton { opacity: 0.6; animation: notif-skel-in 220ms ease-out 1; }
@keyframes notif-skel-in { from { opacity: 0; } to { opacity: 0.6; } }

/* Collapse animation per delete */
.notif-item--collapsing { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .notif-skeleton, .notif-menu, .notif-item { animation: none !important; }
  .notif-item--collapsing { transition-duration: 0ms !important; }
}

/* ─── INVITE PAGE (invite-only access v6) ──────────────────────────────── */
.invite-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  min-height: 70vh; padding: 24px; text-align: center;
  max-width: 480px; margin: 0 auto;
}
.invite-logo {
  width: 96px; height: 96px; border-radius: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  margin-bottom: 4px;
}
.invite-page h2 { margin: 8px 0 0; }
.invite-tagline { color: var(--muted); margin: 0 0 8px; }
.invite-page button {
  margin-top: 6px; min-width: 240px;
}
.invite-error {
  color: var(--danger); margin-top: 12px;
  font-size: 0.95rem;
}
.invite-error i { margin-right: 6px; }

/* ─── MISC ─────────────────────────────────────────────────────────────── */
.row { display: flex; gap: 8px; align-items: center; }

.countdown { font-variant-numeric: tabular-nums; color: var(--accent-2); font-weight: 700; }
.countdown.ended { color: var(--danger); }

/* ─── MY BIDS PAGE ─────────────────────────────────────────────────────── */
.mybids-count {
  font-size: 0.8rem; background: #333; color: var(--muted);
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}
.mybids-list { display: flex; flex-direction: column; gap: 10px; }
.mybid-card {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--bg-2); border-radius: var(--radius);
  border: 1px solid transparent; padding: 10px;
  text-decoration: none; color: var(--fg);
  transition: border-color 0.15s, transform 0.1s;
}
.mybid-card:hover { border-color: #444; transform: translateY(-1px); }
.mybid-card--outbid { border-color: var(--danger); background: rgba(227,93,106,0.05); }
.mybid-card--outbid:hover { border-color: var(--danger); }
.mybid-card--won { border-color: var(--ok); background: rgba(74,222,128,0.05); }

.mybid-thumb {
  width: 72px; height: 72px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; background: #111;
}
.mybid-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.4rem;
}
.mybid-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.mybid-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mybid-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mybid-status {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.mybid-winning { background: rgba(74,222,128,0.15); color: var(--ok); }
.mybid-outbid { background: rgba(227,93,106,0.15); color: var(--danger); animation: pulse-outbid 1.5s infinite; }
.mybid-won { background: rgba(74,222,128,0.15); color: var(--ok); }
.mybid-lost { background: #333; color: var(--muted); }

@keyframes pulse-outbid {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.mybid-details {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 0.82rem; color: var(--muted);
}
.mybid-details i { font-size: 0.75rem; }
.mybid-price { color: var(--accent-2); font-weight: 600; }
.mybid-time { display: inline-flex; align-items: center; gap: 3px; }
.mybid-urgent { color: var(--danger); font-weight: 700; animation: pulse-outbid 1s infinite; }

.mybid-footer { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.mybid-footer strong { color: var(--fg); }
.mybid-last { display: inline-flex; align-items: center; gap: 4px; }

/* ─── ORDER TIMELINE ───────────────────────────────────────────────────── */
.order-timeline {
  margin: 20px 0; padding: 0;
}
.ot-step {
  display: flex; gap: 12px; min-height: 52px;
  transition: opacity 0.2s;
}
.ot-step--future { opacity: 0.4; }
.ot-step--done, .ot-step--current { opacity: 1; }
.ot-marker-col {
  display: flex; flex-direction: column; align-items: center;
  width: 28px; flex-shrink: 0;
}
.ot-marker {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; background: #333; color: var(--muted);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.ot-step--done .ot-marker {
  background: var(--ok); color: #111;
}
.ot-step--current .ot-marker {
  background: var(--accent-2); color: #111;
  animation: ot-pulse 2s ease-in-out infinite;
}
@keyframes ot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212,160,23,0.4); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(212,160,23,0); }
}
.ot-check { font-weight: 700; font-size: 0.9rem; }
.ot-connector {
  flex: 1; width: 2px; min-height: 20px;
  background: #333; margin: 4px 0;
  transition: background 0.25s;
}
.ot-step--done .ot-connector { background: var(--ok); }
.ot-step--current .ot-connector { background: var(--accent-2); }
.ot-content {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 12px;
}
.ot-label { font-weight: 600; font-size: 0.9rem; }
.ot-meta { font-size: 0.75rem; color: var(--muted); }
.ot-note { font-size: 0.75rem; color: var(--accent-2); font-style: italic; }

.ot-tracking-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 8px 14px;
  background: transparent; border: 1px solid var(--accent-2);
  border-radius: var(--radius); color: var(--accent-2);
  font-weight: 600; font-size: 0.85rem;
  text-decoration: none; cursor: pointer;
  animation: ot-glow 1.5s ease-in-out infinite;
  transition: background 0.15s;
}
.ot-tracking-btn:hover { background: rgba(212,160,23,0.1); }
.ot-tracking-icon { font-size: 1.1rem; }
@keyframes ot-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(212,160,23,0.3); }
  50% { box-shadow: 0 0 12px rgba(212,160,23,0.6); }
}

/* ─── LOT CARD PROGRESS DOTS ──────────────────────────────────────────── */
.lot-progress {
  display: inline-flex; gap: 3px; align-items: center;
  margin-top: 2px;
}
.lot-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #444; transition: background 0.2s;
}
.lot-dot--done { background: var(--ok); }
.lot-dot--current { background: var(--accent-2); }

/* ─── WINNER BANNER (lot-detail) ───────────────────────────────────────── */
.winner-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius);
  background: rgba(230, 194, 0, 0.08); border: 1px solid rgba(230, 194, 0, 0.25);
  color: var(--accent-2); font-size: 0.95rem; font-weight: 600;
}
.winner-banner i { font-size: 1.2rem; }
.winner-banner strong { color: var(--fg); }
.winner-banner--none { background: rgba(154,160,180,0.06); border-color: #333; color: var(--muted); }

/* ─── ADMIN ADVANCE PANEL ─────────────────────────────────────────────── */
.advance-panel {
  width: 100%; margin-top: 12px; padding: 16px;
  background: var(--bg); border: 1px solid #333; border-radius: var(--radius);
  animation: fadeIn 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.advance-label { margin: 0; font-size: 0.9rem; }
.advance-confirm {
  margin-top: 4px; width: 100%;
}
.adv-timeline {
  display: flex; align-items: center; gap: 0; padding: 8px 0;
  justify-content: center;
}
.adv-dot {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #2a2a3e; border: 2px solid #444;
  font-size: 0.85rem; flex-shrink: 0; transition: all 0.2s;
}
.adv-dot--done { border-color: var(--ok); background: rgba(74, 222, 128, 0.1); }
.adv-dot--current { border-color: var(--accent-2); background: rgba(230, 194, 0, 0.15); box-shadow: 0 0 8px rgba(230,194,0,0.3); }
.adv-dot-line { width: 16px; height: 2px; background: #444; flex-shrink: 0; }

#toast-root {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
.toast {
  background: var(--bg-2); border: 1px solid #333;
  padding: 10px 14px; border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 90vw;
  display: flex; align-items: center; gap: 12px;
  animation: toast-in 180ms ease-out;
}
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--danger); }
.toast-text { flex: 1; min-width: 0; }
.toast-action {
  background: transparent; color: var(--accent-2, #d4a017);
  border: 0; padding: 4px 8px; font-weight: 700;
  cursor: pointer; border-radius: 6px;
  text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.04em;
}
.toast-action:hover { background: rgba(255,255,255,0.06); }
.toast--leaving { opacity: 0; transform: translateY(6px); transition: opacity 180ms, transform 180ms; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .toast--leaving { transition: none; }
}

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #333; font-size: 0.75rem; color: var(--fg);
}

.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checkbox-grid label { display: flex; gap: 6px; align-items: center; background: var(--bg-2); padding: 8px; border-radius: var(--radius); cursor: pointer; }
.checkbox-grid input { width: auto; }

/* ─── MODAL DIALOG ─────────────────────────────────────────────────────── */
.sma-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s;
}
.sma-dialog {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 380px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: smaSlideUp 0.2s cubic-bezier(.4,0,.2,1);
}
@keyframes smaSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.sma-dialog-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.sma-dialog-icon { font-size: 1.6rem; flex-shrink: 0; }
.sma-dialog-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--fg); }
.sma-dialog-body {
  color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 16px;
}
.sma-dialog-body strong { color: var(--fg); }
.sma-dialog-body em { color: var(--accent); font-style: normal; font-weight: 600; }
.sma-dialog-disclaimer {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(192,192,192,0.05);
  border: 1px solid rgba(192,192,192,0.12);
  border-radius: var(--radius);
  padding: 12px; margin-bottom: 20px;
  font-size: 0.82rem; color: var(--fg); line-height: 1.55; cursor: pointer;
}
.sma-dialog-disclaimer input[type="checkbox"] {
  flex-shrink: 0; margin-top: 2px; width: auto;
  accent-color: var(--accent-2); cursor: pointer;
}
.sma-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.sma-btn-cancel {
  background: transparent; border: 1px solid #444; color: var(--muted);
  padding: 9px 18px; border-radius: var(--radius);
  cursor: pointer; font-size: 0.88rem; transition: all 0.15s;
}
.sma-btn-cancel:hover, .sma-btn-cancel:focus {
  border-color: var(--fg); color: var(--fg); outline: none;
}
.sma-btn-confirm {
  padding: 9px 20px; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: 0.88rem; font-weight: 600;
  background: var(--accent-2); color: #000; transition: filter 0.15s;
}
.sma-btn-confirm:hover:not(:disabled), .sma-btn-confirm:focus:not(:disabled) {
  filter: brightness(1.15); outline: none;
}
.sma-btn-confirm.danger { background: var(--danger); color: #fff; }

/* ─── ACCOUNT DANGER ZONE (delete account) ─────────────────────────── */
.account-danger-zone {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(227,93,106,0.25);
}
.danger-zone-title {
  color: var(--danger);
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.danger-zone-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  margin: 0 0 12px 0;
}
button.secondary.danger {
  border-color: var(--danger);
  color: var(--danger);
}
button.secondary.danger:hover:not(:disabled) {
  background: rgba(227,93,106,0.12);
}
button.secondary.danger:disabled {
  opacity: 0.6;
  cursor: wait;
}
.sma-btn-confirm:disabled { opacity: 0.35; cursor: default; }
.sma-prompt-label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--fg); }
.sma-prompt-input { width: 100%; margin-top: 4px; }

/* ─── FOOTER (fixed bottom, always visible) ──────────────────────────── */
#app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
#app-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 0;
}
#app-footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  position: relative;
}
#app-footer .footer-links a:hover,
#app-footer .footer-links a:focus-visible {
  color: var(--fg);
  text-decoration: underline;
}
#app-footer .footer-links a + a::before {
  content: "·";
  position: absolute;
  left: -2px;
  color: rgba(255, 255, 255, 0.2);
}
#app-footer .footer-version {
  font-size: 0.65rem;
  opacity: 0.5;
}

/* ─── PWA INSTALL BANNER ───────────────────────────────────────────────── */
#pwa-install-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-2); border-top: 1px solid var(--accent-2);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
  z-index: 200;
}
#pwa-install-banner span { flex: 1; font-weight: 600; }
#pwa-install-banner button { font-size: 0.85rem; padding: 8px 12px; }

.pwa-install-profile-btn {
  width: 100%; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .form-row { flex-direction: column; }
  .admin-tabs .tab span { display: none; }
  #app-nav a span { display: none; }
}

/* ─── FAB (Floating Action Button) ─────────────────────────────────────── */
.sma-fab {
  position: fixed; bottom: 84px; right: 18px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-2); color: #fff; border: none;
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  z-index: 100; cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.sma-fab:active { transform: scale(0.92); }
.sma-fab:hover { background: var(--accent); }

/* ─── HOME FILTERS ─────────────────────────────────────────────────────── */
.home-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.home-toolbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 4;
  flex-shrink: 0;
  background: var(--bg);
  padding-bottom: 8px;
}
.home-toolbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(26, 26, 46, 0.92);
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
  backdrop-filter: blur(14px);
}
.home-content {
  display: flex;
  flex: 1;
  min-height: 0;
}
.home-filters select { flex: 1; min-width: 0; }
.home-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 2px;
}
.home-toggle i { font-size: 0.9rem; color: var(--accent-2); }
.home-grid {
  flex: 1;
  align-content: start;
  min-height: 0;
}
.home-grid--loading,
.home-grid--empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-content: center;
}
.home-empty-state {
  width: min(100%, 320px);
  margin: 0 auto;
  padding: 24px 18px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  text-align: center;
}

@media (max-width: 560px) {
  :root {
    --header-height: 64px;
  }

  .home-toolbar__inner {
    padding: 8px 10px;
    border-radius: 16px;
    gap: 8px;
  }

  .home-toggle {
    gap: 6px;
  }
}

/* ─── CREATE LOT MODAL ─────────────────────────────────────────────────── */
.create-lot-modal { max-width: 440px; width: 92vw; }
.create-lot-modal .clm-form { display: flex; flex-direction: column; gap: 12px; }
.create-lot-modal .form-row { display: flex; gap: 10px; }
.create-lot-modal .form-row .field { flex: 1; }
.clm-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.clm-progress { margin-top: 6px; }
.clm-progress-bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.clm-progress-fill { height: 100%; background: var(--accent-2); width: 0; transition: width 0.3s; }
.clm-progress-text { font-size: 0.78rem; color: var(--muted); }

/* ─── ADMIN LOT PANEL (lot-detail) ─────────────────────────────────────── */
.admin-lot-panel { margin: 18px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid #333; }
.alp-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--bg-2); cursor: pointer; user-select: none;
  font-weight: 600; font-size: 0.92rem;
}
.alp-header .alp-chevron { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.alp-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.alp-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius); border: none;
  font-size: 0.88rem; cursor: pointer; font-weight: 500;
  background: var(--bg-2); color: var(--fg);
  transition: background 0.15s;
}
.alp-btn:hover { background: #333; }
.alp-btn--close { color: var(--accent-2); }
.alp-btn--advance { color: #4ecdc4; }
.alp-btn--delete { color: #e74c3c; }


/* --- LEVEL-UP CELEBRATION ------------------------------------------------ */
/* z-index 600: sopra .sma-overlay (500) → celebration sempre sopra dialog/toast. */
.sma-overlay.sma-celebration {
  z-index: 600;
  animation: celebration-fade-in 180ms ease-out;
  -webkit-overflow-scrolling: touch; /* iOS: evita layering issues con position:fixed */
}
.sma-overlay.sma-celebration.is-leaving { animation: celebration-fade-out 180ms ease-in forwards; }
@keyframes celebration-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes celebration-fade-out { from { opacity: 1; } to { opacity: 0; } }

.celebration-card {
  position: relative;
  width: min(92vw, 360px);
  padding: 28px 22px 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--bg-2, #1a1a1a) 0%, var(--bg, #111) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 160, 23, 0.18);
  text-align: center;
  overflow: hidden;
  animation: celebration-pop 260ms cubic-bezier(.2, .7, .3, 1.05) both;
}
@keyframes celebration-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.celebration-badge {
  width: 88px; height: 88px;
  margin: 4px auto 14px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  /* Le classi badge-level-N ridefiniscono background/color (ereditano via cascade). */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  animation: celebration-badge-in 420ms cubic-bezier(.2, .7, .3, 1.2) 80ms both;
}
@keyframes celebration-badge-in {
  from { transform: scale(0.4) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1)    rotate(0);     opacity: 1; }
}

.celebration-title {
  margin: 0 0 4px;
  font-size: 1.1rem; font-weight: 600;
  color: var(--muted, #aaa);
  letter-spacing: 0.02em;
}
.celebration-name {
  margin: 0 0 6px;
  font-size: 1.7rem; font-weight: 800;
  background: linear-gradient(135deg, #d4a017, #ff7f00);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.celebration-sub {
  margin: 0 0 8px;
  font-size: 0.82rem; color: var(--muted, #aaa);
}
.celebration-points {
  margin: 6px 0 18px;
  font-size: 0.92rem; color: var(--fg, #eee);
  opacity: 0.9;
}
.celebration-actions {
  display: flex; gap: 10px; justify-content: center;
}
.celebration-actions button {
  flex: 1; max-width: 150px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg, #111);
  color: var(--fg, #eee);
  font-size: 0.92rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.celebration-actions button:hover { background: var(--bg-2, #1a1a1a); }
.celebration-actions button:active { transform: scale(0.97); }
.celebration-actions .sma-btn-confirm {
  background: linear-gradient(135deg, #d4a017, #ff7f00);
  color: #111;
  border-color: transparent;
}

/* Confetti � DOM puro, animazione CSS-only. */
.celebration-confetti {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.celebration-confetti .conf {
  position: absolute;
  top: 28%;
  left: 50%;
  width: 8px; height: 14px;
  background: var(--color, #d4a017);
  border-radius: 1px;
  opacity: 0;
  will-change: transform, opacity;
  animation: confetti-fall 1800ms cubic-bezier(.2, .7, .5, 1) var(--delay, 0ms) 1 forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate(0, -8px) rotate(0);                          opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--tx, 0), 60vh) rotate(var(--rot, 0));   opacity: 0; }
}

/* Glow one-shot sul badge profilo dopo arrivo da level-up. */
@keyframes glow-once {
  0%, 100% { filter: none; }
  50%      { filter: drop-shadow(0 0 12px var(--accent-2, #d4a017)); }
}
.badge.celebration-glow { animation: glow-once 1200ms ease-out 1; }

@media (prefers-reduced-motion: reduce) {
  .sma-overlay.sma-celebration,
  .sma-overlay.sma-celebration.is-leaving { animation: none; }
  .celebration-card,
  .celebration-badge { animation: none; }
  .celebration-confetti { display: none; }
  .badge.celebration-glow { animation: none; }
}

/* --- SHIPPING ADDRESS � profile card + modal (v2.15.0) --------------- */
.shipping-card {
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 14px 16px; margin: 14px 0 6px;
}
.shipping-card-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.shipping-card-head h3 { margin: 0; font-size: 1rem; }
.shipping-card-head h3 i { margin-right: 6px; color: var(--accent-2, #d4a017); }
.shipping-private-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(46, 125, 50, 0.18);
  border: 1px solid rgba(46, 125, 50, 0.5);
  color: #66bb6a; font-size: 0.78rem;
}
.shipping-empty, .shipping-loading, .shipping-error {
  color: var(--muted); margin: 0 0 12px;
}
.shipping-error { color: #ef5350; }
.shipping-address {
  font-style: normal; line-height: 1.5;
  background: #141414; border: 1px solid #2a2a2a; border-radius: 8px;
  padding: 10px 12px; margin: 0 0 12px;
}
.shipping-address strong { color: var(--fg); }
.shipping-phone { margin-top: 6px; color: var(--muted); font-size: 0.9rem; }
.shipping-phone i { margin-right: 4px; }

/* Modal ----------------------------------------------------------------- */
.shipping-modal { max-width: 520px; width: 100%; }
.shipping-subtitle { color: var(--muted); margin: 0 0 14px; font-size: 0.92rem; }
.shipping-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px;
}
.shipping-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.shipping-field span { color: var(--muted); }
.shipping-field input {
  background: #141414; border: 1px solid #2e2e2e; border-radius: 8px;
  padding: 8px 10px; color: var(--fg); font-size: 0.95rem;
  min-height: 40px;
}
.shipping-field input:focus { outline: 2px solid var(--accent-2, #d4a017); outline-offset: 1px; }
/* Full-width fields */
.shipping-form label[class="shipping-field"]:nth-child(1),
.shipping-form .shipping-field:nth-child(2),
.shipping-form .shipping-field:nth-child(3) { grid-column: 1 / -1; }
.shipping-hint { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; margin: 4px 0 0; }

@media (max-width: 540px) {
  .shipping-form { grid-template-columns: 1fr; }
  .shipping-form .shipping-field { grid-column: 1 / -1; }
}

/* Admin order block (lot panel) ---------------------------------------- */
.admin-order-shipping {
  margin-top: 12px; padding: 10px 12px;
  background: #141414; border: 1px solid #2a2a2a; border-radius: 8px;
}
.admin-order-shipping h4 {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px; font-size: 0.95rem;
}
.admin-order-shipping h4 .shipping-private-badge { font-size: 0.72rem; }
.admin-order-shipping address { font-style: normal; line-height: 1.5; }
.admin-order-shipping .empty { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* ─── PRIVACY PAGE (v2.15.x) ───────────────────────────────────────────── */
.privacy-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 24px;
}
.privacy-header {
  margin: 8px 0 16px;
}
.privacy-header h2 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.privacy-header h2 i {
  color: var(--accent-2);
}
.privacy-subtitle {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.privacy-intro {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.privacy-card {
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 0;
  margin: 10px 0;
  overflow: hidden;
}
.privacy-card details {
  padding: 0;
}
.privacy-card summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 44px 14px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.privacy-card summary::-webkit-details-marker { display: none; }
.privacy-card summary i {
  color: var(--accent-2);
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}
.privacy-card summary::after {
  content: "\f078"; /* fa-chevron-down */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.privacy-card details[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}
.privacy-card summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
  border-radius: 12px;
}
.privacy-card details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.privacy-body {
  padding: 12px 16px 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--fg);
}
.privacy-body p {
  margin: 0 0 10px;
}
.privacy-body p:last-child { margin-bottom: 0; }
.privacy-body ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.privacy-body li {
  margin-bottom: 6px;
  color: var(--fg);
}
.privacy-body li:last-child { margin-bottom: 0; }
.privacy-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}
.privacy-body a {
  color: var(--accent-2);
  text-decoration: underline;
}
.privacy-note {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.privacy-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

/* Terms section body — callout boxes inside accordion */
.terms-section-body .terms-callout {
  background: rgba(255, 193, 7, .08);
  border-left: 3px solid #ffc107;
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.terms-section-body .terms-callout.warn {
  background: rgba(244, 67, 54, .08);
  border-left-color: #f44336;
}
.terms-section-body h3 {
  font-size: 0.92rem;
  margin: 1.1em 0 0.4em;
  color: var(--fg);
}
.terms-section-body ol {
  margin: 8px 0;
  padding-left: 20px;
}
.terms-section-body ol li {
  margin-bottom: 4px;
}
.terms-section-body a {
  color: var(--accent-2);
  text-decoration: underline;
}

/* Profile "Privacy & Dati" link card */
.profile-link-card {
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 6px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.profile-link-card:hover,
.profile-link-card:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  outline: none;
}
.profile-link-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-link-icon {
  font-size: 1.4rem;
  color: var(--accent-2);
  width: 32px;
  text-align: center;
  flex: 0 0 32px;
}
.profile-link-text {
  flex: 1 1 auto;
  min-width: 0;
}
.profile-link-text h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}
.profile-link-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.profile-link-chevron {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 0 0 auto;
}

/* Auth fineprint (login / invite) */
.auth-fineprint,
.login-hero .auth-fineprint {
  margin: 48px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.85;
  max-width: 320px;
}
.auth-fineprint a {
  color: var(--muted);
  text-decoration: underline;
}
.auth-fineprint a:hover { color: var(--fg); }

/* ============================================================
   Instant Win � badge, box, celebration overlay
   ============================================================ */
.lot-badge-instant {
  display: inline-block;
  margin: 4px 0;
  padding: 2px 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f5b301, #ffd24a);
  color: #4a2e00;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 0 0 1px rgba(245, 179, 1, 0.35);
  animation: iw-soft-pulse 2.6s ease-in-out infinite;
}
@keyframes iw-soft-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245, 179, 1, 0.35); }
  50%      { box-shadow: 0 0 10px 1px rgba(245, 179, 1, 0.55); }
}

.instant-win-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px solid rgba(245, 179, 1, 0.45);
  background: linear-gradient(90deg, rgba(255, 210, 74, 0.12), rgba(245, 179, 1, 0.08));
  border-radius: 8px;
}
.instant-win-box .instant-win-icon { font-size: 1.2rem; }
.instant-win-box .instant-win-text { flex: 1; }
.instant-win-box .instant-win-cta {
  background: linear-gradient(90deg, #f5b301, #ffd24a);
  color: #4a2e00;
  border: none;
  font-weight: 700;
}

.btn-instant-win {
  background: linear-gradient(90deg, #f5b301, #ffd24a) !important;
  color: #4a2e00 !important;
  font-weight: 700;
}
.btn-instant-win-soft {
  box-shadow: 0 0 0 2px rgba(245, 179, 1, 0.35) inset;
}

.field-help { display: block; margin-top: 4px; color: #777; font-size: 0.78rem; }
.field-hint { color: #999; font-weight: 400; font-size: 0.8rem; }

/* Celebration overlay */
.instant-win-overlay {
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: iw-fade-in 160ms ease-out;
}
.instant-win-overlay.fade-out { animation: iw-fade-out 180ms ease-in forwards; }
@keyframes iw-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes iw-fade-out { from { opacity: 1; } to { opacity: 0; } }

.instant-win-card {
  position: relative;
  overflow: hidden;
  padding: 28px 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a1206 0%, #2d1f08 100%);
  color: #ffd24a;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 179, 1, 0.4);
  min-width: 260px;
  animation: iw-pop 220ms cubic-bezier(.2,.9,.3,1.4);
}
.instant-win-card.reduced { animation: none; }
@keyframes iw-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.instant-win-trophy {
  font-size: 3.2rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(245, 179, 1, 0.7));
  animation: iw-trophy 1.8s ease-in-out infinite;
}
.instant-win-card.reduced .instant-win-trophy { animation: none; }
@keyframes iw-trophy {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-4px) rotate(-3deg); }
}
.instant-win-title { margin: 4px 0 2px; color: #ffd24a; font-size: 1.5rem; }
.instant-win-sub   { margin: 0 0 6px; color: #f0d9a3; font-size: 0.95rem; }
.instant-win-amount { margin: 6px 0 0; color: #fff; font-size: 1.6rem; font-weight: 700; }

.instant-win-shimmer {
  position: absolute;
  top: 0; left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg,
    transparent 0%,
    rgba(255, 210, 74, 0.18) 50%,
    transparent 100%);
  animation: iw-shimmer 1.6s linear infinite;
  pointer-events: none;
}
@keyframes iw-shimmer {
  from { transform: translateX(0); }
  to   { transform: translateX(400%); }
}

@media (prefers-reduced-motion: reduce) {
  .lot-badge-instant,
  .instant-win-trophy,
  .instant-win-shimmer { animation: none !important; }
  .instant-win-overlay,
  .instant-win-overlay.fade-out { animation: none !important; }
}


/* -------------------------------------------------------------------------
   TERMS & CONDITIONS � pagina lettura + pagina accettazione (gating)
   ------------------------------------------------------------------------- */
.terms-page,
.terms-accept {
  max-width: 820px;
  margin: 16px auto;
  padding: 16px 14px 80px;
}
.terms-page-header h2,
.terms-accept-header h2 {
  display: flex; align-items: center; gap: .5em;
  margin: 0 0 .25em;
}
.terms-page-header .muted,
.terms-accept-header .muted {
  opacity: .7; font-size: .9rem; margin: 0 0 1em;
}
.terms-embed-wrap,
.terms-accept-doc {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 16px 18px;
  line-height: 1.55;
}
.terms-accept-doc {
  max-height: 50vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.terms-accept-doc h2 {
  font-size: 1.05rem; margin-top: 1.4em; padding-top: .35em;
  border-top: 1px solid rgba(255,255,255,.08);
}
.terms-accept-doc h3 { font-size: .95rem; margin-top: 1em; }
.terms-accept-doc .terms-callout {
  background: rgba(255,193,7,.08);
  border-left: 3px solid #ffc107;
  padding: 8px 12px; margin: 10px 0; border-radius: 4px;
}
.terms-accept-doc .terms-callout.warn {
  background: rgba(244,67,54,.08); border-left-color: #f44336;
}
.terms-accept-controls {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
}
.terms-check {
  display: flex; gap: .6em; align-items: flex-start;
  padding: 8px 0;
  cursor: pointer;
  line-height: 1.4;
}
.terms-check input[type="checkbox"] {
  margin-top: .25em;
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.terms-scroll-hint {
  margin: 8px 0 14px;
  font-size: .9rem;
  opacity: .8;
  text-align: center;
}
.terms-accept-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
}
.terms-accept-actions button { flex: 1 1 160px; min-height: 44px; }
.terms-page-actions { margin-top: 16px; text-align: center; }

@media (max-width: 480px) {
  .terms-accept-doc { max-height: 45vh; }
  .terms-page, .terms-accept { padding: 10px 8px 80px; }
}
/* --- ADMIN TERMS (v2.19.0) -------------------------------------------- */
.admin-terms { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-terms-header { display: flex; align-items: center; justify-content: space-between; }
.admin-terms-current, .admin-terms-edit, .admin-terms-preview, .admin-terms-history {
  background: var(--card, #1e1e26); padding: 1rem; border-radius: 10px;
}
.admin-terms-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.terms-current-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 0.75rem; }
.terms-current-dl dt { color: var(--muted, #9aa0a6); }
.terms-current-dl dd { margin: 0; }

.terms-status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; line-height: 1.4;
}
.terms-status-draft     { background: #3a3a44; color: #d0d0d8; }
.terms-status-published { background: #1e3a5c; color: #9cc4ff; }
.terms-status-active    { background: #1e5c2a; color: #a8f0a8; }
.terms-status-archived  { background: #44292a; color: #e0a0a0; }

.terms-history-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.terms-history-table th, .terms-history-table td {
  padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border, #2a2a32); text-align: left; vertical-align: middle;
}
.terms-history-table th { color: var(--muted, #9aa0a6); font-weight: 600; }
.terms-history-actions { display: flex; gap: 0.3rem; }
@media (max-width: 640px) {
  .terms-history-table { font-size: 0.85rem; }
  .terms-history-table th:nth-child(6), .terms-history-table td:nth-child(6) { display: none; }
}

/* ── FISCAL MODULE v2.20.0 ────────────────────────────────────────────── */

/* Billing card (profilo) */
.billing-card {
  background: var(--card, #1c1c22); border: 1px solid var(--border, #2a2a32);
  border-radius: 12px; padding: 16px; margin: 16px 0;
}
.billing-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.billing-card-head h3 { margin: 0; font-size: 1.05rem; }
.billing-optional-chip {
  background: #1e3a2a; color: #a8f0c8; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.billing-loading, .billing-empty, .billing-error { color: var(--muted, #9aa0a6); margin: 6px 0; }
.billing-summary { margin-bottom: 10px; }
.billing-summary strong { display: block; font-size: 1rem; }
.billing-summary-meta { color: var(--muted, #9aa0a6); font-size: 0.85rem; margin-top: 4px; }

/* Billing modal */
.billing-modal .billing-subtitle { color: var(--muted, #9aa0a6); margin: 0 0 12px; font-size: 0.9rem; }
.billing-form { display: flex; flex-direction: column; gap: 10px; }
.billing-entity-toggle { display: flex; gap: 14px; padding: 6px 0; }
.billing-entity-toggle label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.billing-field { display: flex; flex-direction: column; gap: 4px; }
.billing-field > span { font-size: 0.85rem; color: var(--muted, #9aa0a6); }
.billing-field input, .billing-field textarea {
  background: #0f0f14; border: 1px solid var(--border, #2a2a32); border-radius: 8px;
  padding: 8px 10px; color: inherit; font: inherit; resize: vertical;
}
.billing-hint { color: var(--muted, #9aa0a6); font-size: 0.78rem; margin: 4px 0 0; }

/* My-documents page */
.my-documents .page-hint { color: var(--muted, #9aa0a6); margin-top: -6px; }
.documents-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.documents-filters .chip {
  background: #1c1c22; border: 1px solid var(--border, #2a2a32); color: inherit;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 0.88rem;
}
.documents-filters .chip.active { background: var(--accent, #0d6efd); border-color: transparent; color: #fff; }
.documents-filters .chip-reload { margin-left: auto; }

.documents-list { display: flex; flex-direction: column; gap: 10px; }
.document-item {
  background: var(--card, #1c1c22); border: 1px solid var(--border, #2a2a32);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.document-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.document-date { color: var(--muted, #9aa0a6); font-size: 0.85rem; margin-left: auto; }
.document-related { display: flex; flex-direction: column; gap: 3px; font-size: 0.88rem; }
.related-lot { color: var(--accent, #0d6efd); text-decoration: none; }
.related-lot:hover { text-decoration: underline; }
.document-notes { color: var(--muted, #9aa0a6); font-size: 0.85rem; margin: 0; white-space: pre-wrap; }
.document-actions { display: flex; gap: 8px; margin-top: 2px; }
.document-pending { color: var(--muted, #9aa0a6); font-style: italic; font-size: 0.85rem; }

.document-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 8px;
  border-radius: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.document-badge-receipt { background: #1e3a5c; color: #9cc4ff; }
.document-badge-invoice { background: #4a2a5c; color: #d0a8ff; }
.document-badge-other   { background: #44423a; color: #e8d8a0; }

.document-status {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 3px 8px; border-radius: 8px;
}
.document-status-draft  { background: #3a3a3a; color: #c0c0c0; }
.document-status-issued { background: #1e5c2a; color: #a8f0a8; }
.document-status-sent   { background: #1e3a5c; color: #9cc4ff; }

/* Admin documents panel */
.admin-doc-step {
  background: var(--card, #1c1c22); border: 1px solid var(--border, #2a2a32);
  border-radius: 12px; padding: 14px 16px; margin: 12px 0;
}
.admin-doc-step h4 { margin: 0 0 8px; font-size: 1rem; }
.admin-doc-step[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.buyer-suggest {
  position: relative; background: #0f0f14; border: 1px solid var(--border, #2a2a32);
  border-radius: 8px; margin-top: 4px; max-height: 240px; overflow: auto;
}
.suggest-item {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
  background: transparent; border: 0; padding: 8px 10px; cursor: pointer; color: inherit;
  border-bottom: 1px solid var(--border, #2a2a32);
}
.suggest-item:hover { background: #1c1c22; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-meta { color: var(--muted, #9aa0a6); font-size: 0.78rem; }

.related-lots { list-style: none; padding: 0; margin: 0; max-height: 240px; overflow: auto; }
.related-lots li { padding: 4px 0; border-bottom: 1px solid var(--border, #2a2a32); }
.related-lots li:last-child { border-bottom: 0; }
.related-lots label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.related-lot-meta { color: var(--muted, #9aa0a6); font-size: 0.8rem; margin-left: 8px; }

.upload-progress { margin-top: 8px; }
.upload-progress .bar {
  background: #0f0f14; border: 1px solid var(--border, #2a2a32); border-radius: 999px;
  height: 8px; overflow: hidden;
}
.upload-progress .bar-fill {
  background: var(--accent, #0d6efd); height: 100%; width: 0%; transition: width 0.2s;
}
.upload-progress small { color: var(--muted, #9aa0a6); font-size: 0.78rem; }

.documents-admin-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.documents-admin-filters select, .documents-admin-filters input {
  background: #0f0f14; border: 1px solid var(--border, #2a2a32); border-radius: 8px;
  padding: 6px 10px; color: inherit; font: inherit;
}
.documents-admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.documents-admin-table th, .documents-admin-table td {
  padding: 8px 8px; border-bottom: 1px solid var(--border, #2a2a32); text-align: left; vertical-align: middle;
}
.documents-admin-table th { color: var(--muted, #9aa0a6); font-weight: 600; }
.documents-admin-actions { display: flex; gap: 4px; }
.documents-admin-table code { font-size: 0.78rem; color: var(--muted, #9aa0a6); }
@media (max-width: 640px) {
  .documents-admin-table { font-size: 0.82rem; }
  .documents-admin-table th:nth-child(4), .documents-admin-table td:nth-child(4) { display: none; }
}

/* Documents link card on profile */
.documents-link-card { margin: 12px 0; }


/* ─── v2.21.0 Post-sale support module ─────────────────────────────────── */

/* ─ List page ─ */
.support-page-head { display:flex; justify-content:space-between; align-items:center; gap:.5rem; flex-wrap:wrap; margin-bottom:.25rem; }
.support-filters { display:flex; gap:.4rem; flex-wrap:wrap; margin:.5rem 0 1rem; }
.support-list { display:flex; flex-direction:column; gap:.6rem; }
.support-item {
  background: var(--card-bg, #1c1f24); border:1px solid var(--border, #2a2f37);
  border-radius:10px; padding:.7rem .9rem; cursor:pointer; transition:background .15s, border-color .15s;
}
.support-item:hover, .support-item:focus { background:#23272f; border-color:#3a4150; outline:none; }
.support-item-head { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin-bottom:.35rem; }
.support-subject { margin:0; font-size:1rem; font-weight:600; }
.support-lot { margin:.3rem 0 0; font-size:.85rem; opacity:.75; }

/* ─ Badges & status ─ */
.support-badge {
  font-size:.72rem; padding:.15rem .5rem; border-radius:999px; font-weight:600; text-transform:uppercase; letter-spacing:.03em;
}
.support-badge-problem  { background:#5a3030; color:#ffb3b3; }
.support-badge-dispute  { background:#5a4030; color:#ffd1a8; }
.support-badge-return   { background:#30505a; color:#a8e0ff; }
.support-badge-generic  { background:#3a4050; color:#c8d2e0; }

.support-status {
  font-size:.72rem; padding:.15rem .5rem; border-radius:999px; font-weight:600;
}
.support-status-open        { background:#2a4a3a; color:#9bf0c5; }
.support-status-in_progress { background:#3a3a6a; color:#b3b8ff; }
.support-status-resolved    { background:#3a5a3a; color:#a8f0a8; }
.support-status-closed      { background:#3a3a3a; color:#aaa; }

.support-date { font-size:.75rem; opacity:.65; margin-left:auto; }
.support-unread-dot {
  display:inline-block; width:9px; height:9px; border-radius:50%; background:#ff5252; box-shadow:0 0 0 2px rgba(255,82,82,.25);
}

/* ─ Detail / thread ─ */
.support-detail-head { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin-bottom:.5rem; }
.support-thread-head { margin-bottom:.8rem; }
.support-thread-meta { display:flex; gap:.4rem; flex-wrap:wrap; margin-bottom:.4rem; }
.support-thread-subject { margin:.2rem 0; font-size:1.15rem; }
.support-thread-lot {
  display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; color:inherit;
  background:#1f242b; border:1px solid #2a2f37; border-radius:8px; padding:.3rem .55rem; font-size:.85rem;
}
.support-thread-lot:hover { border-color:#3a4150; }
.support-thread-lot .lot-price { opacity:.7; margin-left:.4rem; }

.support-thread {
  display:flex; flex-direction:column; gap:.6rem;
  max-height:55vh; overflow-y:auto; padding:.5rem; background:#13161a; border:1px solid #2a2f37; border-radius:10px;
}
.support-message { display:flex; flex-direction:column; max-width:85%; }
.support-message.from-user  { align-self:flex-start; }
.support-message.from-admin { align-self:flex-end; }
.support-message-bubble {
  padding:.55rem .8rem; border-radius:14px; line-height:1.4; white-space:pre-wrap; word-wrap:break-word;
  background:#262b34; color:#eef;
}
.support-message.from-admin .support-message-bubble {
  background:#2a4a7a; color:#fff;
}
.support-message-meta { display:flex; gap:.5rem; font-size:.7rem; opacity:.6; margin-top:.2rem; padding:0 .3rem; }
.support-message.from-admin .support-message-meta { justify-content:flex-end; }

/* ─ Input ─ */
.support-input {
  margin-top:.8rem; display:flex; flex-direction:column; gap:.4rem;
  background:#1c1f24; border:1px solid #2a2f37; border-radius:10px; padding:.6rem;
}
.support-input textarea {
  width:100%; min-height:70px; background:#13161a; border:1px solid #2a2f37; color:inherit;
  border-radius:8px; padding:.5rem; font-family:inherit; resize:vertical;
}
.support-input-actions { display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.support-input-count { font-size:.75rem; opacity:.6; }
.support-closed-note {
  margin-top:.8rem; padding:.6rem .8rem; background:#23272f; border-left:3px solid #888;
  border-radius:6px; font-size:.85rem; opacity:.85;
}

/* ─ Create modal ─ */
.support-create-modal { max-width:520px; }
.support-create-subtitle { opacity:.75; font-size:.9rem; margin:0 0 .8rem; }
.support-create-form { display:flex; flex-direction:column; gap:.7rem; }
.support-field { display:flex; flex-direction:column; gap:.3rem; }
.support-field > span { font-size:.85rem; opacity:.75; }
.support-field input, .support-field select, .support-field textarea {
  background:#13161a; border:1px solid #2a2f37; color:inherit; border-radius:8px;
  padding:.5rem .6rem; font-family:inherit;
}
.support-hint { font-size:.75rem; opacity:.6; margin:.1rem 0 0; }

/* ─ Admin support ─ */
.admin-support-filters { display:flex; gap:.5rem; margin:.5rem 0 1rem; flex-wrap:wrap; }
.admin-support-table { width:100%; border-collapse:collapse; }
.admin-support-table th, .admin-support-table td {
  text-align:left; padding:.45rem .5rem; border-bottom:1px solid #2a2f37; font-size:.9rem;
}
.admin-support-detail {
  margin-top:1rem; padding:1rem; background:#1c1f24; border:1px solid #2a2f37; border-radius:10px;
}
.admin-support-detail-head h4 { margin:.3rem 0; }
.admin-support-detail .d-user code { background:#13161a; padding:.1rem .3rem; border-radius:4px; font-size:.8rem; }
.admin-support-actions { display:flex; gap:.5rem; align-items:center; margin:.8rem 0; flex-wrap:wrap; }

/* Support notification class (mirror notif-* tinting) */
.notif-support { background:#2a3950; color:#a8c8ff; }

@media (max-width:480px) {
  .support-thread { max-height:48vh; }
  .support-message { max-width:92%; }
}
