:root{
  --bg:#0a0a0a;
  --panel:#101114;
  --panel-2:#15171a;
  --text:#ffffff;
  --muted:#9aa3ad;
  --brand:#ff6a00;      /* laranja MP */
  --brand-2:#ff9a3d;
  --success:#21c07a;
  --danger:#ff4d4d;
  --radius:18px;
  --shadow:0 12px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:linear-gradient(180deg,#0a0a0a,#0b0b0b 40%,#0a0a0a);color:var(--text);
  font-family:Montserrat,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans",sans-serif}

/* === CORREÇÃO DO SISTEMA DE NAVEGAÇÃO === */
.container {
    display: none;
}

.container[style*="display: block"] {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === SIDEBAR === */
.sidebar {
  position:fixed;left:0;top:0;bottom:0;width:78px;
  background:#0c0d10;border-right:1px solid rgba(255,255,255,.06);
  padding:14px 10px;display:flex;flex-direction:column;gap:12px;
  z-index:1000;transition:width .2s ease;
  overflow:hidden;
  scrollbar-width:none;
}

.sidebar:hover{
  width:260px;
  overflow:auto;
}

.sidebar:hover::-webkit-scrollbar{width:6px}
.sidebar:hover::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:6px}
.sidebar::-webkit-scrollbar{width:0;height:0}

/* Logo */
.sb-top{padding:2px 0 6px}
.sb-logo{display:flex;align-items:center;gap:10px}
.logo-img{width:36px;height:36px;border-radius:8px;object-fit:cover}
.brand-text{display:flex;flex-direction:column;line-height:1.1}
.sidebar:not(:hover) .brand-text{ display:none }

/* Navegação */
.sb-nav{display:flex;flex-direction:column;gap:6px;margin-top:8px;overflow:auto}
.sb-section{padding:8px 10px 2px;font-size:11px;color:var(--muted)}
.sb-link{
  width:100%;text-align:left;background:transparent;color:#cfd3da;border:1px solid transparent;border-radius:12px;
  padding:10px 10px;display:flex;align-items:center;gap:10px;cursor:pointer;transition:all .2s ease;
}
.sb-link:hover{background:#13161e;border-color:rgba(255,255,255,.06)}
.sb-link.active{background:#161a22;border-color:rgba(255,255,255,.10);color:#fff}

/* Labels */
.sidebar .label{opacity:0;max-width:0;white-space:nowrap;overflow:hidden;transition:opacity .2s ease,max-width .2s ease}
.sidebar:hover .label{opacity:1;max-width:200px}

/* Footer */
.sb-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.06);padding-top:10px}
.btn-ghost-small{width:100%;background:transparent;color:#a9b0b8;border:1px solid rgba(255,255,255,.10);padding:8px 10px;border-radius:10px;cursor:pointer}
.btn-ghost-small:hover{color:#fff;border-color:rgba(255,255,255,.18)}

/* Ícones */
.i-svg{
  width:18px;height:18px;fill:#cfd3da;
}
.sb-link:hover .i-svg{ fill:#ffffff }

/* === MAIN CONTENT === */
.main{
    margin-left:78px;
    transition:margin-left .2s ease;
    min-height:100vh;
    overflow-y:auto;
}

.sidebar:hover + .main {
    margin-left:260px;
}

.topbar{
    position:sticky;top:0;z-index:20;padding:14px 20px;
    background:linear-gradient(180deg,rgba(10,10,10,.95),rgba(10,10,10,.6));
    backdrop-filter:blur(6px);border-bottom:1px solid rgba(255,255,255,.06)
}

.brand{display:flex;flex-direction:column}
.muted{color:var(--muted);font-size:12px}
.badge{background:linear-gradient(90deg,var(--brand),var(--brand-2));color:#0b0b0b;font-weight:800;padding:6px 12px;border-radius:999px;float:right}

.page{padding:18px;padding-bottom:60px}

/* === DASHBOARD MODERNA === */
.dash-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.grid{display:grid;grid-template-columns:1fr;gap:20px}
@media (min-width:980px){.grid{grid-template-columns:1.1fr .9fr}}
.col{display:flex;flex-direction:column;gap:20px}

.card{
    background:linear-gradient(180deg,var(--panel),var(--panel-2));
    border:1px solid rgba(255,255,255,.06);
    border-radius:var(--radius);
    padding:18px;
    box-shadow:var(--shadow)
}

.performance-card {
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.card-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-badge.positive {
  background: rgba(33, 192, 122, 0.15);
  color: #21c07a;
}

.card-badge.warning {
  background: rgba(255, 167, 38, 0.15);
  color: #ffa726;
}

.card-badge.negative {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
}

.performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.performance-item {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.performance-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.performance-value {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.performance-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Sistema de Edição */
.editable-field {
  position: relative;
}

.field-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.editable-field:hover .field-actions {
  opacity: 1;
}

.btn-increase, .btn-decrease {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  color: var(--text);
  font-size: 10px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-increase:hover, .btn-decrease:hover {
  background: var(--brand);
  color: #0a0a0a;
}

/* Alertas */
.alert-card {
  border-left: 4px solid #ff4d4d;
}

.alert-count {
  background: #ff4d4d;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.alert-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.alert-item.critical {
  border-left: 3px solid #ff4d4d;
}

.alert-item.warning {
  border-left: 3px solid #ffa726;
}

.alert-item.info {
  border-left: 3px solid #29b6f6;
}

.alert-icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.alert-content {
  flex: 1;
}

.alert-content strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.alert-content p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.alert-time {
  color: var(--brand);
  font-weight: 600;
}

.alert-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.alert-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--brand);
}

/* Ações Rápidas */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  cursor: pointer !important;
}

.quick-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 1.5rem;
}

.action-text {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* Serviços */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.service-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.service-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-revenue {
  font-size: 0.8rem;
  color: var(--muted);
}

.service-progress {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Funil */
.funnel-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-label {
  width: 100px;
  font-size: 0.9rem;
  color: var(--muted);
}

.step-value {
  width: 50px;
  font-weight: 700;
  text-align: right;
}

.step-progress {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

/* Recomendações */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.rec-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}

.rec-content {
  flex: 1;
}

.rec-content strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.rec-content p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* === MP CHAT COMPACTO === */
.chat-medium-container {
  width: 100%;
  height: 75vh;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-medium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--panel-2) 0%, rgba(255, 106, 0, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.chat-medium-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-medium-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
}

.chat-medium-titles h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.chat-medium-titles p {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.chat-medium-actions {
  display: flex;
  gap: 8px;
}

.btn-chat-clear,
.btn-chat-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-chat-clear:hover,
.btn-chat-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.chat-medium-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.message-medium-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message-medium-group.user {
  flex-direction: row-reverse;
}

.message-medium-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 4px;
}

.message-medium-content {
  flex: 1;
  max-width: 75%;
}

.message-medium-bubble {
  padding: 14px 18px;
  border-radius: 14px;
  position: relative;
  animation: messageSlideIn 0.3s ease-out;
}

.message-medium-bubble.assistant {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-left-radius: 4px;
}

.message-medium-bubble.user {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a0a0a;
  border-top-right-radius: 4px;
}

.message-medium-text {
  line-height: 1.4;
  font-size: 0.9rem;
}

.message-medium-time {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

.chat-medium-quick-actions {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.quick-actions-medium-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-action-medium {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.quick-action-medium:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.quick-action-icon {
  font-size: 1.1rem;
}

.quick-action-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.chat-medium-input-container {
  padding: 16px 20px;
  background: var(--panel-2);
  flex-shrink: 0;
}

.chat-medium-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-medium-input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.chat-medium-input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.1);
}

.chat-medium-send-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: 10px;
  padding: 14px;
  color: #0a0a0a;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-medium-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-medium-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-medium-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.chat-medium-messages::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 2px;
}

/* === SISTEMA FINANCEIRO === */
.financial-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.financial-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.financial-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.financial-value {
    font-size: 1.3rem;
    font-weight: 800;
}

.financial-value.positive {
    color: #21c07a;
}

.financial-value.negative {
    color: #ff4d4d;
}

.goals-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goal-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--muted);
}

.goal-value {
    width: 100px;
    font-weight: 700;
    text-align: right;
}

.goal-progress {
    flex: 2;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.goal-percent {
    width: 50px;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
}

.financial-table th,
.financial-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.financial-table th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
}

.financial-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.recebido,
.status-badge.pago {
    background: rgba(33, 192, 122, 0.15);
    color: #21c07a;
}

.status-badge.pendente {
    background: rgba(255, 167, 38, 0.15);
    color: #ffa726;
}

.status-badge.atrasado {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
}

.no-data {
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* === FORMULÁRIOS === */
.input-group{display:flex;flex-direction:column;gap:8px;margin:10px 0}
input,select,textarea{
    width:100%;background:#0f1012;color:var(--text);border:1px solid rgba(255,255,255,.08);
    border-radius:12px;padding:12px 14px;outline:none;font-family:inherit
}
input:focus,select:focus,textarea:focus{border-color:var(--brand)}
.form-actions{display:flex;gap:10px;flex-wrap:wrap}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}

.btn-primary,.btn-secondary,.btn-ghost{
    border:0;cursor:pointer;font-weight:800;border-radius:12px;padding:12px 16px;transition:all .2s ease;
    display:inline-flex;align-items:center;gap:8px;
}
.btn-primary{
    background:linear-gradient(90deg,var(--brand),var(--brand-2));color:#0b0b0b;
}
.btn-primary:hover{transform:translateY(-1px)}
.btn-secondary{
    background:#191b1f;color:#fff;border:1px solid rgba(255,255,255,.08);
}
.btn-secondary:hover{background:#202329}
.btn-ghost{background:transparent;color:var(--muted)}

.btn-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
  fill: currentColor;
}

/* === MODAIS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* === TOAST === */
.toast{
    position:fixed;right:18px;bottom:18px;background:#111;color:#fff;
    border:1px solid rgba(255,255,255,.08);padding:12px 14px;border-radius:12px;
    z-index:50;opacity:0;transform:translateY(10px);transition:all .2s ease
}
.toast.show{opacity:1;transform:translateY(0)}

/* === RESPONSIVO === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .financial-summary {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-medium-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .message-medium-content {
        max-width: 80%;
    }
    
    .dash-head {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* === UTILITÁRIOS === */
.format-currency::before {
    content: 'R$ ';
}

.format-percentage::after {
    content: '%';
}

/* Remove scrollbars visíveis mas mantém funcionalidade */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* === RESTAURAR FONTES E ÍCONES === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Rubik:wght@400;500;600;700&display=swap');

body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* === ÍCONES DA SIDEBAR CORRETOS === */
.sb-link .ico {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-link .ico svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* === CORREÇÃO DO CHAT === */
.chat-medium-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    max-height: 400px;
}

.message-medium-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.message-medium-group.user {
    flex-direction: row-reverse;
}

.message-medium-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.message-medium-content {
    flex: 1;
    max-width: 75%;
}

.message-medium-bubble {
    padding: 14px 18px;
    border-radius: 14px;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
}

.message-medium-bubble.assistant {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 4px;
}

.message-medium-bubble.user {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #0a0a0a;
    border-top-right-radius: 4px;
}

.message-medium-text {
    line-height: 1.4;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.message-medium-time {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 6px;
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ÍCONES SVG DA SIDEBAR === */
.sb-link .ico {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sb-link .ico svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: all 0.2s ease;
}

.sb-link:hover .ico svg,
.sb-link.active .ico svg {
    transform: scale(1.1);
}

/* === ÍCONES SVG DA SIDEBAR === */
.sb-link .ico {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sb-link .ico svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: all 0.2s ease;
}

.sb-link:hover .ico svg,
.sb-link.active .ico svg {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Divisor da sidebar */
.sb-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

/* Logo da sidebar */
.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 14px;
    font-weight: 700;
}

.brand-text .muted {
    font-size: 11px;
    opacity: 0.8;
}

/* === NOVOS ESTILOS FINANCEIROS === */
.today-transactions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.transaction-item.positive {
  border-left: 3px solid #21c07a;
}

.transaction-item.negative {
  border-left: 3px solid #ff4d4d;
}

.transaction-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.transaction-details {
  flex: 1;
}

.transaction-details strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.transaction-details small {
  color: var(--muted);
  font-size: 0.75rem;
}

.transaction-value {
  font-weight: 700;
  font-size: 0.9rem;
}

.transaction-item.positive .transaction-value {
  color: #21c07a;
}

.transaction-item.negative .transaction-value {
  color: #ff4d4d;
}

/* Top Products & Expenses */
.top-products-list,
.top-expenses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.product-item,
.expense-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.product-rank {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a0a0a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.expense-category {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.product-info,
.expense-info {
  flex: 1;
}

.product-info strong,
.expense-info strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.product-info small,
.expense-info small {
  color: var(--muted);
  font-size: 0.75rem;
}

.product-revenue {
  font-weight: 700;
  color: #21c07a;
}

.expense-value {
  font-weight: 700;
  color: #ff4d4d;
}

/* Badges melhorados */
.card-badge.warning {
  background: rgba(255, 167, 38, 0.15);
  color: #ffa726;
}

.card-badge.info {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
}

/* Goal items melhorados */
.goal-item .goal-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goal-item .goal-label small {
  font-size: 0.7rem;
  color: var(--muted);
}

/* === FONTES PROFISSIONAIS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* === CONTROLE FINANCEIRO PREMIUM === */
.financial-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* CABEÇALHO MELHORADO */
.financial-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.financial-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.financial-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

/* CARDS DE RESUMO MELHORADOS */
.financial-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}

.summary-card {
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.summary-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.summary-card-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--brand);
}

.summary-card-content {
  flex: 1;
  min-width: 0;
}

.summary-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

.summary-card-value.positive {
  color: #10b981;
}

.summary-card-value.negative {
  color: #ef4444;
}

.summary-card-label {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.summary-card-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.summary-card-trend.positive {
  color: #10b981;
}

.summary-card-trend.negative {
  color: #ef4444;
}

.summary-card-trend.warning {
  color: #f59e0b;
}

/* AÇÕES RÁPIDAS PREMIUM */
.quick-actions-section {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.quick-action-btn {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.quick-action-btn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 106, 0, 0.15);
}

.quick-action-icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
}

.quick-action-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

/* LAYOUT EM GRID MELHORADO */
.financial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .financial-grid {
    grid-template-columns: 1fr;
  }
}

/* CARD DE HOJE MELHORADO */
.today-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
}

.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.today-title {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.today-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.today-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.today-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.today-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.today-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.today-value {
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-heading);
}

.today-value.positive {
  color: #10b981;
}

.today-value.negative {
  color: #ef4444;
}

/* VENCIMENTOS MELHORADOS */
.vencimentos-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
}

.vencimentos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.vencimentos-title {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.vencimentos-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.vencimentos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.vencimento-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.vencimento-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.vencimento-item.urgente {
  border-left: 4px solid #ef4444;
}

.vencimento-item.proximo {
  border-left: 4px solid #f59e0b;
}

.vencimento-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vencimento-details {
  flex: 1;
  min-width: 0;
}

.vencimento-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vencimento-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.vencimento-valor {
  font-weight: 700;
  font-size: 0.875rem;
  color: #ef4444;
  flex-shrink: 0;
}

/* TRANSAÇÕES MELHORADAS */
.transactions-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  grid-column: 1 / -1;
}

.transactions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.transactions-title {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.transactions-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.transaction-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transaction-details {
  flex: 1;
  min-width: 0;
}

.transaction-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.transaction-amount {
  font-weight: 700;
  font-size: 0.875rem;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.transaction-amount.positive {
  color: #10b981;
}

.transaction-amount.negative {
  color: #ef4444;
}

/* CATEGORIAS MELHORADAS */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

.category-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.category-header {
  margin-bottom: 20px;
}

.category-title {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.category-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.category-value {
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-heading);
}

.category-value.positive {
  color: #10b981;
}

.category-value.negative {
  color: #ef4444;
}

/* STATES VISUAIS */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* === ESTILOS ADICIONAIS === */
.summary-card-trend {
  font-size: 0.75rem;
  margin-top: 4px;
}

.summary-card-trend.positive {
  color: #10b981;
}

.summary-card-trend.negative {
  color: #ef4444;
}

.summary-card-trend.warning {
  color: #f59e0b;
}

/* Visão do Hoje */
.today-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.today-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.today-item:last-child {
  border-bottom: none;
}

.today-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.today-value {
  font-weight: 600;
  font-size: 0.875rem;
}

.today-value.positive {
  color: #10b981;
}

.today-value.negative {
  color: #ef4444;
}

/* Vencimentos */
.vencimentos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.vencimento-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.vencimento-item.urgente {
  border-left: 3px solid #ef4444;
}

.vencimento-item.proximo {
  border-left: 3px solid #f59e0b;
}

.vencimento-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vencimento-details {
  flex: 1;
}

.vencimento-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.vencimento-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.vencimento-valor {
  font-weight: 700;
  font-size: 0.875rem;
  color: #ef4444;
}

/* Categorias */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.category-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.category-value {
  font-weight: 600;
  font-size: 0.875rem;
}

.category-value.positive {
  color: #10b981;
}

.category-value.negative {
  color: #ef4444;
}

/* Header actions */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-select-small {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.75rem;
}

/* === CORREÇÕES CRÍTICAS === */

/* Garantir que as views sejam mostradas corretamente */
#dashboard,
#mpChatView, 
#financeiroView,
#insightsView,
#metricasView,
#conteudoView,
#bibliotecaView,
#pixelsView,
#funisView,
#relatoriosView,
#espionarView,
#perfilView {
    display: none;
}

/* View ativa */
.view-active {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}

/* Correção do sistema de navegação */
.sb-link {
    cursor: pointer !important;
}

/* Garantir que botões sejam clicáveis */
.btn-primary, 
.btn-secondary, 
.quick-action, 
.alert-action,
.quick-action-medium {
    cursor: pointer !important;
}

/* Modal de edição corrigido */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay[style*="display: flex"] {
    display: flex !important;
}

/* Toast corrigido */
.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #111;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
    border-radius: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Correção do chat */
.chat-medium-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

/* Garantir que o sidebar funcione corretamente */
.sidebar:hover .label {
    opacity: 1;
    max-width: 200px;
    display: block;
}

/* Loading states */
.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar funcional mas discreta */
.chat-medium-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-medium-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.chat-medium-messages::-webkit-scrollbar-thumb {
    background: var(--brand);
    border-radius: 2px;
}

/* Correção dos campos editáveis */
.editable-field {
    position: relative;
    transition: all 0.3s ease;
}

.editable-field:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.field-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.editable-field:hover .field-actions {
    opacity: 1;
}

/* Garantir que os botões +/- funcionem */
.btn-increase, 
.btn-decrease {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    color: var(--text);
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-increase:hover, 
.btn-decrease:hover {
    background: var(--brand);
    color: #0a0a0a;
}

/* === MP CHAT PREMIUM - ESTILO DEEPSEEK === */
.chat-premium-container {
  width: 100%;
  max-width: 900px;
  height: 75vh;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
}

/* HEADER */
.chat-premium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--panel-2) 0%, rgba(255, 106, 0, 0.08) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.chat-premium-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-premium-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.9rem;
}

.chat-premium-titles h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading);
}

.chat-premium-titles p {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.chat-premium-actions {
  display: flex;
  gap: 8px;
}

.btn-chat-action,
.btn-chat-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-chat-action:hover,
.btn-chat-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand);
  transform: translateY(-1px);
}

/* ÁREA DE MENSAGENS */
.chat-premium-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.message-premium-group {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: messageSlideIn 0.3s ease-out;
}

.message-premium-group.user {
  flex-direction: row-reverse;
}

.message-premium-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}

.avatar-assistant {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.avatar-user {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.message-premium-content {
  flex: 1;
  max-width: 70%;
  min-width: 0;
}

.message-premium-bubble {
  padding: 18px 20px;
  border-radius: 18px;
  position: relative;
  line-height: 1.5;
}

.message-premium-bubble.assistant {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-left-radius: 6px;
}

.message-premium-bubble.user {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a0a0a;
  border-top-right-radius: 6px;
}

.message-premium-text {
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-premium-text strong {
  color: inherit;
}

.message-premium-text em {
  opacity: 0.8;
  font-style: italic;
}

.message-premium-time {
  margin-top: 8px;
  text-align: right;
}

.message-status {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.7;
}

/* SUGESTÕES RÁPIDAS */
.chat-premium-suggestions {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.suggestions-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.suggestions-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand);
  transform: translateY(-1px);
}

/* INPUT AREA */
.chat-premium-input-container {
  padding: 20px 24px;
  background: var(--panel-2);
  flex-shrink: 0;
}

.chat-premium-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

.chat-premium-input-wrapper:focus-within {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.1);
}

.input-actions {
  display: flex;
  gap: 4px;
}

.btn-input-action {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-input-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.chat-premium-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.chat-premium-input::placeholder {
  color: var(--muted);
}

.chat-premium-send-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: #0a0a0a;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-premium-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

.chat-premium-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-footer {
  margin-top: 8px;
  text-align: center;
}

/* TYPING INDICATOR */
.typing-indicator-premium {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  border-top-left-radius: 6px;
  margin-bottom: 8px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

.typing-text {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ANIMAÇÕES */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SCROLLBAR PERSONALIZADA */
.chat-premium-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-premium-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.chat-premium-messages::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 3px;
}

.chat-premium-messages::-webkit-scrollbar-thumb:hover {
  background: var(--brand-2);
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .chat-premium-container {
    height: 85vh;
    border-radius: 0;
    margin: 0;
  }
  
  .message-premium-content {
    max-width: 85%;
  }
  
  .chat-premium-header {
    padding: 16px 20px;
  }
  
  .suggestions-grid {
    justify-content: center;
  }
  
  .suggestion-chip {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

/* TEMA CLARO (OPCIONAL) */
.chat-premium-container.light-theme {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --panel-2: #ffffff;
  --text: #1a1a1a;
  --muted: #6c757d;
  background: var(--panel);
  border-color: rgba(0, 0, 0, 0.1);
}

.chat-premium-container.light-theme .message-premium-bubble.assistant {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.chat-premium-container.light-theme .chat-premium-input-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Remover sublinhado dos links da sidebar */
.sb-link {
    text-decoration: none !important;
}

.sb-link:hover {
    text-decoration: none !important;
}

.sb-link:focus {
    text-decoration: none !important;
}

.sb-link.active {
    text-decoration: none !important;
}

/* === CORREÇÃO DO SISTEMA DE NAVEGAÇÃO === */
.container {
    display: none;
}

.container[style*="display: block"] {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 78px;
    background: #0c0d10;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* === Ajustes para a Sidebar no mobile (max-width: 768px) === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;  /* O menu ocupará toda a largura */
        height: auto;  /* Altura ajustada automaticamente */
        position: relative;  /* Modificado para 'relative' para ajustar melhor */
        z-index: 1000;  /* Garante que o menu fique acima de outros elementos */
    }

    /* Ajusta a margem do conteúdo principal para não ser sobreposto */
    .main {
        margin-left: 0 !important;  /* Remover qualquer margem à esquerda */
    }

    /* Evitar que o conteúdo principal seja coberto pelo menu */
    body {
        overflow-x: hidden;  /* Impede a rolagem horizontal */
    }

    /* Ajustar o layout da página para uma única coluna */
    .grid {
        grid-template-columns: 1fr;  /* Uma coluna no layout */
    }

    .financial-summary {
        grid-template-columns: 1fr;  /* Certifica-se de que o grid de finanças usa uma coluna */
    }

    .quick-actions-medium-grid {
        grid-template-columns: repeat(2, 1fr);  /* Ajusta o grid de ações rápidas */
    }

    /* Ajustar elementos no menu lateral (caso haja ícones ou links) */
    .sb-link .ico {
        width: 24px;  /* Aumenta o tamanho dos ícones */
        height: 24px;
    }

    .sb-link .ico svg {
        width: 24px;
        height: 24px;
    }

    /* Outros ajustes para garantir boa legibilidade e usabilidade */
    .dash-head {
        flex-direction: column;  /* Organiza os itens do cabeçalho verticalmente */
        align-items: flex-start;
    }

    .actions {
        width: 100%;  /* Garante que os botões de ação se estendam corretamente */
        justify-content: space-between;
    }
}

/* CORREÇÃO DO FUNDO BRANCO - ADICIONAR NO FINAL DO STYLE.CSS */
body {
    background: #0a0a0a !important;
}

/* CORREÇÃO FINAL - GARANTIR CLICABILIDADE */
@media (max-width: 768px) {
    .sidebar a,
    .sidebar button,
    .sidebar .sb-link {
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    .sidebar {
        pointer-events: auto !important;
    }
}