/* ============================================================
   ÁREA ADMINISTRATIVA — Dia de Negócios Bouwman
   Reaproveita o style guide da LP (creme/verde, vidro fosco).
   ============================================================ */

@font-face {
  font-family: 'Resolve';
  src: url('../fonts/Resolve-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Resolve';
  src: url('../fonts/Resolve-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --cream: #fbf7ee;
  --ink: #14331f;
  --ink-soft: rgba(20, 51, 31, 0.72);
  --ink-faint: rgba(20, 51, 31, 0.50);
  --green: #0a7a3d;
  --green-deep: #064d27;
  --gold: #e2a93b;
  --gold-deep: #c4861d;
  --sky: #2b87b8;
  --danger: #c0392b;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.80);
  --glass-line: rgba(20, 51, 31, 0.12);
  --glass-shadow: 0 18px 50px rgba(20, 51, 31, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Resolve', 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Space Grotesk', 'Resolve', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7ec 55%, #eaf3e4 100%);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 9999px; border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap; color: var(--ink); background: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn--block { width: 100%; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--green {
  background: var(--green); color: #fff;
  box-shadow: 0 10px 24px rgba(10, 122, 61, .25);
}
.btn--green:hover { background: #0b8a45; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-line); color: var(--green-deep);
}
.btn--ghost:hover { background: #fff; }
.btn--danger { background: #fff; color: var(--danger); border: 1px solid rgba(192, 57, 43, .3); }
.btn--danger:hover { background: var(--danger); color: #fff; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
input, select {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.85);
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(10, 122, 61, .12); }

/* ============================================================
   LOGIN
   ============================================================ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card {
  width: 100%; max-width: 400px; padding: 40px 34px; border-radius: var(--radius);
  text-align: center;
}
.login__logo { height: 46px; width: auto; margin: 0 auto 18px; }
.login__title { font-size: 26px; }
.login__sub { color: var(--ink-faint); font-size: 14px; margin: 6px 0 28px; }
.login__error {
  background: rgba(192, 57, 43, .08); color: var(--danger);
  border: 1px solid rgba(192, 57, 43, .25); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; margin: 0 0 16px;
}
.login__back {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: color .2s ease;
}
.login__back:hover { color: var(--green); }
.login__back svg { flex: none; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash__top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 247, 238, 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-line);
}
.dash__top-inner {
  max-width: 1180px; margin-inline: auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dash__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dash__brand img { height: 30px; width: auto; }
.dash__brand span { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.dash__top-actions { display: flex; gap: 10px; }

.dash__main { max-width: 1180px; margin-inline: auto; padding: 28px 24px 80px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { border-radius: var(--radius-sm); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ink-faint); }
.kpi--green::before { background: var(--green); }
.kpi--blue::before { background: var(--sky); }
.kpi--gold::before { background: var(--gold); }
.kpi__label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.kpi__value { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; color: var(--ink); }

/* Controles */
.controls {
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.tabs { display: inline-flex; gap: 4px; background: rgba(20, 51, 31, .05); padding: 4px; border-radius: 9999px; }
.tab {
  border: none; background: transparent; font-family: var(--font-body); font-weight: 600; font-size: 14px;
  color: var(--ink-soft); padding: 8px 16px; border-radius: 9999px; transition: all .2s ease;
}
.tab.is-active { background: #fff; color: var(--green-deep); box-shadow: 0 4px 12px rgba(20, 51, 31, .08); }
.controls__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; color: var(--ink-faint); pointer-events: none; }
.search input { padding-left: 40px; min-width: 280px; }

.result-count { color: var(--ink-faint); font-size: 14px; margin: 0 4px 14px; }

/* Tabela */
.table-wrap { border-radius: var(--radius-sm); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); font-weight: 700; padding: 14px 18px;
  border-bottom: 1px solid var(--glass-line); background: rgba(255, 255, 255, .4);
}
.table tbody td { padding: 14px 18px; border-bottom: 1px solid rgba(20, 51, 31, .07); font-size: 14px; vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .15s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, .55); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-name { font-weight: 600; color: var(--ink); }
.cell-muted { color: var(--ink-soft); }
.cell-date { color: var(--ink-faint); white-space: nowrap; font-size: 13px; }

/* Badge de tipo */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 9999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge--participante { background: rgba(10, 122, 61, .12); color: var(--green-deep); border-color: rgba(10, 122, 61, .25); }
.badge--expositor { background: rgba(43, 135, 184, .12); color: var(--sky); border-color: rgba(43, 135, 184, .3); }

/* Pill de status */
.pill {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 9999px; text-transform: capitalize;
}
.pill--novo { background: rgba(226, 169, 59, .15); color: var(--gold-deep); }
.pill--contatado { background: rgba(43, 135, 184, .14); color: var(--sky); }
.pill--confirmado { background: rgba(10, 122, 61, .14); color: var(--green-deep); }
.pill--arquivado { background: rgba(20, 51, 31, .08); color: var(--ink-faint); }

.empty { padding: 50px 20px; text-align: center; color: var(--ink-faint); }

/* ============================================================
   MODAL
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 51, 31, .35); backdrop-filter: blur(4px); }
.modal__card {
  position: relative; width: 100%; max-width: 520px; border-radius: var(--radius);
  padding: 32px; z-index: 1; max-height: 90vh; overflow-y: auto;
}
.modal__close {
  position: absolute; top: 16px; right: 18px; background: none; border: none;
  font-size: 28px; line-height: 1; color: var(--ink-faint); cursor: pointer;
}
.modal__close:hover { color: var(--ink); }
.modal__name { font-size: 24px; margin: 12px 0 20px; }
.modal__grid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 24px; }
.modal__row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(20, 51, 31, .07); }
.modal__row dt { font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.modal__row dd { margin: 0; font-size: 15px; color: var(--ink); word-break: break-word; }
.modal__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-select { display: flex; align-items: center; gap: 8px; }
.status-select label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.status-select select { padding: 9px 12px; width: auto; }
.modal__delete-wrap { margin-left: auto; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 9999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease; z-index: 80; box-shadow: 0 12px 30px rgba(20, 51, 31, .25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 880px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .controls { flex-direction: column; align-items: stretch; }
  .controls__right { justify-content: space-between; }
  .search input { min-width: 0; width: 100%; }
  .search { flex: 1; }
}
@media (max-width: 620px) {
  .dash__brand span { display: none; }
  /* tabela vira cartões */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { padding: 12px 4px; border-bottom: 1px solid var(--glass-line); }
  .table tbody td { border: none; padding: 4px 18px; }
  .table tbody td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 700; }
}
@media (max-width: 460px) {
  .kpis { grid-template-columns: 1fr; }
}
