/* index.css — Sistema de Design "Arena Command" (Cyberpunk/Minimalist) — ML Dashboard */

:root {
  --bg: #0b0d10;
  --panel: #13171c;
  --elev: #181d23;
  --elev-2: #1f252c;
  --line: #232a32;
  --line-2: #2f3842;
  --ink: #ecedef;
  --ink-2: #9aa3af;
  --ink-3: #6b727b;
  --ink-4: #444b54;

  --accent: #d4ff3a;        /* Electric Lime */
  --accent-ink: #0b0d10;
  --accent-dim: #5a6e1a;

  --success: #58d68d;
  --warning: #ffb74d;
  --danger: #ff5e5e;
  --info: #5cc8ff;

  --r-1: 6px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;

  --font: 'Space Grotesk', system-ui, sans-serif;
}

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

html, body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum'; }
.serif { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }

a { color: var(--accent); text-decoration: none; transition: opacity 0.12s; }
a:hover { opacity: 0.85; }

.scroll, .main-content { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll::-webkit-scrollbar, .main-content::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
.scroll::-webkit-scrollbar-track { background: var(--elev); border-radius: 4px; }

/* Botões */
button {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary { background-color: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled) { background-color: #c2eb2e; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212, 255, 58, 0.15); }

button.secondary { background-color: var(--elev); color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover:not(:disabled) { background-color: var(--elev-2); color: #ffffff; border-color: var(--line-2); }

button.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); padding: 5px 10px; font-size: 0.78rem; }
button.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }

button.icon-btn { padding: 4px 9px; font-size: 0.95rem; }

/* Inputs */
input, select, textarea {
  font-family: var(--font);
  background-color: #0d1013;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--r-1);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 255, 58, 0.08); }
textarea { resize: vertical; min-height: 70px; }

/* Layout Global (Shell) */
.shell-container { display: flex; height: 100vh; }

.sidebar {
  width: 248px;
  background-color: #0a0c0f;
  border-right: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-logo {
  padding: 0 22px 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; }
.sidebar-section { padding: 8px 14px 4px; color: var(--ink-3); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.sidebar-footer { border-top: 1px solid var(--line); padding: 14px 14px 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 14px;
  border-radius: var(--r-1);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
  font-weight: 500;
  font-size: 13px;
  position: relative;
}
.sidebar-item svg { flex: 0 0 auto; width: 16px; height: 16px; }
.sidebar-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item:hover { color: var(--ink); background: #11141a; }
.sidebar-item.active { color: var(--ink); background-color: var(--elev); }
.sidebar-item.active svg { color: var(--accent); }
.sidebar-item .count {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.main-content { flex: 1; padding: 32px 40px; overflow-y: auto; background-color: var(--bg); }

/* Painéis / Cards */
.card {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 24px;
  position: relative;
}
.card-title {
  font-size: 0.95rem; font-weight: 600; margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2);
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}

/* Grids e Tabelas */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-item { background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--r-2); padding: 16px 20px; }
.stat-item.clickable { cursor: pointer; transition: border-color 0.12s, transform 0.12s; }
.stat-item.clickable:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat-val { font-size: 1.8rem; font-weight: 700; color: var(--accent); margin-top: 4px; letter-spacing: -0.02em; }
.stat-val.green { color: var(--success); }
.stat-val.red { color: var(--danger); }
.stat-val.blue { color: var(--info); }

.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-3); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
td { font-size: 0.9rem; vertical-align: middle; }
tr:hover td { background-color: rgba(255, 255, 255, 0.01); }
tr.critical td { background-color: rgba(255, 94, 94, 0.05); }

/* Badges */
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.badge.active, .badge.paid, .badge.answered { background-color: rgba(88, 214, 141, 0.12); color: var(--success); }
.badge.lead, .badge.shipped, .badge.under_review { background-color: rgba(92, 200, 255, 0.12); color: var(--info); }
.badge.paused, .badge.pending, .badge.unanswered { background-color: rgba(255, 183, 77, 0.14); color: var(--warning); }
.badge.inactive, .badge.closed, .badge.cancelled { background-color: rgba(255, 94, 94, 0.12); color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  padding: 9px 16px; cursor: pointer; color: var(--ink-2); font-weight: 600;
  font-size: 0.85rem; border-bottom: 2px solid transparent; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Diversos */
.thumb { width: 42px; height: 42px; border-radius: var(--r-1); object-fit: cover; background: var(--elev); border: 1px solid var(--line); }
.muted { color: var(--ink-3); font-size: 0.82rem; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .spacer { flex: 1; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 1.7rem; font-weight: 700; }
.page-head p { color: var(--ink-2); margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.inline-input { width: 90px; padding: 5px 8px; }
.account-box { padding: 0 14px; margin-bottom: 12px; }
.account-box select { font-size: 0.82rem; }
.link-row { padding: 10px 22px 0; }

/* Modais */
.modal-overlay {
  position: fixed; inset: 0; background-color: rgba(5, 6, 8, 0.85);
  display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(4px);
}
.modal-container {
  background-color: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-3);
  padding: 24px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 38px rgba(0, 0, 0, 0.5);
}

/* Utilitários */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { display: flex; gap: 8px; }
.gap-12 { display: flex; gap: 12px; }
.empty { text-align: center; color: var(--ink-3); padding: 40px; }
.loading { text-align: center; color: var(--ink-2); padding: 40px; }
