/* ============================================================
   SaaS Eventos — global.css
   Design System: dark sidebar + light content, tipografia Syne
   ============================================================ */

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

/* ── Variáveis ──────────────────────────────────────────── */
:root {
  --primary:       #7C3AED;
  --primary-dark:  #5B21B6;
  --primary-light: #EDE9FE;
  --primary-glow:  rgba(124,58,237,0.15);
  --accent:        #F59E0B;
  --accent-light:  #FEF3C7;

  --success:       #10B981;
  --success-light: #D1FAE5;
  --danger:        #EF4444;
  --danger-light:  #FEE2E2;
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --info:          #3B82F6;
  --info-light:    #DBEAFE;

  --text:          #111827;
  --text-2:        #374151;
  --text-muted:    #6B7280;
  --text-faint:    #9CA3AF;
  --border:        #E5E7EB;
  --border-2:      #D1D5DB;
  --bg:            #F8F7FF;
  --bg-card:       #FFFFFF;
  --bg-hover:      #F3F4F6;

  /* Sidebar */
  --sidebar-bg:    #0D0920;
  --sidebar-w:     242px;
  --sidebar-text:  rgba(255,255,255,0.68);
  --sidebar-active:#7C3AED;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 10px 40px rgba(0,0,0,0.12);

  --topbar-h:      60px;
  --font-display:  'Plus Jakarta Sans', sans-serif;
  --font-body:     'Inter', sans-serif;
  --transition:    0.18s ease;
}

/* ============================================================
   DARK MODE — ativado via [data-theme="dark"] no <html>
   ============================================================ */
[data-theme="dark"] {
  --text:          #F1F0FF;
  --text-2:        #C4C2D4;
  --text-muted:    #9B99B0;
  --text-faint:    #6B6880;
  --border:        #2A2740;
  --border-2:      #352F52;
  --bg:            #0E0C1A;
  --bg-card:       #161326;
  --bg-hover:      #1E1A30;

  --primary-light: rgba(124,58,237,0.2);
  --primary-glow:  rgba(124,58,237,0.25);
  --accent-light:  rgba(245,158,11,0.15);

  --success-light: rgba(16,185,129,0.15);
  --danger-light:  rgba(239,68,68,0.15);
  --warning-light: rgba(245,158,11,0.15);
  --info-light:    rgba(59,130,246,0.15);

  --sidebar-bg:    #080614;
  --sidebar-text:  rgba(255,255,255,0.65);

  --shadow:        0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg:     0 10px 40px rgba(0,0,0,0.5);
}

/* Smooth transition on theme change */
*, *::before, *::after {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

/* Dark mode adjustments for specific components */
[data-theme="dark"] .card { background: var(--bg-card); }
[data-theme="dark"] .table thead th { background: #1A1630; }
[data-theme="dark"] .table tbody tr:hover td { background: var(--bg-hover); }
[data-theme="dark"] .form-control {
  background: #1A1630;
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .form-control::placeholder { color: var(--text-faint); }
[data-theme="dark"] .modal-content { background: var(--bg-card); }
[data-theme="dark"] .topbar { background: var(--bg-card); border-bottom-color: var(--border); }
[data-theme="dark"] .badge-light { background: #1E1A30; color: var(--text-2); }
[data-theme="dark"] .dropdown-menu { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .dropdown-item:hover { background: var(--bg-hover); }
[data-theme="dark"] select.form-control { background: #1A1630 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239B99B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center; }
[data-theme="dark"] .toast { background: #1E1A30; border: 1px solid var(--border); }

/* Dark mode toggle button */
.dark-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.18s;
  font-size: 18px;
}
.dark-toggle:hover { background: var(--bg-hover); color: var(--text); }
[data-theme="dark"] .dark-toggle { color: #FCD34D; }
[data-theme="dark"] .dark-toggle:hover { background: rgba(252,211,77,0.1); }


/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-width: 0;
  transition: margin-left var(--transition);
}

.page-body {
  padding: 24px;
  max-width: 1400px;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0D0920 0%, #110C28 60%, #0D0920 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  border-right: 1px solid rgba(124,58,237,0.12);
}

.sidebar-header {
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text { min-width: 0; }
.logo-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-role {
  display: block;
  font-size: 0.7rem;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.company-selector select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.company-selector select option { background: #1a0f3c; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 12px 8px 4px;
  font-family: var(--font-display);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.845rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active {
  background: rgba(124,58,237,0.18);
  color: #fff;
  border-left: 2px solid var(--primary);
  padding-left: 8px;
}
.nav-item.active svg { stroke: var(--primary); }
.nav-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-meta { min-width: 0; }
.user-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  display: block;
  font-size: 0.7rem;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.15); color: var(--danger); }
.btn-logout svg { width: 16px; height: 16px; }

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
}

.topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-icon {
  position: relative;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
}
.topbar-icon:hover { background: var(--bg-hover); color: var(--text); }
.topbar-icon svg { width: 18px; height: 18px; }

.topbar-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* ── KPI Cards ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--primary));
}

.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.kpi-icon {
  position: absolute;
  top: 16px; right: 16px;
  color: var(--kpi-color, var(--primary));
  opacity: 0.2;
}
.kpi-icon svg { width: 32px; height: 32px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.9); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.9); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success  { background: var(--success-light);  color: #065F46; }
.badge-danger   { background: var(--danger-light);   color: #991B1B; }
.badge-warning  { background: var(--warning-light);  color: #92400E; }
.badge-info     { background: var(--info-light);     color: #1E40AF; }
.badge-secondary{ background: var(--bg-hover);       color: var(--text-muted); }
.badge-primary  { background: var(--primary-light);  color: var(--primary-dark); }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-faint); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ── Modais ─────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }

@keyframes modal-in {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 20px;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 0 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
}
.page-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 2px; }

/* ── Search & filters ───────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-input input { padding-left: 36px; }
.search-input .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}
.search-input .search-icon svg { width: 16px; height: 16px; }

/* ── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger);  }
.toast-warning { background: var(--warning); color: var(--text); }
.toast-info    { background: var(--info);    }
.toast-icon { font-size: 1rem; flex-shrink: 0; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ── Loading ────────────────────────────────────────────── */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }

/* ── Chips / selects de status ──────────────────────────── */
.status-select {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* ── Confirm dialog ─────────────────────────────────────── */
.confirm-message {
  font-size: 1rem;
  padding: 20px 24px 0;
  color: var(--text-2);
}

/* ── Utility ────────────────────────────────────────────── */
.mt-1 { margin-top:  4px; } .mt-2 { margin-top:  8px; }
.mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom:  4px; } .mb-2 { margin-bottom:  8px; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.fw-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.money { font-family: var(--font-display); font-weight: 700; }

/* ── Agenda / Calendar ──────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-header {
  background: var(--bg);
  padding: 10px 6px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cal-day {
  background: var(--bg-card);
  padding: 8px;
  min-height: 90px;
  position: relative;
}
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cal-day.today { background: var(--primary-light); }
.cal-day.today .cal-day-num { color: var(--primary); }
.cal-day.other-month { background: var(--bg); opacity: 0.5; }
.cal-event {
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event-SCHEDULED { background: var(--info-light);    color: #1E40AF; }
.cal-event-CONFIRMED  { background: var(--success-light); color: #065F46; }
.cal-event-DONE       { background: var(--bg-hover);      color: var(--text-muted); }
.cal-event-CANCELED   { background: var(--danger-light);  color: #991B1B; }

/* ── Charts container ───────────────────────────────────── */
.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main-content { margin-left: 0; }

  .topbar { left: 0; }
  .menu-toggle { display: flex; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }

  .page-body { padding: 16px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
    max-width: 100%;
  }

  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ── PWA / App styles ───────────────────────────────────── */
.pwa-app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 70px;
}

.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
}
.bottom-nav-item svg { width: 20px; height: 20px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .notif-badge {
  position: absolute;
  top: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

/* ============================================================
   v5 — Novos estilos: nav icons coloridos, search, kanban etc
   ============================================================ */

/* Nav icon colorido */
.nav-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.nav-icon svg { width: 14px; height: 14px; }
.nav-label { flex: 1; }
.nav-item { padding: 7px 10px; }
.nav-item:hover .nav-icon { transform: scale(1.1); }

/* Topbar search */
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  gap: 8px;
  width: 240px;
  transition: all var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 300px;
}
.topbar-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.topbar-search input {
  border: none; background: none; outline: none;
  font-size: 0.85rem; width: 100%; color: var(--text);
}
.topbar-search input::placeholder { color: var(--text-faint); }

.search-results {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  overflow: hidden;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item svg { width: 14px; height: 14px; color: var(--text-muted); }

/* Topbar badge */
.topbar-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ── Kanban Board ─────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 60vh;
}
.kanban-col {
  min-width: 280px;
  width: 280px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  flex-shrink: 0;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow var(--transition);
  position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11.5px; color: var(--text-muted); }
.kanban-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.kanban-add-card {
  width: 100%;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  margin-top: 4px;
}
.kanban-add-card:hover { background: var(--bg-card); color: var(--text); border-style: solid; }
.kanban-drop-zone { min-height: 40px; transition: background var(--transition); border-radius: var(--radius-sm); }
.kanban-drop-zone.drag-over { background: var(--primary-glow); }

/* ── NPS / Avaliações ────────────────────────────────────── */
.nps-star { cursor: pointer; font-size: 1.4rem; transition: transform 0.1s; }
.nps-star:hover { transform: scale(1.2); }
.stars-row { display: flex; gap: 4px; }
.nps-number-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nps-number {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all var(--transition);
}
.nps-number:hover { border-color: var(--primary); color: var(--primary); }
.nps-number.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.nps-number[data-val="0"],.nps-number[data-val="1"],.nps-number[data-val="2"],.nps-number[data-val="3"],.nps-number[data-val="4"],.nps-number[data-val="5"],.nps-number[data-val="6"] { border-color: #FECACA; }
.nps-number[data-val="7"],.nps-number[data-val="8"] { border-color: #FDE68A; }
.nps-number[data-val="9"],.nps-number[data-val="10"] { border-color: #A7F3D0; }

/* ── Contrato / Sign ─────────────────────────────────────── */
.contract-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  font-family: 'Times New Roman', serif;
  max-width: 800px;
  line-height: 1.8;
  color: #111;
}
.contract-preview h1 { text-align: center; font-size: 1.2rem; margin-bottom: 8px; }
.contract-preview h2 { font-size: 1rem; margin: 24px 0 8px; text-transform: uppercase; }
.contract-preview p { margin-bottom: 12px; text-align: justify; }
.contract-sign-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
}
.sign-line {
  border-top: 1px solid #333;
  padding-top: 8px;
  text-align: center;
  font-size: 13px;
}

/* ── Check-in ────────────────────────────────────────────── */
.checkin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.checkin-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0; overflow: hidden;
}
.checkin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.checkin-info { flex: 1; min-width: 0; }
.checkin-name { font-weight: 700; font-size: 14px; }
.checkin-role { font-size: 12px; color: var(--text-muted); }
.checkin-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkin-time { font-size: 12px; color: var(--text-muted); }

/* ── Public Form ─────────────────────────────────────────── */
.public-form-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px;
}
.public-form-header {
  text-align: center;
  margin-bottom: 32px;
}
.public-form-header .brand { font-size: 2rem; margin-bottom: 8px; }
.public-form-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.public-form-header p { color: var(--text-muted); }
.public-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

/* ── Badge purple ────────────────────────────────────────── */
.badge-purple { background: var(--primary-light); color: var(--primary-dark); }
.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-cyan   { background: #CFFAFE; color: #155E75; }
.badge-green  { background: var(--success-light); color: #065F46; }

/* ── Metric trend ────────────────────────────────────────── */
.trend-up   { color: var(--success); font-size: 12px; font-weight: 600; }
.trend-down { color: var(--danger);  font-size: 12px; font-weight: 600; }

/* ── Section divider ─────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}
.section-divider span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  white-space: nowrap;
}
.section-divider::before,.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Progress bar ────────────────────────────────────────── */
.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.4s; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 28px; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  z-index: 1;
}
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-weight: 600; font-size: 13.5px; }
.timeline-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
