/* PixSlot — tokens nos papéis do layout de referência (Results Tracking) */
:root {
  --primary: #54f404;
  --primary-rgb: 84, 244, 4;
  --primary-foreground: #05131f;
  --background: #080c12;
  --foreground: #f8f8f5;
  --card: #0b1017;
  --popover: #0d131b;
  --muted: #151c26;
  --muted-foreground: #8396a8;
  --border: #1c2531;
  --sidebar: #05080d;
  --sidebar-border: rgba(255, 255, 255, 0.04);
  --sidebar-accent: #111822;

  --blue: #4ec8ff;
  --amber: #f0b90b;
  --emerald: #0ecb81;
  --rose: #f6465d;

  --radius: 12px;
  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
.muted { color: var(--muted-foreground); }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-sm { width: 12px; height: 12px; flex-shrink: 0; }
.icon-md { width: 14px; height: 14px; flex-shrink: 0; }
.spin { animation: spin 1s linear infinite; }
[hidden] { display: none !important; }

/* ── Animações ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in-scale { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes glow-pulse { 0%, 100% { opacity: .15; transform: translate(-50%, -50%) scale(1); } 50% { opacity: .25; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes glow-pulse-plain { 0%, 100% { opacity: .15; transform: scale(1); } 50% { opacity: .25; transform: scale(1.05); } }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.animate-fade-in { animation: fade-in .5s ease-out both; }
.animate-fade-in-scale { animation: fade-in-scale .4s ease-out both; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent;
  font-size: 11px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover:not(:disabled) { background: rgba(var(--primary-rgb), .9); }
.btn-outline { border-color: rgba(28, 37, 49, .9); background: rgba(21, 28, 38, .5); }
.btn-outline:hover:not(:disabled) { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
.btn-danger { background: rgba(246, 70, 93, .12); color: #ff8a9a; border-color: rgba(246, 70, 93, .3); }
.btn-danger:hover:not(:disabled) { background: rgba(246, 70, 93, .2); }
.btn-icon { width: 24px; height: 24px; padding: 0; border-radius: 6px; }

/* ── Inputs ── */
.input {
  height: 36px; width: 100%; padding: 0 12px; border-radius: 8px;
  border: 1px solid rgba(28, 37, 49, .9); background: rgba(21, 28, 38, .5); outline: none;
  font-size: 13px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: rgba(131, 150, 168, .6); }
.input:focus { border-color: rgba(var(--primary-rgb), .5); box-shadow: 0 0 0 1px rgba(var(--primary-rgb), .25); }
.label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.hint { margin: 4px 0 0; font-size: 10px; color: var(--muted-foreground); }
.hint.error { color: #ff8a9a; }

/* ── Card ── */
.card { background: var(--card); border: 1px solid rgba(28, 37, 49, .8); border-radius: var(--radius); }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--muted); font-size: 10px; font-weight: 600; }

/* ── Dropdown / Popover ── */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 4px); z-index: 40; min-width: 240px;
  background: var(--popover); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 38px -10px rgba(0, 0, 0, .6), 0 10px 20px -15px rgba(0, 0, 0, .4);
  padding: 4px; animation: fade-in-scale .12s ease-out both; transform-origin: top;
}
.menu.right { right: 0; }
.menu.left { left: 0; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 4px;
  background: transparent; font-size: 12px; text-align: left;
}
.menu-item:hover { background: var(--muted); }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.subtle { color: var(--muted-foreground); }
.menu-item .row-action { opacity: 0; color: var(--muted-foreground); padding: 2px; border-radius: 4px; display: inline-flex; }
.menu-item:hover .row-action { opacity: 1; }
.menu-item .row-action:hover { color: var(--foreground); background: rgba(255, 255, 255, .06); }
.menu-sep { height: 1px; background: var(--border); margin: 4px -4px; }
.popover { width: 320px; padding: 16px; display: grid; gap: 16px; }
.popover p { margin: 0; }
.segmented { display: flex; gap: 2px; padding: 2px; border-radius: 6px; border: 1px solid rgba(28, 37, 49, .9); background: rgba(21, 28, 38, .35); }
.segmented button { flex: 1; border: 0; border-radius: 4px; padding: 4px 8px; font-size: 10px; font-weight: 600; background: transparent; color: var(--muted-foreground); }
.segmented button:hover { color: var(--foreground); }
.segmented button.active { background: rgba(var(--primary-rgb), .15); color: var(--primary); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238396a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; font-size: 12px; height: 32px; }
select.input option { background: var(--popover); }

/* ── Dialog ── */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .8);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: overlay-in .15s ease-out both;
}
.dialog {
  position: relative; width: 100%; max-width: 448px; padding: 24px;
  background: var(--card); border: 1px solid rgba(28, 37, 49, .8); border-radius: 10px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .6); animation: fade-in-scale .2s ease-out both;
}
.dialog form { display: grid; gap: 16px; }
.dialog-close { position: absolute; right: 16px; top: 16px; border: 0; background: transparent; color: var(--muted-foreground); opacity: .7; padding: 0; display: inline-flex; }
.dialog-close:hover { opacity: 1; color: var(--foreground); }
.dialog-title { display: flex; align-items: center; gap: 8px; }
.dialog-title h2 { margin: 0; font-size: 14px; font-weight: 600; }
.dialog-text { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted-foreground); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
