/* ============================================
   RICKK IA — GLOBAL DESIGN SYSTEM
   Sora · paleta Rickk (azul #4f7dff → #7fb0ff) · v3
   Layout inspirado no Stryver, movimento no Next Pages / rickk.com.br
   ============================================ */

:root {
  --accent:          #4f7dff;
  --accent-hover:    #6a93ff;
  --accent-2:        #7fb0ff;
  --accent-deep:     #1830a8;
  --accent-glow:     rgba(79, 125, 255, 0.14);
  --accent-glow-lg:  rgba(79, 125, 255, 0.40);
  --accent-text:     #7fb0ff;

  --bg-base:         #030307;
  --bg-surface:      #0a0b12;
  --bg-elevated:     #10121b;
  --bg-overlay:      #161923;
  --bg-hover:        #1a1e2a;
  --bg-card:         #0d0f17;
  --bg-glass:        rgba(255, 255, 255, 0.04);
  --bg-glass-2:      rgba(255, 255, 255, 0.07);
  --bg-topbar:       rgba(3, 3, 7, 0.55);

  --border:          rgba(255, 255, 255, 0.08);
  --border-soft:     rgba(255, 255, 255, 0.05);
  --border-strong:   rgba(255, 255, 255, 0.14);
  --border-hover:    rgba(140, 175, 255, 0.45);
  --border-active:   rgba(140, 175, 255, 0.45);
  --inset-hi:        inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --text-primary:    #f3f5fb;
  --text-secondary:  #aab0c4;
  --text-muted:      #6b7189;

  --color-todo:      #4f7dff;
  --color-doing:     #f59e0b;
  --color-done:      #22c55e;
  --color-late:      #ef4444;
  --color-today-warn:#f59e0b;

  --priority-high:   #ef4444;
  --priority-mid:    #f59e0b;
  --priority-low:    #22c55e;

  --sidebar-w:           256px;
  --sidebar-w-collapsed:  72px;
  --radius:     12px;
  --radius-sm:  10px;
  --radius-lg:  16px;
  --shadow:     0 24px 60px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow:0 12px 30px -10px rgba(79, 125, 255, 0.65);
  --ease:       cubic-bezier(.22, 1, .36, 1);
  --spring:     cubic-bezier(.22, 1.4, .36, 1);
  --transition: 0.2s ease;
  --transition-base: 0.2s ease;
}

/* =====================
   LIGHT THEME
   ===================== */
body.light-theme {
  --accent-text:     #3461e6;

  --bg-base:         #f5f7fc;
  --bg-surface:      #ffffff;
  --bg-elevated:     #f1f4fa;
  --bg-overlay:      #e9edf6;
  --bg-hover:        #e4e9f4;
  --bg-card:         #fafbfe;
  --bg-glass:        rgba(10, 20, 50, 0.03);
  --bg-glass-2:      rgba(10, 20, 50, 0.055);
  --bg-topbar:       rgba(245, 247, 252, 0.7);

  --border:          rgba(10, 20, 50, 0.08);
  --border-soft:     rgba(10, 20, 50, 0.05);
  --border-strong:   rgba(10, 20, 50, 0.14);
  --border-hover:    rgba(79, 125, 255, 0.45);
  --border-active:   rgba(79, 125, 255, 0.45);
  --inset-hi:        inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --text-primary:    #0b1020;
  --text-secondary:  #4a5470;
  --text-muted:      #8a93ab;

  --shadow:     0 20px 50px -16px rgba(10, 20, 50, 0.18);
  --shadow-glow:0 10px 24px -10px rgba(79, 125, 255, 0.55);
}
body.light-theme input[type="date"], body.light-theme input[type="month"] { color-scheme: light; }
input[type="date"], input[type="month"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* =====================
   APP SHELL
   ===================== */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-glass);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.35s var(--ease), min-width 0.35s var(--ease);
  overflow: hidden;
  z-index: 100;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); min-width: var(--sidebar-w-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.35rem 1rem 1.1rem 1.25rem;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-header { flex-direction: column; padding: 1.35rem 0 0.75rem; gap: 0.9rem; }

.sidebar-logo {
  display: flex; align-items: center;
  overflow: hidden;
  color: var(--text-primary);
}

/* Logo Rickk em SVG (currentColor: branca no escuro, preta no claro) */
.sidebar-logo-svg { height: 22px; width: auto; display: block; }
.sidebar-logo-symbol { height: 24px; display: none; color: var(--accent-2); }
body.light-theme .sidebar-logo-symbol { color: var(--accent); }
.sidebar.collapsed .sidebar-logo-full { display: none; }
.sidebar.collapsed .sidebar-logo-symbol { display: block; }
.sidebar-logo-tag {
  margin-left: 0.6rem;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sidebar.collapsed .sidebar-logo-tag { display: none; }

.sidebar-toggle {
  background: none; border: 1px solid transparent; color: var(--text-muted);
  cursor: pointer; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-glass-2); border-color: var(--border); color: var(--text-primary); }
.sidebar-toggle i { transition: transform 0.35s var(--ease); }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

/* User info */
.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0 0.75rem 0.5rem;
  padding: 0.65rem 0.7rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--inset-hi);
  overflow: hidden; flex-shrink: 0;
  transition: margin 0.35s var(--ease), padding 0.35s var(--ease);
}
.sidebar.collapsed .sidebar-user { margin: 0 0.75rem 0.5rem; padding: 0.5rem; justify-content: center; }

.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.8rem; flex-shrink: 0;
  box-shadow: 0 6px 16px -6px var(--accent);
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; transition: opacity var(--transition); }
.sidebar.collapsed .user-info { opacity: 0; width: 0; }
.user-name { font-weight: 600; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); letter-spacing: -0.01em; }
.user-role { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }

/* Nav */
.sidebar-nav { flex: 1; padding: 0.25rem 0 0.5rem; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-section { margin-bottom: 0.35rem; }

/* Rótulo de seção em formato de etiqueta (estilo Stryver) */
.nav-label {
  display: inline-block;
  margin: 0.9rem 0 0.4rem 1.25rem;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.6rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  white-space: nowrap; transition: opacity var(--transition);
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.8rem; margin: 0.1rem 0.75rem;
  border-radius: var(--radius-sm); text-decoration: none;
  color: var(--text-secondary); font-weight: 400; font-size: 0.85rem;
  cursor: pointer; border: none; background: none;
  width: calc(100% - 1.5rem); white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  font-family: inherit; position: relative; text-align: left;
}

.nav-item i { font-size: 0.92rem; width: 18px; flex-shrink: 0; text-align: center; transition: transform 0.35s var(--spring); }
.nav-item > span { overflow: hidden; transition: opacity var(--transition); flex: 1; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-item > span { opacity: 0; width: 0; flex: 0; }
.nav-item:hover { background: var(--bg-glass-2); color: var(--text-primary); }
.nav-item:hover i { transform: scale(1.12); }

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-text);
  font-weight: 500;
}
/* Pontinho de luz à direita do item ativo */
.nav-item.active::after {
  content: '';
  position: absolute; right: 0.8rem; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  transform: translateY(-50%);
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}
.sidebar.collapsed .nav-item.active::after { display: none; }

.nav-item-danger { color: var(--color-late) !important; }
.nav-item-danger:hover { background: rgba(239,68,68,0.1) !important; }

/* Sub-menu */
.nav-sub-toggle { cursor: pointer; user-select: none; }
.nav-sub-toggle .nav-chevron {
  margin-left: auto; font-size: 0.65rem; color: var(--text-muted);
  transition: transform var(--transition);
}
.nav-sub-toggle.open .nav-chevron { transform: rotate(90deg); }
.nav-sub-list { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.nav-sub-list.open { max-height: 200px; }
.nav-sub-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.875rem 0.5rem 2.75rem;
  margin: 0.05rem 0.75rem;
  border-radius: var(--radius-sm); text-decoration: none;
  color: var(--text-muted); font-weight: 400; font-size: 0.8rem;
  cursor: pointer; border: none; background: none;
  width: calc(100% - 1.5rem); white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.nav-sub-item i { font-size: 0.75rem; width: 14px; text-align: center; }
.nav-sub-item:hover { background: var(--bg-glass-2); color: var(--text-secondary); }
.nav-sub-item.active { color: var(--accent-text); font-weight: 500; }
.sidebar.collapsed .nav-sub-list { display: none; }

/* Separator */
.nav-separator { height: 1px; background: var(--border); margin: 0.5rem 1rem; }

/* Footer */
.sidebar-footer { padding: 0.75rem 0; border-top: 1px solid var(--border); flex-shrink: 0; }

/* Badge "Em breve" */
.nav-badge-soon {
  margin-left: auto;
  background: var(--accent-glow);
  color: var(--accent-text);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar.collapsed .nav-badge-soon { display: none; }

/* =====================
   MAIN WRAPPER & TOPBAR
   ===================== */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; position: relative; isolation: isolate; }

/* Brilho difuso no canto superior (estilo Stryver / rickk.com.br) */
.main-wrapper::before {
  content: '';
  position: absolute;
  width: 620px; height: 620px;
  right: -180px; top: -300px;
  border-radius: 50%;
  background: var(--accent-glow-lg);
  filter: blur(150px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}
body.light-theme .main-wrapper::before { opacity: 0.25; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; height: 62px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  flex-shrink: 0; gap: 1rem;
  position: relative; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }

/* Botões de ícone da barra (tema, modo privado, notificações) */
.topbar-icon-btn, .topbar-notif {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-glass); border: 1px solid var(--border);
  box-shadow: var(--inset-hi);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.35s var(--spring);
}
.topbar-icon-btn i { font-size: 0.85rem; }
.topbar-icon-btn:hover, .topbar-notif:hover { background: var(--bg-glass-2); color: var(--text-primary); border-color: var(--border-strong); transform: translateY(-1px); }
.topbar-menu-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; padding: 0.4rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.topbar-search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; width: 240px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search:focus-within { border-color: var(--border-active); box-shadow: 0 0 0 3px var(--accent-glow); }
.topbar-search i { color: var(--text-muted); font-size: 0.85rem; }
.topbar-search input { background: none; border: none; outline: none; color: var(--text-primary); font-family: inherit; font-size: 0.875rem; width: 100%; }
.topbar-search input::placeholder { color: var(--text-muted); }

/* ================== FINANCEIRO ================== */
.fin-dash {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.fin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--inset-hi);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fin-card-title {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 400;
}
.fin-card-value {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0.2rem 0;
}
.fin-card-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.topbar-notif { position: relative; }

.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-base);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ================== NOTIFICATION DROPDOWN ================== */
.notif-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 1000;
  overflow: hidden;
  text-align: left;
  transform-origin: top right;
  animation: slideDown 0.2s ease forwards;
}

.notif-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}
.notif-header h4 { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }

.notif-body {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex;
  gap: 0.8rem;
  transition: var(--transition-base);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }

.notif-item-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.notif-item.late .notif-item-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.notif-item-content {
  flex: 1;
}
.notif-item-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.notif-item-desc {
  font-size: 0.75rem; color: var(--text-secondary);
}

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =====================
   VIEWS
   ===================== */
.views-container {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2rem 2.25rem;
  scrollbar-width: thin; scrollbar-color: var(--bg-overlay) transparent;
}
.views-container::-webkit-scrollbar { width: 5px; }
.views-container::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 3px; }

.view { animation: viewFadeIn 0.6s var(--ease) both; }
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap;
}
.view-header h2 { font-size: 1.65rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
/* Etiqueta "// Seção" acima dos títulos (estilo Next Pages) */
.view-header h2::before {
  content: '// ' attr(data-eyebrow);
  display: block;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--accent-text);
  margin-bottom: 0.45rem;
}
.view-header h2:not([data-eyebrow])::before { content: '// Rickk IA'; }
.view-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* Placeholder "Em breve" */
.view-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; gap: 1rem; text-align: center;
}
.view-placeholder .placeholder-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent-glow); border: 1px solid var(--border-active);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: var(--accent);
  margin-bottom: 0.5rem;
}
.view-placeholder h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.view-placeholder p { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; line-height: 1.7; }
.view-placeholder .soon-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-glow); border: 1px solid var(--border-active);
  color: var(--accent); font-weight: 700; font-size: 0.75rem;
  padding: 0.35rem 0.875rem; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* =====================
   BUTTONS
   ===================== */
/* Principal: gradiente Rickk + brilho que atravessa no hover + mola */
.btn-primary {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  color: white; border: none;
  padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.84rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: background-position 0.5s var(--ease), box-shadow 0.35s ease, transform 0.38s var(--spring);
  letter-spacing: -0.01em;
}
.btn-primary::before {
  content: ''; position: absolute; inset: -50% -65%; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,0.1) 46%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0.1) 54%, transparent 60%);
  transform: translateX(-65%);
}
.btn-primary:hover::before { animation: buttonShine 0.9s var(--ease); }
@keyframes buttonShine { to { transform: translateX(65%); } }
.btn-primary:hover { background-position: 100% 0; box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.3); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary i { transition: transform 0.38s var(--spring); }
.btn-primary:hover i { transform: scale(1.12); }

/* Secundário: vidro (estilo Stryver) */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-glass-2); color: var(--text-primary);
  border: 1px solid var(--border-strong); padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.84rem; font-weight: 500;
  box-shadow: var(--inset-hi);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.38s var(--spring);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-hover); transform: translateY(-1px); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--color-late); color: white; border: none;
  padding: 0.55rem 1.2rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.3rem 0.7rem !important; font-size: 0.8rem !important; }

.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm); font-size: 0.85rem; transition: var(--transition); font-family: inherit;
}
.btn-icon:hover { background: var(--bg-glass-2); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(239,68,68,0.12); color: var(--color-late); }

/* =====================
   FILTER BAR
   ===================== */
.filter-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-bar.full {
  margin-bottom: 1rem; padding: 0.75rem;
  background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--inset-hi);
}

.filter-select {
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border); padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.8rem;
  cursor: pointer; outline: none; transition: var(--transition);
}
.filter-select:hover { border-color: var(--border-strong); }
.filter-select:focus { border-color: var(--border-active); color: var(--text-primary); box-shadow: 0 0 0 4px var(--accent-glow); }

/* =====================
   DATA TABLE
   ===================== */
.table-wrapper {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
  box-shadow: var(--inset-hi);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  padding: 0.85rem 1rem; text-align: left;
  font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: var(--bg-glass); white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td { transition: background 0.2s ease, color 0.2s ease; }
.data-table tr:hover td { background: var(--bg-glass-2); color: var(--text-primary); }
.data-table .col-primary { color: var(--text-primary); font-weight: 600; }
.table-empty { text-align: center; padding: 3rem !important; color: var(--text-muted) !important; font-size: 0.9rem !important; }

/* =====================
   BADGES & TAGS
   ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.badge-todo  { background: var(--accent-glow); color: var(--color-todo); }
.badge-doing { background: rgba(245,158,11,0.15); color: var(--color-doing); }
.badge-done  { background: rgba(34,197,94,0.15);  color: var(--color-done); }
.badge-late  { background: rgba(239,68,68,0.15);  color: var(--color-late); }
.badge-active   { background: rgba(34,197,94,0.15);  color: var(--color-done); }
.badge-inactive { background: rgba(107,114,128,0.12); color: #6b7280; }

.priority-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 0.35rem; }
.priority-dot.Alta  { background: var(--priority-high); }
.priority-dot.Média { background: var(--priority-mid); }
.priority-dot.Baixa { background: var(--priority-low); }

.tag-chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem;
  border-radius: 4px; font-size: 0.68rem; font-weight: 600;
  background: var(--bg-overlay); color: var(--text-secondary); border: 1px solid var(--border);
}
.tag-chip i { font-size: 0.6rem; }

/* =====================
   FORM ELEMENTS
   ===================== */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.form-group label { font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0; }
.form-input {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.65rem 0.875rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.875rem; width: 100%;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:hover { border-color: var(--border-strong); }
.form-input:focus { border-color: var(--border-active); box-shadow: 0 0 0 4px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }
.form-input[readonly] { opacity: 0.6; cursor: not-allowed; }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select.form-input { cursor: pointer; }
select.form-input option { background: var(--bg-elevated); }
.form-row { display: flex; gap: 1rem; }

/* =====================
   CHECKLIST STYLES
   ===================== */
.checklist-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.625rem;
}

.checklist-section .section-title {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 0.25rem;
}

.checklist-add-row {
  display: flex; gap: 0.5rem; align-items: center;
}

.checklist-add-row input {
  flex: 1; background: var(--bg-overlay); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.85rem;
  outline: none; transition: border-color var(--transition);
}
.checklist-add-row input:focus { border-color: var(--border-active); }
.checklist-add-row input::placeholder { color: var(--text-muted); }

.checklist-add-btn {
  background: var(--accent-glow); border: 1px solid var(--border-active);
  color: var(--accent); padding: 0.5rem 0.875rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.checklist-add-btn:hover { background: var(--accent); color: white; }

.checklist-items { display: flex; flex-direction: column; gap: 0.35rem; }

.checklist-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.45rem 0.5rem; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.checklist-item:hover { background: var(--bg-overlay); }

.checklist-item input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  appearance: none; -webkit-appearance: none;
  border: 2px solid var(--border-active); border-radius: 4px;
  background: transparent; cursor: pointer; transition: var(--transition);
  position: relative;
}
.checklist-item input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.checklist-item input[type="checkbox"]:checked::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: white; font-size: 10px; font-weight: 700;
}

.checklist-item-text {
  flex: 1; font-size: 0.875rem; color: var(--text-secondary);
  transition: color var(--transition);
}
.checklist-item-text.done {
  text-decoration: line-through; color: var(--text-muted);
}

.checklist-item-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.75rem; padding: 0.2rem 0.3rem;
  border-radius: 4px; transition: var(--transition); opacity: 0;
}
.checklist-item:hover .checklist-item-del { opacity: 1; }
.checklist-item-del:hover { color: var(--color-late); background: rgba(239,68,68,0.1); }

.checklist-progress {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem;
}
.checklist-progress-bar {
  flex: 1; height: 4px; background: var(--bg-overlay); border-radius: 999px; overflow: hidden;
}
.checklist-progress-fill {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 0.3s ease;
}
.checklist-progress-text { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* =====================
   PERIOD BUTTONS
   ===================== */
.period-filters { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.period-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 0.35rem 0.875rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.period-btn:hover { color: var(--text-primary); border-color: var(--border-active); }
.period-btn { border-radius: 999px; }
.period-btn.active { background: var(--accent-glow); border-color: var(--border-active); color: var(--accent-text); font-weight: 500; }
.custom-date-range { display: flex; align-items: center; gap: 0.5rem; }

/* =====================
   TABS (Créditos, etc.)
   ===================== */
.credits-tabs { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.credits-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); padding: 0.6rem 0.2rem; margin-right: 1.25rem;
  font-family: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.credits-tab:hover { color: var(--text-primary); }
.credits-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 500; }
.custom-date-range input {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.8rem; outline: none;
}

/* =====================
   TOASTS
   ===================== */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  color: var(--text-primary); padding: 0.75rem 1.25rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 0.75rem;
  min-width: 280px; animation: slideInRight 0.45s var(--spring);
  pointer-events: all; border-left: 3px solid var(--accent);
}
.toast.success { border-left-color: var(--color-done); }
.toast.error   { border-left-color: var(--color-late); }
.toast.warning { border-left-color: var(--color-today-warn); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =====================
   DASHBOARD STYLES
   ===================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color var(--transition), transform var(--transition);
}
.metric-card:hover { border-color: var(--border-active); transform: translateY(-2px); }

.metric-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}

.metric-body { display: flex; flex-direction: column; gap: 0.2rem; }
.metric-label { font-size: 0.78rem; font-weight: 400; color: var(--text-secondary); }
.metric-value { font-size: 1.9rem; font-weight: 600; color: var(--text-primary); line-height: 1; letter-spacing: -0.03em; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-wide { grid-column: 1 / -1; }

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.chart-card h3 {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 1.25rem;
}

.collab-table-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--inset-hi);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.collab-table-section h3 {
  font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}

/* =====================
   CONFIG / PROFILE VIEW
   ===================== */
.config-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  max-width: 860px;
}

.config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--inset-hi);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

.config-card-title {
  font-size: 0.78rem; font-weight: 500; color: var(--accent-text);
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}

.avatar-upload-area {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: border-color var(--transition);
}
.avatar-upload-area:hover { border-color: var(--border-active); }

.avatar-preview {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 700; color: white;
  overflow: hidden; box-shadow: var(--shadow-glow);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-hint { font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); transition: transform var(--transition); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu-btn { display: block; }
  .topbar-search { width: 150px; }
  .form-row { flex-direction: column; }
  .charts-grid { grid-template-columns: 1fr; }
  .config-layout { grid-template-columns: 1fr; }

  .topbar { padding: 0 0.85rem; gap: 0.5rem; }
  .topbar-left { gap: 0.6rem; min-width: 0; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 0.5rem !important; }
  #btn-export-csv-label { display: none; }
  #btn-export-csv { padding: 0 !important; width: 34px; height: 34px; justify-content: center; }

  .views-container { padding: 1.25rem 1rem; }
  .view-header h2 { font-size: 1.35rem; }
  .home-hero { padding: 1.75rem 1.4rem !important; }

  .modal-box { max-height: 94vh; }
  .modal-body { padding: 1.1rem; }
  .modal-header { padding: 1rem 1.1rem; }
}

/* =====================
   HOME HERO (card de boas-vindas estilo Stryver)
   ===================== */
@property --frame-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 2.5rem 2.5rem 2.25rem;
  border-radius: var(--radius-lg);
}
/* Luz girando na borda (rickk.com.br) */
.home-hero::after {
  content: '';
  position: absolute; inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(from var(--frame-angle), transparent 0deg 260deg, rgba(79,125,255,0.33) 310deg, #a9ceff 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  animation: frameSweep 8s ease-in-out infinite;
}
@keyframes frameSweep { to { --frame-angle: 360deg; } }
.home-hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem; font-weight: 500;
  color: var(--accent-text);
  margin-bottom: 0.9rem;
}
.home-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 0.6rem;
}
.home-hero h1 strong {
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-hero p { color: var(--text-secondary); font-size: 0.95rem; }

/* =====================
   CARDS EM VIDRO + HOVER (Stryver + Next Pages)
   ===================== */
.metric-card, .chart-card, .fin-card, .config-card {
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.metric-card:hover, .fin-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--inset-hi), 0 20px 40px -26px var(--accent);
}
.chart-card:hover, .config-card:hover { border-color: var(--border-strong); }

/* Títulos de card como etiqueta "// " */
.chart-card h3 {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text-secondary) !important;
}
.chart-card h3 i { color: var(--accent-text) !important; }

/* =====================
   MOTION — entrada em cascata (npPop do Next Pages)
   ===================== */
@keyframes npPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.view .home-hero,
.view .metrics-grid > *,
.view .charts-grid > *,
.view .fin-dash > *,
.view .config-layout > *,
.view .kanban-col {
  animation: npPop 0.6s var(--ease) both;
}
.view .home-hero { animation-duration: 0.8s; }
.view .metrics-grid > :nth-child(2), .view .charts-grid > :nth-child(2), .view .fin-dash > :nth-child(2), .view .config-layout > :nth-child(2), .view .kanban-col:nth-child(2) { animation-delay: 70ms; }
.view .metrics-grid > :nth-child(3), .view .charts-grid > :nth-child(3), .view .fin-dash > :nth-child(3), .view .kanban-col:nth-child(3) { animation-delay: 140ms; }
.view .metrics-grid > :nth-child(4), .view .charts-grid > :nth-child(4), .view .fin-dash > :nth-child(4), .view .kanban-col:nth-child(4) { animation-delay: 210ms; }
.view .charts-grid > :nth-child(n+5) { animation-delay: 280ms; }

/* Barra de rolagem discreta */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--accent-glow-lg); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================
   INÍCIO — fundo de ondas + LIQUID GLASS
   ===================== */
.liquid-glass {
  --lg-tint: rgba(6, 8, 22, 0.18);
  --lg-edge: rgba(255, 255, 255, 0.22);
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.04)),
    var(--lg-tint) !important;
  border: 1px solid var(--lg-edge) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 24px rgba(255, 255, 255, 0.05),
    0 24px 60px -24px rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(16px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(180%) brightness(1.05);
}
/* Refração de verdade (Chrome/Edge): o JS liga essa classe só onde o filtro SVG funciona */
.lg-refract .liquid-glass {
  backdrop-filter: url(#liquid-glass) blur(10px) saturate(190%) brightness(1.05);
}
/* Reflexo que acompanha o cursor */
.liquid-glass > * { position: relative; z-index: 1; }
.home-hero.liquid-glass::before,
.liquid-glass:not(.home-hero)::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.18), transparent 28%);
  opacity: 0.8;
  transition: opacity 0.4s var(--ease);
}
.liquid-glass:hover { border-color: rgba(190, 215, 255, 0.45) !important; }
.liquid-glass:hover::before, .liquid-glass:not(.home-hero):hover::after { opacity: 1; }

body.light-theme .liquid-glass {
  --lg-tint: rgba(255, 255, 255, 0.55);
  --lg-edge: rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 24px rgba(255, 255, 255, 0.4),
    0 24px 50px -24px rgba(10, 20, 50, 0.3) !important;
}
/* Texto do hero sempre claro sobre as ondas no tema escuro */
.home-hero h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.home-hero h1 strong {
  background: linear-gradient(90deg, #a9ceff, #ffffff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.light-theme .home-hero h1 strong {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
}

/* =====================================================================
   v4 — ESTILO "DASHBOARD ESCURO" (referência enviada):
   app emoldurado, trilho de ícones, cinza-carvão neutro, números grandes
   ===================================================================== */
:root {
  --bg-base:        #050506;
  --bg-panel:       #0b0b0e;
  --bg-surface:     #111114;
  --bg-elevated:    #16161a;
  --bg-overlay:     #1b1b20;
  --bg-hover:       #202027;
  --bg-card:        #131316;
  --bg-glass:       rgba(255, 255, 255, 0.03);
  --bg-glass-2:     rgba(255, 255, 255, 0.06);
  --bg-topbar:      transparent;
  --card-fill:      linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)), #111114;

  --border:         rgba(255, 255, 255, 0.06);
  --border-soft:    rgba(255, 255, 255, 0.04);
  --border-strong:  rgba(255, 255, 255, 0.11);

  --text-secondary: #a1a1aa;
  --text-muted:     #686873;

  --radius:    16px;
  --radius-sm: 11px;
  --radius-lg: 20px;
  --sidebar-w: 236px;
  --sidebar-w-collapsed: 76px;
}
body.light-theme {
  --bg-base:        #e9ebf0;
  --bg-panel:       #f7f8fa;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f2f3f6;
  --bg-overlay:     #eceef2;
  --bg-hover:       #e6e8ee;
  --bg-card:        #ffffff;
  --card-fill:      #ffffff;
  --bg-topbar:      transparent;
  --border:         rgba(10, 15, 30, 0.07);
  --border-strong:  rgba(10, 15, 30, 0.12);
  --text-secondary: #525866;
  --text-muted:     #8b909c;
}

/* ---- Moldura: app dentro de painéis arredondados ---- */
.app-shell { padding: 10px; gap: 10px; background: var(--bg-base); }
.sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
}
.main-wrapper {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.main-wrapper::before { opacity: 0.18; }
body.light-theme .main-wrapper::before { opacity: 0.12; }

/* ---- Trilho de ícones (menu recolhido) ---- */
.sidebar.collapsed .sidebar-header { padding: 1.2rem 0 1rem; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-section { margin: 0 0 0.9rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }
.sidebar.collapsed .nav-section:last-child { border-bottom: none; }
.sidebar.collapsed .nav-item {
  width: 44px; height: 44px;
  margin: 0.3rem auto;
  padding: 0;
  border-radius: 13px;
}
.sidebar.collapsed .nav-item i { font-size: 1rem; width: auto; }
.sidebar.collapsed .nav-item.active {
  background: var(--accent-glow);
  box-shadow: inset 0 0 0 1px rgba(127, 176, 255, 0.28), 0 8px 20px -10px var(--accent);
}
.sidebar.collapsed .sidebar-footer { border-top: none; padding-bottom: 1rem; }
.sidebar-nav { padding-top: 0.5rem; }

/* ---- Topbar: trilha "› Tela" + chip do usuário ---- */
.topbar { border-bottom: none; height: 68px; padding: 0 1.75rem; backdrop-filter: none; background: transparent; }
.topbar-title { display: flex; align-items: center; gap: 0.65rem; font-size: 1rem; font-weight: 500; }
.topbar-title::before {
  content: '\f054';
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 0.65rem; color: var(--text-muted);
}
.topbar-icon-btn, .topbar-notif { border-radius: 50%; background: var(--bg-surface); box-shadow: none; }
.topbar-user {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 4px 14px 4px 4px;
  margin-left: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 220px;
}
.topbar-user .user-avatar { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
.topbar-user .user-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-user .user-name { font-size: 0.8rem; }
.topbar-user .user-role { font-size: 0.68rem; }

.views-container { padding: 0.5rem 1.75rem 2rem; }

/* ---- Cards cinza-carvão ---- */
.metric-card, .chart-card, .fin-card, .config-card, .table-wrapper, .kanban-col, .collab-table-section, .filter-bar.full {
  background: var(--card-fill);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
}
body.light-theme .metric-card, body.light-theme .chart-card, body.light-theme .fin-card, body.light-theme .config-card,
body.light-theme .table-wrapper, body.light-theme .kanban-col, body.light-theme .collab-table-section {
  box-shadow: 0 1px 2px rgba(10, 15, 30, 0.04), 0 8px 24px -16px rgba(10, 15, 30, 0.12);
}
.metric-card:hover, .fin-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 18px 40px -26px rgba(0,0,0,0.9); }

/* Métrica: ícone redondo em cima, número grande, botão ↗ no canto */
.metrics-grid .metric-card {
  position: relative;
  flex-direction: column; align-items: flex-start;
  gap: 1.1rem;
  padding: 1.35rem 1.4rem 1.4rem;
}
.metric-card::after {
  content: '\f062';
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 1.15rem; right: 1.15rem;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  transform: rotate(45deg);
  color: var(--text-secondary);
  background: var(--bg-glass-2);
  border: 1px solid var(--border);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.metric-card:hover::after { background: var(--accent); color: #fff; border-color: transparent; }
.metrics-grid .metric-icon { width: 38px; height: 38px; border-radius: 50%; font-size: 0.9rem; border: none; }
.metrics-grid .metric-body { align-items: flex-start; text-align: left; }
.metric-body { gap: 0.35rem; }
.metric-value { font-size: 2.3rem; font-weight: 500; letter-spacing: -0.04em; }

.chart-card h3 { color: var(--text-primary) !important; font-size: 0.9rem !important; }
.view-header h2::before { color: var(--text-muted); }

/* ---- Início: hero com as ondas dentro + relógio em vidro líquido ---- */
.home-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  min-height: 230px;
  padding: 2rem 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, #0b0b0e 0%, rgba(11, 11, 14, 0.85) 30%, rgba(11, 11, 14, 0.15) 70%, rgba(11, 11, 14, 0.35) 100%),
    url('../assets/home-bg.webp') 70% 62% / cover no-repeat;
  animation: npPop 0.8s var(--ease) both, heroWaves 26s ease-in-out infinite alternate;
}
@keyframes heroWaves { from { background-position: 0 0, 70% 62%; } to { background-position: 0 0, 40% 72%; } }
body.light-theme .home-hero {
  background:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.3) 100%),
    url('../assets/home-bg.webp') 70% 62% / cover no-repeat;
}
.home-hero::before { display: none; }
.home-hero-text { max-width: 520px; }
.home-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text-muted); font-size: 0.78rem; font-weight: 400;
}
.home-hero-eyebrow i { font-size: 0.55rem; }
.home-hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 500; }

.home-hero-clock {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius);
  min-width: 220px;
}
.home-hero-clock-label { font-size: 0.75rem; color: rgba(255, 255, 255, 0.75); display: inline-flex; align-items: center; gap: 0.45rem; }
.home-hero-clock-value {
  font-size: 2.6rem; font-weight: 500; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
body.light-theme .home-hero-clock-label { color: var(--text-secondary); }
body.light-theme .home-hero-clock-value { color: var(--text-primary); }

@media (max-width: 768px) {
  .app-shell { padding: 0; gap: 0; }
  .main-wrapper { border-radius: 0; border: none; }
  .sidebar { border-radius: 0; }
  .topbar-user .user-info { display: none; }
  .topbar-user { padding: 4px; }
  .home-hero { min-height: 0; }
  .home-hero-clock { min-width: 0; width: 100%; }
}

/* =====================================================================
   INÍCIO — cards-resumo (Financeiro, Clientes, CRM, Contratos)
   ===================================================================== */
.home-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.summary-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 1.25rem 1.3rem 1.3rem;
  background: var(--card-fill);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  animation: npPop 0.6s var(--ease) both;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.summary-card:nth-child(2) { animation-delay: 60ms; }
.summary-card:nth-child(3) { animation-delay: 120ms; }
.summary-card:nth-child(4) { animation-delay: 180ms; }
/* brilho da cor do card no canto */
.summary-card::before {
  content: '';
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -70px; top: -90px;
  background: var(--c, var(--accent));
  filter: blur(70px); opacity: 0.12;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.summary-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 20px 40px -28px rgba(0,0,0,0.9); }
.summary-card:hover::before { opacity: 0.28; }
.summary-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.65rem; }
.summary-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.summary-label { flex: 1; font-size: 0.8rem; color: var(--text-secondary); }
.summary-go {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--text-secondary);
  background: var(--bg-glass-2); border: 1px solid var(--border);
  transform: rotate(45deg);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.4s var(--spring);
}
.summary-card:hover .summary-go { background: var(--accent); color: #fff; border-color: transparent; transform: rotate(45deg) scale(1.1); }
.summary-value { font-size: 1.9rem; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; }
.summary-soon { font-size: 1.15rem; color: var(--text-muted); padding: 0.4rem 0; }
.summary-sub { font-size: 0.74rem; color: var(--text-muted); }

/* =====================================================================
   CLIENTES — tabela com avatar
   ===================================================================== */
.client-cell { display: flex; align-items: center; gap: 0.7rem; }
.client-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  object-fit: contain;
}
img.client-avatar { background: #fff; padding: 3px; }
.client-notes { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table td { padding-top: 0.95rem; padding-bottom: 0.95rem; }

/* =====================================================================
   FINANCEIRO
   ===================================================================== */
.fin-dash { margin-top: 0; }
.fin-card { padding: 1.35rem 1.4rem; }
.fin-card-goal {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(79, 125, 255, 0.16), transparent 55%),
    var(--card-fill) !important;
  border-color: rgba(127, 176, 255, 0.28) !important;
}
.fin-card-value { font-weight: 500; font-size: 2.1rem; }
.fin-status-filter {
  font-size: 0.75rem; padding: 0.3rem 0.8rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.fin-status-filter:hover { border-color: var(--border-strong); color: var(--text-primary); }
.fin-status-filter.active { background: var(--accent-glow); color: var(--accent-text); border-color: var(--border-active); }
.fin-status-filter i { margin-right: 4px; }
#view-financeiros .table-wrapper > div:first-child { background: transparent !important; }

/* =====================================================================
   CONTRATOS — painel "em breve"
   ===================================================================== */
.soon-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, var(--bg-panel) 0%, rgba(11, 11, 14, 0.8) 45%, rgba(11, 11, 14, 0.3) 100%),
    url('../assets/home-bg.webp') 80% 60% / cover no-repeat;
  animation: npPop 0.7s var(--ease) both;
}
body.light-theme .soon-panel {
  background:
    linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.85) 45%, rgba(255,255,255,0.4) 100%),
    url('../assets/home-bg.webp') 80% 60% / cover no-repeat;
}
.soon-panel .soon-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-glow); border: 1px solid var(--border-active);
  color: var(--accent-text); font-weight: 500; font-size: 0.72rem;
  padding: 0.3rem 0.8rem; border-radius: 999px; margin-bottom: 1rem;
}
.soon-panel h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 0.6rem; }
.soon-panel p { color: var(--text-secondary); max-width: 420px; }
.soon-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.soon-list li {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(11, 11, 14, 0.55);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px) saturate(160%);
  font-size: 0.85rem;
}
body.light-theme .soon-list li { background: rgba(255, 255, 255, 0.7); }
.soon-list li span { font-size: 0.72rem; font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .soon-panel { grid-template-columns: 1fr; padding: 1.75rem; }
}

/* =====================================================================
   v5 — TODAS AS TELAS NO MODELO DO INÍCIO
   Cabeçalho de cada tela vira um card-hero com as ondas à direita,
   trilha "Rickk IA › Seção", título grande, descrição e ações em
   cápsula de vidro (como o relógio do Início).
   ===================================================================== */
.view > .view-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: flex-end;
  min-height: 170px;
  padding: 1.75rem 1.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, var(--bg-panel) 0%, rgba(11, 11, 14, 0.92) 38%, rgba(11, 11, 14, 0.3) 78%, rgba(11, 11, 14, 0.5) 100%),
    url('../assets/home-bg.webp') 85% 65% / cover no-repeat;
  animation: npPop 0.7s var(--ease) both, pageWaves 30s ease-in-out infinite alternate;
}
@keyframes pageWaves { from { background-position: 0 0, 85% 65%; } to { background-position: 0 0, 60% 78%; } }
body.light-theme .view > .view-header {
  background:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.92) 38%, rgba(255, 255, 255, 0.25) 78%, rgba(255, 255, 255, 0.45) 100%),
    url('../assets/home-bg.webp') 85% 65% / cover no-repeat;
}

/* Título */
.view > .view-header h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
/* Trilha "Rickk IA › Seção" (igual ao "Seu painel › Hoje" do Início) */
.view > .view-header h2::before,
.view > .view-header h2:not([data-eyebrow])::before {
  content: 'Rickk IA  \203A  ' attr(data-eyebrow);
  white-space: pre;
  font-size: 0.76rem; font-weight: 400; letter-spacing: 0;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}
.view > .view-header h2:not([data-eyebrow])::before { content: 'Rickk IA'; }
/* Descrição */
.view > .view-header h2::after {
  content: attr(data-desc);
  display: block;
  margin-top: 0.55rem;
  font-size: 0.88rem; font-weight: 400; letter-spacing: 0; line-height: 1.5;
  color: var(--text-secondary);
  max-width: 460px;
}
.view > .view-header h2:not([data-desc])::after { display: none; }
.view > .view-header > div:first-child > p,
.view > .view-header > div:first-child > div { margin-top: 0.55rem !important; font-size: 0.88rem !important; max-width: 460px; }

/* Ações em cápsula de vidro */
.view > .view-header > :last-child:not(:first-child):not(button) {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.5rem;
  background: rgba(11, 11, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 40px -24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
body.light-theme .view > .view-header > :last-child:not(:first-child):not(button) {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 30px -20px rgba(10, 15, 30, 0.25);
}
.view > .view-header .filter-bar { gap: 0.5rem; }
.view > .view-header .topbar-search,
.view > .view-header .crm-search { height: 38px; background: var(--bg-surface); }
.view > .view-header .filter-select { height: 38px; }
.view > .view-header .period-btn { border-color: transparent; background: transparent; }
.view > .view-header .period-btn:hover { background: var(--bg-glass-2); }
.view > .view-header .period-btn.active { background: var(--accent-glow); border-color: rgba(127, 176, 255, 0.3); }

/* Abas (Créditos) viram controle segmentado */
.credits-tabs {
  display: inline-flex; gap: 0.3rem;
  padding: 0.3rem;
  margin-bottom: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.credits-tab {
  margin: 0; padding: 0.5rem 1rem;
  border: none; border-radius: 10px;
  font-size: 0.82rem;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.credits-tab:hover { background: var(--bg-glass-2); }
.credits-tab.active { background: var(--accent-glow); color: var(--accent-text); box-shadow: inset 0 0 0 1px rgba(127, 176, 255, 0.25); }
/* Sub-cabeçalhos dentro das abas continuam simples */
.view-header .view-header, [id^="credits-panel-"] > .view-header { min-height: 0; }

@media (max-width: 768px) {
  .view > .view-header { min-height: 0; padding: 1.35rem 1.2rem; }
  .view > .view-header > :last-child:not(:first-child):not(button) { width: 100%; }
}

/* =====================================================================
   v6 — SISTEMA DE BOTÕES
   Mesma base para todos: 40px, cantos 12px, peso 500, foco visível.
   ===================================================================== */
.btn-primary, .btn-secondary, .btn-danger {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  height: 40px;
  padding: 0 1.1rem;
  border-radius: 12px;
  font-family: inherit; font-size: 0.84rem; font-weight: 500; letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform 0.38s var(--spring), box-shadow 0.3s ease, background 0.3s ease,
              border-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
}
.btn-primary > i, .btn-secondary > i, .btn-danger > i { font-size: 0.8rem; transition: transform 0.4s var(--spring); }

/* Ícone dentro de uma bolinha (como os botões da referência) */
.btn-primary > i:first-child, .btn-secondary > i:first-child {
  width: 22px; height: 22px; margin-left: -0.35rem;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.68rem;
}
.btn-primary > i:first-child { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-secondary > i:first-child { background: var(--bg-glass-2); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-primary:hover > i.fa-plus, .btn-secondary:hover > i.fa-plus { transform: rotate(90deg); }
.btn-primary:hover > i:not(.fa-plus), .btn-secondary:hover > i:not(.fa-plus) { transform: scale(1.1); }

/* ---- Principal ---- */
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #6d95ff 0%, #4f7dff 52%, #416ff2 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 10px 24px -10px rgba(79, 125, 255, 0.75);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  background-position: 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 16px 32px -10px rgba(79, 125, 255, 0.95);
}
.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.96);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 4px 12px -6px rgba(79, 125, 255, 0.6);
  transition-duration: 0.08s;
}

/* ---- Secundário ---- */
.btn-secondary {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.25);
  backdrop-filter: none;
}
.btn-secondary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)), var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover > i:first-child { color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:active { transform: translateY(1px) scale(0.98); transition-duration: 0.08s; }
body.light-theme .btn-secondary {
  background: #fff;
  box-shadow: 0 1px 2px rgba(10, 15, 30, 0.06), 0 4px 12px -6px rgba(10, 15, 30, 0.12);
}
body.light-theme .btn-secondary:hover { background: #f7f8fb; border-color: rgba(10, 15, 30, 0.2); }

/* ---- Perigo: vermelho suave que fica sólido no hover ---- */
.btn-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
}
.btn-danger:hover { color: #fff; background: #ef4444; border-color: transparent; transform: translateY(-1px); box-shadow: 0 12px 26px -12px rgba(239, 68, 68, 0.9); }
.btn-danger:active { transform: translateY(1px) scale(0.98); }
body.light-theme .btn-danger { color: #dc2626; }

/* ---- Tamanho pequeno ---- */
.btn-sm { height: 32px !important; padding: 0 0.75rem !important; font-size: 0.78rem !important; border-radius: 10px !important; }
.btn-sm > i:first-child { width: 18px; height: 18px; margin-left: -0.2rem; }

/* ---- Botão de ícone ---- */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-width: 32px; height: 32px;
  padding: 0 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.35s var(--spring);
}
.btn-icon:hover { background: var(--bg-glass-2); border-color: var(--border); color: var(--text-primary); }
.btn-icon:active { transform: scale(0.92); }
.btn-icon.danger:hover { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); color: #f87171; }

/* ---- Foco (teclado) e desativado ---- */
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible,
.btn-icon:focus-visible, .topbar-icon-btn:focus-visible, .period-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px rgba(127, 176, 255, 0.7);
}
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, .btn-icon:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(0.3);
}
.btn-primary:disabled::before { display: none; }

/* Rodapé dos modais: botões com a mesma altura */
.modal-footer { gap: 0.6rem; }

/* Tema claro: as ondas escuras viram ondas azul-claras (imagem invertida numa camada própria) */
body.light-theme .view > .view-header,
body.light-theme .home-hero,
body.light-theme .soon-panel { background: #ffffff; }
body.light-theme .soon-panel { position: relative; isolation: isolate; overflow: hidden; }
body.light-theme .view > .view-header::before,
body.light-theme .home-hero::before,
body.light-theme .soon-panel::before {
  content: '';
  display: block;
  position: absolute; inset: 0;
  width: auto; height: auto;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: url('../assets/home-bg.webp') 85% 65% / cover no-repeat;
  filter: invert(1) hue-rotate(180deg) saturate(1.6);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
  opacity: 0.9;
  animation: none;
}

/* Cards de número: fundo carvão/branco (o dashboard.css carregava depois e deixava translúcido) */
.metrics-grid .metric-card { background: var(--card-fill); backdrop-filter: none; }

/* =====================================================================
   PESSOAL — Minhas demandas / Meus clientes
   ===================================================================== */
.p-form { display: flex; flex-direction: column; gap: 1rem; }
.p-client-name { display: flex; flex-direction: column; min-width: 0; }
.p-client-name small { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-contact { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; }
.p-contact span { display: inline-flex; align-items: center; gap: 0.45rem; }
.p-contact .crm-wa { width: 24px; height: 24px; font-size: 0.8rem; }
.p-open-tasks {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-glass-2);
  color: var(--text-secondary);
  font-size: 0.74rem; font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.p-open-tasks i { font-size: 0.6rem; transition: transform 0.3s var(--spring); }
.p-open-tasks:hover { border-color: var(--border-hover); color: var(--text-primary); background: var(--accent-glow); }
.p-open-tasks:hover i { transform: translateX(2px); }

/* =====================================================================
   DASHBOARD — botão Empresa / Pessoal
   ===================================================================== */
.scope-toggle {
  display: inline-flex; gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.scope-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 32px; padding: 0 0.85rem;
  border: none; border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit; font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.scope-btn i { font-size: 0.75rem; }
.scope-btn:hover { color: var(--text-primary); background: var(--bg-glass-2); }
.scope-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #6d95ff 0%, #4f7dff 52%, #416ff2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 16px -8px rgba(79, 125, 255, 0.9);
}
.scope-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px rgba(127, 176, 255, 0.7); }
.scope-divider { width: 1px; height: 24px; background: var(--border-strong); margin: 0 0.25rem; }

/* Modo Pessoal: some o que é "por colaborador" */
#view-dashboard.is-personal .dash-team-only { display: none !important; }
#view-dashboard.is-personal .charts-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
#view-dashboard.is-personal .charts-grid .chart-wide { grid-column: auto; }
@media (max-width: 900px) { #view-dashboard.is-personal .charts-grid { grid-template-columns: 1fr; } }

/* Menu recolhido: ícones exatamente no centro (o espaço de 12px entre ícone e
   texto continuava ativo com o texto escondido e empurrava o ícone 6px pra esquerda) */
.sidebar.collapsed .nav-item { gap: 0; }
.sidebar.collapsed .nav-item > span { display: none; }
.sidebar.collapsed .nav-item i { width: 20px; text-align: center; }

/* Botões só de ícone (arquivar, excluir, enviar): quadrados e com o ícone no centro */
.btn-primary.btn-square, .btn-secondary.btn-square { width: 40px; padding: 0; flex-shrink: 0; }
.btn-primary.btn-square > i:first-child, .btn-secondary.btn-square > i:first-child {
  width: auto; height: auto; margin: 0;
  background: none; border: none; box-shadow: none;
  font-size: 0.85rem;
}
.btn-secondary.btn-square > i:first-child { color: var(--text-secondary); }
.btn-secondary.btn-square:hover > i:first-child { color: var(--text-primary); }
.btn-secondary.btn-square-danger > i:first-child { color: #f87171; }
.btn-secondary.btn-square-danger { border-color: rgba(239, 68, 68, 0.3); }
.btn-secondary.btn-square-danger:hover { background: #ef4444; border-color: transparent; }
.btn-secondary.btn-square-danger:hover > i:first-child { color: #fff; }

/* ---- Pessoas nas demandas pessoais ---- */
.p-hint { display: flex; align-items: flex-start; gap: 0.4rem; margin-top: 0.4rem; font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.p-hint i { margin-top: 0.15rem; }
.p-shared-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem; font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-glow);
  border: 1px solid rgba(127, 176, 255, 0.25);
}
.p-shared-note {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  font-size: 0.8rem; color: var(--text-secondary);
}
.p-shared-note.hidden { display: none; }

#ptf-people-display.is-disabled { cursor: default; opacity: 0.6; }
#ptf-people-display.is-disabled i { display: none; }

/* Quadros redesenhados (arrastar / atualização em tempo real): sem animação de entrada */
.no-anim .k-card, .no-anim .kanban-col, .no-anim.kanban-board > .kanban-col,
.no-anim .crm-card, .no-anim .crm-col, .no-anim.crm-board > .crm-col {
  animation: none !important;
}

.notif-item.soon .notif-item-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }


/* Aprovação do cliente (modal da demanda pessoal) */
.appr-box { border: 1px solid var(--border); border-radius: var(--radius-md, 12px); padding: 0.85rem 1rem; background: var(--bg-glass-2, rgba(255,255,255,0.03)); }
.appr-empty p { font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 0.7rem; line-height: 1.45; }
.appr-status { font-size: 0.88rem; font-weight: 500; }
.appr-comment { font-size: 0.82rem; color: var(--text-secondary); margin: 0.45rem 0 0; white-space: pre-line; }
.appr-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }