/* ================================================
   BASE.CSS — Reset, layout, utilitários
   ================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); overflow: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Layout principal */
.app { display: flex; height: 100vh; overflow: hidden; }
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; min-width: 0; }

/* Utilitários */
.hidden { display: none !important; }

/* Botão ícone */
.btn-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; flex-shrink: 0;
}
.btn-icon:hover { background: var(--brand); border-color: var(--brand); color: white; }
.btn-icon.active { background: var(--brand); border-color: var(--brand); color: white; }
.btn-icon svg { width: 16px; height: 16px; }

/* Spinner */
.spinner { width: 36px; height: 36px; border: 3px solid var(--bg-4); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
.spinner-sm { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }

/* Status badges */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.status-badge.open     { background: rgba(34,197,94,.15);  color: var(--green); }
.status-badge.pending  { background: rgba(245,158,11,.15); color: var(--yellow); }
.status-badge.resolved { background: rgba(255,255,255,.07); color: var(--text-3); }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--text); box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; max-width: 300px; animation: toastIn .3s ease; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--brand); }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; text-align: center; gap: 8px; }
.empty-icon svg { width: 48px; height: 48px; stroke: var(--text-3); }
.empty-state p    { color: var(--text-2); font-size: 14px; font-weight: 600; }
.empty-state span { color: var(--text-3); font-size: 12px; line-height: 1.5; }

/* Date separator */
.date-separator { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.date-separator::before, .date-separator::after { content:''; flex:1; height:1px; background: var(--border); }
.date-separator span { font-size: 11px; color: var(--text-3); font-weight: 600; white-space: nowrap; }

/* System message */
.msg-system { display: flex; justify-content: center; margin: 8px 0; }
.msg-system span { background: var(--bg-3); color: var(--text-3); font-size: 12px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); }

/* Animations */
@keyframes slideUp { from { opacity:0; transform: translateY(20px) scale(.96); } to { opacity:1; transform: translateY(0) scale(1); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes zoomIn { from { opacity:0; transform: scale(.9); } to { opacity:1; transform: scale(1); } }
.msg-new { animation: highlightMsg 1.5s ease; }
@keyframes highlightMsg { from { background: rgba(108,99,255,.15); } to { background: transparent; } }

/* ---- Responsivo ---- */
@media (max-width: 480px) {
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

