/* VivasBarber — tokens e componentes compartilhados */
:root {
  --bg: #0d0d0f;
  --bg-2: #121215;
  --surface: #17171b;
  --surface-2: #1e1e23;
  --surface-3: #26262c;
  --border: #2a2a31;
  --border-strong: #3a3a42;
  --text: #f4f0e8;
  --text-2: #bdb7ad;
  --muted: #847e74;
  --accent: #c9a45c;
  --accent-2: #e0c48a;
  --accent-ink: #17120a;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --good: #5cbf85;
  --warn: #e3ab4f;
  --bad: #e5735f;
  --info: #74a9e6;
  --violet: #a993e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Bebas Neue", "Arial Narrow", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.display { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s;
  text-decoration: none !important; color: var(--text);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.lg { height: 52px; font-size: 16px; padding: 0 26px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  font: inherit; font-size: 15px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 36px; font-size: 14px; padding: 0 10px; }
.input::placeholder { color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Cartões */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-body { padding: 16px 20px; }

/* Badges / status */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.badge.violet { background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #111; letter-spacing: 0.02em;
}
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }

/* Modal / drawer */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 5, 7, 0.68);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade 0.15s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow);
  animation: pop 0.18s ease;
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.overlay.drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
.overlay.drawer .modal { height: 100vh; max-height: 100vh; border-radius: 0; width: min(480px, 100%); animation: slide 0.2s ease; border-width: 0 0 0 1px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: center; animation: pop 0.2s ease; max-width: min(92vw, 520px);
}
.toast.good .icon { color: var(--good); }
.toast.bad .icon { color: var(--bad); }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table .r { text-align: right; }

/* Chips / segmented */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .count { font-size: 11px; opacity: 0.75; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface-3); color: var(--text); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 32px; height: 32px; opacity: 0.6; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.loading { display: grid; place-items: center; padding: 50px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.notice .icon { color: var(--accent); margin-top: 1px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.warn .icon { color: var(--warn); }

.logo-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.logo-mark .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.logo-mark .word { font-family: var(--display); font-size: 20px; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase; }
.logo-mark .word b { color: var(--accent); font-weight: 600; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
