@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg:        #0F0F0F;
  --surface:   #1A1A1A;
  --surface2:  #222222;
  --border:    #2A2A2A;
  --text:      #EAEAEA;
  --muted:     #A0A0A0;
  --white:     #FFFFFF;
  --green:     #22C55E;
  --yellow:    #EAB308;
  --red:       #EF4444;
  --blue:      #3B82F6;
  --orange:    #F97316;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Inter', system-ui, sans-serif;
  --radius:    6px;
  --radius-lg: 10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── LINKS ─────────────────────────────────────────── */
a { color: inherit; text-decoration: none; }

/* ── BOTÕES ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--white);
  color: var(--bg);
  border-color: var(--white);
}
.btn-primary:hover { opacity: .85; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: #3A1A1A;
}
.btn-danger:hover { background: #3A1A1A; }

/* ── INPUTS ────────────────────────────────────────── */
input, select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { border-color: var(--muted); }
select option { background: var(--surface2); }

/* ── BADGES DE STATUS ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-green  { color: var(--green);  background: rgba(34,197,94,.12);  }
.badge-red    { color: var(--red);    background: rgba(239,68,68,.12);   }
.badge-yellow { color: var(--yellow); background: rgba(234,179,8,.12);   }
.badge-blue   { color: var(--blue);   background: rgba(59,130,246,.12);  }
.badge-orange { color: var(--orange); background: rgba(249,115,22,.12);  }
.badge-muted  { color: var(--muted);  background: rgba(160,160,160,.10); }

/* ── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.modal-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--border); }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

/* ── TOAST ─────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text);
  z-index: 200;
  transform: translateY(10px);
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.toast-error { border-color: var(--red); color: var(--red); }

/* ── SPINNER ───────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ESTADO VAZIO ──────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  gap: 8px;
}
.empty-state svg { opacity: .3; }
.empty-state p { font-size: 13px; }
