/* =============================================
   GLOBAL.CSS
   Variaveis, reset, tipografia e componentes base
   ============================================= */

:root {
  --black: #000000;
  --near-black: #080808;
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161b22;
  --surface-3: #1c2128;
  --border: #1e1e1e;
  --border-light: #2a2a2a;
  --accent: #2dd4bf;
  --accent-dim: #14b8a6;
  --accent-glow: rgba(45, 212, 191, 0.15);
  --accent-glow2: rgba(45, 212, 191, 0.06);
  --white: #ffffff;
  --gray-1: #e6edf3;
  --gray-2: #8b949e;
  --gray-3: #484f58;
  --gold: #c9a84c;
  --danger: #f85149;
  --warning: #d29922;
  --success: #3fb950;

  --font-title: "Cormorant Garamond", serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.42);

  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--gray-1);
  font-family: var(--font-body);
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
  color: var(--white);
}

p {
  margin: 0 0 0.8rem;
  color: var(--gray-2);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Scrollbar */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--surface);
}
*::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* Inputs */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--gray-1);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Botoes */
.btn-primary,
.btn-outline,
.btn-ghost {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--near-black);
  box-shadow: 0 8px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px var(--accent-glow);
}

.btn-outline {
  border-color: var(--border-light);
  background: transparent;
  color: var(--gray-1);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-2);
}
.btn-ghost:hover {
  color: var(--white);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

/* Cards */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.005)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-accent {
  background: var(--accent-glow2);
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.35);
}
.badge-gold {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.35);
}
.badge-success {
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
  border-color: rgba(63, 185, 80, 0.35);
}
.badge-warning {
  background: rgba(210, 153, 34, 0.12);
  color: var(--warning);
  border-color: rgba(210, 153, 34, 0.35);
}
.badge-danger {
  background: rgba(248, 81, 73, 0.12);
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.35);
}

/* Toast */
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1200;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--gray-1);
  transform: translateY(20px);
  opacity: 0;
  transition: 0.35s ease;
  box-shadow: var(--shadow-md);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-success {
  border-color: rgba(63, 185, 80, 0.45);
}
.toast-warning {
  border-color: rgba(210, 153, 34, 0.45);
}
.toast-danger {
  border-color: rgba(248, 81, 73, 0.45);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  z-index: 1300;
  padding: 1rem;
}
.modal {
  width: min(96vw, 640px);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header,
.modal-footer {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}
.modal-close {
  border: 0;
  background: transparent;
  color: var(--gray-2);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-body {
  padding: 1rem;
  max-height: 70vh;
  overflow: auto;
}
.modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Utilitarios */
.hidden {
  display: none !important;
}
.text-center {
  text-align: center;
}
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--gray-2);
}

.campo-grupo {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.campo-grupo > label {
  font-size: 0.9rem;
  color: var(--gray-2);
}

/* Tabelas */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th,
td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
}
th {
  color: var(--gray-1);
  font-weight: 600;
  background: var(--surface-2);
}
tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}
td .acoes {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Reveal padrao */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}

@media (max-width: 768px) {
  :root {
    --container: 100%;
  }
}
