/* ======================================================
   NEGOCIO PANEL — Slide-over de detalhes (MODERN REDESIGN)
   ====================================================== */

.np-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  justify-content: flex-end;
  animation: npFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.np-overlay--closing { animation: npFadeOut 0.25s ease both; }
@keyframes npFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes npFadeOut { from { opacity: 1; backdrop-filter: blur(0); } to { opacity: 0; backdrop-filter: blur(0); } }

.np-panel {
  width: 580px;
  max-width: 100%;
  height: 100%;
  background: #F8FAFC; /* Light gray background for contrast with cards */
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 60px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid rgba(0,0,0,0.04);
}
.np-panel--open { transform: translateX(0); }
.np-overlay--closing .np-panel { transform: translateX(100%); }

/* Loading */
.np-loading-state {
  display: flex; align-items: center; justify-content: center; height: 100%;
}
.np-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(0,0,0,0.06);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Header */
.np-header {
  background: #FFFFFF;
  padding: 32px 32px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: relative;
  flex-shrink: 0;
  z-index: 10;
}

.np-close-btn {
  position: absolute; top: 20px; right: 20px;
  background: #F1F5F9;
  border: none; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.np-close-btn:hover { background: #E2E8F0; transform: scale(1.05); }
.np-close-btn svg {
  width: 16px; height: 16px;
  stroke: #475569; fill: none;
  stroke-width: 2.5; stroke-linecap: round;
}

.np-header-main { margin-bottom: 12px; }

.np-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 24px;
  font-size: 11px; font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.np-badge--open  { background: #E0F2FE !important; color: #0284C7 !important; }
.np-badge--won   { background: #DCFCE7 !important; color: #16A34A !important; }
.np-badge--lost  { background: #FEE2E2 !important; color: #DC2626 !important; }

.np-title {
  font-size: 24px; font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
  line-height: 1.2;
  padding-right: 48px;
}

.np-valor {
  font-size: 20px; font-weight: 700;
  color: #64748B;
  letter-spacing: -0.5px;
}

.np-header-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.np-meta-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #F1F5F9;
  border: 1px solid rgba(0,0,0,0.02);
  border-radius: 10px;
  font-size: 11px; font-weight: 600;
  color: #475569;
}
.np-meta-pill svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Scrollable Body Content */
.np-scrollable-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.np-scrollable-content::-webkit-scrollbar { width: 6px; }
.np-scrollable-content::-webkit-scrollbar-track { background: transparent; }
.np-scrollable-content::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* ── Actions Row ──────────────────────────────── */

.np-actions-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
  padding: 0 24px 24px;
}

.np-reuniao-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s ease;
  flex: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  box-sizing: border-box;
}
.np-reuniao-toggle:hover:not(:disabled) {
  border-color: #059669;
  color: #059669;
  background: #F0FDF4;
}
.np-reuniao-toggle:disabled { opacity: 0.6; cursor: not-allowed; }

.np-reuniao-toggle--done {
  background: #F0FDF4;
  border-color: #059669;
  color: #059669;
}

.np-reuniao-check {
  width: 20px; height: 20px;
  border: 2px solid currentColor;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.np-reuniao-toggle--done .np-reuniao-check {
  background: #059669; border-color: #059669;
}
.np-reuniao-check svg {
  width: 12px; height: 12px;
  stroke: #fff; fill: none; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.np-reuniao-toggle--done .np-reuniao-check svg {
  opacity: 1; transform: scale(1);
}

.np-status-actions {
  display: flex;
  gap: 8px;
  flex: 1.5;
}

.np-status-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.np-status-btn svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round;
  flex-shrink: 0;
}
.np-status-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.np-status-btn--ganho { border-color: #E2E8F0; color: #10B981; }
.np-status-btn--ganho:hover:not(:disabled) { border-color: #10B981; background: #ECFDF5; }
.np-status-btn--ganho.np-status-btn--active { background: #10B981; color: #fff; border-color: #10B981; }

.np-status-btn--perdido { border-color: #E2E8F0; color: #EF4444; }
.np-status-btn--perdido:hover:not(:disabled) { border-color: #EF4444; background: #FEF2F2; }
.np-status-btn--perdido.np-status-btn--active { background: #EF4444; color: #fff; border-color: #EF4444; }

.np-status-btn--aberto { border-color: #E2E8F0; color: #0284C7; }
.np-status-btn--aberto:hover:not(:disabled) { border-color: #0284C7; background: #E0F2FE; }


/* ── Grid & Cards ──────────────────────────────── */

.np-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(0,0,0,0.04);
  border-top: 1px solid rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.np-card {
  background: #FFFFFF;
  border-radius: 0;
  padding: 24px;
  box-shadow: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.np-card--span2 { grid-column: span 2; }

.np-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: #94A3B8;
  display: flex; align-items: center; gap: 8px;
}

/* Responsável */
.np-vendedor-row {
  display: flex; align-items: center; gap: 12px;
}
.np-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #F1F5F9;
}
.np-avatar--initials {
  background: #0F172A;
  color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.np-vendedor-nome {
  font-size: 14px; font-weight: 700; color: #0F172A;
}

/* Grid de informações */
.np-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.np-info-item { display: flex; flex-direction: column; gap: 4px; }
.np-info-label {
  font-size: 11px; font-weight: 600;
  color: #94A3B8; display: flex; align-items: center; gap: 6px;
}
.np-info-label svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round;
}
.np-info-value {
  font-size: 14px; font-weight: 600; color: #334155;
  word-break: break-word; line-height: 1.4;
}

/* ── Tabs Wrapper ──────────────────────────────── */

.np-tabs-wrapper {
  background: #FFFFFF;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.np-tabs {
  display: flex;
  border-bottom: 1px solid #F1F5F9;
  background: #FAFAFA;
}
.np-tab {
  flex: 1;
  padding: 16px 0;
  background: none; border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: #64748B;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}
.np-tab:hover { color: #0F172A; background: #F1F5F9; }
.np-tab svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.np-tab--active {
  color: #0F172A;
  background: #FFFFFF;
}
.np-tab--active::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px; background: #0F172A;
}

.np-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #E2E8F0; color: #475569;
  border-radius: 20px; font-size: 10px; font-weight: 800;
  transition: all 0.2s ease;
}
.np-tab--active .np-tab-badge { background: #0F172A; color: #FFF; }
.np-tab-badge:empty { display: none; }

.np-tab-panel {
  display: none;
  padding: 24px;
  animation: npPanelIn 0.2s ease both;
}
.np-tab-panel--active { display: block; }
@keyframes npPanelIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ── Tarefas ──────────────────────────────── */

.np-task-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.np-task-form-row { display: flex; align-items: center; gap: 10px; }

.np-task-input, .np-task-date, .np-task-desc-input {
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: all 0.2s ease;
}
.np-task-input { flex: 1; padding: 12px 14px; font-size: 13px; font-weight: 500; }
.np-task-date { padding: 12px; font-size: 12px; width: 140px; }
.np-task-desc-input { padding: 12px 14px; font-size: 13px; min-height: 60px; resize: vertical; }

.np-task-input:focus, .np-task-date:focus, .np-task-desc-input:focus {
  border-color: #0F172A; background: #FFF; box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}

.np-task-submit {
  width: 44px; height: 44px;
  background: #0F172A; border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s ease;
}
.np-task-submit:hover { background: #334155; transform: scale(1.03); }
.np-task-submit svg { width: 18px; height: 18px; stroke: #FFF; fill: none; stroke-width: 2.5; }

.np-task-list { display: flex; flex-direction: column; gap: 10px; }
.np-empty-tasks { font-size: 13px; color: #94A3B8; text-align: center; padding: 20px 0; }

.np-task {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  transition: all 0.2s ease;
}
.np-task:hover { border-color: #CBD5E1; background: #F1F5F9; }
.np-task--done { opacity: 0.5; background: #FFFFFF; }
.np-task--overdue { border-color: rgba(239,68,68,0.3); background: #FEF2F2; }

.np-task-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid #CBD5E1;
  background: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #10B981;
  flex-shrink: 0; margin-top: 2px;
  transition: all 0.2s ease;
}
.np-task--done .np-task-check { background: #0F172A; border-color: #0F172A; color: #FFF; }

.np-task-info { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.np-task-title { font-size: 14px; font-weight: 700; color: #0F172A; }
.np-task--done .np-task-title { text-decoration: line-through; color: #64748B; }
.np-task-desc  { font-size: 12px; color: #64748B; line-height: 1.4; }
.np-task-venc  { font-size: 11px; color: #94A3B8; font-weight: 600; margin-top: 4px; }
.np-task-venc--late { color: #EF4444; }

.np-task-check--pending { cursor: pointer; }
.np-task-check--pending:hover { border-color: #10B981; background: #ECFDF5; transform: scale(1.1); }

/* ── Anotações ──────────────────────────────── */

.np-nota-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.np-nota-textarea {
  border: 1.5px solid #E2E8F0; border-radius: 10px; padding: 12px 14px;
  font-family: 'Inter', sans-serif; font-size: 13px; color: #0F172A; background: #F8FAFC;
  min-height: 80px; resize: vertical; transition: all 0.2s ease;
}
.np-nota-textarea:focus { border-color: #0F172A; background: #FFF; box-shadow: 0 0 0 3px rgba(15,23,42,0.05); }

.np-nota-submit {
  align-self: flex-end; padding: 10px 20px;
  background: #0F172A; color: #FFF; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif;
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.2s ease;
}
.np-nota-submit:hover { background: #334155; transform: scale(1.02); }
.np-nota-submit svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }

.np-nota-list { display: flex; flex-direction: column; gap: 12px; }
.np-empty-notas { font-size: 13px; color: #94A3B8; text-align: center; padding: 20px 0; }

.np-nota-item {
  padding: 16px 40px 16px 16px;
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px;
  position: relative; animation: notaFadeIn 0.2s ease both;
}

.np-nota-texto { font-size: 13px; font-weight: 500; color: #334155; line-height: 1.6; }
.np-nota-date { font-size: 11px; font-weight: 600; color: #94A3B8; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #E2E8F0; }

.np-nota-edit-btn {
  position: absolute; top: 12px; right: 12px;
  background: #FFF; border: 1px solid #E2E8F0; border-radius: 8px;
  padding: 6px; color: #64748B; cursor: pointer; transition: all 0.2s ease;
}
.np-nota-edit-btn:hover { background: #F1F5F9; color: #0F172A; border-color: #CBD5E1; }
.np-nota-edit-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Responsive */
@media (max-width: 600px) {
  .np-panel { width: 100%; border-left: none; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .np-panel--open { transform: translateY(0); }
  .np-overlay--closing .np-panel { transform: translateY(100%); }
  .np-overlay { align-items: flex-end; }
  .np-cards-grid { grid-template-columns: 1fr; }
  .np-card--span2 { grid-column: span 1; }
  .np-header { padding: 24px 24px 16px; }
  .np-scrollable-content { padding: 16px 24px 32px; }
  .np-actions-row { flex-direction: column; }
}

/* ======================================================
   DARK MODE OVERRIDES PARA NEGOCIO PANEL
   ====================================================== */
[data-theme="dark"] .np-panel {
  background: var(--bg);
  border-left-color: var(--border-light);
}
[data-theme="dark"] .np-header {
  background: var(--card-light);
  border-bottom-color: var(--border-light);
}
[data-theme="dark"] .np-close-btn {
  background: var(--bg);
}
[data-theme="dark"] .np-close-btn:hover {
  background: var(--border-light);
}
[data-theme="dark"] .np-close-btn svg {
  stroke: var(--text-secondary);
}
[data-theme="dark"] .np-title {
  color: var(--black);
}
[data-theme="dark"] .np-valor {
  color: var(--text-secondary);
}
[data-theme="dark"] .np-meta-pill {
  background: var(--bg);
  color: var(--text-secondary);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-reuniao-toggle {
  background: var(--card-light);
  border-color: var(--border-light);
  color: var(--text-secondary);
}
[data-theme="dark"] .np-reuniao-toggle:hover:not(:disabled) {
  background: rgba(5, 150, 105, 0.1);
}
[data-theme="dark"] .np-reuniao-toggle--done {
  background: rgba(5, 150, 105, 0.1);
}
[data-theme="dark"] .np-status-btn {
  background: var(--card-light);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-cards-grid {
  background: var(--border-light);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-card {
  background: var(--card-light);
}
[data-theme="dark"] .np-section-title {
  color: var(--text-muted);
}
[data-theme="dark"] .np-vendedor-nome {
  color: var(--black);
}
[data-theme="dark"] .np-info-label {
  color: var(--text-muted);
}
[data-theme="dark"] .np-info-value {
  color: var(--black);
}
[data-theme="dark"] .np-tabs-wrapper {
  background: var(--card-light);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-tabs {
  background: var(--bg);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-tab {
  color: var(--text-secondary);
}
[data-theme="dark"] .np-tab:hover {
  background: var(--bg);
  color: var(--black);
}
[data-theme="dark"] .np-tab--active {
  background: var(--card-light);
  color: var(--black);
}
[data-theme="dark"] .np-tab--active::after {
  background: var(--black);
}
[data-theme="dark"] .np-tab-badge {
  background: var(--border-light);
  color: var(--text-secondary);
}
[data-theme="dark"] .np-tab--active .np-tab-badge {
  background: var(--black);
  color: var(--card-light);
}
[data-theme="dark"] .np-task-input,
[data-theme="dark"] .np-task-date,
[data-theme="dark"] .np-task-desc-input {
  background: var(--bg);
  border-color: var(--border-light);
  color: var(--black);
}
[data-theme="dark"] .np-task-input:focus,
[data-theme="dark"] .np-task-date:focus,
[data-theme="dark"] .np-task-desc-input:focus {
  background: var(--card-light);
  border-color: var(--black);
}
[data-theme="dark"] .np-task-submit {
  background: var(--black);
}
[data-theme="dark"] .np-task-submit svg {
  stroke: var(--card-light);
}
[data-theme="dark"] .np-task {
  background: var(--bg);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-task:hover {
  background: var(--card-light);
}
[data-theme="dark"] .np-task--done {
  background: var(--card-light);
}
[data-theme="dark"] .np-task-title {
  color: var(--black);
}
[data-theme="dark"] .np-task-desc {
  color: var(--text-secondary);
}
[data-theme="dark"] .np-task-venc {
  color: var(--text-muted);
}
[data-theme="dark"] .np-task-check {
  background: var(--card-light);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-task--done .np-task-check {
  background: var(--black);
  border-color: var(--black);
  color: var(--card-light);
}
[data-theme="dark"] .np-nota-textarea {
  background: var(--bg);
  border-color: var(--border-light);
  color: var(--black);
}
[data-theme="dark"] .np-nota-textarea:focus {
  background: var(--card-light);
  border-color: var(--black);
}
[data-theme="dark"] .np-nota-submit {
  background: var(--black);
  color: var(--card-light);
}
[data-theme="dark"] .np-nota-item {
  background: var(--bg);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-nota-texto {
  color: var(--black);
}
[data-theme="dark"] .np-nota-date {
  color: var(--text-muted);
  border-color: var(--border-light);
}
[data-theme="dark"] .np-nota-edit-btn {
  background: var(--card-light);
  border-color: var(--border-light);
  color: var(--text-secondary);
}
[data-theme="dark"] .np-nota-edit-btn:hover {
  background: var(--bg);
  color: var(--black);
}

/* Badges e Status Buttons (Cores Específicas) */
[data-theme="dark"] .np-badge--open { background: rgba(2, 132, 199, 0.2) !important; color: #38BDF8 !important; }
[data-theme="dark"] .np-badge--won { background: rgba(22, 163, 74, 0.2) !important; color: #4ADE80 !important; }
[data-theme="dark"] .np-badge--lost { background: rgba(220, 38, 38, 0.2) !important; color: #F87171 !important; }

[data-theme="dark"] .np-status-btn--ganho { border-color: var(--border-light); color: #10B981; }
[data-theme="dark"] .np-status-btn--ganho:hover:not(:disabled) { background: rgba(16, 185, 129, 0.1); border-color: #10B981; }
[data-theme="dark"] .np-status-btn--ganho.np-status-btn--active { background: #10B981; color: #fff; border-color: #10B981; }

[data-theme="dark"] .np-status-btn--perdido { border-color: var(--border-light); color: #EF4444; }
[data-theme="dark"] .np-status-btn--perdido:hover:not(:disabled) { background: rgba(239, 68, 68, 0.1); border-color: #EF4444; }
[data-theme="dark"] .np-status-btn--perdido.np-status-btn--active { background: #EF4444; color: #fff; border-color: #EF4444; }

[data-theme="dark"] .np-status-btn--aberto { border-color: var(--border-light); color: #38BDF8; }
[data-theme="dark"] .np-status-btn--aberto:hover:not(:disabled) { background: rgba(56, 189, 248, 0.1); border-color: #38BDF8; }
