/* =========================================================================
   StarConversor — modern design system
   ========================================================================= */
:root {
  /* surfaces */
  --bg: #08080f;
  --bg-2: #0b0b16;
  --panel: rgba(22, 23, 38, 0.55);
  --panel-solid: #14141f;
  --panel-2: rgba(30, 32, 52, 0.6);
  --panel-2-solid: #191b2b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  /* text */
  --text: #f2f2fa;
  --text-muted: #9a9cb5;
  /* brand */
  --accent: #8b5cf6;
  --accent-strong: #a78bfa;
  --accent-alt: #fbbf24;
  --accent-2: #22d3ee;
  --pink: #f472b6;
  --danger: #fb7185;
  --success: #34d399;
  /* effects */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 20px 50px -18px rgba(139, 92, 246, 0.35);
  --grad: linear-gradient(135deg, #8b5cf6, #6366f1 55%, #22d3ee);
  --grad-warm: linear-gradient(135deg, #fbbf24, #f472b6);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
a { color: inherit; }
::selection { background: rgba(139, 92, 246, 0.35); }

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); background-clip: padding-box; }

/* ---------- Animated aurora background ---------- */
.bg-glow {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(45% 45% at 15% 12%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(40% 40% at 88% 8%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(50% 50% at 75% 95%, rgba(244, 114, 182, 0.16), transparent 60%),
    radial-gradient(45% 45% at 25% 90%, rgba(251, 191, 36, 0.12), transparent 60%);
  filter: blur(20px);
  animation: aurora 22s ease-in-out infinite alternate;
}
.bg-glow::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 80%);
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, -1%, 0) scale(1.04); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(8,8,15,0.9), rgba(8,8,15,0.55));
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.16rem; letter-spacing: -0.01em; text-decoration: none; font-family: var(--font-display); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(139,92,246,0.55));
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }
.brand-name { background: linear-gradient(90deg, #fff, #c9c4ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.topbar-status { display: flex; gap: 9px; align-items: center; }
.status-pill {
  font-size: 0.76rem; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--panel); backdrop-filter: blur(6px);
}
.status-pill.ok { color: var(--success); border-color: rgba(52,211,153,0.4); box-shadow: 0 0 18px -6px rgba(52,211,153,0.5); }
.status-pill.bad { color: var(--danger); border-color: rgba(251,113,133,0.4); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); padding: 9px 16px; border-radius: 11px;
  font-size: 0.86rem; cursor: pointer; font-weight: 600; font-family: var(--font);
  transition: transform 0.16s cubic-bezier(.2,.7,.3,1), border-color 0.16s, box-shadow 0.16s, background 0.16s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px; justify-content: center;
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.16), transparent);
  transform: skewX(-18deg); transition: left 0.6s ease;
}
.btn:hover::after { left: 130%; }
.btn.ghost { background: rgba(255,255,255,0.03); color: var(--text-muted); }
.btn.ghost:hover { color: var(--text); }
.btn.primary { background: var(--grad); background-size: 160% 160%; border-color: transparent; color: #fff; box-shadow: 0 10px 26px -10px rgba(139,92,246,0.7); animation: gradShift 6s ease infinite; }
.btn.primary:hover { box-shadow: 0 16px 34px -10px rgba(139,92,246,0.8); }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; animation: none; }
.btn.success { background: linear-gradient(135deg, var(--success), #10b981); border-color: transparent; color: #052e1a; box-shadow: 0 10px 26px -12px rgba(52,211,153,0.7); }
.btn.small { padding: 6px 12px; font-size: 0.8rem; border-radius: 9px; }
.btn.big { padding: 15px 28px; font-size: 1.02rem; border-radius: 14px; }
.btn.discord { background: #5865F2; color: #fff; border: none; box-shadow: 0 10px 26px -12px rgba(88,101,242,0.8); }
.btn.discord:hover { background: #4752c4; }
.discord-logo { font-size: 0.95em; }

.icon-btn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 0.95rem;
  transition: all 0.16s ease; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: rgba(139,92,246,0.12); }

/* ---------- Shell / panel layout ---------- */
.shell { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 40px 28px 90px; }
.hero { max-width: 780px; margin-bottom: 38px; }
.hero-tech-badge {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(139,92,246,0.35);
  border-radius: 999px; padding: 6px 16px 6px 10px; margin-bottom: 18px;
  background: rgba(139,92,246,0.08); animation: fadeUp 0.6s ease both;
}
.hero-tech-badge img { width: 20px; height: 20px; object-fit: contain; display: block; border-radius: 5px; }
.hero-tech-badge .arrow { color: var(--text-muted); flex-shrink: 0; }
.hero-tech-badge span { font-size: 0.78rem; font-weight: 600; color: var(--accent-strong); letter-spacing: 0.2px; }
.hero h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 14px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.02em; }
.hero p { color: var(--text-muted); font-size: 1.04rem; line-height: 1.65; margin: 0; }
.accent { background: linear-gradient(120deg, var(--accent-strong), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.accent-alt { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.workspace { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-heading h2 { font-size: 1.06rem; margin: 0; font-weight: 600; font-family: var(--font-display); }
.muted { color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 0; }

/* Glass panels */
.pack-list-panel, .items-panel > .pack-detail, .items-panel > .result-panel, .empty-state {
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.pack-list-panel { position: sticky; top: 86px; }

.pack-list { display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; padding-right: 4px; }

/* Upload box */
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 20px 16px; text-align: center; margin-bottom: 18px;
  transition: all 0.2s ease; position: relative; overflow: hidden;
}
.upload-box::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(60% 60% at 50% 0%, rgba(139,92,246,0.16), transparent 70%);
}
.upload-box.dragover { border-color: var(--accent); transform: scale(1.01); }
.upload-box.dragover::before { opacity: 1; }
.upload-icon { font-size: 1.8rem; margin-bottom: 8px; animation: floaty 4s ease-in-out infinite; }
.upload-box p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 12px; }
.upload-box code { color: var(--accent-alt); font-size: 0.75rem; }
.upload-hint { margin-top: 10px !important; min-height: 1em; }

.convert-all-btn { width: 100%; margin-bottom: 14px; }

/* Pack cards */
.pack-card {
  display: flex; flex-direction: column; gap: 4px; padding: 13px 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--panel-2); cursor: pointer; text-align: left;
  transition: transform 0.16s cubic-bezier(.2,.7,.3,1), border-color 0.16s, background 0.16s;
}
.pack-card:hover { border-color: var(--border-strong); transform: translateX(3px); }
.pack-card.active { border-color: var(--accent); background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(34,211,238,0.06)); box-shadow: inset 0 0 0 1px rgba(139,92,246,0.3); }
.pack-card .pname { font-weight: 600; font-size: 0.93rem; }
.pack-card .pmeta { font-size: 0.76rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }

.skeleton-row { height: 54px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--panel-2-solid) 25%, #232538 37%, var(--panel-2-solid) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 360px; color: var(--text-muted); text-align: center; }
.empty-icon { font-size: 2.8rem; opacity: 0.7; animation: floaty 5s ease-in-out infinite; }

.hidden { display: none !important; }

.pack-detail-heading { align-items: flex-start; gap: 12px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Item grid ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; margin-top: 6px; }
.item-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px; cursor: pointer; position: relative;
  transition: transform 0.18s cubic-bezier(.2,.7,.3,1), border-color 0.18s, box-shadow 0.18s;
  animation: cardIn 0.45s cubic-bezier(.2,.7,.3,1) both;
}
.item-grid .item-card:nth-child(1){animation-delay:.02s}.item-grid .item-card:nth-child(2){animation-delay:.05s}.item-grid .item-card:nth-child(3){animation-delay:.08s}.item-grid .item-card:nth-child(4){animation-delay:.11s}.item-grid .item-card:nth-child(5){animation-delay:.14s}.item-grid .item-card:nth-child(6){animation-delay:.17s}.item-grid .item-card:nth-child(7){animation-delay:.2s}.item-grid .item-card:nth-child(8){animation-delay:.23s}.item-grid .item-card:nth-child(n+9){animation-delay:.26s}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.item-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(139,92,246,0.6); }
.item-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 30px -18px rgba(139,92,246,0.7); }
.item-card .thumb-wrap {
  width: 100%; aspect-ratio: 1;
  background: repeating-conic-gradient(#171826 0% 25%, #10111b 0% 50%) 50% / 15px 15px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 9px;
}
.item-card img.thumb { max-width: 92%; max-height: 92%; image-rendering: pixelated; transition: transform 0.25s ease; }
.item-card:hover img.thumb { transform: scale(1.08); }
.item-card .thumb-fallback { font-size: 1.6rem; opacity: 0.4; }
.item-card .iname { font-size: 0.82rem; font-weight: 600; line-height: 1.28; margin-bottom: 4px; }
.item-card .ibadges { display: flex; flex-wrap: wrap; gap: 4px; }

.badge { font-size: 0.62rem; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.badge.model { color: var(--accent-strong); border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.1); }
.badge.icon { color: var(--accent-alt); border-color: rgba(251,191,36,0.45); background: rgba(251,191,36,0.08); }
.badge.wearable { color: var(--accent-2); border-color: rgba(34,211,238,0.4); }
.badge.warn { color: var(--danger); border-color: rgba(251,113,133,0.5); background: rgba(251,113,133,0.08); }
.badge.fixed { color: var(--success); border-color: rgba(52,211,153,0.5); background: rgba(52,211,153,0.08); }

.check {
  position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--text-muted); background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; font-size: 0.72rem;
  transition: all 0.16s ease; opacity: 0;
}
.item-card:hover .check, .item-card.selected .check { opacity: 1; }
.item-card.selected .check { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 0 14px -2px rgba(139,92,246,0.8); }

.edit-btn {
  position: absolute; bottom: 9px; right: 9px; width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.5); color: var(--text-muted);
  cursor: pointer; font-size: 0.75rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.16s ease; opacity: 0;
}
.item-card:hover .edit-btn { opacity: 1; }
.edit-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- Result panel ---------- */
.result-panel { margin-top: 22px; animation: cardIn 0.4s ease both; }
.result-stats { display: flex; gap: 11px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; min-width: 104px; transition: transform 0.16s; }
.stat-chip:hover { transform: translateY(-2px); }
.stat-chip .n { font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); }
.stat-chip .l { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-chip.c3d .n { color: var(--accent-strong); }
.stat-chip.cicon .n { color: var(--accent-alt); }
.stat-chip.cskip .n { color: var(--danger); }

.result-log { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 18px; background: rgba(0,0,0,0.15); }
.log-row { display: flex; gap: 10px; padding: 8px 13px; font-size: 0.8rem; border-bottom: 1px solid var(--border); align-items: baseline; }
.log-row:last-child { border-bottom: none; }
.log-row .lid { font-weight: 600; min-width: 200px; }
.log-row .lnote { color: var(--text-muted); }
.log-status { font-size: 0.64rem; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.log-status.converted-3d { color: var(--accent-strong); border-color: rgba(139,92,246,0.45); }
.log-status.icon-only { color: var(--accent-alt); border-color: rgba(251,191,36,0.45); }
.log-status.skipped, .log-status.error { color: var(--danger); border-color: rgba(251,113,133,0.45); }
.result-actions { display: flex; gap: 11px; flex-wrap: wrap; }

/* ---------- Auth chip ---------- */
.auth-area { display: flex; align-items: center; }
.user-menu { position: relative; }
.chip-main {
  display: flex; align-items: center; gap: 8px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text); cursor: pointer;
  padding: 4px 10px 4px 4px; font-family: var(--font); border-radius: 999px;
  transition: opacity 0.15s, border-color 0.15s;
}
.chip-main:hover { opacity: 0.85; border-color: var(--border-strong); }
.chip-caret { flex-shrink: 0; transition: transform 0.18s ease; }
.user-menu.open .chip-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px; z-index: 60;
  background: linear-gradient(180deg, rgba(26,27,44,0.98), rgba(18,19,30,0.98));
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px;
  animation: modalIn 0.18s cubic-bezier(.2,.8,.3,1);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 8px; border: none; background: none;
  color: var(--text); font-size: 0.85rem; font-family: var(--font); cursor: pointer;
  text-decoration: none; transition: background 0.15s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(251,113,133,0.1); }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.user-avatar { width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--border-strong); }
.chip-main span { font-size: 0.85rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,4,10,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, rgba(26,27,44,0.95), rgba(18,19,30,0.95));
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
  animation: modalIn 0.28s cubic-bezier(.2,.8,.3,1); max-height: 88vh; overflow-y: auto;
}
.modal-wide { max-width: 660px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 1.06rem; font-family: var(--font-display); }
.edit-issues { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.edit-issues:empty { display: none; }
.issue-line { font-size: 0.78rem; color: var(--danger); background: rgba(251,113,133,0.08); border: 1px solid rgba(251,113,133,0.28); border-radius: 8px; padding: 8px 11px; line-height: 1.4; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field span { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.field input {
  background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; outline: none; font-family: var(--font);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,0.18); }
.modal-hint { font-size: 0.75rem; line-height: 1.5; margin: 2px 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Texture remap section */
.texture-section { margin: 6px 0 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.section-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 11px; }
.texture-list { display: flex; flex-direction: column; gap: 8px; }
.tex-row { display: flex; align-items: center; gap: 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; transition: border-color 0.16s; }
.tex-row:hover { border-color: var(--border-strong); }
.tex-thumb { width: 36px; height: 36px; border-radius: 7px; background: repeating-conic-gradient(#232538 0% 25%, #1a1c2b 0% 50%) 50% / 12px 12px; image-rendering: pixelated; flex-shrink: 0; object-fit: contain; }
.tex-info { flex: 1; min-width: 0; }
.tex-var { font-size: 0.8rem; font-weight: 600; }
.tex-var .miss { color: var(--danger); font-weight: 500; }
.tex-var .ok { color: var(--success); font-weight: 500; }
.tex-select { width: 100%; margin-top: 5px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 6px 8px; font-size: 0.78rem; font-family: var(--font); }
.tex-select:focus { outline: none; border-color: var(--accent); }

/* History list */
.history-list { display: flex; flex-direction: column; gap: 9px; max-height: 60vh; overflow-y: auto; }
.history-row { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; transition: border-color 0.16s, transform 0.16s; }
.history-row:hover { border-color: var(--border-strong); transform: translateX(2px); }
.history-row .hinfo { flex: 1; min-width: 0; }
.history-row .hname { font-weight: 600; }
.history-row .hmeta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.history-row .hactions { display: flex; gap: 6px; flex-shrink: 0; }
.history-empty { color: var(--text-muted); text-align: center; padding: 34px; }

/* Payment box */
.pay-box { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; animation: fadeUp 0.4s ease both; }
.pay-price { font-size: 1.9rem; font-weight: 800; font-family: var(--font-display); }
.pay-price .cur { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pay-sub { color: var(--text-muted); font-size: 0.88rem; margin: 4px 0 16px; }
.pay-options { display: flex; flex-direction: column; gap: 11px; }
.pay-choice { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 15px; flex-wrap: wrap; transition: border-color 0.16s; }
.pay-choice:hover { border-color: var(--border-strong); }
.pay-choice .pc-info { flex: 1; min-width: 160px; }
.pay-choice .pc-title { font-weight: 600; }
.pay-choice .pc-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.pay-providers { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-locked-note { color: var(--success); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.provider-btn { display: inline-flex; align-items: center; gap: 6px; }
.provider-btn.mp { background: #00b1ea; color: #fff; border: none; }
.provider-btn.stripe { background: #635bff; color: #fff; border: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(0);
  background: linear-gradient(180deg, rgba(30,31,50,0.98), rgba(20,21,34,0.98));
  border: 1px solid var(--border-strong); padding: 13px 22px; border-radius: 13px;
  font-size: 0.88rem; box-shadow: var(--shadow); z-index: 70; animation: toastIn 0.3s cubic-bezier(.2,.8,.3,1);
}
.toast.hidden { display: none !important; }
.toast.error { border-color: rgba(251,113,133,0.5); color: var(--danger); }
.toast.success { border-color: rgba(52,211,153,0.5); color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- Scroll reveal ---------- */
.reveal-armed .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(.2,.7,.3,1), transform 0.7s cubic-bezier(.2,.7,.3,1); transition-delay: var(--rd, 0ms); }
.reveal-armed .reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   Landing page
   ========================================================================= */
.landing-main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 20px 24px 70px; }
.landing-hero { text-align: center; padding: 70px 10px 50px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent-strong); border: 1px solid rgba(139,92,246,0.35);
  border-radius: 999px; padding: 7px 16px; margin-bottom: 26px; background: rgba(139,92,246,0.08);
  animation: fadeUp 0.6s ease both, pulseBadge 3s ease-in-out infinite 0.6s;
}
@keyframes pulseBadge { 0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); } 50% { box-shadow: 0 0 24px -4px rgba(139,92,246,0.5); } }
.landing-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.06; margin: 0 0 20px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; animation: fadeUp 0.7s ease both 0.05s; }
.hero-sub { color: var(--text-muted); max-width: 660px; margin: 0 auto 30px; font-size: 1.08rem; line-height: 1.65; animation: fadeUp 0.7s ease both 0.15s; }
.hero-cta { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; animation: fadeUp 0.7s ease both 0.25s; }
.hero-cta.center { margin-top: 30px; }
.hero-note { margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; animation: fadeUp 0.7s ease both 0.35s; }
.hero-note code { color: var(--accent-alt); }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 60px 0; }
.feature-card {
  position: relative; background: var(--panel); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; overflow: hidden;
  transition: transform 0.2s cubic-bezier(.2,.7,.3,1), border-color 0.2s, box-shadow 0.2s;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s; pointer-events: none;
  background: radial-gradient(180px 180px at var(--mx, 50%) var(--my, 0%), rgba(139,92,246,0.16), transparent 70%);
}
.feature-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 24px 50px -24px rgba(139,92,246,0.5); }
.feature-card:hover::before { opacity: 1; }
.feature-ico { font-size: 2rem; margin-bottom: 12px; display: inline-block; }
.feature-card:hover .feature-ico { animation: floaty 1.6s ease-in-out infinite; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.08rem; font-family: var(--font-display); }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }

.landing-steps { margin: 80px 0; text-align: center; }
.landing-steps h2, .landing-pricing h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 10px; font-family: var(--font-display); letter-spacing: -0.02em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; text-align: left; }
.step { display: flex; gap: 15px; background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform 0.2s, border-color 0.2s; }
.step:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.step-n { flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); box-shadow: 0 8px 20px -8px rgba(139,92,246,0.7); }
.step strong { display: block; margin-bottom: 5px; font-family: var(--font-display); }
.step p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }

.landing-pricing { margin: 80px 0 40px; text-align: center; }
.center { text-align: center; }
.pricing-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 32px 0; }
.price-card {
  background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 18px; transition: transform 0.2s cubic-bezier(.2,.7,.3,1), border-color 0.2s, box-shadow 0.2s;
}
.price-card:hover { transform: translateY(-6px); border-color: rgba(139,92,246,0.5); box-shadow: 0 24px 50px -24px rgba(139,92,246,0.5); }
.price-tier { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.price-val { font-size: 1.9rem; font-weight: 800; font-family: var(--font-display); background: linear-gradient(120deg, var(--accent-strong), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.price-val span { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; -webkit-text-fill-color: var(--text-muted); }
.price-unlimited { grid-column: 1 / -1; border-color: rgba(139,92,246,0.4); background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(34,211,238,0.05)); }
.price-unlimited .price-val { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.price-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }

.landing-cta { margin: 80px 0 40px; }
.cta-band { text-align: center; background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(34,211,238,0.06)); border: 1px solid rgba(139,92,246,0.3); border-radius: calc(var(--radius) + 6px); padding: 48px 30px; }
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 8px; font-family: var(--font-display); letter-spacing: -0.02em; }
.cta-band .hero-cta { margin-top: 24px; }

.landing-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 26px; display: flex; justify-content: space-between; max-width: 1120px; margin: 0 auto; font-size: 0.85rem; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .landing-features, .steps, .pricing-cards { grid-template-columns: 1fr; }
  .price-unlimited { grid-column: auto; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .pack-list-panel { position: static; }
  .shell { padding: 28px 18px 70px; }
  .topbar { padding: 12px 16px; }
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal-armed .reveal { opacity: 1; transform: none; }
}

/* ================= Icons ================= */
.ico { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
.ico-wrap { display: inline-flex; align-items: center; }
.btn .ico, .side-link .ico { flex-shrink: 0; }

/* ================= App shell with sidebar (client + staff) ================= */
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16,17,28,0.85), rgba(10,10,18,0.85));
  backdrop-filter: blur(16px);
}
.sidebar-brand { text-decoration: none; color: inherit; padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; border-radius: 11px; border: 1px solid transparent;
  background: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; text-align: left; text-decoration: none; font-family: var(--font);
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.side-link:hover { background: rgba(255,255,255,0.05); color: var(--text); transform: translateX(2px); }
.side-link.active { background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(34,211,238,0.06)); color: var(--text); border-color: rgba(139,92,246,0.35); }
.side-foot { display: flex; flex-direction: column; gap: 10px; }
.lang-btn { justify-content: flex-start; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.side-user .su-info { flex: 1; min-width: 0; }
.side-user .su-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .su-plan { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main { padding: 34px 38px 70px; max-width: 1000px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.view-head h1 { font-size: 1.9rem; margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { display: flex; align-items: center; gap: 14px; background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.sc-ico { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(34,211,238,0.12)); display: flex; align-items: center; justify-content: center; color: var(--accent-strong); }
.sc-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.sc-value { font-size: 1.15rem; font-weight: 700; font-family: var(--font-display); }

/* Unlimited plan advert */
.promo { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); border: 1px solid rgba(139,92,246,0.35); background: linear-gradient(135deg, rgba(139,92,246,0.16), rgba(34,211,238,0.06)); padding: 34px; }
.promo-glow { position: absolute; inset: -40%; background: radial-gradient(40% 40% at 80% 10%, rgba(251,191,36,0.18), transparent 65%); animation: aurora 14s ease-in-out infinite alternate; pointer-events: none; }
.promo-body { position: relative; }
.promo-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent-alt); border: 1px solid rgba(251,191,36,0.35); border-radius: 999px; padding: 6px 13px; margin-bottom: 16px; }
.promo h2 { font-size: 1.35rem; margin: 0 0 14px; font-family: var(--font-display); max-width: 520px; line-height: 1.35; }
.promo-price { font-size: 2.2rem; font-weight: 800; font-family: var(--font-display); background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 18px; }
.promo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.plan-active { display: flex; align-items: center; gap: 14px; background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.35); border-radius: var(--radius); padding: 20px 22px; color: var(--success); }
.plan-active .pa-title { font-weight: 700; font-family: var(--font-display); }
.plan-active .pa-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* Conversion cards */
.conv-list { display: flex; flex-direction: column; gap: 11px; }
.conv-card { display: flex; align-items: center; gap: 15px; background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; transition: border-color 0.16s, transform 0.16s; }
.conv-card:hover { border-color: var(--border-strong); transform: translateX(3px); }
.cc-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--accent-strong); flex-shrink: 0; }
.cc-info { flex: 1; min-width: 0; }
.cc-name { font-weight: 600; }
.cc-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.cc-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.cc-locked { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--accent-alt); border: 1px solid rgba(251,191,36,0.35); border-radius: 999px; padding: 6px 12px; }

/* Staff users table */
.user-row { display: flex; align-items: center; gap: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; }
.user-row img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); }
.ur-info { flex: 1; min-width: 0; }
.ur-name { font-weight: 600; font-size: 0.9rem; }
.ur-meta { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.ur-actions { display: flex; gap: 7px; flex-shrink: 0; }
.plan-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.plan-pill.on { color: var(--success); border-color: rgba(52,211,153,0.45); background: rgba(52,211,153,0.08); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .app-main { padding: 24px 18px 60px; }
}

/* form helpers used by staff panel */
.check-line { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; margin: 10px 0; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); }
.tier-line { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.tier-input { width: 96px !important; margin-top: 0 !important; }
.view-head .btn { flex-shrink: 0; }

/* ================= Ferramenta ItemsAdder (pack editor) ================= */
.tool-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; min-height: 360px; color: var(--text-muted);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 30px;
}
.tool-locked h2 { margin: 4px 0 0; font-family: var(--font-display); color: var(--text); font-size: 1.3rem; }
.progress-track { width: 100%; max-width: 320px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent-2)); border-radius: 999px; transition: width 0.3s ease; }

.tool-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-muted);
  border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; cursor: pointer; font-family: var(--font);
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { color: var(--text); border-color: var(--accent); background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(34,211,238,0.06)); }

.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px; animation: cardIn 0.25s ease both;
}
.bulk-bar span { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.bulk-bar input[type="text"] {
  flex: 1; min-width: 160px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 11px; font-size: 0.85rem; outline: none; font-family: var(--font);
}
.bulk-bar input[type="text"]:focus { border-color: var(--accent); }

.tool-item-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tool-item-card { cursor: default; }
.tool-item-card.dirty { border-color: var(--accent-alt); box-shadow: 0 0 0 1px rgba(251,191,36,0.4) inset; }
.tool-select { position: absolute; top: 9px; left: 9px; z-index: 1; }
.tool-select input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.tool-field { margin: 8px 0 6px; }
.tool-field input { padding: 7px 9px; font-size: 0.8rem; }
.hat-toggle { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.hat-toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.name-preview {
  font-size: 0.82rem; font-weight: 600; line-height: 1.3; padding: 6px 9px; margin: -2px 0 8px;
  background: repeating-conic-gradient(#171826 0% 25%, #10111b 0% 50%) 50% / 10px 10px;
  border-radius: 8px; border: 1px solid var(--border); word-break: break-word;
}
.name-preview .cp-empty { color: var(--text-muted); font-weight: 400; }
.bulk-sep { width: 1px; align-self: stretch; background: var(--border-strong); flex-shrink: 0; }
