/* ================================================================
   LYKOS SISTEMA — GLOBAL STYLES
   Paleta: roxo escuro + laranja (#ff6620)
   Fonte: Sora
================================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Brand colors */
  --purple-900: #0d0810;
  --purple-800: #130c1a;
  --purple-700: #1e1228;
  --purple-600: #271636;
  --purple-500: #341d4a;
  --purple-400: #4a2870;
  --purple-300: #6b3fa0;
  --purple-200: #9b6ed0;
  --purple-100: #c9a8f0;
  --orange-500: #ff6620;
  --orange-400: #ff8040;
  --orange-300: #ffaa80;
  --text-primary:   #f0eaf8;
  --text-secondary: #b09ac8;
  --text-muted:     #7a6290;

  /* System colors */
  --green:   #22c55e;
  --red:     #ef4444;
  --yellow:  #f59e0b;
  --blue:    #3b82f6;
  --cyan:    #06b6d4;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  60px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Transitions */
  --t: 0.2s ease;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: 'Sora', 'Inter', system-ui, sans-serif;
  background: var(--purple-900);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

body.auth-enabled.auth-locked #app {
  visibility: hidden;
  pointer-events: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background:
    radial-gradient(circle at top left, rgba(255, 102, 32, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(107, 63, 160, 0.32), transparent 35%),
    linear-gradient(135deg, #0d0810 0%, #130c1a 45%, #1b1025 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(126, 85, 183, 0.24);
  background: rgba(19, 12, 26, 0.92);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  flex-shrink: 0;
}

.auth-brand-copy h1 {
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.auth-brand-copy p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-brand-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit {
  justify-content: center;
  min-height: 44px;
}

.auth-alert {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.auth-alert.info {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
}

.auth-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-setup h2 {
  font-size: 18px;
}

.auth-setup p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.auth-setup-code {
  display: inline-flex;
  align-self: flex-start;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--purple-400);
  background: var(--purple-700);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

/* ================================================================
   SIDEBAR
================================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--purple-800);
  border-right: 1px solid var(--purple-400);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--t), width var(--t);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  transform: translateX(-100%);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--purple-400);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 112px;
  height: 112px;
  display: block;
  object-fit: contain;
  border-radius: 14px;
}

.brand-icon { flex-shrink: 0; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--orange-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--purple-700);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(255,102,32,0.12);
  color: var(--orange-500);
}

.nav-item svg { flex-shrink: 0; }

.nav-chevron {
  margin-left: auto;
  transition: transform var(--t);
}

.nav-group-btn { position: relative; }

.nav-group.open .nav-chevron { transform: rotate(180deg); }

/* Sub-nav */
.nav-sub {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
  padding-left: 20px;
}

.nav-group.open .nav-sub { max-height: 200px; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}

.nav-sub-item:hover {
  background: var(--purple-700);
  color: var(--text-secondary);
}

.nav-sub-item.active {
  color: var(--orange-400);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--purple-400);
  flex-shrink: 0;
}

.sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================================================================
   MAIN WRAPPER
================================================================ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--purple-800);
  border-bottom: 1px solid var(--purple-400);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}

.topbar-menu-btn:hover {
  background: var(--purple-700);
  color: var(--text-primary);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

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

.auth-topbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-topbar-user {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 85, 183, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supabase-sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 85, 183, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.supabase-sync-pill.loading,
.supabase-sync-pill.saving {
  border-color: rgba(255, 184, 0, 0.28);
  background: rgba(255, 184, 0, 0.10);
  color: #ffd76a;
}

.supabase-sync-pill.synced {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(52, 211, 153, 0.10);
  color: #9df0cc;
}

.supabase-sync-pill.error {
  border-color: rgba(255, 97, 97, 0.26);
  background: rgba(255, 97, 97, 0.10);
  color: #ffb3b3;
}

.notifications-bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(126, 85, 183, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform var(--t), border-color var(--t), color var(--t), background var(--t);
}

.notifications-bell:hover {
  color: var(--text-primary);
  border-color: rgba(255, 102, 32, 0.28);
  background: rgba(255, 102, 32, 0.08);
  transform: translateY(-1px);
}

.notifications-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--orange-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(255, 102, 32, 0.28);
}

/* ── Views Container ────────────────────────────────────────── */
.views-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: none;
  animation: fadeIn 0.15s ease;
}

.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── View Body ──────────────────────────────────────────────── */
.view-body {
  padding: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.view-body-wide {
  padding: 28px;
  max-width: none;
  padding-bottom: 40px;
}

/* ── View Toolbar ───────────────────────────────────────────── */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 38px;
  flex: 1;
  min-width: 180px;
}

.toolbar-search svg { color: var(--text-muted); flex-shrink: 0; }

.toolbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.toolbar-search input::placeholder { color: var(--text-muted); }

.toolbar-select {
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  padding: 0 12px;
  height: 38px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t);
}

.toolbar-select:focus { border-color: var(--orange-500); }

.toolbar-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Section header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================================================
   BUTTONS
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--t), opacity var(--t), transform var(--t);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--purple-400);
}
.btn-ghost:hover {
  background: var(--purple-700);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-icon {
  background: var(--purple-600);
  border: 1px solid var(--purple-400);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.btn-icon:hover {
  background: var(--purple-500);
  color: var(--text-primary);
}
.btn-icon.danger:hover { background: rgba(239,68,68,0.15); color: var(--red); }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 20px;
  transition: color var(--t);
}
.btn-back:hover { color: var(--orange-500); }

/* ================================================================
   FORMS
================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label,
.info-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.field-input {
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--t), background var(--t);
  width: 100%;
}

.form-input:focus,
.field-input:focus {
  border-color: var(--orange-500);
  background: var(--purple-600);
}

.form-input::placeholder,
.field-input::placeholder { color: var(--text-muted); }

.form-textarea,
.field-textarea {
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  width: 100%;
  transition: border-color var(--t);
  line-height: 1.5;
}

.form-textarea:focus,
.field-textarea:focus {
  border-color: var(--orange-500);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

select.form-input { cursor: pointer; }

option { background: var(--purple-700); }

/* Checkbox row */
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--orange-500);
  cursor: pointer;
}

/* Password input */
.input-password {
  position: relative;
}

.input-password .form-input {
  padding-right: 40px;
}

.toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--t);
}
.toggle-pwd:hover { color: var(--text-primary); }

/* Photo Upload */
.photo-upload-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--purple-700);
  border: 1px dashed var(--purple-400);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}

.photo-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--purple-600);
  border: 2px solid var(--purple-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-muted);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--purple-500);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  font-family: inherit;
}

.btn-upload:hover {
  background: var(--purple-400);
  color: var(--text-primary);
}

/* ================================================================
   MODALS
================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,8,16,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: overlayIn 0.15s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--purple-800);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
  overflow: hidden;
}

.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--purple-500);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  transition: color var(--t), background var(--t);
}
.modal-close:hover {
  color: var(--text-primary);
  background: var(--purple-600);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-scrollable {
  max-height: calc(90vh - 130px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--purple-500);
  flex-shrink: 0;
}

/* ================================================================
   CARDS & COMMON
================================================================ */
.card {
  background: var(--purple-700);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-md);
  padding: 20px;
  transition: border-color var(--t);
}

.card:hover { border-color: var(--purple-300); }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--purple-700);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--t);
}

.stat-card:hover { border-color: var(--purple-300); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
}

.notifications-modal-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.notifications-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notifications-summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(126, 85, 183, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
}

.notifications-summary-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.notifications-summary-value {
  font-size: 24px;
  color: var(--text-primary);
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(126, 85, 183, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.notification-card.danger {
  border-color: rgba(239, 68, 68, 0.22);
}

.notification-card.warning {
  border-color: rgba(245, 158, 11, 0.22);
}

.notification-card-main {
  min-width: 0;
}

.notification-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.notification-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.12);
  color: #d8deea;
}

.notification-chip.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ff9b9b;
}

.notification-chip.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #ffd37f;
}

.notification-chip.info {
  background: rgba(59, 130, 246, 0.14);
  color: #8ab6ff;
}

.notification-card-action {
  font-size: 11px;
  color: var(--text-muted);
}

.notification-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-card-description {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── Daily Questions ────────────────────────────────────────── */
.daily-questions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

.dq-card {
  background: var(--purple-700);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
}

.dq-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dq-card-header h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.dq-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dq-icon--yesterday { background: rgba(107,63,160,0.25); color: var(--purple-200); }
.dq-icon--today     { background: rgba(255,102,32,0.15); color: var(--orange-400); }
.dq-icon--blocked   { background: rgba(239,68,68,0.12);  color: #f87171; }

.dq-answers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.dq-answer-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dq-answer-item::before {
  content: '→';
  color: var(--orange-500);
  flex-shrink: 0;
  margin-top: 1px;
}

.dq-answer-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--t);
}
.dq-answer-del:hover { color: var(--red); }

.dq-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed var(--purple-400);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
  align-self: flex-start;
}

.dq-add-btn:hover {
  border-color: var(--orange-500);
  color: var(--orange-500);
}

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--purple-500);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--purple-600);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--purple-700); }

.data-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Mode Toggle ────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.mode-btn:hover { color: var(--text-secondary); }

.mode-btn.active {
  background: var(--purple-500);
  color: var(--text-primary);
}

/* ── FAB ────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--orange-500);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,102,32,0.4);
  transition: background var(--t), transform var(--t), box-shadow var(--t);
  z-index: 500;
}

.fab:hover {
  background: var(--orange-400);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255,102,32,0.5);
}

.fab:active { transform: scale(0.96); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-300); }

/* ── Nav Badge ──────────────────────────────────────────────── */
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  line-height: 1.4;
  display: none;
}
.nav-badge.visible { display: inline-block; }

/* ── Form helpers ───────────────────────────────────────────── */
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.field-static {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 0;
}

/* ── Schedule alert ─────────────────────────────────────────── */
.schedule-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #f59e0b;
  margin-bottom: 16px;
}

/* ── Dashboard Grid ─────────────────────────────────────────── */
.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-top: 4px;
}

.dash-col-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-widget {
  background: var(--purple-700);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-widget-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-widget-link {
  font-size: 12px;
  color: var(--orange-400);
  text-decoration: none;
  cursor: pointer;
}
.dash-widget-link:hover { text-decoration: underline; }

.dash-lead-schedule-item {
  cursor: pointer;
  border-radius: var(--r-sm);
}

.dash-lead-schedule-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ── Mini Kanban (Dashboard) ────────────────────────────────── */
.dash-mini-kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dash-mini-col-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--purple-500);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-mini-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}

.dash-mini-card {
  background: var(--purple-600);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color var(--t);
}
.dash-mini-card:hover { border-color: var(--purple-300); }

.dash-mini-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 3px;
}

.dash-mini-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Dash Widget: Agenda do Dia ─────────────────────────────── */
.dash-agenda-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.dash-agenda-empty svg { opacity: 0.4; }

.dash-agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--purple-600);
}
.dash-agenda-item:last-child { border-bottom: none; }

.dash-agenda-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-400);
  min-width: 38px;
  padding-top: 1px;
  flex-shrink: 0;
}

.dash-agenda-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.dash-agenda-body { flex: 1; min-width: 0; }

.dash-agenda-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-agenda-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Dash Widget: Metas ─────────────────────────────────────── */
.dash-goal-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--purple-600);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dash-goal-item:last-child { border-bottom: none; }

.dash-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-goal-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-goal-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

.dash-goal-bar-wrap {
  background: var(--purple-600);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}

.dash-goal-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
  min-width: 3px;
}

.dash-goal-pct {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Dash Widget: Prospecção Hoje ───────────────────────────── */
.dash-prosp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dash-prosp-num {
  background: var(--purple-600);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.dash-prosp-icon { opacity: 0.85; }

.dash-prosp-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.dash-prosp-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Quick Links ────────────────────────────────────────────── */
.quick-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-link-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--purple-600);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color var(--t), color var(--t);
  position: relative;
  group: link;
}
.quick-link-item:hover {
  border-color: var(--orange-500);
  color: var(--orange-400);
}

.quick-link-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0 0 4px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity var(--t), color var(--t);
}
.quick-link-del:hover { opacity: 1; color: var(--red); }

/* ── Notes ──────────────────────────────────────────────────── */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.note-item {
  background: var(--purple-600);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.note-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  transition: color var(--t);
  padding: 0;
}
.note-del:hover { color: var(--red); }

/* ── Empty State Small ──────────────────────────────────────── */
.empty-state-sm {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ── Diary / Daily Questions (client profile) ───────────────── */
.diary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.diary-date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diary-date-input {
  width: 160px;
  text-align: center;
}

.diary-questions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Conversion Tabs ────────────────────────────────────────── */
.conversion-tabs {
  display: flex;
  gap: 4px;
  background: var(--purple-600);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-sm);
  padding: 3px;
  width: fit-content;
}

.conv-tab {
  padding: 6px 16px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.conv-tab.active {
  background: var(--purple-500);
  color: var(--text-primary);
}

/* ── Metrics Controls ───────────────────────────────────────── */
.metrics-today-header {
  background: var(--purple-700);
  border: 1px solid var(--purple-500);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metrics-today-day {
  font-size: 20px;
  font-weight: 700;
  color: var(--orange-500);
}

.metrics-today-date {
  font-size: 13px;
  color: var(--text-muted);
}

.metrics-saved-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  padding: 3px 10px;
  border-radius: 100px;
}

.metrics-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.metrics-cal-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--purple-700);
  border: 1px solid var(--purple-400);
  border-radius: var(--r-md);
  padding: 12px 16px;
}

/* ── Agenda legend ──────────────────────────────────────────── */
.agenda-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.agenda-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-period-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 180px;
  text-align: center;
}

/* ── Metrics day header text ────────────────────────────────── */
.metrics-day-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--orange-500);
}

.metrics-day-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Lead scheduling-status card highlight ──────────────────── */
.lead-card.scheduling-status {
  border-left: 3px solid #eab308;
}

.lead-followup-badge.missing {
  color: #ef4444 !important;
  font-weight: 600;
}

.lead-followup-badge.scheduled {
  color: #22c55e !important;
}

/* ── Kanban Drag & Drop ─────────────────────────────────────── */
[data-drag-id] {
  cursor: grab;
  user-select: none;
}
[data-drag-id]:active {
  cursor: grabbing;
}
.dragging {
  opacity: 0.35;
  transform: rotate(1.5deg) scale(1.02);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  cursor: grabbing !important;
}
[data-drop-status] {
  min-height: 72px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.drag-over {
  background: rgba(139, 92, 246, 0.13) !important;
  outline: 2px dashed rgba(139, 92, 246, 0.55);
  outline-offset: -2px;
  border-radius: 6px;
}
.kanban-empty-hint {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.5;
}
.drag-over .kanban-empty-hint {
  opacity: 1;
  color: var(--purple-300);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid-3 { grid-template-columns: 1fr; }
  .dashboard-grid-2 { grid-template-columns: 1fr; }
  .dash-prosp-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .diary-questions-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .dash-mini-kanban { grid-template-columns: 1fr; }
  .notifications-summary { grid-template-columns: 1fr; }
  .notification-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
  .view-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; height: 100%; }
  .topbar { padding: 0 16px; }
  .topbar-right-group { gap: 8px; }
}
